diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-11-15 23:24:21 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-11-15 23:24:21 +0000 |
commit | f7db5ce6267b8b54fb71768f6577ef8386d36644 (patch) | |
tree | 6c85dac17c1f28bba8d4e7c376e638ba7f393fdb /gdb/ns32k-tdep.c | |
parent | c6248f4865395224a34716d1d47ebeca8702c98b (diff) | |
download | gdb-f7db5ce6267b8b54fb71768f6577ef8386d36644.tar.gz |
2002-11-15 Andrew Cagney <cagney@redhat.com>
* frame.h (sigtramp_saved_pc): Delete declaration.
* blockframe.c (sigtramp_saved_pc): Delete function.
* ns32k-tdep.c (ns32k_sigtramp_saved_pc): New function.
(ns32k_frame_saved_pc): Call ns32k_sigtramp_saved_pc.
* vax-tdep.c (vax_sigtramp_saved_pc): New function.
(vax_frame_saved_pc): Call vax_sigtramp_saved_pc.
Diffstat (limited to 'gdb/ns32k-tdep.c')
-rw-r--r-- | gdb/ns32k-tdep.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 5563cf9b0c6..89bdee956ac 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -314,11 +314,36 @@ ns32k_frame_chain (struct frame_info *frame) return (read_memory_integer (frame->frame, 4)); } + +static CORE_ADDR +ns32k_sigtramp_saved_pc (struct frame_info *frame) +{ + CORE_ADDR sigcontext_addr; + char *buf; + int ptrbytes = TYPE_LENGTH (builtin_type_void_func_ptr); + int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT; + + buf = alloca (ptrbytes); + /* Get sigcontext address, it is the third parameter on the stack. */ + if (frame->next) + sigcontext_addr = read_memory_typed_address + (FRAME_ARGS_ADDRESS (frame->next) + FRAME_ARGS_SKIP + sigcontext_offs, + builtin_type_void_data_ptr); + else + sigcontext_addr = read_memory_typed_address + (read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr); + + /* Don't cause a memory_error when accessing sigcontext in case the stack + layout has changed or the stack is corrupt. */ + target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes); + return extract_typed_address (buf, builtin_type_void_func_ptr); +} + static CORE_ADDR ns32k_frame_saved_pc (struct frame_info *frame) { if (frame->signal_handler_caller) - return (sigtramp_saved_pc (frame)); /* XXXJRT */ + return (ns32k_sigtramp_saved_pc (frame)); /* XXXJRT */ return (read_memory_integer (frame->frame + 4, 4)); } |