]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: Allow replayed threads to read and write pseudo registers
authorGuinevere Larsen <guinevere@redhat.com>
Wed, 19 Jun 2024 20:16:33 +0000 (17:16 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Mon, 28 Oct 2024 13:46:33 +0000 (10:46 -0300)
commit2f46cda83b89a4f46625163d679aed3e1ed9ea5c
tree1ff53ffabbcce76529b9d1bd8d9f2f1f57e8c22f
parent917ed12066382c48459f85124cbeca1286c3bb53
gdb: Allow replayed threads to read and write pseudo registers

In an effort to support AVX instructions when recording, we need to
allow replaying threads to access pseudo registers. Currently, if
we try to do that gdb will fail in a call to validate_registers_access,
because the thread is executing so GDB thinks it is unsafe to read
pseudo registers.

When replaying, the thread is really executing for all intents and
purposes, but the execution is just having GDB change values on
registers, so it will always be safe to read and write pseudo registers.
This commit changes functions that check for register access to allow
access when we are replaying. The check to whether we are replaying must
not happen when writing a core file, as record_full_list could be nullptr,
so we only check it if the thread is executing.

As of this commit, I don't know of a way to trigger this commit without
AVX support on record, so a test isn't provided. However, as soon as
record-full supports saving ymm registers, the AVX tests will test this
as well.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/record-full.c
gdb/record-full.h
gdb/thread.c