Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions llvm/docs/CommandGuide/llvm-objdump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,23 @@ OPTIONS
and at least one server URL was provided by the environment variable
``DEBUGINFOD_URLS``.

.. option:: --debug-vars=<format>
.. option:: --debug-indent=<width>

Distance to indent the source-level variable or inlined function display,
relative to the start of the disassembly. Defaults to 52 characters.

.. option:: --debug-inlined-funcs[=<format>]

Print the locations of inlined functions alongside disassembly.
``format`` may be ``unicode``, ``ascii`` or ``line``, defaulting to
``unicode`` if omitted.

.. option:: --debug-vars[=<format>]

Print the locations (in registers or memory) of source-level variables
alongside disassembly. ``format`` may be ``unicode`` or ``ascii``, defaulting
to ``unicode`` if omitted.

.. option:: --debug-vars-indent=<width>

Distance to indent the source-level variable display, relative to the start
of the disassembly. Defaults to 52 characters.

.. option:: -j, --section=<section1[,section2,...]>

Perform commands on the specified sections only. For Mach-O use
Expand Down
4 changes: 4 additions & 0 deletions llvm/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ Changes to the LLVM tools
* In llvm-objcopy/llvm-strip's ELF port, `--discard-locals` and `--discard-all` now allow and preserve symbols referenced by relocations.
([#47468](https://github.com/llvm/llvm-project/issues/47468))
* llvm-addr2line now supports a `+` prefix when specifying an address.
* llvm-objdump now supports the `--debug-inlined-funcs` flag that prints the
locations of inlined functions alongside disassembly. It also renames
`--debug-vars-indent` flag to `--debug-indent`.


Changes to LLDB
---------------------------------
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/tools/llvm-objdump/ELF/ARM/debug-vars-dwarf4.s
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

## Check that passing the default value for --debug-vars-indent (52) makes no
## change to the output.
# RUN: llvm-objdump %t.o -d --debug-vars --debug-vars-indent=52 | \
# RUN: llvm-objdump %t.o -d --debug-vars --debug-indent=52 | \
# RUN: FileCheck %s --check-prefix=RAW --strict-whitespace

# RUN: llvm-objdump %t.o -d --debug-vars --debug-vars-indent=30 | \
# RUN: llvm-objdump %t.o -d --debug-vars --debug-indent=30 | \
# RUN: FileCheck %s --check-prefix=INDENT --strict-whitespace

# RUN: llvm-objdump %t.o -d --debug-vars --no-show-raw-insn | \
Expand Down
10 changes: 10 additions & 0 deletions llvm/test/tools/llvm-objdump/X86/Inputs/debug-inlined-functions.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
int bar(int x, int y) {
int sum = x + y;
int mul = x * y;
return sum + mul;
}

int foo(int a, int b) {
int result = bar(a, b);
return result;
}
650 changes: 650 additions & 0 deletions llvm/test/tools/llvm-objdump/X86/debug-inlined-function.s

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion llvm/tools/llvm-objdump/ObjdumpOpts.td
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,13 @@ def debug_vars_EQ : Joined<["--"], "debug-vars=">,
Values<"unicode,ascii">;
def : Flag<["--"], "debug-vars">, Alias<debug_vars_EQ>, AliasArgs<["unicode"]>;

def debug_vars_indent_EQ : Joined<["--"], "debug-vars-indent=">,
def debug_inlined_funcs_EQ : Joined<["--"], "debug-inlined-funcs=">,
HelpText<"Print the locations of inlined functions alongside disassembly. "
"Supported formats: ascii, unicode (default) and line">,
Values<"unicode,ascii,line">;
def : Flag<["--"], "debug-inlined-funcs">, Alias<debug_inlined_funcs_EQ>, AliasArgs<["unicode"]>;

def debug_indent_EQ : Joined<["--"], "debug-indent=">,
HelpText<"Distance to indent the source-level variable display, "
"relative to the start of the disassembly">;

Expand Down
Loading
Loading