Skip to content

Commit 87980c0

Browse files
authored
Don't dump full debug info section when creating source maps (#9580)
wasm-sourcemap.py dumps the entire .debug_info section when creating source maps (which really only contains the info from the .debug_line section). It does this because it wants to find the compilation directory (DW_AT_comp_dir) associated with each compile unit, and remove it from the path of each file in the debug line section. However dumping the entire debug info section is very slow for large wasm files, and is unnecessary. Instead, only dump the top-level entities (the DW_TAG_compile_unit and don't recurse into their children). This goes a long way toward fixing #8948.
1 parent 881b6de commit 87980c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/wasm-sourcemap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def read_dwarf_entries(wasm, options):
178178
if not os.path.exists(options.dwarfdump):
179179
logger.error('llvm-dwarfdump not found: ' + options.dwarfdump)
180180
sys.exit(1)
181-
process = Popen([options.dwarfdump, "-debug-info", "-debug-line", wasm], stdout=PIPE)
181+
process = Popen([options.dwarfdump, '-debug-info', '-debug-line', '--recurse-depth=0', wasm], stdout=PIPE)
182182
output, err = process.communicate()
183183
exit_code = process.wait()
184184
if exit_code != 0:

0 commit comments

Comments
 (0)