[RFA, patch] Add missing source location info to thunks

Richard Henderson rth@redhat.com
Mon Aug 6 18:21:00 GMT 2012


On 08/03/2012 04:38 PM, Cary Coutant wrote:
> 2012-08-03  Cary Coutant  <ccoutant@google.com>
> 
> 	* gcc/cgraphunit.c (assemble_thunk): Add source line info.
> 	* gcc/final.c (final): Check for non-null cfg pointer.

I'm uncomfortable with just the one call into the debug generator, outside of the other debug_hooks begin/end calls.

It'll obviously work for stabs, and probably work for sdb, due to how the debug info is represented.

But for dwarf2 it probably only works for selected targets.

For instance, !DWARF2_ASM_LINE_DEBUG_INFO requires a call to dwarf2out_finish in order to get anything emitted at all.  Some targets, like x86, use final_start_function + final_end_function in the output_mi_thunk hook, and that would take care of it.  However, x86-linux is also going to define DWARF2_ASM_LINE_DEBUG_INFO making both cases work.  And I'm guessing that's all you tested.

Try a target like arm-linux (which doesn't use final_end_function), and hack the generated auto-host.h so that HAVE_AS_DWARF2_DEBUG_LINE is undefined.


r~


PS: Yet Another Reason thunks should be represented as first-class citizens with a decl and other assorted paths through code emission done "properly".



More information about the Gcc-patches mailing list