diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-09-27 14:28:26 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-09-27 14:28:26 +0100 |
commit | 7031746224c2c274548596b5ee1e856360d860c5 (patch) | |
tree | 7da21669bb7b34b55b4705735febf9b73fa04ab0 /xen/common/gdbstub.c | |
parent | a301105b5b9177c9750ded2cba138f9be695fb4a (diff) | |
download | xen-7031746224c2c274548596b5ee1e856360d860c5.tar.gz xen-7031746224c2c274548596b5ee1e856360d860c5.tar.bz2 xen-7031746224c2c274548596b5ee1e856360d860c5.zip |
[XEN] gdbstub return value is used to determine whether or not
to continue execution.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/gdbstub.c')
-rw-r--r-- | xen/common/gdbstub.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/xen/common/gdbstub.c b/xen/common/gdbstub.c index 708357c56a..54a81680a7 100644 --- a/xen/common/gdbstub.c +++ b/xen/common/gdbstub.c @@ -506,14 +506,13 @@ gdbstub_console_puts(const char *str) int __trap_to_gdb(struct cpu_user_regs *regs, unsigned long cookie) { - int resume = 0; - int r; + int rc = 0; unsigned long flags; if ( gdb_ctx->serhnd < 0 ) { dbg_printk("Debugger not ready yet.\n"); - return 0; + return -EBUSY; } /* We rely on our caller to ensure we're only on one processor @@ -532,7 +531,7 @@ __trap_to_gdb(struct cpu_user_regs *regs, unsigned long cookie) { printk("WARNING WARNING WARNING: Avoiding recursive gdb.\n"); atomic_inc(&gdb_ctx->running); - return 0; + return -EBUSY; } if ( !gdb_ctx->connected ) @@ -565,19 +564,14 @@ __trap_to_gdb(struct cpu_user_regs *regs, unsigned long cookie) gdb_cmd_signum(gdb_ctx); } - while ( resume == 0 ) - { - r = receive_command(gdb_ctx); - if ( r < 0 ) - { - dbg_printk("GDB disappeared, trying to resume Xen...\n"); - resume = 1; - } - else + do { + if ( receive_command(gdb_ctx) < 0 ) { - resume = process_command(regs, gdb_ctx); + dbg_printk("Error in GDB session...\n"); + rc = -EIO; + break; } - } + } while ( process_command(regs, gdb_ctx) == 0 ); gdb_arch_exit(regs); console_end_sync(); @@ -586,7 +580,7 @@ __trap_to_gdb(struct cpu_user_regs *regs, unsigned long cookie) local_irq_restore(flags); - return 0; + return rc; } void |