2007-11-07 Markus Deuling <deuling@de.ibm.com>

* gdbarch.sh (legacy_virtual_frame_pointer): Add gdbarch parameter.
	* gdbarch.{c,h}: Regenerate.
	* arch-utils.c (legacy_virtual_frame_pointer): Add gdbarch parameter.
	Replace current_gdbarch by gdbarch.
	* m32c-tdep.c (m32c_virtual_frame_pointer): Likewise.
	* mips-tdep.c (mips_virtual_frame_pointer): Likewise.
	* spu-tdep.c (spu_virtual_frame_pointer): Likewise.
This commit is contained in:
Markus Deuling 2007-11-07 06:58:31 +00:00
parent 9970f04b03
commit a54fba4c5d
8 changed files with 32 additions and 19 deletions

View File

@ -1,3 +1,13 @@
2007-11-07 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (legacy_virtual_frame_pointer): Add gdbarch parameter.
* gdbarch.{c,h}: Regenerate.
* arch-utils.c (legacy_virtual_frame_pointer): Add gdbarch parameter.
Replace current_gdbarch by gdbarch.
* m32c-tdep.c (m32c_virtual_frame_pointer): Likewise.
* mips-tdep.c (mips_virtual_frame_pointer): Likewise.
* spu-tdep.c (spu_virtual_frame_pointer): Likewise.
2007-11-07 Markus Deuling <deuling@de.ibm.com>
* shnbsd-tdep.c (shnbsd_supply_gregset, shnbsd_collect_gregset): Use

View File

@ -135,7 +135,8 @@ cannot_register_not (int regnum)
raw. */
void
legacy_virtual_frame_pointer (CORE_ADDR pc,
legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
CORE_ADDR pc,
int *frame_regnum,
LONGEST *frame_offset)
{
@ -144,14 +145,14 @@ legacy_virtual_frame_pointer (CORE_ADDR pc,
register and an offset can determine this. I think it should
instead generate a byte code expression as that would work better
with things like Dwarf2's CFI. */
if (gdbarch_deprecated_fp_regnum (current_gdbarch) >= 0
&& gdbarch_deprecated_fp_regnum (current_gdbarch)
< gdbarch_num_regs (current_gdbarch))
*frame_regnum = gdbarch_deprecated_fp_regnum (current_gdbarch);
else if (gdbarch_sp_regnum (current_gdbarch) >= 0
&& gdbarch_sp_regnum (current_gdbarch)
< gdbarch_num_regs (current_gdbarch))
*frame_regnum = gdbarch_sp_regnum (current_gdbarch);
if (gdbarch_deprecated_fp_regnum (gdbarch) >= 0
&& gdbarch_deprecated_fp_regnum (gdbarch)
< gdbarch_num_regs (gdbarch))
*frame_regnum = gdbarch_deprecated_fp_regnum (gdbarch);
else if (gdbarch_sp_regnum (gdbarch) >= 0
&& gdbarch_sp_regnum (gdbarch)
< gdbarch_num_regs (gdbarch))
*frame_regnum = gdbarch_sp_regnum (gdbarch);
else
/* Should this be an internal error? I guess so, it is reflecting
an architectural limitation in the current design. */

View File

@ -266,7 +266,7 @@ struct gdbarch startup_gdbarch =
1, /* char_signed */
0, /* read_pc */
0, /* write_pc */
0, /* virtual_frame_pointer */
legacy_virtual_frame_pointer, /* virtual_frame_pointer */
0, /* pseudo_register_read */
0, /* pseudo_register_write */
0, /* num_regs */
@ -1366,7 +1366,7 @@ gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame
gdb_assert (gdbarch->virtual_frame_pointer != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
}
void

View File

@ -160,7 +160,7 @@ extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftyp
whole scheme for dealing with "frames" and "frame pointers" needs a
serious shakedown. */
typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
typedef void (gdbarch_virtual_frame_pointer_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);

View File

@ -392,7 +392,7 @@ F:void:write_pc:struct regcache *regcache, CORE_ADDR val:regcache, val
# Function for getting target's idea of a frame pointer. FIXME: GDB's
# whole scheme for dealing with "frames" and "frame pointers" needs a
# serious shakedown.
f:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset:0:legacy_virtual_frame_pointer::0
m:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset:0:legacy_virtual_frame_pointer::0
#
M:void:pseudo_register_read:struct regcache *regcache, int cookednum, gdb_byte *buf:regcache, cookednum, buf
M:void:pseudo_register_write:struct regcache *regcache, int cookednum, const gdb_byte *buf:regcache, cookednum, buf

View File

@ -2525,7 +2525,7 @@ m32c_m16c_pointer_to_address (struct type *type, const gdb_byte *buf)
}
void
m32c_virtual_frame_pointer (CORE_ADDR pc,
m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
int *frame_regnum,
LONGEST *frame_offset)
{
@ -2534,12 +2534,12 @@ m32c_virtual_frame_pointer (CORE_ADDR pc,
struct m32c_prologue p;
struct regcache *regcache = get_current_regcache ();
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (!find_pc_partial_function (pc, &name, &func_addr, &func_end))
internal_error (__FILE__, __LINE__, _("No virtual frame pointer available"));
m32c_analyze_prologue (current_gdbarch, func_addr, pc, &p);
m32c_analyze_prologue (gdbarch, func_addr, pc, &p);
switch (p.kind)
{
case prologue_with_frame_ptr:
@ -2556,7 +2556,7 @@ m32c_virtual_frame_pointer (CORE_ADDR pc,
break;
}
/* Sanity check */
if (*frame_regnum > gdbarch_num_regs (current_gdbarch))
if (*frame_regnum > gdbarch_num_regs (gdbarch))
internal_error (__FILE__, __LINE__, _("No virtual frame pointer available"));
}

View File

@ -5040,7 +5040,8 @@ mips_integer_to_address (struct gdbarch *gdbarch,
an assertion failure. */
static void
mips_virtual_frame_pointer (CORE_ADDR pc, int *reg, LONGEST *offset)
mips_virtual_frame_pointer (struct gdbarch *gdbarch,
CORE_ADDR pc, int *reg, LONGEST *offset)
{
*reg = MIPS_SP_REGNUM;
*offset = 0;

View File

@ -708,7 +708,8 @@ spu_skip_prologue (CORE_ADDR pc)
/* Return the frame pointer in use at address PC. */
static void
spu_virtual_frame_pointer (CORE_ADDR pc, int *reg, LONGEST *offset)
spu_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
int *reg, LONGEST *offset)
{
struct spu_prologue_data data;
spu_analyze_prologue (pc, (CORE_ADDR)-1, &data);