[llvm-objdump] Display locations of variables alongside disassembly
authorOliver Stannard <oliver.stannard@linaro.org>
Tue, 17 Mar 2020 14:21:42 +0000 (14:21 +0000)
committerOliver Stannard <oliver.stannard@linaro.org>
Thu, 9 Jul 2020 08:58:00 +0000 (09:58 +0100)
commitdc4a6f5db4f0178bae43ef615cc8902c759d6195
tree234634076b11b65bd52f62b9df1c4e6f35571fb5
parent1c7c5019a7adfb16e0449ffb1d0e10631998d854
[llvm-objdump] Display locations of variables alongside disassembly

This adds the --debug-vars option to llvm-objdump, which prints
locations (registers/memory) of source-level variables alongside the
disassembly based on DWARF info. A vertical line is printed for each
live-range, with a label at the top giving the variable name and
location, and the position and length of the line indicating the program
counter range in which it is valid.

Differential revision: https://reviews.llvm.org/D70720
12 files changed:
llvm/docs/CommandGuide/llvm-objdump.rst
llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
llvm/test/tools/llvm-objdump/ARM/Inputs/debug.c [new file with mode: 0644]
llvm/test/tools/llvm-objdump/ARM/Inputs/wide-char.c [new file with mode: 0644]
llvm/test/tools/llvm-objdump/ARM/debug-vars-dwarf4-sections.s [new file with mode: 0644]
llvm/test/tools/llvm-objdump/ARM/debug-vars-dwarf4.s [new file with mode: 0644]
llvm/test/tools/llvm-objdump/ARM/debug-vars-dwarf5-sections.s [new file with mode: 0644]
llvm/test/tools/llvm-objdump/ARM/debug-vars-dwarf5.s [new file with mode: 0644]
llvm/test/tools/llvm-objdump/ARM/debug-vars-wide-chars.s [new file with mode: 0644]
llvm/test/tools/llvm-objdump/PowerPC/debug-vars.s [new file with mode: 0644]
llvm/tools/llvm-objdump/llvm-objdump.cpp