* gdbarch.sh (stab_reg_to_regnum, dwarf_reg_to_regnum)
( dwarf2_reg_to_regnum, sdb_reg_to_regnum, ecoff_reg_to_regnum): Add gdbarch as parameter. * gdbarch.{c,h}: Regenerate. * xtensa-tdep.c (xtensa_reg_to_regnum): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. * s390-tdep.c (s390_dwarf_reg_to_regnum): Likewise. * rs6000-tdep.c (rs6000_stab_reg_to_regnum) (rs6000_dwarf2_reg_to_regnum): Likewise. * mips-tdep.c (mips_stab_reg_to_regnum) (mips_dwarf_dwarf2_ecoff_reg_to_regnum): Likewise. * mep-tdep.c (mep_debug_reg_to_regnum): Likewise. * m32c-tdep.c (m32c_debug_info_reg_to_regnum): Likewise. * i386-tdep.c (i386_dbx_reg_to_regnum) (i386_svr4_reg_to_regnum): Likewise * h8300-tdep.c (h8300s_dbg_reg_to_regnum) (h8300_dbg_reg_to_regnum): Likewise. * amd64-tdep.c (amd64_dwarf_reg_to_regnum): Likewise. * arch-utils.c (no_op_reg_to_regnum): Likewise. * arch-utils.h (no_op_reg_to_regnum): Likewise. * arm-tdep.c (arm_dwarf_reg_to_regnum): Likewise. * cris-tdep.c (cris_dwarf2_reg_to_regnum): Likewise. * hppa-tdep.c (hppa64_dwarf_reg_to_regnum): Likewise. * ia64-tdep.c (ia64_dwarf_reg_to_regnum): Likewise. * m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise.
This commit is contained in:
parent
b79d787e44
commit
d3f73121db
20 changed files with 90 additions and 67 deletions
|
@ -1,3 +1,32 @@
|
||||||
|
2007-12-06 Markus Deuling <deuling@de.ibm.com>
|
||||||
|
|
||||||
|
* gdbarch.sh (stab_reg_to_regnum, dwarf_reg_to_regnum)
|
||||||
|
( dwarf2_reg_to_regnum, sdb_reg_to_regnum, ecoff_reg_to_regnum): Add
|
||||||
|
gdbarch as parameter.
|
||||||
|
* gdbarch.{c,h}: Regenerate.
|
||||||
|
|
||||||
|
* xtensa-tdep.c (xtensa_reg_to_regnum): Add gdbarch as parameter.
|
||||||
|
Replace current_gdbarch by gdbarch.
|
||||||
|
* s390-tdep.c (s390_dwarf_reg_to_regnum): Likewise.
|
||||||
|
* rs6000-tdep.c (rs6000_stab_reg_to_regnum)
|
||||||
|
(rs6000_dwarf2_reg_to_regnum): Likewise.
|
||||||
|
* mips-tdep.c (mips_stab_reg_to_regnum)
|
||||||
|
(mips_dwarf_dwarf2_ecoff_reg_to_regnum): Likewise.
|
||||||
|
* mep-tdep.c (mep_debug_reg_to_regnum): Likewise.
|
||||||
|
* m32c-tdep.c (m32c_debug_info_reg_to_regnum): Likewise.
|
||||||
|
* i386-tdep.c (i386_dbx_reg_to_regnum)
|
||||||
|
(i386_svr4_reg_to_regnum): Likewise
|
||||||
|
* h8300-tdep.c (h8300s_dbg_reg_to_regnum)
|
||||||
|
(h8300_dbg_reg_to_regnum): Likewise.
|
||||||
|
* amd64-tdep.c (amd64_dwarf_reg_to_regnum): Likewise.
|
||||||
|
* arch-utils.c (no_op_reg_to_regnum): Likewise.
|
||||||
|
* arch-utils.h (no_op_reg_to_regnum): Likewise.
|
||||||
|
* arm-tdep.c (arm_dwarf_reg_to_regnum): Likewise.
|
||||||
|
* cris-tdep.c (cris_dwarf2_reg_to_regnum): Likewise.
|
||||||
|
* hppa-tdep.c (hppa64_dwarf_reg_to_regnum): Likewise.
|
||||||
|
* ia64-tdep.c (ia64_dwarf_reg_to_regnum): Likewise.
|
||||||
|
* m68k-tdep.c (m68k_dwarf_reg_to_regnum): Likewise.
|
||||||
|
|
||||||
2007-12-06 Vladimir Prus <vladimir@codesourcery.com>
|
2007-12-06 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
Localize infrun use of remove_breakpoints.
|
Localize infrun use of remove_breakpoints.
|
||||||
|
|
|
@ -187,7 +187,7 @@ static const int amd64_dwarf_regmap_len =
|
||||||
number used by GDB. */
|
number used by GDB. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
amd64_dwarf_reg_to_regnum (int reg)
|
amd64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
int regnum = -1;
|
int regnum = -1;
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ convert_from_func_ptr_addr_identity (struct gdbarch *gdbarch, CORE_ADDR addr,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
no_op_reg_to_regnum (int reg)
|
no_op_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
return reg;
|
return reg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr_ident
|
||||||
|
|
||||||
/* No-op conversion of reg to regnum. */
|
/* No-op conversion of reg to regnum. */
|
||||||
|
|
||||||
extern int no_op_reg_to_regnum (int reg);
|
extern int no_op_reg_to_regnum (struct gdbarch *gdbarch, int reg);
|
||||||
|
|
||||||
/* Do nothing version of elf_make_msymbol_special. */
|
/* Do nothing version of elf_make_msymbol_special. */
|
||||||
|
|
||||||
|
|
|
@ -1430,7 +1430,7 @@ arm_register_type (struct gdbarch *gdbarch, int regnum)
|
||||||
number. */
|
number. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
arm_dwarf_reg_to_regnum (int reg)
|
arm_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
/* Core integer regs. */
|
/* Core integer regs. */
|
||||||
if (reg >= 0 && reg <= 15)
|
if (reg >= 0 && reg <= 15)
|
||||||
|
|
|
@ -1847,7 +1847,7 @@ crisv32_register_name (struct gdbarch *gdbarch, int regno)
|
||||||
number used by GDB. */
|
number used by GDB. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cris_dwarf2_reg_to_regnum (int reg)
|
cris_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
/* We need to re-map a couple of registers (SRP is 16 in Dwarf-2 register
|
/* We need to re-map a couple of registers (SRP is 16 in Dwarf-2 register
|
||||||
numbering, MOF is 18).
|
numbering, MOF is 18).
|
||||||
|
|
|
@ -275,11 +275,11 @@ struct gdbarch startup_gdbarch =
|
||||||
-1, /* pc_regnum */
|
-1, /* pc_regnum */
|
||||||
-1, /* ps_regnum */
|
-1, /* ps_regnum */
|
||||||
0, /* fp0_regnum */
|
0, /* fp0_regnum */
|
||||||
0, /* stab_reg_to_regnum */
|
no_op_reg_to_regnum, /* stab_reg_to_regnum */
|
||||||
0, /* ecoff_reg_to_regnum */
|
no_op_reg_to_regnum, /* ecoff_reg_to_regnum */
|
||||||
0, /* dwarf_reg_to_regnum */
|
no_op_reg_to_regnum, /* dwarf_reg_to_regnum */
|
||||||
0, /* sdb_reg_to_regnum */
|
no_op_reg_to_regnum, /* sdb_reg_to_regnum */
|
||||||
0, /* dwarf2_reg_to_regnum */
|
no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */
|
||||||
0, /* register_name */
|
0, /* register_name */
|
||||||
0, /* register_type */
|
0, /* register_type */
|
||||||
0, /* unwind_dummy_id */
|
0, /* unwind_dummy_id */
|
||||||
|
@ -1502,7 +1502,7 @@ gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
|
||||||
gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
|
gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
|
||||||
if (gdbarch_debug >= 2)
|
if (gdbarch_debug >= 2)
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
|
fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
|
||||||
return gdbarch->stab_reg_to_regnum (stab_regnr);
|
return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1519,7 +1519,7 @@ gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
|
||||||
gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
|
gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
|
||||||
if (gdbarch_debug >= 2)
|
if (gdbarch_debug >= 2)
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
|
fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
|
||||||
return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
|
return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1536,7 +1536,7 @@ gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
|
||||||
gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
|
gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
|
||||||
if (gdbarch_debug >= 2)
|
if (gdbarch_debug >= 2)
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
|
fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
|
||||||
return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
|
return gdbarch->dwarf_reg_to_regnum (gdbarch, dwarf_regnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1553,7 +1553,7 @@ gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
|
||||||
gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
|
gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
|
||||||
if (gdbarch_debug >= 2)
|
if (gdbarch_debug >= 2)
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
|
fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
|
||||||
return gdbarch->sdb_reg_to_regnum (sdb_regnr);
|
return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1570,7 +1570,7 @@ gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
|
||||||
gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
|
gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
|
||||||
if (gdbarch_debug >= 2)
|
if (gdbarch_debug >= 2)
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
|
fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
|
||||||
return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
|
return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -206,29 +206,29 @@ extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
|
||||||
|
|
||||||
/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
|
/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
|
||||||
|
|
||||||
typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
|
typedef int (gdbarch_stab_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int stab_regnr);
|
||||||
extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
|
extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
|
||||||
extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
|
extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
|
||||||
|
|
||||||
/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
|
/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
|
||||||
|
|
||||||
typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
|
typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int ecoff_regnr);
|
||||||
extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
|
extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
|
||||||
extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
|
extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
|
||||||
|
|
||||||
/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
|
/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
|
||||||
|
|
||||||
typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
|
typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int dwarf_regnr);
|
||||||
extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
|
extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
|
||||||
extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
|
extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
|
||||||
|
|
||||||
/* Convert from an sdb register number to an internal gdb register number. */
|
/* Convert from an sdb register number to an internal gdb register number. */
|
||||||
|
|
||||||
typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
|
typedef int (gdbarch_sdb_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int sdb_regnr);
|
||||||
extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
|
extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
|
||||||
extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
|
extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
|
||||||
|
|
||||||
typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
|
typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int dwarf2_regnr);
|
||||||
extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
|
extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
|
||||||
extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
|
extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
|
||||||
|
|
||||||
|
|
|
@ -413,14 +413,14 @@ v:int:pc_regnum:::-1:-1::0
|
||||||
v:int:ps_regnum:::-1:-1::0
|
v:int:ps_regnum:::-1:-1::0
|
||||||
v:int:fp0_regnum:::0:-1::0
|
v:int:fp0_regnum:::0:-1::0
|
||||||
# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
|
# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
|
||||||
f:int:stab_reg_to_regnum:int stab_regnr:stab_regnr::no_op_reg_to_regnum::0
|
m:int:stab_reg_to_regnum:int stab_regnr:stab_regnr::no_op_reg_to_regnum::0
|
||||||
# Provide a default mapping from a ecoff register number to a gdb REGNUM.
|
# Provide a default mapping from a ecoff register number to a gdb REGNUM.
|
||||||
f:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr::no_op_reg_to_regnum::0
|
m:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr::no_op_reg_to_regnum::0
|
||||||
# Provide a default mapping from a DWARF register number to a gdb REGNUM.
|
# Provide a default mapping from a DWARF register number to a gdb REGNUM.
|
||||||
f:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr::no_op_reg_to_regnum::0
|
m:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr::no_op_reg_to_regnum::0
|
||||||
# Convert from an sdb register number to an internal gdb register number.
|
# Convert from an sdb register number to an internal gdb register number.
|
||||||
f:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr::no_op_reg_to_regnum::0
|
m:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr::no_op_reg_to_regnum::0
|
||||||
f:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr::no_op_reg_to_regnum::0
|
m:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr::no_op_reg_to_regnum::0
|
||||||
m:const char *:register_name:int regnr:regnr::0
|
m:const char *:register_name:int regnr:regnr::0
|
||||||
|
|
||||||
# Return the type of a register specified by the architecture. Only
|
# Return the type of a register specified by the architecture. Only
|
||||||
|
|
|
@ -1175,7 +1175,7 @@ h8300_pseudo_register_write (struct gdbarch *gdbarch,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
h8300_dbg_reg_to_regnum (int regno)
|
h8300_dbg_reg_to_regnum (struct gdbarch *gdbarch, int regno)
|
||||||
{
|
{
|
||||||
if (regno == E_CCR_REGNUM)
|
if (regno == E_CCR_REGNUM)
|
||||||
return E_PSEUDO_CCR_REGNUM;
|
return E_PSEUDO_CCR_REGNUM;
|
||||||
|
@ -1183,7 +1183,7 @@ h8300_dbg_reg_to_regnum (int regno)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
h8300s_dbg_reg_to_regnum (int regno)
|
h8300s_dbg_reg_to_regnum (struct gdbarch *gdbarch, int regno)
|
||||||
{
|
{
|
||||||
if (regno == E_CCR_REGNUM)
|
if (regno == E_CCR_REGNUM)
|
||||||
return E_PSEUDO_CCR_REGNUM;
|
return E_PSEUDO_CCR_REGNUM;
|
||||||
|
|
|
@ -659,7 +659,7 @@ hppa64_register_name (struct gdbarch *gdbarch, int i)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
hppa64_dwarf_reg_to_regnum (int reg)
|
hppa64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
/* r0-r31 and sar map one-to-one. */
|
/* r0-r31 and sar map one-to-one. */
|
||||||
if (reg <= 32)
|
if (reg <= 32)
|
||||||
|
|
|
@ -167,7 +167,7 @@ i386_register_name (struct gdbarch *gdbarch, int regnum)
|
||||||
number used by GDB. */
|
number used by GDB. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
i386_dbx_reg_to_regnum (int reg)
|
i386_dbx_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
/* This implements what GCC calls the "default" register map
|
/* This implements what GCC calls the "default" register map
|
||||||
(dbx_register_map[]). */
|
(dbx_register_map[]). */
|
||||||
|
@ -199,15 +199,14 @@ i386_dbx_reg_to_regnum (int reg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This will hopefully provoke a warning. */
|
/* This will hopefully provoke a warning. */
|
||||||
return gdbarch_num_regs (current_gdbarch)
|
return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
|
||||||
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert SVR4 register number REG to the appropriate register number
|
/* Convert SVR4 register number REG to the appropriate register number
|
||||||
used by GDB. */
|
used by GDB. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
i386_svr4_reg_to_regnum (int reg)
|
i386_svr4_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
/* This implements the GCC register map that tries to be compatible
|
/* This implements the GCC register map that tries to be compatible
|
||||||
with the SVR4 C compiler for DWARF (svr4_dbx_register_map[]). */
|
with the SVR4 C compiler for DWARF (svr4_dbx_register_map[]). */
|
||||||
|
@ -227,7 +226,7 @@ i386_svr4_reg_to_regnum (int reg)
|
||||||
else if (reg >= 21 && reg <= 36)
|
else if (reg >= 21 && reg <= 36)
|
||||||
{
|
{
|
||||||
/* The SSE and MMX registers have the same numbers as with dbx. */
|
/* The SSE and MMX registers have the same numbers as with dbx. */
|
||||||
return i386_dbx_reg_to_regnum (reg);
|
return i386_dbx_reg_to_regnum (gdbarch, reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (reg)
|
switch (reg)
|
||||||
|
@ -244,8 +243,7 @@ i386_svr4_reg_to_regnum (int reg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This will hopefully provoke a warning. */
|
/* This will hopefully provoke a warning. */
|
||||||
return gdbarch_num_regs (current_gdbarch)
|
return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
|
||||||
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef I387_ST0_REGNUM
|
#undef I387_ST0_REGNUM
|
||||||
|
|
|
@ -313,7 +313,7 @@ ia64_register_type (struct gdbarch *arch, int reg)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ia64_dwarf_reg_to_regnum (int reg)
|
ia64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
if (reg >= IA64_GR32_REGNUM && reg <= IA64_GR127_REGNUM)
|
if (reg >= IA64_GR32_REGNUM && reg <= IA64_GR127_REGNUM)
|
||||||
return V32_REGNUM + (reg - IA64_GR32_REGNUM);
|
return V32_REGNUM + (reg - IA64_GR32_REGNUM);
|
||||||
|
|
|
@ -248,9 +248,9 @@ m32c_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
m32c_debug_info_reg_to_regnum (int reg_nr)
|
m32c_debug_info_reg_to_regnum (struct gdbarch *gdbarch, int reg_nr)
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
if (0 <= reg_nr && reg_nr <= M32C_MAX_DWARF_REGNUM
|
if (0 <= reg_nr && reg_nr <= M32C_MAX_DWARF_REGNUM
|
||||||
&& tdep->dwarf_regs[reg_nr])
|
&& tdep->dwarf_regs[reg_nr])
|
||||||
return tdep->dwarf_regs[reg_nr]->num;
|
return tdep->dwarf_regs[reg_nr]->num;
|
||||||
|
|
|
@ -527,7 +527,7 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
/* Convert a dwarf or dwarf2 regnumber to a GDB regnum. */
|
/* Convert a dwarf or dwarf2 regnumber to a GDB regnum. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
m68k_dwarf_reg_to_regnum (int num)
|
m68k_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int num)
|
||||||
{
|
{
|
||||||
if (num < 8)
|
if (num < 8)
|
||||||
/* d0..7 */
|
/* d0..7 */
|
||||||
|
@ -535,15 +535,14 @@ m68k_dwarf_reg_to_regnum (int num)
|
||||||
else if (num < 16)
|
else if (num < 16)
|
||||||
/* a0..7 */
|
/* a0..7 */
|
||||||
return (num - 8) + M68K_A0_REGNUM;
|
return (num - 8) + M68K_A0_REGNUM;
|
||||||
else if (num < 24 && gdbarch_tdep (current_gdbarch)->fpregs_present)
|
else if (num < 24 && gdbarch_tdep (gdbarch)->fpregs_present)
|
||||||
/* fp0..7 */
|
/* fp0..7 */
|
||||||
return (num - 16) + M68K_FP0_REGNUM;
|
return (num - 16) + M68K_FP0_REGNUM;
|
||||||
else if (num == 25)
|
else if (num == 25)
|
||||||
/* pc */
|
/* pc */
|
||||||
return M68K_PC_REGNUM;
|
return M68K_PC_REGNUM;
|
||||||
else
|
else
|
||||||
return gdbarch_num_regs (current_gdbarch)
|
return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
|
||||||
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -785,7 +785,7 @@ mep_init_pseudoregister_maps (void)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mep_debug_reg_to_regnum (int debug_reg)
|
mep_debug_reg_to_regnum (struct gdbarch *gdbarch, int debug_reg)
|
||||||
{
|
{
|
||||||
/* The debug info uses the raw register numbers. */
|
/* The debug info uses the raw register numbers. */
|
||||||
return mep_raw_to_pseudo[debug_reg];
|
return mep_raw_to_pseudo[debug_reg];
|
||||||
|
|
|
@ -5040,23 +5040,22 @@ mips_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
|
||||||
[1 * gdbarch_num_regs .. 2 * gdbarch_num_regs) REGNUM. */
|
[1 * gdbarch_num_regs .. 2 * gdbarch_num_regs) REGNUM. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mips_stab_reg_to_regnum (int num)
|
mips_stab_reg_to_regnum (struct gdbarch *gdbarch, int num)
|
||||||
{
|
{
|
||||||
int regnum;
|
int regnum;
|
||||||
if (num >= 0 && num < 32)
|
if (num >= 0 && num < 32)
|
||||||
regnum = num;
|
regnum = num;
|
||||||
else if (num >= 38 && num < 70)
|
else if (num >= 38 && num < 70)
|
||||||
regnum = num + mips_regnum (current_gdbarch)->fp0 - 38;
|
regnum = num + mips_regnum (gdbarch)->fp0 - 38;
|
||||||
else if (num == 70)
|
else if (num == 70)
|
||||||
regnum = mips_regnum (current_gdbarch)->hi;
|
regnum = mips_regnum (gdbarch)->hi;
|
||||||
else if (num == 71)
|
else if (num == 71)
|
||||||
regnum = mips_regnum (current_gdbarch)->lo;
|
regnum = mips_regnum (gdbarch)->lo;
|
||||||
else
|
else
|
||||||
/* This will hopefully (eventually) provoke a warning. Should
|
/* This will hopefully (eventually) provoke a warning. Should
|
||||||
we be calling complaint() here? */
|
we be calling complaint() here? */
|
||||||
return gdbarch_num_regs (current_gdbarch)
|
return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
|
||||||
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
return gdbarch_num_regs (gdbarch) + regnum;
|
||||||
return gdbarch_num_regs (current_gdbarch) + regnum;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5064,23 +5063,22 @@ mips_stab_reg_to_regnum (int num)
|
||||||
gdbarch_num_regs .. 2 * gdbarch_num_regs) REGNUM. */
|
gdbarch_num_regs .. 2 * gdbarch_num_regs) REGNUM. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mips_dwarf_dwarf2_ecoff_reg_to_regnum (int num)
|
mips_dwarf_dwarf2_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int num)
|
||||||
{
|
{
|
||||||
int regnum;
|
int regnum;
|
||||||
if (num >= 0 && num < 32)
|
if (num >= 0 && num < 32)
|
||||||
regnum = num;
|
regnum = num;
|
||||||
else if (num >= 32 && num < 64)
|
else if (num >= 32 && num < 64)
|
||||||
regnum = num + mips_regnum (current_gdbarch)->fp0 - 32;
|
regnum = num + mips_regnum (gdbarch)->fp0 - 32;
|
||||||
else if (num == 64)
|
else if (num == 64)
|
||||||
regnum = mips_regnum (current_gdbarch)->hi;
|
regnum = mips_regnum (gdbarch)->hi;
|
||||||
else if (num == 65)
|
else if (num == 65)
|
||||||
regnum = mips_regnum (current_gdbarch)->lo;
|
regnum = mips_regnum (gdbarch)->lo;
|
||||||
else
|
else
|
||||||
/* This will hopefully (eventually) provoke a warning. Should we
|
/* This will hopefully (eventually) provoke a warning. Should we
|
||||||
be calling complaint() here? */
|
be calling complaint() here? */
|
||||||
return gdbarch_num_regs (current_gdbarch)
|
return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
|
||||||
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
return gdbarch_num_regs (gdbarch) + regnum;
|
||||||
return gdbarch_num_regs (current_gdbarch) + regnum;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -2557,9 +2557,9 @@ e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||||
|
|
||||||
/* Convert a DBX STABS register number to a GDB register number. */
|
/* Convert a DBX STABS register number to a GDB register number. */
|
||||||
static int
|
static int
|
||||||
rs6000_stab_reg_to_regnum (int num)
|
rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num)
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
if (0 <= num && num <= 31)
|
if (0 <= num && num <= 31)
|
||||||
return tdep->ppc_gp0_regnum + num;
|
return tdep->ppc_gp0_regnum + num;
|
||||||
|
@ -2599,9 +2599,9 @@ rs6000_stab_reg_to_regnum (int num)
|
||||||
|
|
||||||
/* Convert a Dwarf 2 register number to a GDB register number. */
|
/* Convert a Dwarf 2 register number to a GDB register number. */
|
||||||
static int
|
static int
|
||||||
rs6000_dwarf2_reg_to_regnum (int num)
|
rs6000_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int num)
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||||
|
|
||||||
if (0 <= num && num <= 31)
|
if (0 <= num && num <= 31)
|
||||||
return tdep->ppc_gp0_regnum + num;
|
return tdep->ppc_gp0_regnum + num;
|
||||||
|
|
|
@ -147,7 +147,7 @@ static int s390_dwarf_regmap[] =
|
||||||
/* Convert DWARF register number REG to the appropriate register
|
/* Convert DWARF register number REG to the appropriate register
|
||||||
number used by GDB. */
|
number used by GDB. */
|
||||||
static int
|
static int
|
||||||
s390_dwarf_reg_to_regnum (int reg)
|
s390_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||||
{
|
{
|
||||||
int regnum = -1;
|
int regnum = -1;
|
||||||
|
|
||||||
|
|
|
@ -303,18 +303,17 @@ xtensa_register_type (struct gdbarch *gdbarch, int regnum)
|
||||||
to n for An. So, we only have to add the base number for A0. */
|
to n for An. So, we only have to add the base number for A0. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xtensa_reg_to_regnum (int regnum)
|
xtensa_reg_to_regnum (struct gdbarch *gdbarch, int regnum)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (regnum >= 0 && regnum < 16)
|
if (regnum >= 0 && regnum < 16)
|
||||||
return gdbarch_tdep (current_gdbarch)->a0_base + regnum;
|
return gdbarch_tdep (gdbarch)->a0_base + regnum;
|
||||||
|
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < gdbarch_num_regs (current_gdbarch)
|
i < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
|
||||||
+ gdbarch_num_pseudo_regs (current_gdbarch);
|
|
||||||
i++)
|
i++)
|
||||||
if (regnum == gdbarch_tdep (current_gdbarch)->regmap[i].target_number)
|
if (regnum == gdbarch_tdep (gdbarch)->regmap[i].target_number)
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
internal_error (__FILE__, __LINE__,
|
internal_error (__FILE__, __LINE__,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue