From 2c008ed0f6b4df485e939d8b8bfadf16d2427978 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Fri, 9 Nov 2018 11:09:42 -0600 Subject: [PATCH] Fix wasm-sourcemap when DWARF debug-line section has relative directories. --- tools/wasm-sourcemap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/wasm-sourcemap.py b/tools/wasm-sourcemap.py index 72d9411694cfb..c292adb2d5397 100755 --- a/tools/wasm-sourcemap.py +++ b/tools/wasm-sourcemap.py @@ -210,7 +210,7 @@ def read_dwarf_entries(wasm, options): include_directories = {'0': comp_dir} for dir in re.finditer(r"include_directories\[\s*(\d+)\] = \"([^\"]*)", line_chunk): - include_directories[dir.group(1)] = dir.group(2) + include_directories[dir.group(1)] = (comp_dir + '/' if dir.group(2)[0] != '/' else '') + dir.group(2) files = {} for file in re.finditer(r"file_names\[\s*(\d+)\]:\s+name: \"([^\"]*)\"\s+dir_index: (\d+)", line_chunk):