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

Function main

tools/wasm-sourcemap.py:602–630  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

600
601
602def main(args):
603 options = parse_args(args)
604
605 wasm_input = options.wasm
606 with open(wasm_input, 'rb') as infile:
607 wasm = infile.read()
608
609 entries, func_ranges = read_dwarf_info(wasm_input, options)
610
611 code_section_offset = get_code_section_offset(wasm)
612
613 logger.debug('Saving to %s' % options.output)
614 map = build_sourcemap(entries, func_ranges, code_section_offset, options)
615 with open(options.output, 'w', encoding='utf-8') as outfile:
616 json.dump(map, outfile, separators=(',', ':'), ensure_ascii=False)
617
618 if options.strip:
619 wasm = strip_debug_sections(wasm)
620
621 if options.source_map_url:
622 wasm = append_source_mapping(wasm, options.source_map_url)
623
624 if options.w:
625 logger.debug('Saving wasm to %s' % options.w)
626 with open(options.w, 'wb') as outfile:
627 outfile.write(wasm)
628
629 logger.debug('Done')
630 return 0
631
632
633if __name__ == '__main__':

Callers 1

wasm-sourcemap.pyFile · 0.70

Calls 10

read_dwarf_infoFunction · 0.85
get_code_section_offsetFunction · 0.85
build_sourcemapFunction · 0.85
strip_debug_sectionsFunction · 0.85
append_source_mappingFunction · 0.85
dumpMethod · 0.80
parse_argsFunction · 0.70
openFunction · 0.50
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected