gdbserver/linux-low: turn 'fetch_register' into a method

gdbserver/ChangeLog:
2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	Turn the 'fetch_register' linux target op into a method of
	linux_process_target.

	* linux-low.h (struct linux_target_ops) <fetch_register>: Remove.
	(class linux_process_target) <low_fetch_register>: Declare.
	* linux-x86-low.cc (the_low_target)
	* linux-aarch64-low.cc (the_low_target)
	* linux-arm-low.cc (the_low_target)
	* linux-bfin-low.cc (the_low_target)
	* linux-cris-low.cc (the_low_target)
	* linux-crisv32-low.cc (the_low_target)
	* linux-m32r-low.cc (the_low_target)
	* linux-m68k-low.cc (the_low_target)
	* linux-nios2-low.cc (the_low_target)
	* linux-ppc-low.cc (the_low_target)
	* linux-s390-low.cc (the_low_target)
	* linux-sh-low.cc (the_low_target)
	* linux-sparc-low.cc (the_low_target)
	* linux-tic6x-low.cc (the_low_target)
	* linux-tile-low.cc (the_low_target)
	* linux-xtensa-low.cc (the_low_target): Remove the op field.
	* linux-ia64-low.cc (class ia64_target) <low_fetch_register>:
	Declare.
	(ia64_fetch_register): Turn into...
	(ia64_target::low_fetch_register): ...this.
	(the_low_target): Remove the op field.
	* linux-mips-low.cc (class mips_target) <low_fetch_register>:
	Declare.
	(mips_fetch_register): Turn into...
	(mips_target::low_fetch_register): ...this.
	(the_low_target): Remove the op field.
	* linux-riscv-low.cc (class riscv_target) <low_fetch_register>:
	Declare.
	(riscv_fetch_register): Turn into...
	(riscv_target::low_fetch_register): ...this.
	(the_low_target): Remove the op field.

	Update the callers below.

	* linux-low.cc (linux_process_target::fetch_registers)
	(linux_process_target::low_fetch_register)
This commit is contained in:
Tankut Baris Aktemur
2020-04-02 15:11:24 +02:00
parent daca57a7de
commit bd70b1f240
22 changed files with 80 additions and 46 deletions

View File

@ -40,6 +40,8 @@ protected:
bool low_cannot_fetch_register (int regno) override;
bool low_cannot_store_register (int regno) override;
bool low_fetch_register (regcache *regcache, int regno) override;
};
/* The singleton target ops object. */
@ -263,18 +265,18 @@ mips_target::low_cannot_store_register (int regno)
return false;
}
static int
mips_fetch_register (struct regcache *regcache, int regno)
bool
mips_target::low_fetch_register (regcache *regcache, int regno)
{
const struct target_desc *tdesc = current_process ()->tdesc;
if (find_regno (tdesc, "r0") == regno)
{
supply_register_zeroed (regcache, regno);
return 1;
return true;
}
return 0;
return false;
}
static CORE_ADDR
@ -950,7 +952,6 @@ mips_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
mips_fetch_register,
mips_get_pc,
mips_set_pc,
NULL, /* breakpoint_kind_from_pc */