summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/ppc/kernel/ppc-stub.c33
1 files changed, 17 insertions, 16 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.");