]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add bool argument to fetch only one register
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 25 Apr 2025 01:29:01 +0000 (22:29 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 25 Apr 2025 01:34:56 +0000 (22:34 -0300)
commitc4d68c00c4c6db39189790f54e3e16eed6fbd205
treeb80e3c78b05c852a1fb2b0deb75accb854b109b5
parent4833d6dac6d942ad1613dc47af88669e0c6da829
Add bool argument to fetch only one register

When trying to fetch the VG register in aarch64_fetch_tdesc_parameter,
remote_target::fetch_registers ends up fetching all registers using the
G packet.  This results in an infinite recursion because GDB will need
to get the VL parameter and thus fetch the VG register again.

To solve the problem, add bool signaling that the target should try to
get just the requested register.

This commit is incomplete because there are some fetch_register
implementations that were not changed to accept the extra argument.

A possibly better and less invasive option would be to add a new
fetch_registers method overload with the new argument to the target_ops
class with a default implementation that would just call the existing
2-arguments version.  This way, only the remote target would need to
override that implementation.  This isn't done here because
make-target-delegates.py doesn't support method overloads and would need
to be adapted.
19 files changed:
gdb/aarch64-linux-nat.c
gdb/aarch64-tdep.c
gdb/aix-thread.c
gdb/amd-dbgapi-target.c
gdb/bsd-uthread.c
gdb/corelow.c
gdb/inf-child.h
gdb/ravenscar-thread.c
gdb/record-btrace.c
gdb/record-full.c
gdb/regcache.c
gdb/regcache.h
gdb/remote.c
gdb/sol-thread.c
gdb/target-delegates-gen.c
gdb/target.c
gdb/target.h
gdb/tracectf.c
gdb/tracefile-tfile.c