diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-03-10 15:28:41 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-03-10 15:28:41 +0000 |
commit | 12cc2063bed3b79f2a3e92342e92dc6211a3bf12 (patch) | |
tree | c65dc866e40ffdd0796020c984da78caaa0d9565 /gdb/gdbarch.c | |
parent | a2ce2e563724c710bcaeaa361ec61446a599060b (diff) | |
download | gdb-12cc2063bed3b79f2a3e92342e92dc6211a3bf12.zip gdb-12cc2063bed3b79f2a3e92342e92dc6211a3bf12.tar.gz gdb-12cc2063bed3b79f2a3e92342e92dc6211a3bf12.tar.bz2 |
2003-03-10 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (gdbarch_unwind_pc): New method.
* gdbarch.h, gdbarch.c: Regenerate.
* frame.c (frame_pc_unwind): Rewrite. Prefer gdbarch_unwind_pc,
but use read_pc and FRAME_SAVED_PC as fall backs.
(frame_saved_regs_pc_unwind): Delete function.
(trad_frame_unwinder): Update.
* frame-unwind.h (frame_unwind_pc_ftype): Delete declaration.
(struct frame_unwind): Update.
* dummy-frame.c (dummy_frame_pc_unwind): Delete function.
(dummy_frame_unwind): Update.
* sentinel-frame.c (sentinel_frame_pc_unwind): Delete function.
(sentinel_frame_unwinder): Update.
* d10v-tdep.c (d10v_frame_pc_unwind): Delete function.
(d10v_frame_unwind): Update.
(d10v_unwind_pc): New function.
(d10v_gdbarch_init): Set unwind_pc.
Index: doc/ChangeLog
2003-03-10 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Cross reference
FRAME_SAVED_PC to unwind_pc. Document unwind_pc.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 636349c..8b5a475 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -242,6 +242,7 @@ struct gdbarch gdbarch_frame_chain_ftype *frame_chain; gdbarch_frame_chain_valid_ftype *frame_chain_valid; gdbarch_frame_saved_pc_ftype *frame_saved_pc; + gdbarch_unwind_pc_ftype *unwind_pc; gdbarch_frame_args_address_ftype *frame_args_address; gdbarch_frame_locals_address_ftype *frame_locals_address; gdbarch_saved_pc_after_call_ftype *saved_pc_after_call; @@ -433,6 +434,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, + 0, generic_in_function_epilogue_p, construct_inferior_arguments, 0, @@ -759,6 +761,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of frame_chain, has predicate */ /* Skip verify of frame_chain_valid, has predicate */ /* Skip verify of frame_saved_pc, has predicate */ + /* Skip verify of unwind_pc, has predicate */ /* Skip verify of frame_args_address, invalid_p == 0 */ /* Skip verify of frame_locals_address, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) @@ -2578,6 +2581,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: unwind_dummy_id = 0x%08lx\n", (long) current_gdbarch->unwind_dummy_id); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n", + gdbarch_unwind_pc_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: unwind_pc = 0x%08lx\n", + (long) current_gdbarch->unwind_pc); #ifdef USE_STRUCT_CONVENTION fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -4845,6 +4856,32 @@ set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch->frame_saved_pc = frame_saved_pc; } +int +gdbarch_unwind_pc_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->unwind_pc != 0; +} + +CORE_ADDR +gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->unwind_pc == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_unwind_pc invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n"); + return gdbarch->unwind_pc (gdbarch, next_frame); +} + +void +set_gdbarch_unwind_pc (struct gdbarch *gdbarch, + gdbarch_unwind_pc_ftype unwind_pc) +{ + gdbarch->unwind_pc = unwind_pc; +} + CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) { |