Re: [patch V2, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGALRM

Paul Koning
2011-06-20T15:14:36Z

On Jun 20, 2011, at 11:07 AM, Yao Qi wrote:

> On 06/20/2011 07:10 PM, Mark Kettenis wrote:
>> My concern with using SIGILL (apart from generating an instruction
>> that forces SIGALL on all architectures we support) is that you're
>> going to end up testing a different unwinder as well. Typically in
>> the SIGSEGV case you'll end up at the faulting instruction, which is
>> defenitely in the function body, where we should be using the DWARF
>> CFI unwinder. But for SIGILL you could end up at the instruction
>> after the trapping instruction, which is likely to be in the function
>> epilogue which may be handled by an epilogue unwinder.
>
> Oh, I don't know PC could be the next instruction of that illegal
> instruction. At least, some years ago, when I was working on PowerPC,
> PC still points to the illegal instruction when SIGILL is triggered.

Same for MIPS.

More in general, where the PC points for any given exception is very much an architecture dependent question. On some architectures, PC points to the next instruction in a SEGV. On some architecture, PC points to the next instruction on SIGILL. Some architectures have imprecise exceptions where any number of these have a PC pointing somewhere in the vicinity (usually) of the offending instruction, but not a single well-known distance from it.

paul