[llvm] r351999 - [llvm-symbolizer] Add support for -i and -inlines as aliases for -inlining
Douglas Yung via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 23 16:34:10 PST 2019
Author: dyung
Date: Wed Jan 23 16:34:09 2019
New Revision: 351999
URL: http://llvm.org/viewvc/llvm-project?rev=351999&view=rev
Log:
[llvm-symbolizer] Add support for -i and -inlines as aliases for -inlining
This change adds two options, -i and -inlines as aliases for the -inlining option to llvm-symbolizer to improve compatibility with the GNU addr2line utility which accepts these options.
It also modifies existing tests that use -inlining to exercise these new aliases as well.
This fixes PR40073.
Reviewed by: jhenderson, Quolyk, ruiu
Differential Revision: https://reviews.llvm.org/D57083
Modified:
llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
llvm/trunk/test/tools/llvm-symbolizer/coff-dwarf.test
llvm/trunk/test/tools/llvm-symbolizer/coff-exports.test
llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test
llvm/trunk/test/tools/llvm-symbolizer/sym.test
llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
Modified: llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst?rev=351999&r1=351998&r2=351999&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst (original)
+++ llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst Wed Jan 23 16:34:09 2019
@@ -91,7 +91,7 @@ OPTIONS
Don't print demangled function names.
-.. option:: -inlining
+.. option:: -inlining, -inlines, -i
If a source code location is in an inlined function, prints all the
inlnied frames. Defaults to true.
Modified: llvm/trunk/test/tools/llvm-symbolizer/coff-dwarf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-symbolizer/coff-dwarf.test?rev=351999&r1=351998&r2=351999&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-symbolizer/coff-dwarf.test (original)
+++ llvm/trunk/test/tools/llvm-symbolizer/coff-dwarf.test Wed Jan 23 16:34:09 2019
@@ -1,6 +1,12 @@
RUN: grep '^ADDR:' %s | sed -s 's/ADDR: //' \
RUN: | llvm-symbolizer --inlining --relative-address -obj="%p/Inputs/coff-dwarf.exe" \
RUN: | FileCheck %s
+RUN: grep '^ADDR:' %s | sed -s 's/ADDR: //' \
+RUN: | llvm-symbolizer --inlines --relative-address -obj="%p/Inputs/coff-dwarf.exe" \
+RUN: | FileCheck %s
+RUN: grep '^ADDR:' %s | sed -s 's/ADDR: //' \
+RUN: | llvm-symbolizer -i --relative-address -obj="%p/Inputs/coff-dwarf.exe" \
+RUN: | FileCheck %s
This test relies on UnDecorateSymbolName, which is Windows-only.
REQUIRES: target-windows, system-windows
Modified: llvm/trunk/test/tools/llvm-symbolizer/coff-exports.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-symbolizer/coff-exports.test?rev=351999&r1=351998&r2=351999&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-symbolizer/coff-exports.test (original)
+++ llvm/trunk/test/tools/llvm-symbolizer/coff-exports.test Wed Jan 23 16:34:09 2019
@@ -1,6 +1,12 @@
RUN: grep '^ADDR:' %s | sed -s 's/ADDR: //' \
RUN: | llvm-symbolizer --inlining --relative-address -obj="%p/Inputs/coff-exports.exe" \
RUN: | FileCheck %s
+RUN: grep '^ADDR:' %s | sed -s 's/ADDR: //' \
+RUN: | llvm-symbolizer --inlines --relative-address -obj="%p/Inputs/coff-exports.exe" \
+RUN: | FileCheck %s
+RUN: grep '^ADDR:' %s | sed -s 's/ADDR: //' \
+RUN: | llvm-symbolizer -i --relative-address -obj="%p/Inputs/coff-exports.exe" \
+RUN: | FileCheck %s
This test relies on UnDecorateSymbolName, which is Win32-only.
REQUIRES: system-windows
Modified: llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test?rev=351999&r1=351998&r2=351999&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test (original)
+++ llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test Wed Jan 23 16:34:09 2019
@@ -1,4 +1,4 @@
-RUN: llvm-symbolizer -inlining -apfC -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
+RUN: llvm-symbolizer -apCi -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
CHECK: some text
CHECK: 0x40054d: inctwo
Modified: llvm/trunk/test/tools/llvm-symbolizer/sym.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-symbolizer/sym.test?rev=351999&r1=351998&r2=351999&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-symbolizer/sym.test (original)
+++ llvm/trunk/test/tools/llvm-symbolizer/sym.test Wed Jan 23 16:34:09 2019
@@ -22,6 +22,10 @@ RUN: llvm-symbolizer -addresses -obj=%p/
RUN: llvm-symbolizer -a -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
RUN: llvm-symbolizer -inlining -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
RUN: llvm-symbolizer -inlining -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
+RUN: llvm-symbolizer -inlines -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
+RUN: llvm-symbolizer -inlines -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
+RUN: llvm-symbolizer -i -print-address -pretty-print -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
+RUN: llvm-symbolizer -i -print-address -p -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
RUN: echo "0x1" > %t.input
RUN: llvm-symbolizer -obj=%p/Inputs/zero < %t.input | FileCheck -check-prefix="ZERO" %s
Modified: llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp?rev=351999&r1=351998&r2=351999&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp Wed Jan 23 16:34:09 2019
@@ -58,6 +58,13 @@ static cl::opt<bool>
static cl::opt<bool>
ClPrintInlining("inlining", cl::init(true),
cl::desc("Print all inlined frames for a given address"));
+static cl::alias
+ ClPrintInliningAliasI("i", cl::desc("Alias for -inlining"),
+ cl::NotHidden, cl::aliasopt(ClPrintInlining),
+ cl::Grouping);
+static cl::alias
+ ClPrintInliningAliasInlines("inlines", cl::desc("Alias for -inlining"),
+ cl::NotHidden, cl::aliasopt(ClPrintInlining));
// -basenames, -s
static cl::opt<bool> ClBasenames("basenames", cl::init(false),
More information about the llvm-commits
mailing list