summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index a384d2cd5..0931a8180 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -1490,8 +1490,11 @@ private:
MixedArena allocator;
- // storage of source map locations until the section is placed at its final
- // location (shrinking LEBs may cause changes there)
+ // Storage of source map locations until the section is placed at its final
+ // location (shrinking LEBs may cause changes there).
+ //
+ // A null DebugLocation* indicates we have no debug information for that
+ // location.
std::vector<std::pair<size_t, const Function::DebugLocation*>>
sourceMapLocations;
size_t sourceMapLocationsSizeAtSectionStart;
@@ -1522,13 +1525,26 @@ class WasmBinaryReader {
Module& wasm;
MixedArena& allocator;
const std::vector<char>& input;
+
std::istream* sourceMap;
+
struct NextDebugLocation {
uint32_t availablePos;
uint32_t previousPos;
Function::DebugLocation next;
- };
- NextDebugLocation nextDebugLocation;
+ } nextDebugLocation;
+
+ // Whether debug info is present next or not in the next debug location. A
+ // debug location can contain debug info (file:line:col) or it might not. We
+ // need to track this boolean alongside |nextDebugLocation| - that is, we
+ // can't just do something like std::optional<DebugLocation> or such - as we
+ // still need to track the values in |next|, as later positions are relative
+ // to them. That is, if we have line number 100, then no debug info, and then
+ // line number 500, then when we get to 500 we will see "+400" which is
+ // relative to the last existing line number (we "skip" over the place without
+ // debug info).
+ bool nextDebugLocationHasDebugInfo;
+
bool debugInfo = true;
bool DWARF = false;
bool skipFunctionBodies = false;