diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-04-02 15:11:28 +0200 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-04-02 15:11:28 +0200 |
commit | b35db73327cf54445a20533305fcf705e88a520b (patch) | |
tree | c58b7a0bfc8322f8a8093adfb95968bf3580e5c2 /gdbserver/linux-ppc-low.cc | |
parent | ac1bbaca10666fc85572a6deeaa6f1debcd4c129 (diff) | |
download | binutils-b35db73327cf54445a20533305fcf705e88a520b.zip binutils-b35db73327cf54445a20533305fcf705e88a520b.tar.gz binutils-b35db73327cf54445a20533305fcf705e88a520b.tar.bz2 |
gdbserver/linux-low: turn '{collect, supply}_ptrace_register' into methods
gdbserver/ChangeLog:
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'collect_ptrace_register' and 'supply_ptrace_register'
linux target ops into methods of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <low_collect_ptrace_register>
<low_store_ptrace_register>: Declare.
* linux-low.cc (linux_process_target::low_collect_ptrace_register)
(linux_process_target::low_supply_ptrace_register): Define.
Update the callers below.
(linux_process_target::fetch_register)
(linux_process_target::store_register)
* linux-x86-low.cc (the_low_target): Remove the op fields.
* linux-aarch64-low.cc (the_low_target): Ditto.
* linux-arm-low.cc (the_low_target): Ditto.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
* linux-mips-low.cc (class mips_target)
<low_collect_ptrace_register>
<low_supply_ptrace_register>: Declare.
(mips_collect_ptrace_register): Turn into ...
(mips_target::low_collect_ptrace_register): ...this.
(mips_supply_ptrace_register): Turn into...
(mips_target::low_supply_ptrace_register): ...this.
(the_low_target): Remove the op fields.
* linux-ppc-low.cc (class ppc_target)
<low_collect_ptrace_register>
<low_supply_ptrace_register>: Declare.
(ppc_collect_ptrace_register): Turn into ...
(ppc_target::low_collect_ptrace_register): ...this.
(ppc_supply_ptrace_register): Turn into ...
(ppc_target::low_supply_ptrace_register): ...this.
(ppc_fill_gregset): Update for the calls to
low_collect_ptrace_register.
(the_low_target): Remove the op fields.
* linux-s390-low.cc (class s390_target)
<low_collect_ptrace_register>
<low_supply_ptrace_register>: Declare.
(s390_collect_ptrace_register): Turn into ...
(s390_target::low_collect_ptrace_register): ...this.
(s390_supply_ptrace_register): Turn into ...
(s390_target::low_supply_ptrace_register): ...this.
(s390_fill_gregset): Update for the calls to
low_collect_ptrace_register.
(the_low_target): Remove the op fields.
Diffstat (limited to 'gdbserver/linux-ppc-low.cc')
-rw-r--r-- | gdbserver/linux-ppc-low.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc index deb2ef6..e031085 100644 --- a/gdbserver/linux-ppc-low.cc +++ b/gdbserver/linux-ppc-low.cc @@ -56,6 +56,12 @@ public: bool supports_z_point_type (char z_type) override; + + void low_collect_ptrace_register (regcache *regcache, int regno, + char *buf) override; + + void low_supply_ptrace_register (regcache *regcache, int regno, + const char *buf) override; protected: void low_arch_setup () override; @@ -208,8 +214,9 @@ ppc_target::low_cannot_fetch_register (int regno) return false; } -static void -ppc_collect_ptrace_register (struct regcache *regcache, int regno, char *buf) +void +ppc_target::low_collect_ptrace_register (regcache *regcache, int regno, + char *buf) { memset (buf, 0, sizeof (long)); @@ -234,9 +241,9 @@ ppc_collect_ptrace_register (struct regcache *regcache, int regno, char *buf) perror_with_name ("Unexpected byte order"); } -static void -ppc_supply_ptrace_register (struct regcache *regcache, - int regno, const char *buf) +void +ppc_target::low_supply_ptrace_register (regcache *regcache, int regno, + const char *buf) { if (__BYTE_ORDER == __LITTLE_ENDIAN) { @@ -401,14 +408,19 @@ static void ppc_fill_gregset (struct regcache *regcache, void *buf) { int i; + ppc_target *my_ppc_target = (ppc_target *) the_linux_target; + for (i = 0; i < 32; i++) - ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]); + my_ppc_target->low_collect_ptrace_register (regcache, i, + (char *) buf + ppc_regmap[i]); for (i = 64; i < 70; i++) - ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]); + my_ppc_target->low_collect_ptrace_register (regcache, i, + (char *) buf + ppc_regmap[i]); for (i = 71; i < 73; i++) - ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]); + my_ppc_target->low_collect_ptrace_register (regcache, i, + (char *) buf + ppc_regmap[i]); } /* Program Priority Register regset fill function. */ @@ -3416,8 +3428,6 @@ ppc_get_ipa_tdesc_idx (void) } struct linux_target_ops the_low_target = { - ppc_collect_ptrace_register, - ppc_supply_ptrace_register, NULL, /* siginfo_fixup */ NULL, /* new_process */ NULL, /* delete_process */ |