This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][4.3] Deprecate -ftrapv
- From: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- To: gcc at gcc dot gnu dot org
- Date: Mon, 3 Mar 2008 15:08:18 -0500 (EST)
- Subject: Re: [PATCH][4.3] Deprecate -ftrapv
Ross Ridge:
>With INTO I don't see any way distignuish the SIGSEGV it generates on
>Linux from any of the myriad other ways a SIGSEGV can be generated.
Paolo Bonzini writes:
>sc.eip == 0xCE (if I remember x86 opcodes well :-) as I'm going by heart...)
The INTO instruction generates a trap exception, just like INT 4 would, so
the return address on the stack points to the instruction after the INTO.
>That's similar to how Java traps SIGFPEs and transform them to
>zero-divide exceptions, IIRC.
Floating point exceptions are fault exceptions so the return address
points to the faulting instruction.
At the risk of my curiousity getting me into more trouble, could any
one explain to me how to access these "eip" and "trapno" members from
a signal handler on Linux? I can't find any relevent documention with
man nor Google.
Ross Ridge