Browse Source

WebAssembly debug info: use different LINE_BASE and LINE_RANGE on WebAssembly to
improve compatibility with WasmTime's debugger support

Nikolay Nikolov 10 months ago
parent
commit
993db6cf32
1 changed files with 8 additions and 0 deletions
  1. 8 0
      compiler/dbgdwarf.pas

+ 8 - 0
compiler/dbgdwarf.pas

@@ -282,8 +282,16 @@ implementation
       ;
 
     const
+{$ifdef WASM}
+      { WasmTime's debugger requires that:
+        (LINE_BASE<=0) and (SignedInt8(LINE_BASE + LINE_RANGE) > 0),
+        so we use different values for WebAssembly }
+      LINE_BASE   = 0;
+      LINE_RANGE  = 127;
+{$else WASM}
       LINE_BASE   = 1;
       LINE_RANGE  = 255;
+{$endif WASM}
       OPCODE_BASE = 13;
 
     const