diff options
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/arch-utils.c | 19 | ||||
-rw-r--r-- | gdb/gdbarch.c | 4 | ||||
-rw-r--r-- | gdb/gdbarch.h | 2 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 2 | ||||
-rw-r--r-- | gdb/m32c-tdep.c | 8 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 3 | ||||
-rw-r--r-- | gdb/spu-tdep.c | 3 |
8 files changed, 32 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8049d36374d..af8f60287be 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,15 @@ 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 get_regcache_arch to get at the current architecture by regcache. * xstormy16-tdep.c (xstormy16_frame_prev_register): Use get_frame_arch diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 4ef616ae711..c75e10bb8ed 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -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. */ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index d84dca48b16..ea8c4d4a890 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -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 diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index d27498b9748..8874d3e61c6 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -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); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index f2840338f89..7a0f0358b40 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -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 diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index db25f6c86e3..c79f88f95cd 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -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")); } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 1a2b55416de..44e4aeb9499 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -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; diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index f5d0081c120..4e41f57b511 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -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); |