[llvm-symbolizer] Add -addresses, -a as aliases for -print-address

Summary: Provides -addresses, -a as aliases for -print-address. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40067.

Reviewers: jhenderson, ruiu, rnk, fjricci

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Differential Revision: https://reviews.llvm.org/D56635

llvm-svn: 351043
This commit is contained in:
Dmitry Venikov 2019-01-14 10:10:51 +00:00
parent 40c6624b76
commit d7fc122a32
3 changed files with 13 additions and 3 deletions

View File

@ -106,7 +106,7 @@ OPTIONS
location, look for the debug info at the .dSYM path provided via the
``-dsym-hint`` flag. This flag can be used multiple times.
.. option:: -print-address
.. option:: -print-address, -addresses, -a
Print address before the source code location. Defaults to false.

View File

@ -18,6 +18,8 @@
#Build as : clang -g -O2 addr.c
RUN: llvm-symbolizer -print-address -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
RUN: llvm-symbolizer -addresses -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
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: echo "0x1" > %t.input

View File

@ -83,9 +83,17 @@ static cl::list<std::string>
ClDsymHint("dsym-hint", cl::ZeroOrMore,
cl::desc("Path to .dSYM bundles to search for debug info for the "
"object files"));
// -print-address, -addresses, -a
static cl::opt<bool>
ClPrintAddress("print-address", cl::init(false),
cl::desc("Show address before line information"));
ClPrintAddress("print-address", cl::init(false),
cl::desc("Show address before line information"));
static cl::alias
ClPrintAddressAliasAddresses("addresses", cl::desc("Alias for -print-address"),
cl::NotHidden, cl::aliasopt(ClPrintAddress));
static cl::alias
ClPrintAddressAliasA("a", cl::desc("Alias for -print-address"),
cl::NotHidden, cl::aliasopt(ClPrintAddress));
// -pretty-print, -p
static cl::opt<bool>