Index: hppa-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-tdep.c,v retrieving revision 1.183 diff -u -p -r1.183 hppa-tdep.c --- hppa-tdep.c 1 Dec 2004 06:54:56 -0000 1.183 +++ hppa-tdep.c 4 Dec 2004 04:15:30 -0000 @@ -2185,6 +2185,12 @@ hppa_unwind_dummy_id (struct gdbarch *gd static CORE_ADDR hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { + /* If unwinding the PC from the sentinel frame, then which register + to read depends on the value of the status register. Use + hppa_target_read_pc(), it knows where to get the PC. */ + if (target_has_execution && frame_relative_level (next_frame) < 0) + return hppa_target_read_pc (inferior_ptid); + return frame_unwind_register_signed (next_frame, HPPA_PCOQ_HEAD_REGNUM) & ~3; }