aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-10-15 20:18:29 +0100
committerPedro Alves <palves@redhat.com>2014-10-15 20:18:29 +0100
commit6cc83d2a4000e89e4f6f2eb33ffade2d72acfa0f (patch)
tree9415d62e45ee263efd81457fcb1f6ab234065655 /gdb/infrun.c
parenta2abc7de6804e7e9882a86375767b24a6c215f28 (diff)
downloadgdb-6cc83d2a4000e89e4f6f2eb33ffade2d72acfa0f.zip
gdb-6cc83d2a4000e89e4f6f2eb33ffade2d72acfa0f.tar.gz
gdb-6cc83d2a4000e89e4f6f2eb33ffade2d72acfa0f.tar.bz2
Decide whether we may have removed breakpoints based on step_over_info
... instead of trap_expected. Gets rid of one singlestep_breakpoints_inserted_p reference, and is generally more to the point. gdb/ 2014-10-15 Pedro Alves <palves@redhat.com> * infrun.c (step_over_info_valid_p): New function. (resume): Use step_over_info_valid_p instead of checking the threads's trap_expected flag.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 6132274..650d711 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1278,6 +1278,14 @@ stepping_past_instruction_at (struct address_space *aspace,
step_over_info.address));
}
+/* Returns true if step-over info is valid. */
+
+static int
+step_over_info_valid_p (void)
+{
+ return (step_over_info.aspace != NULL);
+}
+
/* Displaced stepping. */
@@ -2143,7 +2151,8 @@ a command like `return' or `jump' to continue execution."));
once we arrive back at the step-resume breakpoint, actually step
over the breakpoint we originally wanted to step over. */
if (singlestep_breakpoints_inserted_p
- && tp->control.trap_expected && sig != GDB_SIGNAL_0)
+ && sig != GDB_SIGNAL_0
+ && step_over_info_valid_p ())
{
/* If we have nested signals or a pending signal is delivered
immediately after a handler returns, might might already have
@@ -2237,13 +2246,10 @@ a command like `return' or `jump' to continue execution."));
tp->suspend.stop_signal = GDB_SIGNAL_0;
/* Advise target which signals may be handled silently. If we have
- removed breakpoints because we are stepping over one (which can
- happen only if we are not using displaced stepping), we need to
- receive all signals to avoid accidentally skipping a breakpoint
- during execution of a signal handler. */
- if ((step || singlestep_breakpoints_inserted_p)
- && tp->control.trap_expected
- && !use_displaced_stepping (gdbarch))
+ removed breakpoints because we are stepping over one (in any
+ thread), we need to receive all signals to avoid accidentally
+ skipping a breakpoint during execution of a signal handler. */
+ if (step_over_info_valid_p ())
target_pass_signals (0, NULL);
else
target_pass_signals ((int) GDB_SIGNAL_LAST, signal_pass);