Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
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
26 changes: 16 additions & 10 deletions llvm/docs/CommandGuide/llvm-objdump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,29 @@ OPTIONS
debug information for stripped binaries. Multiple instances of this argument
are searched in the order given.

.. option:: --debuginfod, --no-debuginfod
.. option:: --debug-indent=<width>

Whether or not to try debuginfod lookups for debug binaries. Unless specified,
debuginfod is only enabled if libcurl was compiled in (``LLVM_ENABLE_CURL``)
and at least one server URL was provided by the environment variable
``DEBUGINFOD_URLS``.
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>]

.. option:: --debug-vars=<format>
Print the locations of inlined functions alongside disassembly.
``format`` may be ``ascii``, ``limits-only``, or ``unicode``, 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
alongside disassembly. ``format`` may be ``ascii`` or ``unicode``, defaulting
to ``unicode`` if omitted.

.. option:: --debug-vars-indent=<width>
.. option:: --debuginfod, --no-debuginfod

Distance to indent the source-level variable display, relative to the start
of the disassembly. Defaults to 52 characters.
Whether or not to try debuginfod lookups for debug binaries. Unless specified,
debuginfod is only enabled if libcurl was compiled in (``LLVM_ENABLE_CURL``)
and at least one server URL was provided by the environment variable
``DEBUGINFOD_URLS``.

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

Expand Down
3 changes: 3 additions & 0 deletions llvm/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ Changes to the LLVM tools
([#47468](https://github.com/llvm/llvm-project/issues/47468))
* llvm-addr2line now supports a `+` prefix when specifying an address.
* Support for `SHT_LLVM_BB_ADDR_MAP` versions 0 and 1 has been dropped.
* llvm-objdump now supports the `--debug-inlined-funcs` flag, which prints the
locations of inlined functions alongside disassembly. The
`--debug-vars-indent` flag has also been renamed 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.cc
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;
}
643 changes: 643 additions & 0 deletions llvm/test/tools/llvm-objdump/X86/debug-inlined-functions.s

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions llvm/tools/llvm-objdump/ObjdumpOpts.td
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,23 @@ defm prefix_strip
"paths. No effect without --prefix">,
MetaVarName<"prefix">;

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

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

def debug_vars_EQ : Joined<["--"], "debug-vars=">,
HelpText<"Print the locations (in registers or memory) of "
"source-level variables alongside disassembly. "
"Supported formats: ascii, unicode (default)">,
Values<"unicode,ascii">;
Values<"ascii,unicode">;
def : Flag<["--"], "debug-vars">, Alias<debug_vars_EQ>, AliasArgs<["unicode"]>;

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

def x86_asm_syntax_att : Flag<["--"], "x86-asm-syntax=att">,
HelpText<"Emit AT&T-style disassembly">;

Expand Down
Loading
Loading