diff options
author | Joel Brobecker <brobecker@gnat.com> | 2002-08-16 17:56:17 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2002-08-16 17:56:17 +0000 |
commit | 0550e065aa312deb517b11c8be960fece6fd3b27 (patch) | |
tree | 11ba7c4bc4ae536f4f6299e23d3cb385e132d9b1 /gdb/infrun.c | |
parent | 9f1e60251c098973ac99424f30f733d7c4d624cd (diff) | |
download | gdb-0550e065aa312deb517b11c8be960fece6fd3b27.tar.gz |
* infrun.c (handle_inferior_event): When receiving a SIGTRAP
signal, check whether we hit a breakpoint before checking for a
single step breakpoint. Otherwise, GDB fails to notice that a
breakpoint has been hit when stepping onto a breakpoint.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 672d5f93c65..af0b3029357 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1826,10 +1826,11 @@ handle_inferior_event (struct execution_control_state *ecs) if (stop_signal == TARGET_SIGNAL_TRAP) { - if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) - ecs->random_signal = 0; - else if (breakpoints_inserted - && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK)) + /* Check if a regular breakpoint has been hit before checking + for a potential single step breakpoint. Otherwise, GDB will + not see this breakpoint hit when stepping onto breakpoints. */ + if (breakpoints_inserted + && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK)) { ecs->random_signal = 0; if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK, @@ -1885,6 +1886,10 @@ handle_inferior_event (struct execution_control_state *ecs) } } } + else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) + { + ecs->random_signal = 0; + } } else ecs->random_signal = 1; |