Skip to content

Commit

Permalink
Add --dwarf-start=0 option to remove the file path in the output (#205
Browse files Browse the repository at this point in the history
)

* Add `--dwarf-start=0` option to remove the file path in output
  • Loading branch information
lebr0nli authored Jul 26, 2023
1 parent 7f3bf13 commit cdf889a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/one_gadget/fetchers/objdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def extra_options=(options)
# @param [Integer] stop The end address.
# @return [String] The CLI command to be executed.
def command(start: nil, stop: nil)
cmd = [bin, '--no-show-raw-insn', '-w', '-d', *@options, @file]
# --dwarf-start=0 is to make sure `suppress_bfd_header` is true to eliminate the file path in the output, see
# issue #204 for more details.
# Note: We might need to update this when the objdump act differently in the future.
cmd = [bin, '--dwarf-start=0', '--no-show-raw-insn', '-w', '-d', *@options, @file]
cmd.push('--start-address', start) if start
cmd.push('--stop-address', stop) if stop
::Shellwords.join(cmd)
Expand Down

0 comments on commit cdf889a

Please sign in to comment.