diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2021-02-26 09:04:41 +0100 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2024-09-13 10:06:40 +0000 |
commit | 754abf9342fd71818e7878a3a364f653df2af5e8 (patch) | |
tree | c81719749b29b7b5d3ab5ba0a65e9efa735d18bc /gdb/gdbthread.h | |
parent | d230d066b2f7616a4add0e9345600b59fa1207e1 (diff) | |
download | gdb-users/mmetzger/pr31353.zip gdb-users/mmetzger/pr31353.tar.gz gdb-users/mmetzger/pr31353.tar.bz2 |
gdb, infrun: fix multi-threaded reverse steppingusers/mmetzger/pr31353
When reverse-stepping a thread that has a pending breakpoint event, the
thread is not resumed as part of the infcmd function. A first resume
notices the event and returns without resuming the target.
If the corresponding breakpoint has been deleted, event processing results
in a second resume that performs the intended stepping action. That
resume happens after the infcmd function returned and the temporarily
modified execution direction was restored. We end up resuming in the
wrong direction.
Store the direction in a thread's control state and change most of
infrun to take it from there rather than using the global variable.
Reviewed-By: Guinevere Larsen <blarsen@redhat.com>
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r-- | gdb/gdbthread.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 2d6b212..12773c7 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -92,6 +92,13 @@ enum step_over_calls_kind STEP_OVER_UNDEBUGGABLE }; +/* Reverse execution. */ +enum exec_direction_kind + { + EXEC_FORWARD, + EXEC_REVERSE + }; + /* Inferior thread specific part of `struct infcall_control_state'. Inferior process counterpart is `struct inferior_control_state'. */ @@ -179,6 +186,9 @@ struct thread_control_state /* Whether the thread was replaying when the command was issued. */ bool is_replaying = false; + + /* The execution direction when the command was issued. */ + enum exec_direction_kind execution_direction = EXEC_FORWARD; }; /* Inferior thread specific part of `struct infcall_suspend_state'. */ |