From 76c8f82d5cf98171ff46ed4bf36791d3b891357f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 7 Feb 2017 11:24:57 -0800 Subject: asm2wasm debuginfo (#895) * parse file/line comments in asm.js into debug intrinsics * convert debug intrinsics into annotations, and print them * ignore --debuginfo if not emitting text, as wasm binaries don't support that yet * emit full debug info when -g and emitting text; when -g and emitting binary, all we can do is the Names section * update wasm.js --- src/wasm-js.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/wasm-js.cpp') diff --git a/src/wasm-js.cpp b/src/wasm-js.cpp index 2735f84f8..970214833 100644 --- a/src/wasm-js.cpp +++ b/src/wasm-js.cpp @@ -59,6 +59,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE load_asm2wasm(char *input) { prepare2wasm(); Asm2WasmPreProcessor pre; + pre.debugInfo = true; // FIXME: we must do this, as the input asm.js might have debug info input = pre.process(input); // proceed to parse and wasmify @@ -79,7 +80,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE load_asm2wasm(char *input) { module->memory.max = pre.memoryGrowth ? Address(Memory::kMaxSize) : module->memory.initial; if (wasmJSDebug) std::cerr << "wasming...\n"; - asm2wasm = new Asm2WasmBuilder(*module, pre.memoryGrowth, debug, false /* TODO: support imprecise? */, PassOptions(), false /* TODO: support optimizing? */, false /* TODO: support asm2wasm-i64? */); + asm2wasm = new Asm2WasmBuilder(*module, pre, debug, false /* TODO: support imprecise? */, PassOptions(), false /* TODO: support optimizing? */, false /* TODO: support asm2wasm-i64? */); asm2wasm->processAsm(asmjs); } -- cgit v1.2.3