瀏覽代碼

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

Nikolay Nikolov 1 年之前
父節點
當前提交
993db6cf32
共有 1 個文件被更改,包括 8 次插入0 次删除
  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