From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randolph Chung To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfa] Signal trampoline unwinder for hppa-hpux Date: Thu, 20 May 2004 20:53:00 -0000 Message-id: <20040520205309.GC566@tausq.org> References: <20040520041746.GW566@tausq.org> <20040520204625.GB10684@gnat.com> X-SW-Source: 2004-05/msg00617.html > 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/