[PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.

Frédéric Riss friss at apple.com
Thu Feb 26 09:45:49 PST 2015


> On Feb 25, 2015, at 2:25 PM, Paul Robinson <Paul_Robinson at playstation.sony.com> wrote:
> 
> Our debugger guys get pretty pedantic about interpreting the DWARF spec. I know GDB will auto-import info from an anonymous namespace, but:
> 
> - the size cost here is really minimal (what, 5 or 6 bytes per anonymous namespace scope);
> - they claimed that deciding whether to skip the namespace based on the name would be a problem for them;
> - the compiler implementation is obviously trivial;
> 
> so I didn't really feel motivated to argue the point.

Basically your debugger guys told you this could be described by standard constructs, so there is no point in adding extra logic to the debugger to handle it. IMHO this is not a very strong argument, because DWARF tries to be language agnostic, and thus every debugger needs to have some layer that adds language semantics to the raw debug information (for example, anonymous unions pose a very similar problem).

However I don’t think the patch will break any debugger (although that might be worth testing). I know that it will have some impact on Darwin’s dsymutil though, because it considers the targets of every ‘import’ directive as required when it decides which DIEs are needed in the final link. If the patch is going in, I think it would be nice to have a DW_AT_artificial in the importing DIE (which shouldn’t add any size to the debug info expect for one additional abbreviation).

Fred

> http://reviews.llvm.org/D7878
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list