| 294 | |
| 295 | |
| 296 | def get_args(): |
| 297 | parser = argparse.ArgumentParser() |
| 298 | parser.add_argument('-s', '--source', choices=['dwarf', 'sourcemap', |
| 299 | 'names', 'symtab', 'symbolmap'], |
| 300 | help='Force debug info source type', default=()) |
| 301 | parser.add_argument('-f', '--file', action='store', |
| 302 | help='Force debug info source file') |
| 303 | parser.add_argument('-t', '--addrtype', choices=['code', 'file'], |
| 304 | default='file', |
| 305 | help='Address type (code section or file offset)') |
| 306 | parser.add_argument('-v', '--verbose', action='store_true', |
| 307 | help='Print verbose info for debugging this script') |
| 308 | parser.add_argument('wasm_file', help='Wasm file') |
| 309 | parser.add_argument('address', help='Address to lookup') |
| 310 | args = parser.parse_args() |
| 311 | if args.verbose: |
| 312 | shared.PRINT_SUBPROCS = 1 |
| 313 | shared.DEBUG = True |
| 314 | return args |
| 315 | |
| 316 | |
| 317 | if __name__ == '__main__': |