diff --git a/ldb/Makefile.orig b/ldb/Makefile.orig index 954ca737943bc8c41600ab019a870527d18b5be2..0d762a28e6b71a4c1c22059aef6ea9e477b96778 100644 --- a/ldb/Makefile.orig +++ b/ldb/Makefile.orig @@ -1,10 +1,10 @@ -# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/Makefile.orig,v 1.7 1990/03/29 21:17:49 ch Exp $ +# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/Makefile.orig,v 1.8 1990/04/04 18:26:15 ch Exp $ CFLAGS = -g OBJS = ldb.o egets.o coreparse.o alloc.o monitor.o print.o \ os.o vars.o assem.o parse.o interrupt.o test.o \ search.o validate.o gc.o globals.o dynbind.o \ - regnames.o + regnames.o backtrace.o ldb.map: ldb echo -n 'Map file for ldb version ' > ldb.map diff --git a/ldb/monitor.c b/ldb/monitor.c index 379d6ff8563f43e86c17c7e018c23f1755937615..90d92e34581e32174b73bf932994cf8f8471d1f3 100644 --- a/ldb/monitor.c +++ b/ldb/monitor.c @@ -16,6 +16,7 @@ static void call_cmd(), dump_cmd(), print_cmd(), quit(), help(); static void flush_cmd(), search_cmd(), regs_cmd(), exit_cmd(), throw_cmd(); static void timed_call_cmd(), gc_cmd(), print_context_cmd(); +static void backtrace_cmd(); static struct cmd { char *cmd, *help; @@ -23,6 +24,7 @@ static struct cmd { } Cmds[] = { {"help", "Display this info", help}, {"?", NULL, help}, + {"backtrace", "backtrace up to N frames", backtrace_cmd}, {"call", "call FUNCTION with ARG1, ARG2, ...", call_cmd}, {"context", "print interrupt context number I.", print_context_cmd}, {"dump", "dump memory starting at ADDRESS for COUNT words.", dump_cmd}, @@ -376,12 +378,13 @@ struct sigcontext *context; static void print_context_cmd(ptr) char **ptr; { - int index; int free; free = SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX)>>2; if (more_p(ptr)) { + int index; + index = parse_number(ptr); if ((index >= 0) && (index < free)) { @@ -403,6 +406,21 @@ char **ptr; } } +static void backtrace_cmd(ptr) +char **ptr; +{ + void backtrace(); + int n; + + if (more_p(ptr)) + n = parse_number(ptr); + else + n = 100; + + printf("Backtrace:\n"); + backtrace(n); +} + static void sub_monitor(csp, bsp) lispobj *csp, *bsp; {