Do not remove leading underscores from DW_AT_names of DW_TAG_labels.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This behavior goes back to r146262:
commit 94c2e85bea1ab1b837a4c055ccc83d5cd32dd027 Author: Kevin Enderby <enderby@apple.com> Date: Fri Dec 9 18:09:40 2011 +0000 The second part of support for generating dwarf for assembly source files. This generates the dwarf Compile Unit DIE and a dwarf subprogram DIE for each non-temporary label. The next part will be to get the clang driver to enable this when assembling a .s file. rdar://9275556 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146262
which added
+ // The dwarf subprogram's name does not have the symbol name's leading + // underbar if any. + StringRef Name = Symbol->getName(); + if (Name.startswith("_")) + Name = Name.substr(1, Name.size()-1); +
Comment Actions
My *guess* is that the underscore trimming was added to allow setting breakpoints by name on labels in assembler output generated by a compiler, but I'm not sure. Perhaps @echristo knows more?
Comment Actions
I don't sadly. I believe the intention was to make it so that breakpoints would be for the "obvious" symbol name rather than the "mangled with an underscore" that you need for the platform. So... whatever makes that easiest? I'd probably think a linkage name would be more helpful than mangling/demangling the actual symbol name here.
Thoughts?