Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-symbolizer] Add support for specifying addresses on command-line
See https://bugs.llvm.org/show_bug.cgi?id=40070. GNU addr2line accepts input addresses both on the command-line and via stdin. llvm-symbolizer previously only supported the latter. This change adds support for the former. As with addr2line, the new behaviour is to only look for addresses on stdin if no positional arguments were provided to llvm-symbolizer. Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D56272 llvm-svn: 350821
- Loading branch information
Showing
2 changed files
with
63 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# REQUIRES: x86-registered-target | ||
|
||
foo: | ||
.space 10 | ||
nop | ||
nop | ||
|
||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -g | ||
|
||
# Check input addresses specified on stdin. | ||
# RUN: echo -e "0xa\n0xb" | llvm-symbolizer --obj=%t.o | FileCheck %s | ||
# RUN: echo -e "10\n11" | llvm-symbolizer --obj=%t.o | FileCheck %s | ||
|
||
# Check input addresses specified on the command-line. | ||
# RUN: llvm-symbolizer 0xa 0xb --obj=%t.o | FileCheck %s | ||
# RUN: llvm-symbolizer 10 11 --obj=%t.o | FileCheck %s | ||
|
||
# CHECK: basic.s:5:0 | ||
# CHECK: basic.s:6:0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters