* 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>
+
+ * 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
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)
{
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. */
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 */
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
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);
# 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
}
void
-m32c_virtual_frame_pointer (CORE_ADDR pc,
+m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
int *frame_regnum,
LONGEST *frame_offset)
{
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:
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"));
}
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;
/* 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);