gdb: call update_thread_list after completing an inferior call
authorAndrew Burgess <aburgess@redhat.com>
Tue, 10 Oct 2023 09:00:10 +0000 (10:00 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 8 Nov 2023 13:28:09 +0000 (13:28 +0000)
commit3c09fd57e6f825672964581e152bd50b507e5630
tree263854000cd04baaeae8427a2e55758adaa669cd
parent75b2eb97a49bf3b539d7e016b2d9a2339170a680
gdb: call update_thread_list after completing an inferior call

I noticed that if GDB is using a remote or extended-remote target,
then, if an inferior call caused a new thread to appear, or for an
existing thread to exit, then these events are not reported to the
user.

The problem is that for these targets GDB relies on a call to
update_thread_list to learn about changes to the inferior's thread
list.

If GDB doesn't pass through the normal stop code then GDB will not
call update_thread_list, and so will not report changes in the thread
list.

This commit adds an additional update_thread_list call, after which
thread events are correctly reported.
gdb/infcall.c
gdb/testsuite/gdb.threads/infcall-thread-announce.c [new file with mode: 0644]
gdb/testsuite/gdb.threads/infcall-thread-announce.exp [new file with mode: 0644]