From 43a759de810c370fc93af16f43e1e12f489a399d Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Mon, 26 Oct 2015 20:12:29 +0000 Subject: [PATCH] [LLVMSymbolize] Use symbol table only if function linkage name was requested. Now it's enough to just specify -functions=short without additionally providing -use-symbol-table=false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251339 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/Symbolize/Symbolize.cpp | 6 ++++-- test/DebugInfo/llvm-symbolizer.test | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/DebugInfo/Symbolize/Symbolize.cpp b/lib/DebugInfo/Symbolize/Symbolize.cpp index 303b6d4236a..6c81ec63283 100644 --- a/lib/DebugInfo/Symbolize/Symbolize.cpp +++ b/lib/DebugInfo/Symbolize/Symbolize.cpp @@ -209,7 +209,8 @@ DILineInfo ModuleInfo::symbolizeCode( ModuleOffset, getDILineInfoSpecifier(Opts)); } // Override function name from symbol table if necessary. - if (Opts.PrintFunctions != FunctionNameKind::None && Opts.UseSymbolTable) { + if (Opts.PrintFunctions == FunctionNameKind::LinkageName && + Opts.UseSymbolTable) { std::string FunctionName; uint64_t Start, Size; if (getNameFromSymbolTable(SymbolRef::ST_Function, ModuleOffset, @@ -233,7 +234,8 @@ DIInliningInfo ModuleInfo::symbolizeInlinedCode( InlinedContext.addFrame(DILineInfo()); } // Override the function name in lower frame with name from symbol table. - if (Opts.PrintFunctions != FunctionNameKind::None && Opts.UseSymbolTable) { + if (Opts.PrintFunctions == FunctionNameKind::LinkageName && + Opts.UseSymbolTable) { DIInliningInfo PatchedInlinedContext; for (uint32_t i = 0, n = InlinedContext.getNumberOfFrames(); i < n; i++) { DILineInfo LineInfo = InlinedContext.getFrame(i); diff --git a/test/DebugInfo/llvm-symbolizer.test b/test/DebugInfo/llvm-symbolizer.test index 8a2aaaab3a3..69619b0261d 100644 --- a/test/DebugInfo/llvm-symbolizer.test +++ b/test/DebugInfo/llvm-symbolizer.test @@ -154,7 +154,7 @@ RUN: | FileCheck %s --check-prefix=STRIPPED STRIPPED: global_func RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7 -RUN: llvm-symbolizer --functions=short --use-symbol-table=false --demangle=false < %t.input7 \ +RUN: llvm-symbolizer --functions=short --demangle=false < %t.input7 \ RUN: | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME SHORT_FUNCTION_NAME-NOT: _Z1cv -- 2.34.1