diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-05-17 00:07:48 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-05-17 00:07:48 +0000 |
commit | bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4 (patch) | |
tree | 766b472982f1c517f2b44e63609987a0163b3fc6 /tools/llvm-symbolizer/LLVMSymbolize.cpp | |
parent | 2d1fa5f718bc53d9b3867371f0941889f02bea3a (diff) | |
download | llvm-bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4.tar.gz llvm-bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4.tar.bz2 llvm-bf6e3f925757fcdb57b4a0ba5a71ceedf95f32e4.tar.xz |
[DWARF parser] Teach DIContext to fetch short (non-linkage) function names for a given address.
Change --functions option in llvm-symbolizer tool to accept
values "none", "short" or "linkage". Update the tests and docs
accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-symbolizer/LLVMSymbolize.cpp')
-rw-r--r-- | tools/llvm-symbolizer/LLVMSymbolize.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp index 7018ebed73..3e71111b00 100644 --- a/tools/llvm-symbolizer/LLVMSymbolize.cpp +++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp @@ -39,8 +39,7 @@ static DILineInfoSpecifier getDILineInfoSpecifier(const LLVMSymbolizer::Options &Opts) { return DILineInfoSpecifier( DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, - Opts.PrintFunctions ? DILineInfoSpecifier::FunctionNameKind::LinkageName - : DILineInfoSpecifier::FunctionNameKind::None); + Opts.PrintFunctions); } ModuleInfo::ModuleInfo(ObjectFile *Obj, DIContext *DICtx) @@ -117,7 +116,7 @@ DILineInfo ModuleInfo::symbolizeCode( ModuleOffset, getDILineInfoSpecifier(Opts)); } // Override function name from symbol table if necessary. - if (Opts.PrintFunctions && Opts.UseSymbolTable) { + if (Opts.PrintFunctions != FunctionNameKind::None && Opts.UseSymbolTable) { std::string FunctionName; uint64_t Start, Size; if (getNameFromSymbolTable(SymbolRef::ST_Function, ModuleOffset, @@ -140,7 +139,7 @@ DIInliningInfo ModuleInfo::symbolizeInlinedCode( InlinedContext.addFrame(DILineInfo()); } // Override the function name in lower frame with name from symbol table. - if (Opts.PrintFunctions && Opts.UseSymbolTable) { + if (Opts.PrintFunctions != FunctionNameKind::None && Opts.UseSymbolTable) { DIInliningInfo PatchedInlinedContext; for (uint32_t i = 0, n = InlinedContext.getNumberOfFrames(); i < n; i++) { DILineInfo LineInfo = InlinedContext.getFrame(i); @@ -398,7 +397,7 @@ std::string LLVMSymbolizer::printDILineInfo(DILineInfo LineInfo) const { // cannot fetch. We replace it to "??" to make our output closer to addr2line. static const std::string kDILineInfoBadString = "<invalid>"; std::stringstream Result; - if (Opts.PrintFunctions) { + if (Opts.PrintFunctions != FunctionNameKind::None) { std::string FunctionName = LineInfo.FunctionName; if (FunctionName == kDILineInfoBadString) FunctionName = kBadString; |