View Issue Details

IDProjectCategoryView StatusLast Update
0037504FPCMiscpublic2020-08-06 23:16
ReporterdevEric69 Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0037504: Evolution of fpc\3.0.4\source\packages\fcl-process\src\dbugintf.pp
DescriptionHello,

it's a request to merge an evolutionary patch which allows the display of the PID: it can be interesting to follow the same software (like a CGI-bin script) when it forks itself in a multi-users context.
TagsNo tags attached.
Fixed in Revision46301
FPCOldBugId
FPCTarget4.0.0
Attached Files

Activities

devEric69

2020-08-06 17:40

reporter  

differences_svn.diff (1,668 bytes)   
--- D:/programs/projects/checkout_cgi_url_sessions_login/cgi/dbugintf_1.pp	sam. mars  7 15:06:43 2009
+++ D:/programs/projects/checkout_cgi_url_sessions_login/cgi/dbugintf_2.pp	jeu. ao�t  6 17:13:59 2020
@@ -43,0 +44 @@ Function InitDebugClient : Boolean;
+Function InitDebugClient(const ShowOrNotPID: Boolean) : Boolean; overload;
@@ -49 +50 @@ ResourceString
-  SProcessID = 'Process %s';
+  SProcessID = 'Process %s (PID=%d)';
@@ -73,0 +75 @@ var
+  AlwaysDisplayPID : Boolean = False;
@@ -138 +140,4 @@ begin
-  Mesg.Msg:=Msg;
+  if AlwaysDisplayPID then
+    Mesg.Msg:=IntToStr(GetProcessID)+' '+Msg
+  else
+    Mesg.Msg:=Msg;
@@ -149 +154,4 @@ begin
-  Mesg.Msg:=Msg;
+  if AlwaysDisplayPID then
+    Mesg.Msg:=IntToStr(GetProcessID)+' '+Msg
+  else
+    Mesg.Msg:=Msg;
@@ -183 +191,4 @@ begin
-  Mesg.Msg:=Format(Msg,Args);
+  if AlwaysDisplayPID then
+    Mesg.Msg:=IntToStr(GetProcessID)+' '+Format(Msg,Args)
+  else
+    Mesg.Msg:=Format(Msg,Args);
@@ -195 +206,4 @@ begin
-  Mesg.Msg:=Format(Msg,Args);
+  if AlwaysDisplayPID then
+    Mesg.Msg:=IntToStr(GetProcessID)+' '+Format(Msg,Args)
+  else
+    Mesg.Msg:=Format(Msg,Args);
@@ -240 +254 @@ begin
-      Msg.Msg:=Format(SProcessID,[ApplicationName]);
+      Msg.Msg:=Format(SProcessID,[ApplicationName, GetProcessID]);
@@ -254 +268 @@ Var
-  
+
@@ -287 +301 @@ begin
-  Msg.Msg:=Format(SProcessID,[ApplicationName]);
+  Msg.Msg:=Format(SProcessID,[ApplicationName, GetProcessID]);
@@ -291,0 +306,6 @@ end;
+function InitDebugClient(const ShowOrNotPID: Boolean): Boolean;
+begin
+  AlwaysDisplayPID:= ShowOrNotPID;
+  Result:= InitDebugClient;
+end;
+
differences_svn.diff (1,668 bytes)   

devEric69

2020-08-06 17:45

reporter   ~0124622

test done:
~~~~~~~~~~
  dbugintf.InitDebugClient(True);
  dbugintf.SendDebug('Hello');
  dtToday:= Now;
  dbugintf.SendDateTime('SendDateTime\dtToday=', dtToday);
  dbugintf.SendDebug('SendDebug');
  dbugintf.SendDebugEx('SendDebugEx', dlError);
  dbugintf.SendDebugFmt('SendDebugFmt %s', ['hello_in_args']);
  dbugintf.SendDebugFmtEx('SendDebugFmtEx %s', ['hello_in_args'], dlError);
  dbugintf.SendInteger('SendInteger', 17, false);
  dbugintf.SendMethodEnter('meth_a');
  dbugintf.SendMethodExit('meth_a');
  dbugintf.SendPointer('SendPointer', Self);
  dbugintf.SendSeparator;

Michael Van Canneyt

2020-08-06 23:16

administrator   ~0124632

Applied the patch, thank you very much !

Issue History

Date Modified Username Field Change
2020-08-06 17:40 devEric69 New Issue
2020-08-06 17:40 devEric69 File Added: differences_svn.diff
2020-08-06 17:45 devEric69 Note Added: 0124622
2020-08-06 23:16 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-08-06 23:16 Michael Van Canneyt Status new => resolved
2020-08-06 23:16 Michael Van Canneyt Resolution open => fixed
2020-08-06 23:16 Michael Van Canneyt Fixed in Version => 3.3.1
2020-08-06 23:16 Michael Van Canneyt Fixed in Revision => 46301
2020-08-06 23:16 Michael Van Canneyt FPCTarget => 4.0.0
2020-08-06 23:16 Michael Van Canneyt Note Added: 0124632