diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-02-07 11:24:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-07 11:24:57 -0800 |
commit | 76c8f82d5cf98171ff46ed4bf36791d3b891357f (patch) | |
tree | ab251df55b1274b053896b10b14faf2ac8e526cd /src/wasm-js.cpp | |
parent | 985bcba6239792ebcb3808f1066ca6ea20ac5688 (diff) | |
download | binaryen-76c8f82d5cf98171ff46ed4bf36791d3b891357f.tar.gz binaryen-76c8f82d5cf98171ff46ed4bf36791d3b891357f.tar.bz2 binaryen-76c8f82d5cf98171ff46ed4bf36791d3b891357f.zip |
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
Diffstat (limited to 'src/wasm-js.cpp')
-rw-r--r-- | src/wasm-js.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |