diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2008-07-26 18:54:38 +0800 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-07-26 18:54:38 +0800 |
commit | 0d1cdd7ab6e0e7ccaf9f3b1d2afa0ddeead23ccc (patch) | |
tree | b9afaa46540a46be141f84aa286acd0dc7f4e65c /arch/blackfin/kernel/kgdb.c | |
parent | 3a2521fa75359450f5ec7e6b76847f933b7ee680 (diff) | |
download | lwn-0d1cdd7ab6e0e7ccaf9f3b1d2afa0ddeead23ccc.tar.gz lwn-0d1cdd7ab6e0e7ccaf9f3b1d2afa0ddeead23ccc.zip |
Blackfin arch: Fix bug - skip single step in high priority interrupt handler instead of disabling all interrupts in single step debugging.
Skip single step if event priority of current instruction is higher than
that of the first instruction, from which gdb starts single step.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/kgdb.c')
-rw-r--r-- | arch/blackfin/kernel/kgdb.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index a9c15515bfd7..a1f9641a6425 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c @@ -203,6 +203,8 @@ struct hw_breakpoint { int kgdb_arch_init(void) { + debugger_step = 0; + kgdb_remove_all_hw_break(); return 0; } @@ -368,6 +370,7 @@ int kgdb_arch_handle_exception(int exceptionVector, int signo, char *ptr; int newPC; int wp_status; + int i; switch (remcom_in_buffer[0]) { case 'c': @@ -392,7 +395,18 @@ int kgdb_arch_handle_exception(int exceptionVector, int signo, /* set the trace bit if we're stepping */ if (remcom_in_buffer[0] == 's') { linux_regs->syscfg |= 0x1; - debugger_step = 1; + debugger_step = linux_regs->ipend; + debugger_step >>= 6; + for (i = 10; i > 0; i--, debugger_step >>= 1) + if (debugger_step & 1) + break; + /* i indicate event priority of current stopped instruction + * user space instruction is 0, IVG15 is 1, IVTMR is 10. + * debugger_step > 0 means in single step mode + */ + debugger_step = i + 1; + } else { + debugger_step = 0; } wp_status = bfin_read_WPSTAT(); |