On Fri, Apr 17, 2015 at 12:32:03PM +0200, Richard Biener wrote: > So Jakub says that using comp_unit_die () for the context of the stub > DIE is wrong and he is of course right. The following adjusted patch > uses the correct context, but only if we already have a DIE for it, > otherwise we drop the DW_TAG_GNU_call_site ref on the floor.
I'd mention that this last line doesn't match what the code does, because in reality it just means that we drop the DW_AT_abstract_origin of DW_TAG_GNU_call_site. That really means just that the debugger won't know what function is called at that point, as if it were e.g. an indirect jump with unknown target that is not preserved in any register across the call), but e.g. all the guarantees that we cover all the calls still holds. Jakub