mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-18 07:52:35 +00:00
llvm-symbolizer: don't always run demangler on global object names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b4a0ba1718
commit
d9729ae8c5
@ -196,7 +196,7 @@ std::string LLVMSymbolizer::symbolizeData(const std::string &ModuleName,
|
||||
if (Opts.UseSymbolTable) {
|
||||
if (ModuleInfo *Info = getOrCreateModuleInfo(ModuleName)) {
|
||||
if (Info->symbolizeData(ModuleOffset, Name, Start, Size) && Opts.Demangle)
|
||||
Name = DemangleName(Name);
|
||||
Name = DemangleGlobalName(Name);
|
||||
}
|
||||
}
|
||||
std::stringstream ss;
|
||||
@ -436,5 +436,11 @@ std::string LLVMSymbolizer::DemangleName(const std::string &Name) {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string LLVMSymbolizer::DemangleGlobalName(const std::string &Name) {
|
||||
// We can spoil names of globals with C linkage, so use an heuristic
|
||||
// approach to check if the name should be demangled.
|
||||
return (Name.substr(0, 2) == "_Z") ? DemangleName(Name) : Name;
|
||||
}
|
||||
|
||||
} // namespace symbolize
|
||||
} // namespace llvm
|
||||
|
@ -71,6 +71,7 @@ private:
|
||||
ObjectFile *getObjectFileFromBinary(Binary *Bin, const std::string &ArchName);
|
||||
|
||||
std::string printDILineInfo(DILineInfo LineInfo) const;
|
||||
static std::string DemangleGlobalName(const std::string &Name);
|
||||
|
||||
// Owns all the parsed binaries and object files.
|
||||
SmallVector<Binary*, 4> ParsedBinariesAndObjects;
|
||||
|
Loading…
x
Reference in New Issue
Block a user