From 0e1c6a7deef58707f443c5e8de478ac5c929da05 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sun, 5 Jul 2015 15:54:04 -0700 Subject: [PATCH] Improve dwarf_decode_address sample a bit Accept file + address from command line, instead of hard-coding an address. --- examples/dwarf_decode_address.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/dwarf_decode_address.py b/examples/dwarf_decode_address.py index dffc178..8b473f1 100644 --- a/examples/dwarf_decode_address.py +++ b/examples/dwarf_decode_address.py @@ -79,6 +79,8 @@ def decode_file_line(dwarfinfo, address): if __name__ == '__main__': - for filename in sys.argv[1:]: - # For testing we use a hardcoded address. - process_file(filename, 0x400503) + if len(sys.argv) < 3: + print('Expected usage: {0}
'.format(sys.argv[0])) + sys.exit(1) + addr = int(sys.argv[1], 0) + process_file(sys.argv[2], addr) -- 2.30.2