[PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.

Romanova, Katya Katya_Romanova at playstation.sony.com
Tue Mar 10 15:25:02 PDT 2015


Hi David,

I wanted to follow up on this bug. I still haven’t heard a definite “yes” or “no” from the other developers.

Here are my thought on why adding DW_TAG_imported_module is beneficial:

(1) We will be more consistent with debug info generated by other compilers (e.g. GCC and Intel's ICC).
(2) It resolves ambiguity created by lack of specification. LLDB and GDB are not the only debuggers in the world. Since it's a grey area in the DWARF spec, other debuggers might not automatically import the anonymous namespaces.

About your concerns:
(1) Import is implicit. It's marked as "artificial", so it shouldn't be confusing for the debuggers.
(2) The impact of the size increase is minimal, 6 bytes per anonymous namespace.
(3) The added complexity is very small. The patch is tiny and clear.

I think the benefits clearly outweigh the drawbacks.

We are talking about adding just one tag and a couple of attributes in some rare cases (like anonymous array). From what I remember, there are several existing attributes that are not exactly universally used, e.g. the DW_AT_APPLE_* attributes that are generated for all platforms, I'm not sure if anybody outside Apple has any use for it. And I haven't seen anybody raising any concerns related to size increases stemming from these attributes. . And we're just asking to add 6 bytes per anonymous namespace.

Sony’s debugger is just asking for a tiny bit of information from the compiler. It's not much really, but without this help. Fixing this problem in the debugger would be much harder. It might help other debuggers as well.

Katya.


From: David Blaikie [mailto:dblaikie at gmail.com]
Sent: Tuesday, March 03, 2015 9:44 AM
To: reviews+D7895+public+7827be49c0b04087 at reviews.llvm.org
Cc: Romanova, Katya; Eric Christopher; Frédéric Riss; Duncan P. N. Exon Smith; llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.



On Fri, Feb 27, 2015 at 5:28 PM, Paul Robinson <Paul_Robinson at playstation.sony.com<mailto:Paul_Robinson at playstation.sony.com>> wrote:
It's an arguable gray area in the compiler/debugger contract.  How much
does the compiler _require_ the debugger to know?  (Which is different
from how much the debugger knows for the purpose of improving the user's
debugging experience.)

I don't quite see the grey here - I thought the line of reasoning you've provided in the past was fairly simple: source fidelity. The source doesn't have a using directive in it, so I don't know why we'd expect to see one in the debug info.

This change reduces that requirement, with very low size cost (which we
are pretty sensitive to).  A debugger that auto-imports anonymous
namespaces will see the import and recognize that it has already imported
 that scope, so the cost there is also very low.

Not seeing a whole lot of down-side here.

Mostly just principles & a desire not to add cruft in source or output.

Not sure if other people have any opinion on this, I'm happy to defer.



http://reviews.llvm.org/D7895

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150310/d0d4dbc8/attachment.html>


More information about the llvm-commits mailing list