This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/rfa] Signal trampoline unwinder for hppa-hpux


+/* Signal frames.  */
+
+static CORE_ADDR
+hppa_hpux_sigtramp_find_sigcontext (CORE_ADDR sp, CORE_ADDR pc)
+{
+  unsigned int insns[5];
+
+  read_memory_nobpt (pc, (char *)insns, sizeof(insns));
+
+  /* This comes from _sigreturn:
+     379a0000 ldo 0(%r28), %r26
+     6bd33fc9 stw %r19, -28(%sp)
+     20200801 ldil -40000000, %r1
+     e420e008 be,l 4(%sr7, %rr1), %sr0, %r31
+     34160116 ldi 139, %r22  */
+
+  if (extract_unsigned_integer (&insns[0], 4) != 0x379a0000
+      || extract_unsigned_integer (&insns[1], 4) != 0x6bd33fc9
+      || extract_unsigned_integer (&insns[2], 4) != 0x20200801
+      || extract_unsigned_integer (&insns[3], 4) != 0xe420e008
+      || extract_unsigned_integer (&insns[4], 4) != 0x34160116)
+    return 0;
+
+  /* We can find a ucontext_t 1352 bytes above the stack. The first
+     element of the ucontext_t is a mcontext_t (save_state_t), which
+     contains the registers we want.  */
+  return sp - 1352;
+}

Can this make use of tramp-frame for the pattern match? For single stepping through trampolines to work, this code needs to be able to match the tramp when part way through it (what sigstep is testing).


Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]