]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
displaced_step_finish: Don't fetch the regcache of exited threads
authorPedro Alves <pedro@palves.net>
Fri, 1 Dec 2023 13:31:00 +0000 (13:31 +0000)
committerPedro Alves <pedro@palves.net>
Wed, 20 Dec 2023 21:18:55 +0000 (21:18 +0000)
commit249d08128787e4e0a977079aa09516d73f196f77
tree45bc735bae678089f08110cbdbbf7cc7ace28440
parentd0b591497952db37ed7a5545ced7aad64433f79a
displaced_step_finish: Don't fetch the regcache of exited threads

displaced_step_finish can be called with event_status.kind ==
TARGET_WAITKIND_THREAD_EXITED, and in that case it is not possible to
get at the already-exited thread's registers.

This patch moves the get_thread_regcache calls to branches that
actually need it, where we know the thread is still alive.

It also adds an assertion to get_thread_regcache, to help catching
these broken cases sooner.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I63b5eacb3e02a538fc5087c270d8025adfda88c3
gdb/infrun.c
gdb/regcache.c