On 05/26/2011 04:03 PM, Dodji Seketeli wrote:
That is what I first did and it worked for this case. But then I wasn't sure if there could be cases where a function DIE would have the DW_AT_abstract_origin set, but won't have any actual code? For instance if the function has DECL_EXTERNAL set. That's why I wanted to call add_linkage_name only if the function has DW_AT_{low,high}_pc so that I am sure it contains actual code.
I think that we only generate debug info for a function if we emit it, so it should always have pc attributes. But you could try adding an assert to see if I'm right.
+ if (TREE_PUBLIC (origin)) + /* So this is where the actual code for a publicly accessible + cloned function is. Let's emit linkage name attribute for + it. This helps debuggers to e.g, set breakpoints into + constructors/destructors when the user asks "break + K::K". */ + add_linkage_name (subr_die, decl);
add_name_and_src_coords_attributes doesn't check TREE_PUBLIC, so I don't think we should here, either; we want the debugger to be able to find cloned constructors in anonymous namespaces, too.
Jason