diff options
| author | Paul Mackerras <paulus@samba.org> | 2003-08-30 12:07:47 +1000 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2003-08-30 12:07:47 +1000 |
| commit | 897f5a06a20add8993fc1587a73033920ab218ec (patch) | |
| tree | 18a83e831e1541a0a458ee0b636a228dfd51aa22 | |
| parent | 2f6527cf28eab9b5cddf32ced2ee5101e8129e02 (diff) | |
| parent | 991b73d26ebc2a7da0e883a72bce7d3aea153aab (diff) | |
Merge bk://stop.crashing.org/linux-2.6-kgdb
into samba.org:/home/paulus/kernel/for-linus-ppc
| -rw-r--r-- | arch/ppc/kernel/ppc-stub.c | 33 | ||||
| -rw-r--r-- | arch/ppc/kernel/setup.c | 6 |
2 files changed, 19 insertions, 20 deletions
diff --git a/arch/ppc/kernel/ppc-stub.c b/arch/ppc/kernel/ppc-stub.c index d595a83a9326..37c9c8b2c578 100644 --- a/arch/ppc/kernel/ppc-stub.c +++ b/arch/ppc/kernel/ppc-stub.c @@ -137,7 +137,7 @@ static const char hexchars[]="0123456789abcdef"; /* typedef void (*trapfunc_t)(void); */ static void kgdb_fault_handler(struct pt_regs *regs); -static void handle_exception (struct pt_regs *regs); +static int handle_exception (struct pt_regs *regs); #if 0 /* Install an exception handler for kgdb */ @@ -461,14 +461,12 @@ static void kgdb_fault_handler(struct pt_regs *regs) int kgdb_bpt(struct pt_regs *regs) { - handle_exception(regs); - return 1; + return handle_exception(regs); } int kgdb_sstep(struct pt_regs *regs) { - handle_exception(regs); - return 1; + return handle_exception(regs); } void kgdb(struct pt_regs *regs) @@ -478,16 +476,14 @@ void kgdb(struct pt_regs *regs) int kgdb_iabr_match(struct pt_regs *regs) { - printk("kgdb doesn't support iabr, what?!?\n"); - handle_exception(regs); - return 1; + printk(KERN_ERR "kgdb doesn't support iabr, what?!?\n"); + return handle_exception(regs); } int kgdb_dabr_match(struct pt_regs *regs) { - printk("kgdb doesn't support dabr, what?!?\n"); - handle_exception(regs); - return 1; + printk(KERN_ERR "kgdb doesn't support dabr, what?!?\n"); + return handle_exception(regs); } /* Convert the hardware trap type code to a unix signal number. */ @@ -560,7 +556,7 @@ static int computeSignal(unsigned int tt) /* * This function does all command processing for interfacing to gdb. */ -static void +static int handle_exception (struct pt_regs *regs) { int sigval; @@ -569,14 +565,19 @@ handle_exception (struct pt_regs *regs) char *ptr; unsigned int msr; + /* We don't handle user-mode breakpoints. */ + if (user_mode(regs)) + return 0; + if (debugger_fault_handler) { debugger_fault_handler(regs); panic("kgdb longjump failed!\n"); } if (kgdb_active) { - printk("interrupt while in kgdb, returning\n"); - return; + printk(KERN_ERR "interrupt while in kgdb, returning\n"); + return 0; } + kgdb_active = 1; kgdb_started = 1; @@ -784,7 +785,7 @@ handle_exception (struct pt_regs *regs) printk("remcomInBuffer: %s\n", remcomInBuffer); printk("remcomOutBuffer: %s\n", remcomOutBuffer); } - return; + return 1; case 's': kgdb_flush_cache_all(); @@ -801,7 +802,7 @@ handle_exception (struct pt_regs *regs) printk("remcomInBuffer: %s\n", remcomInBuffer); printk("remcomOutBuffer: %s\n", remcomOutBuffer); } - return; + return 1; case 'r': /* Reset (if user process..exit ???)*/ panic("kgdb reset."); diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index d413e95a97a3..cc830f9cc924 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -624,12 +624,10 @@ void __init setup_arch(char **cmdline_p) #if defined(CONFIG_KGDB) kgdb_map_scc(); set_debug_traps(); - if (strstr(cmd_line, "nokgdb")) - printk("kgdb default breakpoint deactivated on command line\n"); - else { + if (strstr(cmd_line, "gdb")) { if (ppc_md.progress) ppc_md.progress("setup_arch: kgdb breakpoint", 0x4000); - printk("kgdb default breakpoint activated\n"); + printk("kgdb breakpoint activated\n"); breakpoint(); } #endif |
