* gdbarch.c, gdbarch.h: Regenerate.
* infrun.c (handle_inferior_event): Pass current frame to
gdbarch_get_longjmp_target.
* alpha-tdep.c (alpha_get_longjmp_target): Add FRAME argument.
Read registers from FRAME instead of using read_register.
Use get_frame_arch instead of current_gdbarch.
* arm-tdep.c (arm_get_longjmp_target): Likewise.
* i386-tdep.c (i386_get_longjmp_target): Likewise.
* m68k-tdep.c (m68k_get_longjmp_target): Likewise.
* mips-linux-tdep.c (mips_linux_get_longjmp_target): Likewise.
(mips64_linux_get_longjmp_target): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise.
+2007-06-15 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbarch.sh (get_longjmp_target): Add FRAME argument.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * infrun.c (handle_inferior_event): Pass current frame to
+ gdbarch_get_longjmp_target.
+
+ * alpha-tdep.c (alpha_get_longjmp_target): Add FRAME argument.
+ Read registers from FRAME instead of using read_register.
+ Use get_frame_arch instead of current_gdbarch.
+ * arm-tdep.c (arm_get_longjmp_target): Likewise.
+ * i386-tdep.c (i386_get_longjmp_target): Likewise.
+ * m68k-tdep.c (m68k_get_longjmp_target): Likewise.
+ * mips-linux-tdep.c (mips_linux_get_longjmp_target): Likewise.
+ (mips64_linux_get_longjmp_target): Likewise.
+ * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise.
+
2007-06-15 Ulrich Weigand <uweigand@de.ibm.com>
* gdbarch.sh (skip_trampoline_code): Add FRAME argument.
into the "pc". This routine returns true on success. */
static int
-alpha_get_longjmp_target (CORE_ADDR *pc)
+alpha_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (frame));
CORE_ADDR jb_addr;
gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
- jb_addr = read_register (ALPHA_A0_REGNUM);
+ jb_addr = get_frame_register_unsigned (frame, ALPHA_A0_REGNUM);
if (target_read_memory (jb_addr + (tdep->jb_pc * tdep->jb_elt_size),
raw_buffer, tdep->jb_elt_size))
static int
-arm_get_longjmp_target (CORE_ADDR *pc)
+arm_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
CORE_ADDR jb_addr;
char buf[INT_REGISTER_SIZE];
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (frame));
- jb_addr = read_register (ARM_A1_REGNUM);
+ jb_addr = get_frame_register_unsigned (frame, ARM_A1_REGNUM);
if (target_read_memory (jb_addr + tdep->jb_pc * tdep->jb_elt_size, buf,
INT_REGISTER_SIZE))
}
int
-gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
+gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->get_longjmp_target != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
- return gdbarch->get_longjmp_target (pc);
+ return gdbarch->get_longjmp_target (frame, pc);
}
void
extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
-typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc);
-extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc);
+typedef int (gdbarch_get_longjmp_target_ftype) (struct frame_info *frame, CORE_ADDR *pc);
+extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc);
extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
f::int:cannot_fetch_register:int regnum:regnum::cannot_register_not::0
f::int:cannot_store_register:int regnum:regnum::cannot_register_not::0
# setjmp/longjmp support.
-F::int:get_longjmp_target:CORE_ADDR *pc:pc
+F::int:get_longjmp_target:struct frame_info *frame, CORE_ADDR *pc:frame, pc
#
v:=:int:believe_pcc_promotion:::::::
#
This function is 64-bit safe. */
static int
-i386_get_longjmp_target (CORE_ADDR *pc)
+i386_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
gdb_byte buf[8];
CORE_ADDR sp, jb_addr;
- int jb_pc_offset = gdbarch_tdep (current_gdbarch)->jb_pc_offset;
+ int jb_pc_offset = gdbarch_tdep (get_frame_arch (frame))->jb_pc_offset;
int len = TYPE_LENGTH (builtin_type_void_func_ptr);
/* If JB_PC_OFFSET is -1, we have no way to find out where the
/* Don't use I386_ESP_REGNUM here, since this function is also used
for AMD64. */
- regcache_cooked_read (current_regcache, SP_REGNUM, buf);
+ get_frame_register (frame, SP_REGNUM, buf);
sp = extract_typed_address (buf, builtin_type_void_data_ptr);
if (target_read_memory (sp + len, buf, len))
return 0;
remove_breakpoints ();
breakpoints_inserted = 0;
if (!gdbarch_get_longjmp_target_p (current_gdbarch)
- || !gdbarch_get_longjmp_target (current_gdbarch, &jmp_buf_pc))
+ || !gdbarch_get_longjmp_target (current_gdbarch,
+ get_current_frame (), &jmp_buf_pc))
{
keep_going (ecs);
return;
This routine returns true on success. */
static int
-m68k_get_longjmp_target (CORE_ADDR *pc)
+m68k_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
gdb_byte *buf;
CORE_ADDR sp, jb_addr;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (frame));
if (tdep->jb_pc < 0)
{
}
buf = alloca (gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT);
- sp = read_register (SP_REGNUM);
+ sp = get_frame_register_unsigned (frame, SP_REGNUM);
if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
buf,
#define MIPS_LINUX_JB_PC 0
static int
-mips_linux_get_longjmp_target (CORE_ADDR *pc)
+mips_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
CORE_ADDR jb_addr;
char buf[gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT];
- jb_addr = read_register (MIPS_A0_REGNUM);
+ jb_addr = get_frame_register_unsigned (frame, MIPS_A0_REGNUM);
if (target_read_memory (jb_addr
+ MIPS_LINUX_JB_PC * MIPS_LINUX_JB_ELEMENT_SIZE,
#define MIPS64_LINUX_JB_PC 0
static int
-mips64_linux_get_longjmp_target (CORE_ADDR *pc)
+mips64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
CORE_ADDR jb_addr;
void *buf = alloca (gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT);
int element_size = gdbarch_ptr_bit (current_gdbarch) == 32 ? 4 : 8;
- jb_addr = read_register (MIPS_A0_REGNUM);
+ jb_addr = get_frame_register_unsigned (frame, MIPS_A0_REGNUM);
if (target_read_memory (jb_addr + MIPS64_LINUX_JB_PC * element_size,
buf,
NBSD_MIPS_JB_ELEMENT_SIZE)
static int
-mipsnbsd_get_longjmp_target (CORE_ADDR *pc)
+mipsnbsd_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
{
CORE_ADDR jb_addr;
char *buf;
buf = alloca (NBSD_MIPS_JB_ELEMENT_SIZE);
- jb_addr = read_register (MIPS_A0_REGNUM);
+ jb_addr = get_frame_register_unsigned (frame, MIPS_A0_REGNUM);
if (target_read_memory (jb_addr + NBSD_MIPS_JB_OFFSET, buf,
NBSD_MIPS_JB_ELEMENT_SIZE))