From ec66e273e350c3d48df0ccaaf73c53b14485848f Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 13 Apr 2017 15:12:48 -0700 Subject: Replace text annotations with explicit file/line for debug info (#967) Rather than storing debug info as text annotations, store explicit file and line information. This will make it easier to experiment with outputting other serializations or representations (e.g. source maps), and will allow outputting debug info for binaries as well. --- src/wasm.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/wasm.h') diff --git a/src/wasm.h b/src/wasm.h index 9cfcb4ca8..b27fe6acb 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -510,8 +510,10 @@ public: std::vector localNames; std::map localIndices; - // node annotations, printed alongside the node in the text format - std::unordered_map annotations; + struct DebugLocation { + uint32_t fileIndex, lineNumber; + }; + std::unordered_map debugLocations; Function() : result(none) {} @@ -647,6 +649,7 @@ public: Name start; std::vector userSections; + std::vector debugInfoFileNames; MixedArena allocator; -- cgit v1.2.3