llvm-project/llvm/test/tools/llvm-symbolizer
James Henderson 759d5e6783 [llvm-symbolizer] Add switch to adjust addresses by fixed offset
If a stack trace or similar has a list of addresses from an executable
or DSO loaded at a variable address (e.g. due to ASLR), the addresses
will not directly correspond to the addresses stored in the object file.
If a user wishes to use llvm-symbolizer, they have to subtract the load
address from every address. This is somewhat inconvenient, especially as
the output of --print-address will result in the adjusted address being
listed, rather than the address coming from the stack trace, making it
harder to map results between the two.

This change adds a new switch to llvm-symbolizer --adjust-vma which
takes an offset, which is then used to automatically do this
calculation. The printed address remains the input address (allowing for
easy mapping), whilst the specified offset is applied to the addresses
when performing the lookup.

The switch is conceptually similar to llvm-objdump's new switch of the
same name (see D57051), which in turn mirrors a GNU switch. There is no
equivalent switch in addr2line.

Reviewed by: grimar

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

llvm-svn: 352195
2019-01-25 11:49:21 +00:00
..
Inputs llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
pdb [DebugInfo] Common behavior for error types 2018-08-31 17:41:58 +00:00
adjust-vma.s [llvm-symbolizer] Add switch to adjust addresses by fixed offset 2019-01-25 11:49:21 +00:00
basenames.s [llvm-symbolizer] Add support for --basenames/-s 2019-01-22 10:24:32 +00:00
basic.s [llvm-symbolizer] Add -exe, -e as aliases to -obj 2019-01-11 11:51:52 +00:00
coff-dwarf.test [llvm-symbolizer] Add support for -i and -inlines as aliases for -inlining 2019-01-24 00:34:09 +00:00
coff-exports.test [llvm-symbolizer] Add support for -i and -inlines as aliases for -inlining 2019-01-24 00:34:09 +00:00
dsym.test
dwo.test llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
fat.test
fission-ranges.test llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
flag-grouping.test [llvm-symbolizer] Add support for -i and -inlines as aliases for -inlining 2019-01-24 00:34:09 +00:00
functions.s [llvm-symbolizer] Improve compatibility of --functions with GNU addr2line 2019-01-23 17:27:48 +00:00
padding-x86_64.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
ppc64.test [lit, python] Always add quotes around the python path in lit 2018-08-06 22:37:44 +00:00
print_context.c Get rid of even more "%T" expansions, see <https://reviews.llvm.org/D35396>. 2017-08-20 17:05:22 +00:00
split-debug.test llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
split-dwarf-addr-object-relocation.test llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
split-dwarf-dwp.test llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
split-dwarf-multiple-cu.test llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
split-dwarf.test llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file) 2019-01-24 01:19:17 +00:00
sym-verbose.test
sym.test [llvm-symbolizer] Add support for -i and -inlines as aliases for -inlining 2019-01-24 00:34:09 +00:00