aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1995-10-18 05:48:23 +0000
committerJeff Law <law@redhat.com>1995-10-18 05:48:23 +0000
commit5812b9a12d46d1e3e2818d460e7e52791a678276 (patch)
tree6a44e49f48f4bda007696a920abea1cda2219f62 /gdb/hppa-tdep.c
parent00c916f4a83950d361c50aab635ca2ecf6c218f7 (diff)
downloadgdb-5812b9a12d46d1e3e2818d460e7e52791a678276.zip
gdb-5812b9a12d46d1e3e2818d460e7e52791a678276.tar.gz
gdb-5812b9a12d46d1e3e2818d460e7e52791a678276.tar.bz2
* hppa-tdep.c (frame_chain): Fix more obscure problems caused
by system calls that core dump processes without saving all the register state.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r--gdb/hppa-tdep.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 3addc58..62531a3 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1076,8 +1076,11 @@ frame_chain (frame)
/* Abominable hack. */
if (current_target.to_has_execution == 0
- && saved_regs.regs[FLAGS_REGNUM]
- && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4) & 0x2))
+ && ((saved_regs.regs[FLAGS_REGNUM]
+ && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4)
+ & 0x2))
+ || (saved_regs.regs[FLAGS_REGNUM] == 0
+ && read_register (FLAGS_REGNUM) & 0x2)))
{
u = find_unwind_entry (FRAME_SAVED_PC (frame));
if (!u)
@@ -1091,6 +1094,29 @@ frame_chain (frame)
}
else
{
+ struct frame_saved_regs saved_regs;
+
+ /* Get the innermost frame. */
+ tmp_frame = frame;
+ while (tmp_frame->next != NULL)
+ tmp_frame = tmp_frame->next;
+
+ get_frame_saved_regs (tmp_frame, &saved_regs);
+ /* Abominable hack. See above. */
+ if (current_target.to_has_execution == 0
+ && ((saved_regs.regs[FLAGS_REGNUM]
+ && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4)
+ & 0x2))
+ || (saved_regs.regs[FLAGS_REGNUM] == 0
+ && read_register (FLAGS_REGNUM) & 0x2)))
+ {
+ u = find_unwind_entry (FRAME_SAVED_PC (frame));
+ if (!u)
+ return read_memory_integer (saved_regs.regs[FP_REGNUM], 4);
+ else
+ return frame_base - (u->Total_frame_size << 3);
+ }
+
/* The value in %r3 was never saved into the stack (thus %r3 still
holds the value of the previous frame pointer). */
return read_register (FP_REGNUM);