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 2b27948783, reverted
in 39fec5457c because the test
llvm/test/Support/interrupts.test started failing on Windows. The test was
changed in 18f036d010 and is also updated in
this commit.
Differential Revision: https://reviews.llvm.org/D149759
26 lines
340 B
C++
26 lines
340 B
C++
#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);
|
|
}
|