View Issue Details

IDProjectCategoryView StatusLast Update
0020605LazarusIDEpublic2012-01-06 18:32
ReporterBart Broersma Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWinMe 
Product Version0.9.31 (SVN) 
Summary0020605: Cannot buid IDE with -dCTDEBUG
DescriptionBecause I had troubles with CodeTools I tried building the IDE with -dCTDEBUG.
This failed with numerous errors concerning wrong parameters and wrong number of parameters to debugln statements in IdentComletionTools and CodeToolManager.
Steps To ReproduceTools -> Configure Build Lazarus -> Profile: Cleanup and Build All -> Options -dCTDEBUG -> Click "Build"
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

2011-11-01 11:59

 

codetools.ctdebug.diff (3,293 bytes)   
Index: components/codetools/codetoolmanager.pas
===================================================================
--- components/codetools/codetoolmanager.pas	(revision 33199)
+++ components/codetools/codetoolmanager.pas	(working copy)
@@ -1779,7 +1779,7 @@
     if ErrorCode<>nil then DbgOut(' in "',ErrorCode.Filename,'"');
     DebugLn('');
     {$IFDEF CTDEBUG}
-    WriteDebugReport(true,false,false,false,false);
+    WriteDebugReport(true,false,false,false,false,false);
     {$ENDIF}
   end;
 end;
@@ -1942,7 +1942,7 @@
 begin
   Result:=false;
   {$IFDEF CTDEBUG}
-  DebugLn('TCodeToolManager.FindDeclarationOfIdentifier A ',Code.Filename,' x=',x,' y=',y,' Identifier=',GetIdentifier(Identifier));
+  DebugLn('TCodeToolManager.FindDeclarationOfIdentifier A ',Code.Filename,' x=',DbgS(x),' y=',DbgS(y),' Identifier=',GetIdentifier(Identifier));
   {$ENDIF}
   if not InitCurCodeTool(Code) then exit;
   CursorPos.X:=X;
@@ -2559,7 +2559,7 @@
 begin
   Result:=false;
   {$IFDEF CTDEBUG}
-  DebugLn('TCodeToolManager.RemoveIdentifierDefinition A ',Code.Filename,' X=',X,' Y=',Y);
+  DebugLn('TCodeToolManager.RemoveIdentifierDefinition A ',Code.Filename,' X=',DbgS(X),' Y=',DbgS(Y));
   {$ENDIF}
   if not InitCurCodeTool(Code) then exit;
   CursorPos.X:=X;
@@ -2579,7 +2579,7 @@
 begin
   Result:=false;
   {$IFDEF CTDEBUG}
-  DebugLn('TCodeToolManager.RemoveWithBlock A ',Code.Filename,' X=',X,' Y=',Y);
+  DebugLn('TCodeToolManager.RemoveWithBlock A ',Code.Filename,' X=',DbgS(X),' Y=',DbgS(Y));
   {$ENDIF}
   if not InitCurCodeTool(Code) then exit;
   CursorPos.X:=X;
@@ -2599,7 +2599,9 @@
 begin
   Result:=false;
   {$IFDEF CTDEBUG}
-  DebugLn('TCodeToolManager.AddWithBlock A ',Code.Filename,' X1=',X1,' Y1=',Y1,' X2=',X2,' Y2=',Y2,' WithExpr="',WithExpr,'"');
+  //Breaking this up, else too many parameters for debugln
+  DbgOut('TCodeToolManager.AddWithBlock A ',Code.Filename,' X1=',DbgS(X1),' Y1=',DbgS(Y1));
+  Debugln(' X2=',DbgS(X2),' Y2=',DbgS(Y2),' WithExpr="',WithExpr,'"');
   {$ENDIF}
   if not InitCurCodeTool(Code) then exit;
   StartPos.X:=X1;
@@ -3469,7 +3471,7 @@
   const Proc: TGetStrProc): boolean;
 begin
   {$IFDEF CTDEBUG}
