diff options
-rw-r--r-- | gdb/ChangeLog | 17 | ||||
-rw-r--r-- | gdb/alpha-tdep.c | 6 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 6 | ||||
-rw-r--r-- | gdb/gdbarch.c | 4 | ||||
-rw-r--r-- | gdb/gdbarch.h | 4 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 2 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 6 | ||||
-rw-r--r-- | gdb/infrun.c | 3 | ||||
-rw-r--r-- | gdb/m68k-tdep.c | 6 | ||||
-rw-r--r-- | gdb/mips-linux-tdep.c | 8 | ||||
-rw-r--r-- | gdb/mipsnbsd-tdep.c | 4 |
11 files changed, 42 insertions, 24 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1dc9430..1397758 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,22 @@ 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. * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (generic_skip_trampoline_code): Add FRAME argument. diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index eb1daad..284809d 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -724,13 +724,13 @@ alpha_skip_prologue (CORE_ADDR pc) 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)) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 0935add..a7b62dd 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -2342,13 +2342,13 @@ arm_return_value (struct gdbarch *gdbarch, struct type *valtype, 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)) diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index a7fa046..0f0df43 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -2040,13 +2040,13 @@ gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) } 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 diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 92fa95b..8dbc490 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -383,8 +383,8 @@ extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_ 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); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index ee7669b..e666d92 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -483,7 +483,7 @@ f::int:register_sim_regno:int reg_nr:reg_nr::legacy_register_sim_regno::0 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::::::: # diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 456a2ea..91bce8a 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1266,11 +1266,11 @@ i386_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) 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 @@ -1280,7 +1280,7 @@ i386_get_longjmp_target (CORE_ADDR *pc) /* 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; diff --git a/gdb/infrun.c b/gdb/infrun.c index 1eea281..2c1b32f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2077,7 +2077,8 @@ process_event_stop_test: 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; diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index a3b0b30..b91384c 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -978,11 +978,11 @@ m68k_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) 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) { @@ -992,7 +992,7 @@ m68k_get_longjmp_target (CORE_ADDR *pc) } 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, diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index b16fc53..b7d8dad 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -52,12 +52,12 @@ static struct target_so_ops mips_svr4_so_ops; #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, @@ -254,13 +254,13 @@ mips_fill_fpregset (const struct regcache *regcache, #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, diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 5ec52fa..5008211 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -284,14 +284,14 @@ mipsnbsd_sigtramp_offset (struct frame_info *next_frame) 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)) |