+2007-06-12 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (STAB_REG_TO_REGNUM): Replace by
+ gdbarch_stab_reg_to_regnum.
+ * stabsread.c (define_symbol): Likewise.
+ * gdbarch.sh (ECOFF_REG_TO_REGNUM): Replace by
+ gdbarch_ecoff_reg_to_regnum.
+ * mdebugread.c (parse_symbol): Likewise.
+ * i386-tdep.c (i386_gdbarch_init): Likewise (comment).
+ * gdbarch.sh (DWARF_REG_TO_REGNUM): Replace by
+ gdbarch_dwarf_reg_to_regnum.
+ * gdbarch.sh (SDB_REG_TO_REGNUM): Replace by gdbarch_sdb_reg_to_regnum.
+ * coffread.c (process_coff_symbol): Likewise.
+ * gdbarch.sh (DWARF2_REG_TO_REGNUM): Replace by
+ gdbarch_dwarf2_reg_to_regnum.
+ * dwarf2loc.c (dwarf_expr_read_reg,dwarf2_evaluate_loc_desc)
+ (locexpr_describe_location): Likewise.
+ * dwarf2-frame.c (read_reg,execute_cfa_program,dwarf2_frame_cache)
+ (dwarf2_frame_prev_register,dwarf2_signal_frame_this_id): Likewise.
+ * dwarf2loc.c (DWARF2_REG_TO_REGNUM): Remove macro.
+ * dwarf2read.c (DWARF2_REG_TO_REGNUM): Remove macro.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
2007-06-12 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (SMASH_TEXT_ADDRESS): Replace by
#endif
case C_REG:
SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM (cs->c_value);
+ SYMBOL_VALUE (sym) = gdbarch_sdb_reg_to_regnum
+ (current_gdbarch, cs->c_value);
add_symbol_to_list (sym, &local_symbols);
break;
case C_REGPARM:
SYMBOL_CLASS (sym) = LOC_REGPARM;
- SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM (cs->c_value);
+ SYMBOL_VALUE (sym) = gdbarch_sdb_reg_to_regnum
+ (current_gdbarch, cs->c_value);
add_symbol_to_list (sym, &local_symbols);
#if !defined (BELIEVE_PCC_PROMOTION)
/* FIXME: This should retain the current type, since it's just
int regnum;
gdb_byte *buf;
- regnum = DWARF2_REG_TO_REGNUM (reg);
+ regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg);
buf = alloca (register_size (gdbarch, regnum));
frame_unwind_register (next_frame, regnum, buf);
incomplete CFI data; DW_CFA_restore unspecified\n\
register %s (#%d) at 0x%s"),
gdbarch_register_name
- (current_gdbarch, DWARF2_REG_TO_REGNUM(reg)),
- DWARF2_REG_TO_REGNUM(reg), paddr (fs->pc));
+ (current_gdbarch, gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, reg)),
+ gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg),
+ paddr (fs->pc));
}
else
{
return address column; it's perfectly all right for it to
correspond to a real register. If it doesn't correspond to a
real register, or if we shouldn't treat it as such,
- DWARF2_REG_TO_REGNUM should be defined to return a number outside
+ gdbarch_dwarf2_reg_to_regnum should be defined to return a number outside
the range [0, gdbarch_num_regs). */
{
int column; /* CFI speak for "register number". */
for (column = 0; column < fs->regs.num_regs; column++)
{
/* Use the GDB register number as the destination index. */
- int regnum = DWARF2_REG_TO_REGNUM (column);
+ int regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, column);
/* If there's no corresponding GDB register, ignore it. */
if (regnum < 0 || regnum >= num_regs)
*optimizedp = 0;
*lvalp = lval_register;
*addrp = 0;
- *realnump = DWARF2_REG_TO_REGNUM (cache->reg[regnum].loc.reg);
+ *realnump = gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, cache->reg[regnum].loc.reg);
if (valuep)
frame_unwind_register (next_frame, (*realnump), valuep);
break;
{
CORE_ADDR pc = cache->reg[regnum].loc.offset;
- regnum = DWARF2_REG_TO_REGNUM (cache->retaddr_reg.loc.reg);
+ regnum = gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, cache->retaddr_reg.loc.reg);
pc += frame_unwind_register_unsigned (next_frame, regnum);
pack_long (valuep, register_type (gdbarch, regnum), pc);
}
#include "gdb_string.h"
-#ifndef DWARF2_REG_TO_REGNUM
-#define DWARF2_REG_TO_REGNUM(REG) (REG)
-#endif
-
/* A helper function for dealing with location lists. Given a
symbol baton (BATON) and a pc value (PC), find the appropriate
location expression, set *LOCEXPR_LENGTH, and return a pointer
CORE_ADDR result;
int regnum;
- regnum = DWARF2_REG_TO_REGNUM (dwarf_regnum);
+ regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf_regnum);
result = address_from_register (builtin_type_void_data_ptr,
regnum, debaton->frame);
return result;
if (p->in_reg)
{
bfd_byte regval[MAX_REGISTER_SIZE];
- int gdb_regnum = DWARF2_REG_TO_REGNUM (p->value);
+ int gdb_regnum = gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, p->value);
get_frame_register (frame, gdb_regnum, regval);
memcpy (contents + offset, regval, p->size);
}
else if (ctx->in_reg)
{
CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0);
- int gdb_regnum = DWARF2_REG_TO_REGNUM (dwarf_regnum);
+ int gdb_regnum = gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, dwarf_regnum);
retval = value_from_register (SYMBOL_TYPE (var), gdb_regnum, frame);
}
else
&& dlbaton->data[0] >= DW_OP_reg0
&& dlbaton->data[0] <= DW_OP_reg31)
{
- int regno = DWARF2_REG_TO_REGNUM (dlbaton->data[0] - DW_OP_reg0);
+ int regno = gdbarch_dwarf2_reg_to_regnum
+ (current_gdbarch, dlbaton->data[0] - DW_OP_reg0);
fprintf_filtered (stream,
"a variable in register %s",
gdbarch_register_name (current_gdbarch, regno));
can be used for any other data associated to the objfile (symbol
names, type names, location expressions to name a few). */
-#ifndef DWARF2_REG_TO_REGNUM
-#define DWARF2_REG_TO_REGNUM(REG) (REG)
-#endif
-
#if 0
/* .debug_info header for a compilation unit
Because of alignment constraints, this structure has padding and cannot
fprintf_unfiltered (file,
"gdbarch_dump: double_format = %s\n",
pformat (current_gdbarch->double_format));
-#ifdef DWARF2_REG_TO_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
- XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->dwarf2_reg_to_regnum);
-#ifdef DWARF_REG_TO_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DWARF_REG_TO_REGNUM(dwarf_regnr)",
- XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->dwarf_reg_to_regnum);
-#ifdef ECOFF_REG_TO_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
- XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->ecoff_reg_to_regnum);
fprintf_unfiltered (file,
"gdbarch_dump: return_value = <0x%lx>\n",
(long) current_gdbarch->return_value);
-#ifdef SDB_REG_TO_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "SDB_REG_TO_REGNUM(sdb_regnr)",
- XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->sdb_reg_to_regnum);
fprintf_unfiltered (file,
"gdbarch_dump: sp_regnum = %s\n",
paddr_d (current_gdbarch->sp_regnum));
-#ifdef STAB_REG_TO_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "STAB_REG_TO_REGNUM(stab_regnr)",
- XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->stab_reg_to_regnum);
typedef int (gdbarch_stab_reg_to_regnum_ftype) (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);
-#if !defined (GDB_TM_FILE) && defined (STAB_REG_TO_REGNUM)
-#error "Non multi-arch definition of STAB_REG_TO_REGNUM"
-#endif
-#if !defined (STAB_REG_TO_REGNUM)
-#define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
-#endif
/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (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);
-#if !defined (GDB_TM_FILE) && defined (ECOFF_REG_TO_REGNUM)
-#error "Non multi-arch definition of ECOFF_REG_TO_REGNUM"
-#endif
-#if !defined (ECOFF_REG_TO_REGNUM)
-#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
-#endif
/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (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);
-#if !defined (GDB_TM_FILE) && defined (DWARF_REG_TO_REGNUM)
-#error "Non multi-arch definition of DWARF_REG_TO_REGNUM"
-#endif
-#if !defined (DWARF_REG_TO_REGNUM)
-#define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
-#endif
/* Convert from an sdb register number to an internal gdb register number. */
typedef int (gdbarch_sdb_reg_to_regnum_ftype) (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);
-#if !defined (GDB_TM_FILE) && defined (SDB_REG_TO_REGNUM)
-#error "Non multi-arch definition of SDB_REG_TO_REGNUM"
-#endif
-#if !defined (SDB_REG_TO_REGNUM)
-#define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
-#endif
typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (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);
-#if !defined (GDB_TM_FILE) && defined (DWARF2_REG_TO_REGNUM)
-#error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
-#endif
-#if !defined (DWARF2_REG_TO_REGNUM)
-#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
-#endif
typedef const char * (gdbarch_register_name_ftype) (int regnr);
extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
v:=:int:ps_regnum:::-1:-1::0
v:=:int:fp0_regnum:::0:-1::0
# 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
+f::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.
-f:=:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr::no_op_reg_to_regnum::0
+f::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.
-f:=:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr::no_op_reg_to_regnum::0
+f::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.
-f:=: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
+f::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
f::const char *:register_name:int regnr:regnr
# Return the type of a register specified by the architecture. Only
set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
- /* We don't define ECOFF_REG_TO_REGNUM, since ECOFF doesn't seem to
+ /* We don't set gdbarch_stab_reg_to_regnum, since ECOFF doesn't seem to
be in use on any of the supported i386 targets. */
set_gdbarch_print_float_info (gdbarch, i387_print_float_info);
if (sh->sc == scRegister)
{
class = LOC_REGISTER;
- svalue = ECOFF_REG_TO_REGNUM (svalue);
+ svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
}
else
class = LOC_LOCAL;
case scRegister:
/* Pass by value in register. */
SYMBOL_CLASS (s) = LOC_REGPARM;
- svalue = ECOFF_REG_TO_REGNUM (svalue);
+ svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
break;
case scVar:
/* Pass by reference on stack. */
case scVarRegister:
/* Pass by reference in register. */
SYMBOL_CLASS (s) = LOC_REGPARM_ADDR;
- svalue = ECOFF_REG_TO_REGNUM (svalue);
+ svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
break;
default:
/* Pass by value on stack. */
/* Parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGPARM;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
+ SYMBOL_VALUE (sym) = gdbarch_stab_reg_to_regnum (current_gdbarch, valu);
if (SYMBOL_VALUE (sym) >= gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch))
{
/* Register variable (either global or local). */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
+ SYMBOL_VALUE (sym) = gdbarch_stab_reg_to_regnum (current_gdbarch, valu);
if (SYMBOL_VALUE (sym) >= gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch))
{
/* Reference parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
+ SYMBOL_VALUE (sym) = gdbarch_stab_reg_to_regnum (current_gdbarch, valu);
if (SYMBOL_VALUE (sym) >= gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch))
{