Re: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7

Pedro Alves
2012-01-02T14:44:20Z

On 01/02/2012 02:19 PM, Jan Kratochvil wrote:
> On Mon, 02 Jan 2012 15:09:42 +0100, Pedro Alves wrote:
>> I'm confused. Shouldn't this instead be handled in the unwind
>> machinery? Is this subtraction you refer to the
>> get_frame_address_in_block one? That already has special
>> handling for something like this. Why doesn't it work?
>
> This `- 1' is in inferior's:
>
> gcc/libgcc/unwind-dw2.c:
> uw_frame_state_for:
> fde = _Unwind_Find_FDE (context->ra + _Unwind_IsSignalFrame (context) - 1,
> &context->bases);
>
> GDB can only change the address put on inferior stack and later picked up by
> the inferior's exceptions unwinder.

I see. That '_Unwind_IsSignalFrame(context)' is there to cancel out the
'- 1' for signal frames. Ideally, the same treatment would be
applied for gdb's dummy frame, perhaps by having gdb itself change
`context->flags' making libunwind treat it as a signal frame. I have no
idea whether that's feasible. Oh well.

--
Pedro Alves