-  DebugLn('TCodeToolManager.GetCompatiblePublishedMethods A ',Code.Filename,' Classname=',AClassname,' Instance=',DbgSName(Instance),' PropName=',PropName);
+  DebugLn('TCodeToolManager.GetCompatiblePublishedMethods A ',Code.Filename,' Classname=',AClassname,' PropInstance=',DbgSName(PropInstance),' PropName=',PropName);
   {$ENDIF}
   Result:=false;
   if not InitCurCodeTool(Code) then exit;
Index: components/codetools/identcompletiontool.pas
===================================================================
--- components/codetools/identcompletiontool.pas	(revision 33199)
+++ components/codetools/identcompletiontool.pas	(working copy)
@@ -1708,7 +1708,7 @@
 
   // build code tree
   {$IFDEF CTDEBUG}
-  DebugLn('TIdentCompletionTool.ParseSourceTillCollectionStart A CursorPos=',dbgs(CursorPos.X),',',dbgs(CursorPos.Y),' ',Dbgs(IdentStartXYPos));
+  DebugLn('TIdentCompletionTool.ParseSourceTillCollectionStart A CursorPos=',dbgs(CursorPos.X),',',dbgs(CursorPos.Y));
   {$ENDIF}
   BuildTreeAndGetCleanPos(trTillCursor,lsrEnd,CursorPos,CleanCursorPos,
                           [btSetIgnoreErrorPos]);
codetools.ctdebug.diff (3,293 bytes)   

Bart Broersma

2011-11-01 11:59

developer   ~0053711

Possible patch attached.

Mattias Gaertner

2011-11-01 17:28

manager   ~0053723

The flag CTDebug is not supported.

Bart Broersma

2011-11-01 17:40

developer   ~0053724

In codetools there are numerous occurrences of {$IFDEF CTDEBUG} {$ENDIF}.
IMHO either the code between these ifdefs should compile if the condition was defined, or else we should get rid of these defines and the code inside it.

Mattias Gaertner

2011-11-01 20:37

manager   ~0053725

The ctdebug are used. But they are not supposed to be enabled all at once nor give any useful information for users. They are enabled for single files and are fixed/adapted when some part needs debugging. Some do not work in all cases, i.e. may access nil pointers when called in some corner contexts. So even fixing the syntax won't make them right. They are used by the developers, mainly me.
You can send a patch to fix those you need, but there is no guarantee that the next change will not break those again.

In short: The ctdebug is not supported.

Similar can be said, although to a lesser degree, about the VerboseXXX flags.

Mattias Gaertner

2012-01-06 14:36

manager   ~0055501

It compiles now, but be warned: They do not check if pointers are set. So you can get AV.

Bart Broersma

2012-01-06 18:32

developer   ~0055515

Thanks for the explantion.

Issue History

Date Modified Username Field Change
2011-11-01 11:48 Bart Broersma New Issue
2011-11-01 11:48 Bart Broersma LazTarget => -
2011-11-01 11:59 Bart Broersma File Added: codetools.ctdebug.diff
2011-11-01 11:59 Bart Broersma Note Added: 0053711
2011-11-01 17:28 Mattias Gaertner Note Added: 0053723
2011-11-01 17:28 Mattias Gaertner Assigned To => Mattias Gaertner
2011-11-01 17:28 Mattias Gaertner Status new => resolved
2011-11-01 17:28 Mattias Gaertner Resolution open => won't fix
2011-11-01 17:40 Bart Broersma Status resolved => assigned
2011-11-01 17:40 Bart Broersma Resolution won't fix => reopened
2011-11-01 17:40 Bart Broersma Note Added: 0053724
2011-11-01 20:37 Mattias Gaertner Note Added: 0053725
2012-01-06 14:36 Mattias Gaertner Note Added: 0055501
2012-01-06 14:36 Mattias Gaertner Status assigned => resolved
2012-01-06 14:36 Mattias Gaertner Resolution reopened => fixed
2012-01-06 18:32 Bart Broersma Status resolved => closed
2012-01-06 18:32 Bart Broersma Note Added: 0055515