Skip to content
Snippets Groups Projects
Commit 9bd7fbd4 authored by wlott's avatar wlott
Browse files

Changed arch_init to return the default core name to use, or NULL for the

default default of "lisp.core".
parent c00dd64b
No related branches found
No related tags found
No related merge requests found
#ifndef __ARCH_H__ #ifndef __ARCH_H__
#define __ARCH_H__ #define __ARCH_H__
extern void arch_init(); extern char *arch_init();
extern void arch_skip_instruction(); extern void arch_skip_instruction();
extern os_vm_address_t arch_get_bad_addr(); extern os_vm_address_t arch_get_bad_addr();
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/ldb.c,v 1.17 1992/03/22 20:02:40 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/ldb.c,v 1.18 1992/04/28 21:37:25 wlott Exp $ */
/* Lisp kernel core debugger */ /* Lisp kernel core debugger */
#include <stdio.h> #include <stdio.h>
...@@ -44,7 +44,7 @@ char *argv[]; ...@@ -44,7 +44,7 @@ char *argv[];
char *envp[]; char *envp[];
{ {
char *arg, **argptr; char *arg, **argptr;
char *core = NULL; char *core = NULL, *default_core;
boolean restore_state, monitor; boolean restore_state, monitor;
number_stack_start = (char *)&monitor; number_stack_start = (char *)&monitor;
...@@ -71,17 +71,19 @@ char *envp[]; ...@@ -71,17 +71,19 @@ char *envp[];
} }
} }
default_core = arch_init();
if (default_core == NULL)
default_core = "lisp.core";
/* Note: the /usr/misc/.cmucl/lib/ default path is also wired into */ /* Note: the /usr/misc/.cmucl/lib/ default path is also wired into */
/* the lisp code in .../code/save.lisp. */ /* the lisp code in .../code/save.lisp. */
if (core == NULL) { if (core == NULL) {
static char buf[MAXPATHLEN];
extern char *getenv(); extern char *getenv();
char *lib = getenv("CMUCLLIB"); char *lib = getenv("CMUCLLIB");
if (lib == NULL) if (lib != NULL) {
core = "/usr/misc/.cmucl/lib/lisp.core";
else {
static char buf[MAXPATHLEN];
char *dst; char *dst;
struct stat statbuf; struct stat statbuf;
...@@ -91,18 +93,19 @@ char *envp[]; ...@@ -91,18 +93,19 @@ char *envp[];
*dst++ = *lib++; *dst++ = *lib++;
if (dst != buf && dst[-1] != '/') if (dst != buf && dst[-1] != '/')
*dst++ = '/'; *dst++ = '/';
strcpy(dst, "lisp.core"); strcpy(dst, default_core);
if (stat(buf, &statbuf) == 0) { if (stat(buf, &statbuf) == 0) {
core = buf; core = buf;
break; break;
} }
} while (*lib++ == ':'); } while (*lib++ == ':');
if (core == NULL) }
core = "/usr/misc/.cmucl/lib/lisp.core"; if (core == NULL) {
strcpy(buf, "/usr/misc/.cmucl/lib/";
strcat(buf, default_core);
} }
} }
arch_init();
os_init(); os_init();
#if defined(EXT_PAGER) #if defined(EXT_PAGER)
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#include "lispregs.h" #include "lispregs.h"
#include "signal.h" #include "signal.h"
void arch_init() char *arch_init()
{ {
return NULL;
} }
os_vm_address_t arch_get_bad_addr(context) os_vm_address_t arch_get_bad_addr(context)
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#include "lispregs.h" #include "lispregs.h"
#include "signal.h" #include "signal.h"
void arch_init() char *arch_init()
{ {
return NULL;
} }
os_vm_address_t arch_get_bad_addr(context) os_vm_address_t arch_get_bad_addr(context)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment