Subject: Re: ADB probe hangs
To: Colin Wood <cwood@ichips.intel.com>
From: Dave Huang <khym@bga.com>
List: port-mac68k
Date: 04/04/1999 20:05:53
On Sun, 4 Apr 1999, Colin Wood wrote:
> Dave Huang wrote:
> > I hacked ddb to print a stack trace when it's invoked, since I can't
> > type "t" to do it myself, but there's nothing particularly interesting
> > in it... adbattach -> ADBReInit -> adb_reinit -> adb_op_sync -> adb_op
> > -> send_adb_cuda.
> 
> cool!  i've been meaning to do this for some time.  could you send me the
> patch?  i'd appreciate it.

It probably isn't suitable for normal use; at least the times I've tried
it, it causes a uvm_fault after printing the backtrace... but it does
all I need it to do, so I haven't bothered trying to fix it :)

--- /usr/src/sys/ddb/db_trap.c	Sun Aug 16 06:11:09 1998
+++ db_trap.c	Sun Apr  4 01:40:51 1999
@@ -50,6 +50,7 @@
 {
 	boolean_t	bkpt;
 	boolean_t	watchpt;
+void db_stack_trace_cmd __P((db_expr_t, int, db_expr_t, char *));
 
 	bkpt = IS_BREAKPOINT_TRAP(type, code);
 	watchpt = IS_WATCHPOINT_TRAP(type, code);
@@ -74,6 +75,8 @@
 		db_printf("Stopped at\t");
 	    db_dot = PC_REGS(DDB_REGS);
 	    db_print_loc_and_inst(db_dot);
+
+db_stack_trace_cmd(NULL, 0, -1, "");
 
 	    db_command_loop();
 	}