]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb, infrun: fix multi-threaded reverse stepping users/mmetzger/pr31353
authorMarkus Metzger <markus.t.metzger@intel.com>
Fri, 26 Feb 2021 08:04:41 +0000 (09:04 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 13 Sep 2024 10:06:40 +0000 (10:06 +0000)
commit754abf9342fd71818e7878a3a364f653df2af5e8
treec81719749b29b7b5d3ab5ba0a65e9efa735d18bc
parentd230d066b2f7616a4add0e9345600b59fa1207e1
gdb, infrun: fix multi-threaded reverse stepping

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>
gdb/gdbthread.h
gdb/infrun.c
gdb/infrun.h
gdb/testsuite/gdb.btrace/implicit-stop-replaying.exp [new file with mode: 0644]