Răsfoiți Sursa

- removed the DebugWriteXXX functions from the WASI system unit, since console
output is now quite stable and can be used for debugging

Nikolay Nikolov 3 ani în urmă
părinte
comite
a62c7555d7
2 a modificat fișierele cu 1 adăugiri și 59 ștergeri
  1. 0 58
      rtl/wasi/system.pp
  2. 1 1
      rtl/wasm32/setjump.inc

+ 0 - 58
rtl/wasi/system.pp

@@ -71,14 +71,6 @@ var
 
 function ConvertToFdRelativePath(path: ansistring; out fd: LongInt; out relfd_path: ansistring): Boolean;
 
-procedure DebugWrite(const P: PChar);
-procedure DebugWriteLn(const P: PChar);
-procedure DebugWriteChar(Ch: Char);
-procedure DebugWriteHexDigit(d: Byte);
-procedure DebugWriteHexByte(b: Byte);
-procedure DebugWriteHexWord(w: Word);
-procedure DebugWriteHexLongWord(lw: LongWord);
-
 implementation
 
 {$I wasitypes.inc}
@@ -310,56 +302,6 @@ function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
 begin
 end;
 
-procedure DebugWrite(const P: PChar);
-var
-  our_iov: __wasi_ciovec_t;
-  our_nwritten: longint;
-begin
-  our_iov.buf := PByte(P);
-  our_iov.buf_len := StrLen(P);
-  __wasi_fd_write(1, @our_iov, 1, @our_nwritten);
-end;
-
-procedure DebugWriteLn(const P: PChar);
-begin
-  DebugWrite(P);
-  DebugWriteChar(#10);
-end;
-
-procedure DebugWriteChar(Ch: Char);
-var
-  CharArr: array [0..1] of Char;
-begin
-  CharArr[0] := Ch;
-  CharArr[1] := #0;
-  DebugWrite(@CharArr);
-end;
-
-procedure DebugWriteHexDigit(d: Byte);
-const
-  HexDigits: array [0..15] of Char = '0123456789ABCDEF';
-begin
-  DebugWriteChar(HexDigits[d]);
-end;
-
-procedure DebugWriteHexByte(b: Byte);
-begin
-  DebugWriteHexDigit(b shr 4);
-  DebugWriteHexDigit(b and 15);
-end;
-
-procedure DebugWriteHexWord(w: Word);
-begin
-  DebugWriteHexByte(w shr 8);
-  DebugWriteHexByte(Byte(w));
-end;
-
-procedure DebugWriteHexLongWord(lw: LongWord);
-begin
-  DebugWriteHexWord(lw shr 16);
-  DebugWriteHexWord(Word(lw));
-end;
-
 begin
   { To be set if this is a GUI or console application }
   IsConsole := TRUE;

+ 1 - 1
rtl/wasm32/setjump.inc

@@ -23,7 +23,7 @@ function fpc_setjmp(var S : jmp_buf) : longint;[Public, alias : 'FPC_SETJMP'];co
 procedure fpc_longjmp(var S : jmp_buf;value : longint);[Public, alias : 'FPC_LONGJMP'];compilerproc;
   begin
 {$ifndef embedded}
-    DebugWriteLn('LONGJMP not supported in WebAssembly!!!');
+    WriteLn(StdErr,'LONGJMP not supported in WebAssembly!!!');
 {$endif embedded}
     fpc_wasm32_unreachable;
   end;