This makes it so that reports symbolized after the fact with
llvm-symbolizer are more similar to the ones we generate at runtime with
in-process dbghelp.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
tools/llvm-symbolizer/LLVMSymbolize.cpp | ||
---|---|---|
226 ↗ | (On Diff #31410) | This is not the place we demangle the function names - see LLVMSymbolizer::DemangleName. At that point we already lose the knowledge of whether the module was ELF, or COFF, or MachO, but is it that important? Also, why doesn't ::UnDecorateSymbolName work for you? |
tools/llvm-symbolizer/LLVMSymbolize.cpp | ||
---|---|---|
226 ↗ | (On Diff #31410) | Yes, it's important that we only do this for 32-bit x86 symbols, which requires looking at the machine type of the module. See isWin32Module(). UnDecorateSymbolName only handles C++ symbols. This won't interfere because C++ symbols all start with '?'. |
tools/llvm-symbolizer/LLVMSymbolize.cpp | ||
---|---|---|
92 ↗ | (On Diff #31410) | See below - if you make it a part of DemangleName , you can simplify the code with early-returns. |
226 ↗ | (On Diff #31410) | Still, let's keep all the demangling work in a single place - where we actually render DILineInfo entries. If you need to know smth. about the object file that produced these DILineInfo entries (which looks reasonable - demangling is obviously format-dependent) - just pass it down to printDILineInfo/DemangleName. |
- Add IsWin32Symbol to DILineInfo
tools/llvm-symbolizer/LLVMSymbolize.cpp | ||
---|---|---|
226 ↗ | (On Diff #31410) | I can do that, but it seems kind of silly to add a field to DILineInfo that is only used in LLVMSymbolize.cpp. There are other platforms with underscore prefixes, like MachO, that don't go this way. The underscore is removed earlier under an isMachO() in addSymbol(). |
tools/llvm-symbolizer/LLVMSymbolize.cpp | ||
---|---|---|
188 ↗ | (On Diff #31709) | Ah, sorry, I wasn't clear enough :( |
217 ↗ | (On Diff #31709) | You can pass ModuleInfo* (or the kind of that object file) to printDILineInfo here. |
233 ↗ | (On Diff #31709) | and here |
542 ↗ | (On Diff #31709) | and use the type of object file here to figure out which demangling you should actually do |
- Pass ModuleInfo down into printDILineInfo
tools/llvm-symbolizer/LLVMSymbolize.cpp | ||
---|---|---|
188 ↗ | (On Diff #31709) | Oh, that makes a lot more sense. :) |
LGTM with a note.
tools/llvm-symbolizer/LLVMSymbolize.cpp | ||
---|---|---|
568 ↗ | (On Diff #31717) | This code will be unreachable if _MSC_VER is not defined. |