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.
This commit is contained in:
Ulrich Weigand 2007-06-12 16:59:43 +00:00
parent 260edbc2ca
commit 055d23b8ab
11 changed files with 57 additions and 93 deletions

View file

@ -1,3 +1,26 @@
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> 2007-06-12 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (SMASH_TEXT_ADDRESS): Replace by * gdbarch.sh (SMASH_TEXT_ADDRESS): Replace by

View file

@ -1549,7 +1549,8 @@ process_coff_symbol (struct coff_symbol *cs,
#endif #endif
case C_REG: case C_REG:
SYMBOL_CLASS (sym) = LOC_REGISTER; 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); add_symbol_to_list (sym, &local_symbols);
break; break;
@ -1583,7 +1584,8 @@ process_coff_symbol (struct coff_symbol *cs,
case C_REGPARM: case C_REGPARM:
SYMBOL_CLASS (sym) = LOC_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); add_symbol_to_list (sym, &local_symbols);
#if !defined (BELIEVE_PCC_PROMOTION) #if !defined (BELIEVE_PCC_PROMOTION)
/* FIXME: This should retain the current type, since it's just /* FIXME: This should retain the current type, since it's just

View file

@ -237,7 +237,7 @@ read_reg (void *baton, int reg)
int regnum; int regnum;
gdb_byte *buf; gdb_byte *buf;
regnum = DWARF2_REG_TO_REGNUM (reg); regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg);
buf = alloca (register_size (gdbarch, regnum)); buf = alloca (register_size (gdbarch, regnum));
frame_unwind_register (next_frame, regnum, buf); frame_unwind_register (next_frame, regnum, buf);
@ -340,8 +340,10 @@ execute_cfa_program (gdb_byte *insn_ptr, gdb_byte *insn_end,
incomplete CFI data; DW_CFA_restore unspecified\n\ incomplete CFI data; DW_CFA_restore unspecified\n\
register %s (#%d) at 0x%s"), register %s (#%d) at 0x%s"),
gdbarch_register_name gdbarch_register_name
(current_gdbarch, DWARF2_REG_TO_REGNUM(reg)), (current_gdbarch, gdbarch_dwarf2_reg_to_regnum
DWARF2_REG_TO_REGNUM(reg), paddr (fs->pc)); (current_gdbarch, reg)),
gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg),
paddr (fs->pc));
} }
else else
{ {
@ -901,7 +903,7 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
return address column; it's perfectly all right for it to return address column; it's perfectly all right for it to
correspond to a real register. If it doesn't correspond to a correspond to a real register. If it doesn't correspond to a
real register, or if we shouldn't treat it as such, 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). */ the range [0, gdbarch_num_regs). */
{ {
int column; /* CFI speak for "register number". */ int column; /* CFI speak for "register number". */
@ -909,7 +911,7 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
for (column = 0; column < fs->regs.num_regs; column++) for (column = 0; column < fs->regs.num_regs; column++)
{ {
/* Use the GDB register number as the destination index. */ /* 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 there's no corresponding GDB register, ignore it. */
if (regnum < 0 || regnum >= num_regs) if (regnum < 0 || regnum >= num_regs)
@ -1067,7 +1069,8 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
*optimizedp = 0; *optimizedp = 0;
*lvalp = lval_register; *lvalp = lval_register;
*addrp = 0; *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) if (valuep)
frame_unwind_register (next_frame, (*realnump), valuep); frame_unwind_register (next_frame, (*realnump), valuep);
break; break;
@ -1161,7 +1164,8 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
{ {
CORE_ADDR pc = cache->reg[regnum].loc.offset; 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); pc += frame_unwind_register_unsigned (next_frame, regnum);
pack_long (valuep, register_type (gdbarch, regnum), pc); pack_long (valuep, register_type (gdbarch, regnum), pc);
} }

View file

@ -40,10 +40,6 @@
#include "gdb_string.h" #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 /* A helper function for dealing with location lists. Given a
symbol baton (BATON) and a pc value (PC), find the appropriate symbol baton (BATON) and a pc value (PC), find the appropriate
location expression, set *LOCEXPR_LENGTH, and return a pointer location expression, set *LOCEXPR_LENGTH, and return a pointer
@ -123,7 +119,7 @@ dwarf_expr_read_reg (void *baton, int dwarf_regnum)
CORE_ADDR result; CORE_ADDR result;
int regnum; 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, result = address_from_register (builtin_type_void_data_ptr,
regnum, debaton->frame); regnum, debaton->frame);
return result; return result;
@ -229,7 +225,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
if (p->in_reg) if (p->in_reg)
{ {
bfd_byte regval[MAX_REGISTER_SIZE]; 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); get_frame_register (frame, gdb_regnum, regval);
memcpy (contents + offset, regval, p->size); memcpy (contents + offset, regval, p->size);
} }
@ -243,7 +240,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
else if (ctx->in_reg) else if (ctx->in_reg)
{ {
CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0); 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); retval = value_from_register (SYMBOL_TYPE (var), gdb_regnum, frame);
} }
else else
@ -451,7 +449,8 @@ locexpr_describe_location (struct symbol *symbol, struct ui_file *stream)
&& dlbaton->data[0] >= DW_OP_reg0 && dlbaton->data[0] >= DW_OP_reg0
&& dlbaton->data[0] <= DW_OP_reg31) && 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, fprintf_filtered (stream,
"a variable in register %s", "a variable in register %s",
gdbarch_register_name (current_gdbarch, regno)); gdbarch_register_name (current_gdbarch, regno));

