mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
2012-03-28 Pedro Alves <palves@redhat.com>
* linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC. (IA64_GR0_REGNUM, IA64_FR0_REGNUM) (IA64_FR1_REGNUM): New defines. (ia64_fetch_register): New. (the_low_target): Install it. * linux-low.h (struct linux_target_ops) <fetch_register>: New field. * linux-low.c (linux_fetch_registers): Try the the_low_target.fetch_register hook first. * linux-arm-low.c (the_low_target): Adjust. * linux-bfin-low.c (the_low_target): Adjust. * linux-cris-low.c (the_low_target): Adjust. * linux-crisv32-low.c (the_low_target): Adjust. * linux-m32r-low.c (the_low_target): Adjust. * linux-m68k-low.c (the_low_target): Adjust. * linux-mips-low.c (the_low_target): Adjust. * linux-ppc-low.c (the_low_target): Adjust. * linux-s390-low.c (the_low_target): Adjust. * linux-sh-low.c (the_low_target): Adjust. * linux-sparc-low.c (the_low_target): Adjust. * linux-tic6x-low.c (the_low_target): Adjust. * linux-x86-low.c (the_low_target): Adjust. * linux-xtensa-low.c (the_low_target): Adjust.
This commit is contained in:
@ -1,3 +1,30 @@
|
|||||||
|
2012-03-28 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
|
||||||
|
(IA64_GR0_REGNUM, IA64_FR0_REGNUM)
|
||||||
|
(IA64_FR1_REGNUM): New defines.
|
||||||
|
(ia64_fetch_register): New.
|
||||||
|
(the_low_target): Install it.
|
||||||
|
* linux-low.h (struct linux_target_ops) <fetch_register>: New
|
||||||
|
field.
|
||||||
|
* linux-low.c (linux_fetch_registers): Try the
|
||||||
|
the_low_target.fetch_register hook first.
|
||||||
|
|
||||||
|
* linux-arm-low.c (the_low_target): Adjust.
|
||||||
|
* linux-bfin-low.c (the_low_target): Adjust.
|
||||||
|
* linux-cris-low.c (the_low_target): Adjust.
|
||||||
|
* linux-crisv32-low.c (the_low_target): Adjust.
|
||||||
|
* linux-m32r-low.c (the_low_target): Adjust.
|
||||||
|
* linux-m68k-low.c (the_low_target): Adjust.
|
||||||
|
* linux-mips-low.c (the_low_target): Adjust.
|
||||||
|
* linux-ppc-low.c (the_low_target): Adjust.
|
||||||
|
* linux-s390-low.c (the_low_target): Adjust.
|
||||||
|
* linux-sh-low.c (the_low_target): Adjust.
|
||||||
|
* linux-sparc-low.c (the_low_target): Adjust.
|
||||||
|
* linux-tic6x-low.c (the_low_target): Adjust.
|
||||||
|
* linux-x86-low.c (the_low_target): Adjust.
|
||||||
|
* linux-xtensa-low.c (the_low_target): Adjust.
|
||||||
|
|
||||||
2012-03-26 Pedro Alves <palves@redhat.com>
|
2012-03-26 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* server.c (handle_qxfer_libraries): Don't bail early if
|
* server.c (handle_qxfer_libraries): Don't bail early if
|
||||||
|
@ -837,6 +837,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
arm_cannot_fetch_register,
|
arm_cannot_fetch_register,
|
||||||
arm_cannot_store_register,
|
arm_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
arm_get_pc,
|
arm_get_pc,
|
||||||
arm_set_pc,
|
arm_set_pc,
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
bfin_cannot_fetch_register,
|
bfin_cannot_fetch_register,
|
||||||
bfin_cannot_store_register,
|
bfin_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
bfin_get_pc,
|
bfin_get_pc,
|
||||||
bfin_set_pc,
|
bfin_set_pc,
|
||||||
bfin_breakpoint,
|
bfin_breakpoint,
|
||||||
|
@ -115,6 +115,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
cris_cannot_fetch_register,
|
cris_cannot_fetch_register,
|
||||||
cris_cannot_store_register,
|
cris_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
cris_get_pc,
|
cris_get_pc,
|
||||||
cris_set_pc,
|
cris_set_pc,
|
||||||
(const unsigned char *) &cris_breakpoint,
|
(const unsigned char *) &cris_breakpoint,
|
||||||
|
@ -377,6 +377,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL, /* fetch_register */
|
||||||
cris_get_pc,
|
cris_get_pc,
|
||||||
cris_set_pc,
|
cris_set_pc,
|
||||||
(const unsigned char *) &cris_breakpoint,
|
(const unsigned char *) &cris_breakpoint,
|
||||||
|
@ -256,7 +256,7 @@ static int ia64_regmap[] =
|
|||||||
-1, -1, -1, -1, -1, -1, -1, -1, -1,
|
-1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
PT_AR_PFS,
|
PT_AR_PFS,
|
||||||
PT_AR_LC,
|
PT_AR_LC,
|
||||||
-1, /* Not available: EC, the Epilog Count register */
|
PT_AR_EC,
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
@ -278,6 +278,48 @@ ia64_cannot_fetch_register (int regno)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* GDB register numbers. */
|
||||||
|
#define IA64_GR0_REGNUM 0
|
||||||
|
#define IA64_FR0_REGNUM 128
|
||||||
|
#define IA64_FR1_REGNUM 129
|
||||||
|
|
||||||
|
static int
|
||||||
|
ia64_fetch_register (struct regcache *regcache, int regnum)
|
||||||
|
{
|
||||||
|
/* r0 cannot be fetched but is always zero. */
|
||||||
|
if (regnum == IA64_GR0_REGNUM)
|
||||||
|
{
|
||||||
|
const gdb_byte zero[8] = { 0 };
|
||||||
|
|
||||||
|
gdb_assert (sizeof (zero) == register_size (regnum));
|
||||||
|
supply_register (regcache, regnum, zero);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fr0 cannot be fetched but is always zero. */
|
||||||
|
if (regnum == IA64_FR0_REGNUM)
|
||||||
|
{
|
||||||
|
const gdb_byte f_zero[16] = { 0 };
|
||||||
|
|
||||||
|
gdb_assert (sizeof (f_zero) == register_size (regnum));
|
||||||
|
supply_register (regcache, regnum, f_zero);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fr1 cannot be fetched but is always one (1.0). */
|
||||||
|
if (regnum == IA64_FR1_REGNUM)
|
||||||
|
{
|
||||||
|
const gdb_byte f_one[16] =
|
||||||
|
{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
gdb_assert (sizeof (f_one) == register_size (regnum));
|
||||||
|
supply_register (regcache, regnum, f_one);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct linux_target_ops the_low_target = {
|
struct linux_target_ops the_low_target = {
|
||||||
init_registers_ia64,
|
init_registers_ia64,
|
||||||
ia64_num_regs,
|
ia64_num_regs,
|
||||||
@ -285,4 +327,5 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
ia64_cannot_fetch_register,
|
ia64_cannot_fetch_register,
|
||||||
ia64_cannot_store_register,
|
ia64_cannot_store_register,
|
||||||
|
ia64_fetch_register,
|
||||||
};
|
};
|
||||||
|
@ -4271,11 +4271,19 @@ linux_fetch_registers (struct regcache *regcache, int regno)
|
|||||||
|
|
||||||
if (regno == -1)
|
if (regno == -1)
|
||||||
{
|
{
|
||||||
|
if (the_low_target.fetch_register != NULL)
|
||||||
|
for (regno = 0; regno < the_low_target.num_regs; regno++)
|
||||||
|
(*the_low_target.fetch_register) (regcache, regno);
|
||||||
|
|
||||||
all = regsets_fetch_inferior_registers (regcache);
|
all = regsets_fetch_inferior_registers (regcache);
|
||||||
usr_fetch_inferior_registers (regcache, regno, all);
|
usr_fetch_inferior_registers (regcache, -1, all);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (the_low_target.fetch_register != NULL
|
||||||
|
&& (*the_low_target.fetch_register) (regcache, regno))
|
||||||
|
return;
|
||||||
|
|
||||||
use_regsets = linux_register_in_regsets (regno);
|
use_regsets = linux_register_in_regsets (regno);
|
||||||
if (use_regsets)
|
if (use_regsets)
|
||||||
all = regsets_fetch_inferior_registers (regcache);
|
all = regsets_fetch_inferior_registers (regcache);
|
||||||
|
@ -81,6 +81,14 @@ struct linux_target_ops
|
|||||||
store the register, and 2 if failure to store the register
|
store the register, and 2 if failure to store the register
|
||||||
is acceptable. */
|
is acceptable. */
|
||||||
int (*cannot_store_register) (int);
|
int (*cannot_store_register) (int);
|
||||||
|
|
||||||
|
/* Hook to fetch a register in some non-standard way. Used for
|
||||||
|
example by backends that have read-only registers with hardcoded
|
||||||
|
values (e.g., IA64's gr0/fr0/fr1). Returns true if register
|
||||||
|
REGNO was supplied, false if not, and we should fallback to the
|
||||||
|
standard ptrace methods. */
|
||||||
|
int (*fetch_register) (struct regcache *regcache, int regno);
|
||||||
|
|
||||||
CORE_ADDR (*get_pc) (struct regcache *regcache);
|
CORE_ADDR (*get_pc) (struct regcache *regcache);
|
||||||
void (*set_pc) (struct regcache *regcache, CORE_ADDR newpc);
|
void (*set_pc) (struct regcache *regcache, CORE_ADDR newpc);
|
||||||
const unsigned char *breakpoint;
|
const unsigned char *breakpoint;
|
||||||
|
@ -94,6 +94,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
m32r_cannot_fetch_register,
|
m32r_cannot_fetch_register,
|
||||||
m32r_cannot_store_register,
|
m32r_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
m32r_get_pc,
|
m32r_get_pc,
|
||||||
m32r_set_pc,
|
m32r_set_pc,
|
||||||
(const unsigned char *) &m32r_breakpoint,
|
(const unsigned char *) &m32r_breakpoint,
|
||||||
|
@ -182,6 +182,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
m68k_cannot_fetch_register,
|
m68k_cannot_fetch_register,
|
||||||
m68k_cannot_store_register,
|
m68k_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
m68k_get_pc,
|
m68k_get_pc,
|
||||||
m68k_set_pc,
|
m68k_set_pc,
|
||||||
m68k_breakpoint,
|
m68k_breakpoint,
|
||||||
|
@ -430,6 +430,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
mips_cannot_fetch_register,
|
mips_cannot_fetch_register,
|
||||||
mips_cannot_store_register,
|
mips_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
mips_get_pc,
|
mips_get_pc,
|
||||||
mips_set_pc,
|
mips_set_pc,
|
||||||
(const unsigned char *) &mips_breakpoint,
|
(const unsigned char *) &mips_breakpoint,
|
||||||
|
@ -613,6 +613,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
ppc_cannot_fetch_register,
|
ppc_cannot_fetch_register,
|
||||||
ppc_cannot_store_register,
|
ppc_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
ppc_get_pc,
|
ppc_get_pc,
|
||||||
ppc_set_pc,
|
ppc_set_pc,
|
||||||
(const unsigned char *) &ppc_breakpoint,
|
(const unsigned char *) &ppc_breakpoint,
|
||||||
|
@ -464,6 +464,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
s390_cannot_fetch_register,
|
s390_cannot_fetch_register,
|
||||||
s390_cannot_store_register,
|
s390_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
s390_get_pc,
|
s390_get_pc,
|
||||||
s390_set_pc,
|
s390_set_pc,
|
||||||
s390_breakpoint,
|
s390_breakpoint,
|
||||||
|
@ -115,6 +115,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
sh_cannot_fetch_register,
|
sh_cannot_fetch_register,
|
||||||
sh_cannot_store_register,
|
sh_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
sh_get_pc,
|
sh_get_pc,
|
||||||
sh_set_pc,
|
sh_set_pc,
|
||||||
(const unsigned char *) &sh_breakpoint,
|
(const unsigned char *) &sh_breakpoint,
|
||||||
|
@ -284,6 +284,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
sparc_cannot_fetch_register,
|
sparc_cannot_fetch_register,
|
||||||
sparc_cannot_store_register,
|
sparc_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
sparc_get_pc,
|
sparc_get_pc,
|
||||||
/* No sparc_set_pc is needed. */
|
/* No sparc_set_pc is needed. */
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -324,6 +324,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
tic6x_cannot_fetch_register,
|
tic6x_cannot_fetch_register,
|
||||||
tic6x_cannot_store_register,
|
tic6x_cannot_store_register,
|
||||||
|
NULL, /* fetch_register */
|
||||||
tic6x_get_pc,
|
tic6x_get_pc,
|
||||||
tic6x_set_pc,
|
tic6x_set_pc,
|
||||||
(const unsigned char *) &tic6x_breakpoint,
|
(const unsigned char *) &tic6x_breakpoint,
|
||||||
|
@ -2969,6 +2969,7 @@ struct linux_target_ops the_low_target =
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL, /* fetch_register */
|
||||||
x86_get_pc,
|
x86_get_pc,
|
||||||
x86_set_pc,
|
x86_set_pc,
|
||||||
x86_breakpoint,
|
x86_breakpoint,
|
||||||
|
@ -183,6 +183,7 @@ struct linux_target_ops the_low_target = {
|
|||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
NULL, /* fetch_register */
|
||||||
xtensa_get_pc,
|
xtensa_get_pc,
|
||||||
xtensa_set_pc,
|
xtensa_set_pc,
|
||||||
xtensa_breakpoint,
|
xtensa_breakpoint,
|
||||||
|
Reference in New Issue
Block a user