MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / main

Function main

tools/emsymbolizer.py:261–293  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

259
260
261def main(args):
262 with webassembly.Module(args.wasm_file) as module:
263 base = 16 if args.address.lower().startswith('0x') else 10
264 address = int(args.address, base)
265
266 if args.addrtype == 'code':
267 address += get_codesec_offset(module)
268
269 def print_loc(loc):
270 if isinstance(loc, list):
271 for l in loc:
272 l.print()
273 else:
274 loc.print()
275
276 if ((has_debug_line_section(module) and not args.source) or
277 'dwarf' in args.source):
278 print_loc(symbolize_address_symbolizer(module, address))
279 elif ((get_sourceMappingURL_section(module) and not args.source) or
280 'sourcemap' in args.source):
281 print_loc(symbolize_address_sourcemap(module, address, args.file))
282 elif ((has_name_section(module) and not args.source) or
283 'names' in args.source):
284 print_loc(symbolize_address_symbolizer(module, address))
285 elif ((has_linking_section(module) and not args.source) or
286 'symtab' in args.source):
287 print_loc(symbolize_address_symbolizer(module, address))
288 elif (args.source == 'symbolmap'):
289 print_loc(symbolize_address_symbolmap(module, address, args.file))
290 else:
291 raise Error('No .debug_line or sourceMappingURL section found in '
292 f'{module.filename}.'
293 " I don't know how to symbolize this file yet")
294
295
296def get_args():

Callers 1

emsymbolizer.pyFile · 0.70

Calls 11

get_codesec_offsetFunction · 0.85
has_debug_line_sectionFunction · 0.85
print_locFunction · 0.85
has_name_sectionFunction · 0.85
has_linking_sectionFunction · 0.85
lowerMethod · 0.80
ErrorClass · 0.70

Tested by

no test coverage detected