2004-05-06 Randolph Chung <tausq@debian.org>
* hppa-linux-tdep.c (hppa_linux_sigtramp_find_sigcontext): Pass in pc
instead of sp, handle sigaltstack case.
(hppa_linux_sigtramp_frame_unwind_cache): Adjust calls to
hppa_linux_sigtramp_find_sigcontext, and set base to the frame of the
signal handler and not that of the caller.
(hppa_linux_sigtramp_unwind_sniffer): Adjust calls to
hppa_linux_sigtramp_find_sigcontext.
Index: hppa-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-linux-tdep.c,v
retrieving revision 1.2
diff -u -p -r1.2 hppa-linux-tdep.c
--- hppa-linux-tdep.c 7 May 2004 05:48:49 -0000 1.2
+++ hppa-linux-tdep.c 7 May 2004 06:24:07 -0000
@@ -282,7 +284,7 @@ hppa_linux_skip_trampoline_code (CORE_AD
Note that with a 2.4 64-bit kernel, the signal context is not properly
passed back to userspace so the unwind will not work correctly. */
static CORE_ADDR
-hppa_linux_sigtramp_find_sigcontext (CORE_ADDR sp)
+hppa_linux_sigtramp_find_sigcontext (CORE_ADDR pc)
{
unsigned int dummy[HPPA_MAX_INSN_PATTERN_LEN];
int offs = 0;
@@ -291,6 +293,12 @@ hppa_linux_sigtramp_find_sigcontext (COR
static int pcoffs[] = { 0, 4*4, 5*4 };
/* offsets to the rt_sigframe structure */
static int sfoffs[] = { 4*4, 10*4, 10*4 };
+ CORE_ADDR sp;
+
+ /* Most of the time, this will be correct. The one case when this will
+ fail is if the user defined an alternate stack, in which case the
+ beginning of the stack will not be pc & 63. */
+ sp = (pc & ~63);