Explorar o código

amicommon: basic common debug facilities, influenced by Debug/DebugLn of the AROS port

git-svn-id: trunk@28694 -
Károly Balogh %!s(int64=11) %!d(string=hai) anos
pai
achega
55d85fffad
Modificáronse 3 ficheiros con 64 adicións e 0 borrados
  1. 2 0
      .gitattributes
  2. 44 0
      rtl/amicommon/osdebug.inc
  3. 18 0
      rtl/amicommon/osdebugh.inc

+ 2 - 0
.gitattributes

@@ -7866,6 +7866,8 @@ rtl/aix/unxfunc.inc svneol=native#text/plain
 rtl/amicommon/README.TXT svneol=native#text/plain
 rtl/amicommon/classes.pp svneol=native#text/plain
 rtl/amicommon/dos.pp svneol=native#text/plain
+rtl/amicommon/osdebug.inc svneol=native#text/plain
+rtl/amicommon/osdebugh.inc svneol=native#text/plain
 rtl/amicommon/rtldefs.inc svneol=native#text/plain
 rtl/amicommon/sysdir.inc svneol=native#text/plain
 rtl/amicommon/sysfile.inc svneol=native#text/plain

+ 44 - 0
rtl/amicommon/osdebug.inc

@@ -0,0 +1,44 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2014 by Free Pascal development team
+
+    Platform specific debug functions for Amiga-like systems
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ Basic system-specific debug facility. Logs to the primary log source, which is 
+  usually the serial port or where the serial log is redirected to (eg. RamDebug
+  on MorphOS) We could also use some barely-documented RawDoFmt() blackmagic here
+  specifying "1" as PutChProc pointer, but it doesn't really matter, because
+  RawDoFmt() will just call RawPutChar internally in that case (KB) }
+
+procedure SysDebug(const s: RawByteString); platform;
+var
+  i: LongInt;
+begin
+  if s <> '' then
+    for i:=1 to Length(s) do
+      RawPutChar(s[i]);
+end;
+
+procedure SysDebugLn(const s: RawByteString); platform;
+var
+  i: LongInt;
+begin
+  if s <> '' then
+    for i:=1 to Length(s) do
+      RawPutChar(LongWord(s[i]));
+  RawPutChar(LongWord(#10));
+end;
+
+procedure SysDebugLn; {$IFDEF SYSTEMINLINE}inline;{$ENDIF} platform;
+begin
+  RawPutChar(LongWord(#10));
+end;

+ 18 - 0
rtl/amicommon/osdebugh.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2014 by Free Pascal development team
+
+    Platform specific debug functions for Amiga-like systems
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+procedure SysDebug(const s: RawByteString);
+procedure SysDebugLn(const s: RawByteString);
+procedure SysDebugLn;