diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2024-12-17 08:48:02 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2024-12-17 08:48:02 +0100 |
commit | 2903d618081ac1897beca4ef5cfdb0550f2569e1 (patch) | |
tree | fd4739829be52c5d2bef4bedb1c320e290609a08 /gdbserver/linux-x86-low.cc | |
parent | a030e43267f37681961866760156d74b4e9e30d6 (diff) | |
download | gdb-2903d618081ac1897beca4ef5cfdb0550f2569e1.zip gdb-2903d618081ac1897beca4ef5cfdb0550f2569e1.tar.gz gdb-2903d618081ac1897beca4ef5cfdb0550f2569e1.tar.bz2 |
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>
Diffstat (limited to 'gdbserver/linux-x86-low.cc')
-rw-r--r-- | gdbserver/linux-x86-low.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index d955a71..ad7ed1c 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -284,9 +284,7 @@ static /*const*/ int i386_regmap[] = static int is_64bit_tdesc (thread_info *thread) { - struct regcache *regcache = get_thread_regcache (thread, 0); - - return register_size (regcache->tdesc, 0) == 8; + return register_size (thread->process ()->tdesc, 0) == 8; } #endif @@ -2876,8 +2874,7 @@ x86_target::low_supports_range_stepping () int x86_target::get_ipa_tdesc_idx () { - struct regcache *regcache = get_thread_regcache (current_thread, 0); - const struct target_desc *tdesc = regcache->tdesc; + const target_desc *tdesc = current_process ()->tdesc; if (!use_xml) { |