diff options
author | Pedro Alves <pedro@palves.net> | 2022-06-21 18:05:19 +0100 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2022-12-12 20:01:20 +0000 |
commit | 37dff3c3bb185ebd735882300a7fefabd9f30e0f (patch) | |
tree | 2d0557651c3a123dd8042f4608c2d75912c03f06 /zlib/deflate.h | |
parent | daf510bf56541306c5904af87b37385f7de0933c (diff) | |
download | gdb-users/palves/step-over-thread-exit-v3.zip gdb-users/palves/step-over-thread-exit-v3.tar.gz gdb-users/palves/step-over-thread-exit-v3.tar.bz2 |
Cancel execution command on thread exit, when stepping, nexting, etc.users/palves/step-over-thread-exit-v3
If your target has no support for TARGET_WAITKIND_NO_RESUMED events
(and no way to support them, such as the yet-unsubmitted AMDGPU
target), and you step over thread exit with scheduler-locking on, this
is what you get:
(gdb) n
[Thread ... exited]
*hang*
Getting back the prompt by typing Ctrl-C may not even work, since no
inferior thread is running to receive the SIGINT. Even if it works,
it seems unnecessarily harsh. If you started an execution command for
which there's a clear thread of interest (step, next, until, etc.),
and that thread disappears, then I think it's more user friendly if
GDB just detects the situation and aborts the command, giving back the
prompt.
That is what this commit implements. It does this by explicitly
requesting the target to report thread exit events whenever the main
resumed thread has a thread_fsm. Note that unlike stepping over a
breakpoint, we don't need to enable clone events in this case.
With this patch, we get:
(gdb) n
[Thread 0x7ffff7d89700 (LWP 3961883) exited]
Command aborted, thread exited.
(gdb)
Change-Id: I901ab64c91d10830590b2dac217b5264635a2b95
Diffstat (limited to 'zlib/deflate.h')
0 files changed, 0 insertions, 0 deletions