Skip to content

Commit

Permalink
cli: Add --no-debug-syms option to 'inspect dump elf' sub-command
Browse files Browse the repository at this point in the history
Introduce the --no-debug-syms option to the 'inspect dump elf'
sub-command, so that users can decide whether to dump DWARF or ELF
symbols.

Signed-off-by: Daniel Müller <deso@posteo.net>
  • Loading branch information
d-e-s-o committed Dec 17, 2024
1 parent de34fc5 commit 1387ab7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------
- Added `--no-debug-syms` option to `inspect dump elf` sub-command


0.1.8
-----
- Significantly shortened tracing output when enabled (via `-v`)
Expand Down
3 changes: 3 additions & 0 deletions cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ pub mod inspect {
/// The path to the ELF file.
#[clap(short, long)]
pub path: PathBuf,
/// Dump ELF symbols instead of DWARF ones.
#[clap(long)]
pub no_debug_syms: bool,
}
}

Expand Down
9 changes: 7 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,13 @@ fn inspect(inspect: args::inspect::Inspect) -> Result<()> {
args::inspect::Dump::Breakpad(args::inspect::BreakpadDump { path }) => {
inspect::Source::from(inspect::Breakpad::new(path))
}
args::inspect::Dump::Elf(args::inspect::ElfDump { path }) => {
inspect::Source::from(inspect::Elf::new(path))
args::inspect::Dump::Elf(args::inspect::ElfDump {
path,
no_debug_syms,
}) => {
let mut elf = inspect::Elf::new(path);
elf.debug_syms = !no_debug_syms;
inspect::Source::from(elf)
}
};
let mut sym_infos = Vec::new();
Expand Down

0 comments on commit 1387ab7

Please sign in to comment.