]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: by-pass regcache to access tdesc only
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Tue, 17 Dec 2024 07:48:02 +0000 (08:48 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Tue, 17 Dec 2024 07:48:02 +0000 (08:48 +0100)
commit2903d618081ac1897beca4ef5cfdb0550f2569e1
treefd4739829be52c5d2bef4bedb1c320e290609a08
parenta030e43267f37681961866760156d74b4e9e30d6
gdbserver: by-pass regcache to access tdesc only

The `get_thread_regcache` function has a `fetch` option to skip
fetching the registers from the target.  It seems this option is set
to false only at uses where we just need to access the tdesc through
the regcache of the current thread, as in

  struct regcache *regcache = get_thread_regcache (current_thread, 0);
  ... regcache->tdesc ...

Since the tdesc of a regcache is set from the process of the thread
that owns the regcache, we can simplify the code to access the tdesc
via the process, as in

  ... current_process ()->tdesc ...

This is intended to be a refactoring with no behavioral change.

Tested only for the linux-x86-low target.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdbserver/linux-ppc-low.cc
gdbserver/linux-s390-low.cc
gdbserver/linux-x86-low.cc