forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recent versions of GNU binutils starting from 2.39 support symbol+offset lookup in addition to the usual numeric address lookup. This change adds symbol lookup to llvm-symbolize and llvm-addr2line. Now llvm-symbolize behaves closer to GNU addr2line, - if the value specified as address in command line or input stream is not a number, it is treated as a symbol name. For example: llvm-symbolize --obj=abc.so func_22 llvm-symbolize --obj=abc.so "CODE func_22" This lookup is now supported only for functions. Specification with offset is not supported yet. This is a recommit of 2b27948, reverted in 39fec54 because the test llvm/test/Support/interrupts.test started failing on Windows. The test was changed in 18f036d and is also updated in this commit. Differential Revision: https://reviews.llvm.org/D149759
- Loading branch information
Showing
24 changed files
with
333 additions
and
42 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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
some text | ||
something not a valid address | ||
0x40054d | ||
some text2 | ||
some text possibly a symbol |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ some text | |
0x4005b9 | ||
0x4005ce | ||
0x4005d4 | ||
some more text | ||
another text |
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 @@ | ||
// This file is a part of sources used to build `symbols.so`, which is used to | ||
// test symbol location search made by llvm-symbolizer. | ||
// | ||
// Build instructions: | ||
// $ mkdir /tmp/dbginfo | ||
// $ cp symbols.h symbols.part1.cpp symbols.part2.cpp symbols.part3.c symbols.part4.c /tmp/dbginfo/ | ||
// $ cd /tmp/dbginfo | ||
// $ gcc -osymbols.so -shared -fPIC -g symbols.part1.cpp symbols.part2.cpp symbols.part3.c symbols.part4.c | ||
|
||
|
||
extern "C" { | ||
extern int global_01; | ||
int func_01(); | ||
int func_02(int); | ||
} | ||
|
||
template<typename T> T func_03(T x) { | ||
return x + T(1); | ||
} |
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,25 @@ | ||
#include "symbols.h" | ||
|
||
int global_01 = 22; | ||
|
||
int static static_var = 0; | ||
|
||
static int static_func_01(int x) { | ||
static_var = x; | ||
return global_01; | ||
} | ||
|
||
int func_01() { | ||
int res = 1; | ||
return res + static_func_01(22); | ||
} | ||
|
||
int func_04() { | ||
static_var = 0; | ||
return 22; | ||
} | ||
|
||
int func_04(int x) { | ||
int res = static_var; | ||
return res + func_03(x); | ||
} |
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,18 @@ | ||
#include "symbols.h" | ||
|
||
int static static_var = 4; | ||
|
||
static int static_func_01(int x) { | ||
static_var--; | ||
return x; | ||
} | ||
|
||
int func_02(int x) { | ||
static_var = x; | ||
return static_func_01(x); | ||
} | ||
|
||
int func_05(int x) { | ||
int res = static_var; | ||
return res + func_03(x); | ||
} |
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,12 @@ | ||
static int static_func(int); | ||
static int static_var = 0; | ||
|
||
int static_func(int x) { | ||
static_var++; | ||
return static_var + x; | ||
} | ||
|
||
int func_06(int x) { | ||
return static_func(x); | ||
} | ||
|
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,13 @@ | ||
static int static_func(int); | ||
static int static_var = 5; | ||
|
||
int static_func(int x) { | ||
static_var++; | ||
return static_var + x; | ||
} | ||
|
||
int func_07(int x) { | ||
static_var++; | ||
return static_func(x); | ||
} | ||
|
Binary file not shown.
Oops, something went wrong.