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


> How can you tell whether a kernel is 32bits or not?

in the code? In the save_state_t structure returned by the kernel,
there's a flag, which is checked here:

+  if (!(flag & 0x40))
+    {
+      /* Narrow registers. */
+      off = scptr + offsetof (save_state_t, ss_narrow);
+      incr = 4;
+      szoff = 0;
+    }
+  else
+    {
+      /* Wide registers. */
+      off = scptr + offsetof (save_state_t, ss_wide) + 8;
+      incr = 8;
+      szoff = (tdep->bytes_per_address == 4 ? 4 : 0);
+    }

There are 3 cases, if you have a 32-bit kernel, then it should always
hit the first if case. If you have a 64-bit kernel and 32-bit userspace,
you should hit the second case with szoff == 4. For 64-bit kernel and
64-bit userspace you will hit the else case with szoff == 0.

I've only tested the 2nd scenario on hpux11.00 and hpux11.11. Too many
targets and combinations :-(

> I tried your patch on our machines, it we get noticeably better results,
> especially in sigstep.exp, which no longer times out to death....

yeah, it used to get into an infinite loop.. not very nice :)

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


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