This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: add debug hook to unwinder
- From: Ian Lance Taylor <iant at google dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Richard Henderson <rth at redhat dot com>, tromey at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Jun 2009 18:24:20 -0700
- Subject: Re: RFA: add debug hook to unwinder
- References: <m3ocv5s935.fsf@fleche.redhat.com> <m3octnzsca.fsf@fleche.redhat.com> <4A31E890.7020609@redhat.com> <84fc9c000906120838w4075911aq6607980936da59dc@mail.gmail.com>
Richard Guenther <richard.guenther@gmail.com> writes:
> On Fri, Jun 12, 2009 at 7:33 AM, Richard Henderson<rth@redhat.com> wrote:
>> Tom Tromey wrote:
>>>
>>> +/* This function is called during unwinding. ÂIt is intended as a hook
>>> + Â for a debugger to intercept exceptions. ÂCFA is the CFA of the
>>> + Â target frame. ÂHANDLER is the PC to which control will be
>>> + Â transferred. Â*/
>>> +static void
>>> +_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)),
>>> + Â Â Â Â Â Â Â Â Âvoid *handler __attribute__ ((__unused__)))
>>> +{
>>> + Âasm ("");
>>> +}
>>
>> I think you should mark this function noinline for safety.
>> Otherwise some future version of the compiler could decide
>> to inline this and eliminate the _Unwind_DebugHook symbol
>> entirely.
>
> Hm, and if it is static then the compiler may as well change its calling
> ABI (like for example IPA-SRA might remove the two unused params).
> No idea how to prevent that while still having it being static though ...
Does it matter? The compiler should not change the calling convention
if that convention is not represented correctly in the debug info. If
it is represented correctly in the debug info, gdb should be able to
find the arguments.
Ian