diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2008-07-26 06:54:38 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-07-26 06:54:38 -0400 |
commit | 0d1cdd7ab6e0e7ccaf9f3b1d2afa0ddeead23ccc (patch) | |
tree | b9afaa46540a46be141f84aa286acd0dc7f4e65c /arch/blackfin/kernel/kgdb.c | |
parent | 3a2521fa75359450f5ec7e6b76847f933b7ee680 (diff) |
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 a9c15515bfd..a1f9641a642 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c | |||
@@ -203,6 +203,8 @@ struct hw_breakpoint { | |||
203 | 203 | ||
204 | int kgdb_arch_init(void) | 204 | int kgdb_arch_init(void) |
205 | { | 205 | { |
206 | debugger_step = 0; | ||
207 | |||
206 | kgdb_remove_all_hw_break(); | 208 | kgdb_remove_all_hw_break(); |
207 | return 0; | 209 | return 0; |
208 | } | 210 | } |
@@ -368,6 +370,7 @@ int kgdb_arch_handle_exception(int exceptionVector, int signo, | |||
368 | char *ptr; | 370 | char *ptr; |
369 | int newPC; | 371 | int newPC; |
370 | int wp_status; | 372 | int wp_status; |
373 | int i; | ||
371 | 374 | ||
372 | switch (remcom_in_buffer[0]) { | 375 | switch (remcom_in_buffer[0]) { |
373 | case 'c': | 376 | case 'c': |
@@ -392,7 +395,18 @@ int kgdb_arch_handle_exception(int exceptionVector, int signo, | |||
392 | /* set the trace bit if we're stepping */ | 395 | /* set the trace bit if we're stepping */ |
393 | if (remcom_in_buffer[0] == 's') { | 396 | if (remcom_in_buffer[0] == 's') { |
394 | linux_regs->syscfg |= 0x1; | 397 | linux_regs->syscfg |= 0x1; |
395 | debugger_step = 1; | 398 | debugger_step = linux_regs->ipend; |
399 | debugger_step >>= 6; | ||
400 | for (i = 10; i > 0; i--, debugger_step >>= 1) | ||
401 | if (debugger_step & 1) | ||
402 | break; | ||
403 | /* i indicate event priority of current stopped instruction | ||
404 | * user space instruction is 0, IVG15 is 1, IVTMR is 10. | ||
405 | * debugger_step > 0 means in single step mode | ||
406 | */ | ||
407 | debugger_step = i + 1; | ||
408 | } else { | ||
409 | debugger_step = 0; | ||
396 | } | 410 | } |
397 | 411 | ||
398 | wp_status = bfin_read_WPSTAT(); | 412 | wp_status = bfin_read_WPSTAT(); |