aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
authorRandolph Chung <tausq@debian.org>2004-05-26 04:02:24 +0000
committerRandolph Chung <tausq@debian.org>2004-05-26 04:02:24 +0000
commit6d1be3f1860bfc9fb75ea83cb930afb1ce895514 (patch)
tree46a85f72b6d9fe1b0a1a61b59f91bbaee9c2e3fd /gdb/hppa-tdep.c
parentb057cbf032d588c8fe8b94bcb415fa312d863c21 (diff)
downloadgdb-6d1be3f1860bfc9fb75ea83cb930afb1ce895514.zip
gdb-6d1be3f1860bfc9fb75ea83cb930afb1ce895514.tar.gz
gdb-6d1be3f1860bfc9fb75ea83cb930afb1ce895514.tar.bz2
2004-05-25 Randolph Chung <tausq@debian.org>
* hppa-tdep.c (hppa_fallback_frame_cache): Handle stack adjustment, and multiple stack unwinds. (hppa_stub_unwind_sniffer): Handle unwind from pc == 0.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r--gdb/hppa-tdep.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 0dd954e..e2653d7 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1887,6 +1887,7 @@ static struct hppa_frame_cache *
hppa_fallback_frame_cache (struct frame_info *next_frame, void **this_cache)
{
struct hppa_frame_cache *cache;
+ unsigned int frame_size;
CORE_ADDR pc, start_pc, end_pc, cur_pc;
cache = FRAME_OBSTACK_ZALLOC (struct hppa_frame_cache);
@@ -1895,6 +1896,7 @@ hppa_fallback_frame_cache (struct frame_info *next_frame, void **this_cache)
pc = frame_func_unwind (next_frame);
cur_pc = frame_pc_unwind (next_frame);
+ frame_size = 0;
find_pc_partial_function (pc, NULL, &start_pc, &end_pc);
@@ -1914,21 +1916,18 @@ hppa_fallback_frame_cache (struct frame_info *next_frame, void **this_cache)
insn = read_memory_unsigned_integer (pc, 4);
+ frame_size += prologue_inst_adjust_sp (insn);
+
/* There are limited ways to store the return pointer into the
stack. */
if (insn == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
- {
- cache->saved_regs[HPPA_RP_REGNUM].addr = -20;
- break;
- }
+ cache->saved_regs[HPPA_RP_REGNUM].addr = -20;
else if (insn == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
- {
- cache->saved_regs[HPPA_RP_REGNUM].addr = -16;
- break;
- }
+ cache->saved_regs[HPPA_RP_REGNUM].addr = -16;
}
- cache->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
+ cache->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM) - frame_size;
+ trad_frame_set_value (cache->saved_regs, HPPA_SP_REGNUM, cache->base);
if (trad_frame_addr_p (cache->saved_regs, HPPA_RP_REGNUM))
{
@@ -2080,7 +2079,8 @@ hppa_stub_unwind_sniffer (struct frame_info *next_frame)
{
CORE_ADDR pc = frame_pc_unwind (next_frame);
- if (IN_SOLIB_CALL_TRAMPOLINE (pc, NULL)
+ if (pc == 0
+ || IN_SOLIB_CALL_TRAMPOLINE (pc, NULL)
|| IN_SOLIB_RETURN_TRAMPOLINE (pc, NULL))
return &hppa_stub_frame_unwind;
return NULL;