View file

@ -67,10 +67,6 @@
can be used for any other data associated to the objfile (symbol can be used for any other data associated to the objfile (symbol
names, type names, location expressions to name a few). */ names, type names, location expressions to name a few). */
#ifndef DWARF2_REG_TO_REGNUM
#define DWARF2_REG_TO_REGNUM(REG) (REG)
#endif
#if 0 #if 0
/* .debug_info header for a compilation unit /* .debug_info header for a compilation unit
Because of alignment constraints, this structure has padding and cannot Because of alignment constraints, this structure has padding and cannot

View file

@ -850,30 +850,12 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: double_format = %s\n", "gdbarch_dump: double_format = %s\n",
pformat (current_gdbarch->double_format)); 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, fprintf_unfiltered (file,
"gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n", "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->dwarf2_reg_to_regnum); (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, fprintf_unfiltered (file,
"gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n", "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->dwarf_reg_to_regnum); (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, fprintf_unfiltered (file,
"gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n", "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->ecoff_reg_to_regnum); (long) current_gdbarch->ecoff_reg_to_regnum);
@ -1122,12 +1104,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: return_value = <0x%lx>\n", "gdbarch_dump: return_value = <0x%lx>\n",
(long) current_gdbarch->return_value); (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, fprintf_unfiltered (file,
"gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n", "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->sdb_reg_to_regnum); (long) current_gdbarch->sdb_reg_to_regnum);
@ -1184,12 +1160,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file, fprintf_unfiltered (file,
"gdbarch_dump: sp_regnum = %s\n", "gdbarch_dump: sp_regnum = %s\n",
paddr_d (current_gdbarch->sp_regnum)); 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, fprintf_unfiltered (file,
"gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n", "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->stab_reg_to_regnum); (long) current_gdbarch->stab_reg_to_regnum);

View file

@ -287,58 +287,28 @@ extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr); 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 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);
#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. */ /* 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) (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);
#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. */ /* 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) (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);
#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. */ /* 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) (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);
#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); 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 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);
#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); typedef const char * (gdbarch_register_name_ftype) (int regnr);
extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);

View file

@ -446,14 +446,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 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. # 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. # 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. # 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: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:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr::no_op_reg_to_regnum::0
f::const char *:register_name:int regnr:regnr f::const char *:register_name:int regnr:regnr
# Return the type of a register specified by the architecture. Only # Return the type of a register specified by the architecture. Only

View file

@ -2382,7 +2382,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum); set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
set_gdbarch_dwarf2_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. */ be in use on any of the supported i386 targets. */
set_gdbarch_print_float_info (gdbarch, i387_print_float_info); set_gdbarch_print_float_info (gdbarch, i387_print_float_info);

View file

@ -644,7 +644,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (sh->sc == scRegister) if (sh->sc == scRegister)
{ {
class = LOC_REGISTER; class = LOC_REGISTER;
svalue = ECOFF_REG_TO_REGNUM (svalue); svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
} }
else else
class = LOC_LOCAL; class = LOC_LOCAL;
@ -682,7 +682,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case scRegister: case scRegister:
/* Pass by value in register. */ /* Pass by value in register. */
SYMBOL_CLASS (s) = LOC_REGPARM; SYMBOL_CLASS (s) = LOC_REGPARM;
svalue = ECOFF_REG_TO_REGNUM (svalue); svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
break; break;
case scVar: case scVar:
/* Pass by reference on stack. */ /* Pass by reference on stack. */
@ -691,7 +691,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case scVarRegister: case scVarRegister:
/* Pass by reference in register. */ /* Pass by reference in register. */
SYMBOL_CLASS (s) = LOC_REGPARM_ADDR; SYMBOL_CLASS (s) = LOC_REGPARM_ADDR;
svalue = ECOFF_REG_TO_REGNUM (svalue); svalue = gdbarch_ecoff_reg_to_regnum (current_gdbarch, svalue);
break; break;
default: default:
/* Pass by value on stack. */ /* Pass by value on stack. */

View file

@ -1022,7 +1022,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* Parameter which is in a register. */ /* Parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGPARM; 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) if (SYMBOL_VALUE (sym) >= gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch)) + gdbarch_num_pseudo_regs (current_gdbarch))
{ {
@ -1040,7 +1040,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* Register variable (either global or local). */ /* Register variable (either global or local). */
SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGISTER; 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) if (SYMBOL_VALUE (sym) >= gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch)) + gdbarch_num_pseudo_regs (current_gdbarch))
{ {
@ -1314,7 +1314,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* Reference parameter which is in a register. */ /* Reference parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR; 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) if (SYMBOL_VALUE (sym) >= gdbarch_num_regs (current_gdbarch)
+ gdbarch_num_pseudo_regs (current_gdbarch)) + gdbarch_num_pseudo_regs (current_gdbarch))
{ {