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

Pedro Alves
2012-01-02T14:10:04Z

On 12/22/2011 08:20 PM, Jan Kratochvil wrote:
> @@ -634,9 +635,32 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
> case AT_ENTRY_POINT:
> {
> CORE_ADDR dummy_addr;
> + gdb_byte *insn;
> + CORE_ADDR insn_len;
>
> real_pc = funaddr;
> dummy_addr = entry_point_address ();
> +
> + /* If the inferior call throws an uncaught C++ exception the inferior
> + unwinder will try to unwind all the frames incl. the dummy frame.
> + Using the entry_point_address directly will try to find FDE at the
> + function right before the entry_point_address address as the
> + unwinder subtracts 1 to get at the call instruction. FDE of the
> + preceding function, if found, would be invalid for the dummy frame
> + and it would crash the inferior's unwinder. Therefore attempt to
> + skip the very first instruction of entry_point_address. */
> +

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?