From 495c652e9c1a212f6a9ee9435f111d2e50cba0c5 Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 11 May 2010 16:22:25 +0200 Subject: [PATCH] Added DebugLn --- Projects/Simba/Makefile | 4 ++-- Units/MMLAddon/PSInc/psexportedmethods.inc | 1 + Units/MMLAddon/mmlpsthread.pas | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Projects/Simba/Makefile b/Projects/Simba/Makefile index 9d79011..875ff1f 100644 --- a/Projects/Simba/Makefile +++ b/Projects/Simba/Makefile @@ -1,4 +1,4 @@ -#$ fpc -MObjFPC -Scgi -O2 -OoREGVAR -gl -vewnhi -l -Fu../../Units/MMLCore/ -Fu../../Units/MMLAddon/ -Fu../../Units/PascalScript/ -Fu../../Units/Misc/ -Fu../../../lazarus/components/synedit/units/x86_64-linux/ -Fu../../../lazarus/ideintf/units/x86_64-linux/ -Fu../../../lazarus/lcl/units/x86_64-linux/ -Fu../../../lazarus/lcl/units/x86_64-linux/gtk2/ -Fu../../../lazarus/packager/units/x86_64-linux/ -Fu. -oSAMufasaGUI -dUseCThreads -dM_MEMORY_DEBUG -dLCL -dLCLgtk2 project1.lpr +#$ fpc -MObjFPC -Scgi -O2 -OoREGVAR -gl -vewnhi -l -Fu../../Units/MMLCore/ -Fu../../Units/MMLAddon/ -Fu../../Units/PascalScript/ -Fu../../Units/Misc/ -Fu../../../lazarus/components/synedit/units/x86_64-linux/ -Fu../../../lazarus/ideintf/units/x86_64-linux/ -Fu../../../lazarus/lcl/units/x86_64-linux/ -Fu../../../lazarus/lcl/units/x86_64-linux/gtk2/ -Fu../../../lazarus/packager/units/x86_64-linux/ -Fu. -oSAMufasaGUI -dUseCThreads -dM_MEMORY_DEBUG -dLCL -dLCLgtk2 Simba.lpr .PHONY: default clean @@ -30,6 +30,6 @@ clean: rm -f *.o *.ppu $(binary) $(binary): - $(CC) $(flags) $(units) $(lazarusunits) -o$(binary) $(defines) project1.lpr + $(CC) $(flags) $(units) $(lazarusunits) -o$(binary) $(defines) Simba.lpr -Fu/usr/local/share/lazarus/ideintf/units/x86_64-linux/ diff --git a/Units/MMLAddon/PSInc/psexportedmethods.inc b/Units/MMLAddon/PSInc/psexportedmethods.inc index 7b5e25e..5db04c7 100644 --- a/Units/MMLAddon/PSInc/psexportedmethods.inc +++ b/Units/MMLAddon/PSInc/psexportedmethods.inc @@ -23,6 +23,7 @@ AddFunction(@ThreadSafeCall,'function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;'); AddFunction(@pswriteln,'procedure Writeln(x: string);'); //PS defines a special, keep this for CPascal +AddFunction(@ps_debugln,'procedure DebugLn(str : string);'); { DTM } diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index 247cc08..ea2f57f 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -247,6 +247,13 @@ begin mDebugLn(str); end; +procedure ps_DebugLn(str : string); extdecl; +begin + if CurrThread.Prop.WriteTimeStamp then + str := format('[%s]: %s', [TimeToStr(TimeStampToDateTime(MSecsToTimeStamp(GetTickCount - CurrThread.StartTime))), str]); + mDebugLn(str); +end; + function MakeString(data : TPSVariantIFC) : string; begin; if data.Dta = nil then