Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --dwarf-start=0 option to remove the file path in the output #205

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Changes from all 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
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
Loading