<div dir="ltr">No, I assume the debugger will display the '\01' character when it shouldn't. This is the LLVM IR name, and we want to emit the object file symbol name. The LLVM IR name is "\01@foo@4", and the object file name is "@foo@4". There is no '\01' in the object file.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 17, 2014 at 9:54 AM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wait a sec, the display name *is* correct for \01@foo@4 (foo) already, so this workaround is not needed. Is that right?<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Thu Nov 13 2014 at 1:02:45 AM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 12, 2014 at 12:21 PM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- const StringRef FuncName = getDISubprogram(GV).getDisplayName();<br>
+ StringRef FuncName = getDISubprogram(GV).getDisplayName(),<br>
+ GVName = GV->getName();<br>
+ // FIXME Clang currently sets DisplayName to "bar" for a C++<br>
+ // "namespace_foo::bar" function, see PR21528. Luckily, dbghelp.dll is trying<br>
+ // to demangle display names anyways, so let's just put a mangled name into<br>
+ // the symbols subsection until Clang gives us what we need.<br>
+ if (GVName.startswith("\01?"))<br>
+ FuncName = GVName.substr(1);<br></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Just strip \01 unconditionally, no need to check for ?. Sometimes clang produces names like \01@foo@4 for this code:</div><div>extern "C" void __fastcall foo(int x) {}</div></div></div></div>
</blockquote></div>
</div></div></blockquote></div><br></div>