replaced write by DbgOut

git-svn-id: trunk@6021 -
This commit is contained in:
vincents 2004-09-17 20:30:13 +00:00
parent 97f219aa15
commit c1c08bbb99
13 changed files with 113 additions and 77 deletions

View File

@ -1087,10 +1087,10 @@ begin
{$IFDEF CTDEBUG}
WriteDebugReport(true,false,false,false,false);
{$ENDIF}
write('### TCodeToolManager.HandleException: "'+ErrorMessage+'"');
if ErrorLine>0 then write(' at Line=',ErrorLine);
if ErrorColumn>0 then write(' Col=',ErrorColumn);
if ErrorCode<>nil then write(' in "',ErrorCode.Filename,'"');
DbgOut('### TCodeToolManager.HandleException: "'+ErrorMessage+'"');
if ErrorLine>0 then DbgOut(' at Line=',DbgS(ErrorLine));
if ErrorColumn>0 then DbgOut(' Col=',DbgS(ErrorColumn));
if ErrorCode<>nil then DbgOut(' in "',ErrorCode.Filename,'"');
DebugLn('');
end;
// raise or catch

View File

@ -1831,12 +1831,12 @@ begin
FIgnoreErrorAfter:=AValue;
LastErrorCheckedForIgnored:=false;
{$IFDEF ShowIgnoreErrorAfter}
write('TCustomCodeTool.SetIgnoreErrorAfter ');
DbgOut'TCustomCodeTool.SetIgnoreErrorAfter ');
if FIgnoreErrorAfter.Code<>nil then
write(FIgnoreErrorAfter.Code.Filename)
DbgOutFIgnoreErrorAfter.Code.Filename)
else
write('nil');
write(' ',FIgnoreErrorAfter.P);
DbgOut'nil');
DbgOut' ',FIgnoreErrorAfter.P);
DebugLn('');
{$ENDIF}
if Scanner<>nil then
@ -1901,28 +1901,28 @@ procedure TCustomCodeTool.WriteDebugTreeReport;
procedure WriteSrcSubString(A,Len: integer);
var i: integer;
begin
write('"');
DbgOut('"');
for i:=A to A+Len-1 do begin
if (i>0) and (i<SrcLen) and (ord(Src[i])>31) then
write(Src[i]);
DbgOut(Src[i]);
end;
write('"');
DbgOut('"');
end;
procedure WriteSubTree(RootNode: TCodeTreeNode; Indent: string);
begin
while RootNode<>nil do begin
write(Indent);
DbgOut(Indent);
with RootNode do begin
write(NodeDescToStr(Desc),'(',NodeSubDescToStr(Desc,SubDesc),') ');
write(' Start=',StartPos,' ');
DbgOut(NodeDescToStr(Desc)+'('+NodeSubDescToStr(Desc,SubDesc)+') ');
DbgOut(' Start='+DbgS(StartPos),' ');
WriteSrcSubString(StartPos,5);
write(' End=',EndPos,' ');
DbgOut(' End='+DbgS(EndPos)+' ');
WriteSrcSubString(EndPos-5,5);
{$ifdef fpc}
write(' Self=',HexStr(Cardinal(RootNode),8));
write(' P=',HexStr(Cardinal(Parent),8));
write(' NB=',HexStr(Cardinal(NextBrother),8));
DbgOut(' Self=',HexStr(Cardinal(RootNode),8));
DbgOut(' P=',HexStr(Cardinal(Parent),8));
DbgOut(' NB=',HexStr(Cardinal(NextBrother),8));
//write(' PB=',HexStr(Cardinal(PriorBrother),8));
//write(' FC=',HexStr(Cardinal(FirstChild),8));
//write(' LC=',HexStr(Cardinal(LastChild),8));

View File

@ -3102,7 +3102,7 @@ var
if AnUnitName='' then exit;
UnitLink:=FindUnitLink(AnUnitName);
{$IFDEF VerboseFPCSrcScan}
write('AddFPCSourceLinkForUnit ',AnUnitName,' ');
DbgOut('AddFPCSourceLinkForUnit ',AnUnitName,' ');
if UnitLink<>nil then
DebugLn(' -> ',UnitLink.Filename)
else

View File

@ -96,6 +96,10 @@ procedure DebugLn(const s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12: string);
procedure DbgOut(const s: string);
procedure DbgOut(const s1,s2: string);
procedure DbgOut(const s1,s2,s3: string);
procedure DbgOut(const s1,s2,s3,s4: string);
procedure DbgOut(const s1,s2,s3,s4,s5: string);
procedure DbgOut(const s1,s2,s3,s4,s5,s6: string);
function DbgS(const c: cardinal): string;
function DbgS(const i: integer): string;
@ -909,6 +913,26 @@ begin
DbgOut(s1+s2);
end;
procedure DbgOut(const s1, s2, s3: string);
begin
DbgOut(s1+s2+s3);
end;
procedure DbgOut(const s1, s2, s3, s4: string);
begin
DbgOut(s1+s2+s3+s4);
end;
procedure DbgOut(const s1, s2, s3, s4, s5: string);
begin
DbgOut(s1+s2+s3+s4+s5);
end;
procedure DbgOut(const s1, s2, s3, s4, s5, s6: string);
begin
DbgOut(s1+s2+s3+s4+s5+s6);
end;
function DbgS(const c: cardinal): string;
begin
Result:=IntToStr(c);

View File

@ -900,8 +900,8 @@ begin
while Node<>nil do begin
Entry:=PCodeTreeNodeCacheEntry(Node.Data);
write(Prefix,' Ident="',GetIdentifier(Entry^.Identifier),'"');
write(' Flags=[',NodeCacheEntryFlagsAsString(Entry^.Flags),']');
write(' Node=',Entry^.NewNode<>nil);
DbgOut(' Flags=[',NodeCacheEntryFlagsAsString(Entry^.Flags),']');
DbgOut(' Node=',DbgS(Entry^.NewNode<>nil));
DebugLn('');
Node:=FItems.FindSuccessor(Node);
end;

View File

@ -1722,7 +1722,7 @@ begin
Params.SetResult(CleanFindContext);
end;
{$IFDEF CTDEBUG}
write('[TFindDeclarationTool.FindDeclarationOfIdentAtCursor] Ident=',
DbgOut'[TFindDeclarationTool.FindDeclarationOfIdentAtCursor] Ident=',
'"',GetIdentifier(Params.Identifier),'" ');
if Params.NewNode<>nil then
DebugLn('Node=',Params.NewNode.DescAsString,' ',Params.NewCodeTool.MainFilename)
@ -1821,7 +1821,7 @@ var
// cached result found
Params.SetResult(LastCacheEntry);
{$IFDEF ShowNodeCache}
write(':::: TFindDeclarationTool.FindIdentifierInContext.FindInNodeCache');
DbgOut':::: TFindDeclarationTool.FindIdentifierInContext.FindInNodeCache');
DebugLn(' Ident=',GetIdentifier(Params.Identifier),
' Wanted=[',NodeCacheEntryFlagsAsString(NodeCacheEntryFlags),']',
' Cache=[',NodeCacheEntryFlagsAsString(LastCacheEntry^.Flags),']'
@ -2772,10 +2772,10 @@ begin
FinalizeNodeStack(@NodeStack);
end;
{$IFDEF ShowFoundIdentifier}
write('[TFindDeclarationTool.FindBaseTypeOfNode] END Node=');
if Node<>nil then write(Node.DescAsString) else write('NIL');
write(' Result=');
if Result.Node<>nil then write(Result.Node.DescAsString) else write('NIL');
DbgOut'[TFindDeclarationTool.FindBaseTypeOfNode] END Node=');
if Node<>nil then DbgOutNode.DescAsString) else DbgOut'NIL');
DbgOut' Result=');
if Result.Node<>nil then DbgOutResult.Node.DescAsString) else DbgOut'NIL');
DebugLn('');
{$ENDIF}
end;
@ -3338,7 +3338,7 @@ function TFindDeclarationTool.FindExpressionResultType(
procedure inc(pointer var);
procedure inc(pointer var; ordinal type);
procedure write(...);
procedure DebugLn(...);
procedure writeln(...);
function SizeOf(type): ordinal constant;
typeinfo?
uniquestring?
@ -4854,12 +4854,12 @@ begin
RaiseIdentExpected;
{$IFDEF ShowExprEval}
write('[TFindDeclarationTool.ReadOperandTypeAtCursor] END ',
DbgOut'[TFindDeclarationTool.ReadOperandTypeAtCursor] END ',
ExpressionTypeDescNames[Result.Desc]);
if Result.Context.Node<>nil then
write(' Context.Node=',Result.Context.Node.DescAsString)
DbgOut' Context.Node=',Result.Context.Node.DescAsString)
else
write(' Context.Node=nil');
DbgOut' Context.Node=nil');
DebugLn('');
{$ENDIF}
end;
@ -6201,29 +6201,29 @@ begin
if beVerbose then begin
DebugLn('(((((((((((((((((((((((((((==================');
write('TFindDeclarationTool.AddResultToNodeCaches ',
DbgOut'TFindDeclarationTool.AddResultToNodeCaches ',
' Ident=',GetIdentifier(Params.Identifier));
write(' SearchedForward=',SearchedForward);
write(' Flags=[');
if ncefSearchedInParents in SearchRangeFlags then write('Parents');
if ncefSearchedInAncestors in SearchRangeFlags then write(',Ancestors');
DbgOut' SearchedForward=',SearchedForward);
DbgOut' Flags=[');
if ncefSearchedInParents in SearchRangeFlags then DbgOut'Parents');
if ncefSearchedInAncestors in SearchRangeFlags then DbgOut',Ancestors');
DebugLn(']');
write(' StartNode=',StartNode.DescAsString,
DbgOut' StartNode=',StartNode.DescAsString,
'(',StartNode.StartPos,'-',StartNode.EndPos,')=',
WriteSrcPos(Self,StartNode.StartPos));
NodeOwner:=FindOwnerOfCodeTreeNode(StartNode);
if NodeOwner<>Self then write(' StartNodeOwner=',NodeOwnerAsString(NodeOwner));
if NodeOwner<>Self then DbgOut' StartNodeOwner=',NodeOwnerAsString(NodeOwner));
DebugLn('');
if EndNode<>nil then
write(' EndNode=',EndNode.DescAsString,
DbgOut' EndNode=',EndNode.DescAsString,
'(',EndNode.StartPos,'-',EndNode.EndPos,')=',
WriteSrcPos(Self,EndNode.StartPos))
else
write(' EndNode=nil');
DbgOut' EndNode=nil');
NodeOwner:=FindOwnerOfCodeTreeNode(EndNode);
if NodeOwner<>Self then write(' EndNodeOwner=',NodeOwnerAsString(NodeOwner));
if NodeOwner<>Self then DbgOut' EndNodeOwner=',NodeOwnerAsString(NodeOwner));
DebugLn('');
DebugLn(' Self=',ExtractFileName(MainFilename));
@ -6311,16 +6311,16 @@ var i: integer;
BaseTypeCache: TBaseTypeCache;
begin
{$IFDEF ShowBaseTypeCache}
write('[TFindDeclarationTool.CreateBaseTypeCaches] ',
DbgOut'[TFindDeclarationTool.CreateBaseTypeCaches] ',
' StackPtr=',NodeStack^.StackPtr);
DebugLn(' Self=',MainFilename);
if Result.Node<>nil then
write(' Result=',Result.Node.DescAsString,
DbgOut' Result=',Result.Node.DescAsString,
' Start=',Result.Node.StartPos,
' End=',Result.Node.EndPos,
' "',copy(Src,Result.Node.StartPos,15),'" ',Result.Tool.MainFilename)
else
write(' Result=nil');
DbgOut' Result=nil');
DebugLn('');
{$ENDIF}
for i:=0 to (NodeStack^.StackPtr-1) do begin

View File

@ -1446,12 +1446,12 @@ begin
FIgnoreErrorAfterCursorPos:=ACursorPos;
LastErrorCheckedForIgnored:=false;
{$IFDEF ShowIgnoreErrorAfter}
write('TLinkScanner.SetIgnoreErrorAfter ');
DbgOut'TLinkScanner.SetIgnoreErrorAfter ');
if FIgnoreErrorAfterCode<>nil then
write(OnGetFileName(Self,FIgnoreErrorAfterCode))
DbgOutOnGetFileName(Self,FIgnoreErrorAfterCode))
else
write('nil');
write(' ',FIgnoreErrorAfterCursorPos);
DbgOut'nil');
DbgOut' ',IntToStr(FIgnoreErrorAfterCursorPos));
DebugLn('');
{$ENDIF}
end;

View File

@ -947,20 +947,20 @@ var
AVLNode: TAVLTreeNode;
ANodeExt: TCodeTreeNodeExtension;
begin
DebugLn('TMethodJumpingCodeTool.WriteCodeTreeNodeExtTree ExtTree.Count=',dbgs(ExtTree.Count));
DebugLn('TMethodJumpingCodeTool.WriteCodeTreeNodeExtTree ExtTree.Count=',DbgS(ExtTree.Count));
AVLNode:=ExtTree.FindLowest;
while AVLNode<>nil do begin
ANodeExt:=TCodeTreeNodeExtension(AVLNode.Data);
write(' ');
DbgOut(' ');
if ANodeExt.Node<>nil then begin
write('Node=',ANodeExt.Node.DescAsString,' Node.Start=',ANodeExt.Node.StartPos);
write(' "',StringToPascalConst(copy(Src,ANodeExt.Node.StartPos,30)),'"');
DbgOut('Node=',ANodeExt.Node.DescAsString,' Node.Start=',DbgS(ANodeExt.Node.StartPos));
DbgOut(' "',StringToPascalConst(copy(Src,ANodeExt.Node.StartPos,30)),'"');
end else
write('Node=nil');
write(' Position=',ANodeExt.Position);
write(' Txt="',ANodeExt.Txt,'"');
write(' ExtTxt1="',ANodeExt.ExtTxt1,'"');
write(' ExtTxt2="',ANodeExt.ExtTxt2,'"');
DbgOut('Node=nil');
DbgOut(' Position=',Dbgs(ANodeExt.Position));
DbgOut(' Txt="',ANodeExt.Txt,'"');
DbgOut(' ExtTxt1="',ANodeExt.ExtTxt1,'"');
DbgOut(' ExtTxt2="',ANodeExt.ExtTxt2,'"');
DebugLn();
AVLNode:=ExtTree.FindSuccessor(AVLNode);
end;

View File

@ -1100,7 +1100,7 @@ Begin
RaiseGDBException(SCannotFocus);
// EInvalidOperation.Create(SCannotFocus);
{$IFDEF VerboseFocus}
write('TCustomForm.SetActiveControl ',Name,':',ClassName,' FActive=',FActive);
DbgOut('TCustomForm.SetActiveControl ',Name,':',ClassName,' FActive=',DbgS(FActive));
if FActiveControl<>nil then
DebugLn(' OldActiveControl=',DbgSName(FActiveControl))
else
@ -1808,6 +1808,9 @@ end;
{ =============================================================================
$Log$
Revision 1.158 2004/09/17 20:30:13 vincents
replaced write by DbgOut
Revision 1.157 2004/09/15 07:57:59 micha
convert LM_SETFORMICON message to interface method

View File

@ -1177,8 +1177,8 @@ begin
tvsTopsNeedsUpdate,tvsTopItemNeedsUpdate,tvsBottomItemNeedsUpdate];
{$IFDEF TREEVIEW_DEBUG}
write('[TTreeNode.InternalMove] END Self=',HexStr(Cardinal(Self),8),' Self.Text=',Text
,' ANode=',ANode<>nil,' AddMode=',AddModeNames[AddMode]);
DbgOut('[TTreeNode.InternalMove] END Self=',HexStr(Cardinal(Self),8),' Self.Text=',Text
,' ANode=',DbgS(ANode<>nil),' AddMode=',AddModeNames[AddMode]);
if ANode<>nil then DbgOut(' ANode.Text=',ANode.Text);
DebugLn('');
{$ENDIF}
@ -4768,8 +4768,8 @@ end;
procedure TCustomTreeView.WriteDebugReport(const Prefix: string;
AllNodes: boolean);
begin
write(Prefix);
write('TCustomTreeView.WriteDebugReport Self=',HexStr(Cardinal(Self),8));
DbgOut(Prefix);
DbgOut('TCustomTreeView.WriteDebugReport Self=',HexStr(Cardinal(Self),8));
ConsistencyCheck;
DebugLn('');
if AllNodes then begin

View File

@ -321,7 +321,7 @@ begin
HashItem:=FDeviceContexts.FirstHashItem;
while (n<7) and (HashItem<>nil) do
begin
write(' ',HexStr(Cardinal(HashItem^.Item),8));
DbgOut(' ',HexStr(Cardinal(HashItem^.Item),8));
HashItem:=HashItem^.Next;
inc(n);
end;
@ -545,9 +545,9 @@ begin
for i:=AllWindows.Count-1 downto 0 do begin
ATransientWindow:=PTransientWindow(AllWindows[i]);
{$IFDEF VerboseTransient}
write('TGtkWidgetSet.UpdateTransientWindows Untransient ',i);
DbgOut('TGtkWidgetSet.UpdateTransientWindows Untransient ',i);
if ATransientWindow^.Component<>nil then
write(' ',ATransientWindow^.Component.Name,':',ATransientWindow^.Component.ClassName);
DbgOut(' ',ATransientWindow^.Component.Name,':',ATransientWindow^.Component.ClassName);
DebugLn('');
{$ENDIF}
gtk_window_set_transient_for(ATransientWindow^.GtkWindow,nil);
@ -667,12 +667,12 @@ var
{$ENDIF}
begin
{$IFDEF VerboseTransient}
write('TGtkWidgetSet.UntransientWindow ',HexStr(Cardinal(GtkWindow),8));
DbgOut('TGtkWidgetSet.UntransientWindow ',HexStr(Cardinal(GtkWindow),8));
LCLObject:=GetLCLObject(PGtkWidget(GtkWindow));
if LCLObject<>nil then
write(' LCLObject=',LCLObject.ClassName)
DbgOut(' LCLObject=',LCLObject.ClassName)
else
write(' LCLObject=nil');
DbgOut(' LCLObject=nil');
DebugLn('');
{$ENDIF}
// hide window, so that UpdateTransientWindows untransients it
@ -7496,7 +7496,7 @@ var
begin
{$IFDEF VerboseSizeMsg}
LCLControl:=TWinControl(GetLCLObject(Widget));
write('PPP TGtkWidgetSet.SetResizeRequest Widget=',HexStr(Cardinal(Widget),8));
DbgOut('PPP TGtkWidgetSet.SetResizeRequest Widget=',HexStr(Cardinal(Widget),8));
if (LCLControl<>nil) then begin
if LCLControl is TWinControl then
DebugLn(' ',LCLControl.Name,':',LCLControl.ClassName)
@ -7898,6 +7898,9 @@ end;
{ =============================================================================
$Log$
Revision 1.579 2004/09/17 20:30:13 vincents
replaced write by DbgOut
Revision 1.578 2004/09/17 10:56:25 micha
convert LM_SHORTCUT message to interface methods

View File

@ -3654,13 +3654,13 @@ begin
end else begin
{$IFDEF RaiseExceptionOnNilPointers}
LCLobject:=GetLCLObject(TheWidget);
write('GetWidgetOrigin ');
DbgOut('GetWidgetOrigin ');
if LCLObject=nil then
write(' LCLObject=nil')
DbgOut(' LCLObject=nil')
else if LCLObject is TControl then
write(' LCLObject=',TControl(LCLObject).Name,':',TControl(LCLObject).ClassName)
DbgOut(' LCLObject=',TControl(LCLObject).Name,':',TControl(LCLObject).ClassName)
else
write(' LCLObject=',TControl(LCLObject).ClassName);
DbgOut(' LCLObject=',TControl(LCLObject).ClassName);
DebugLn('');
RaiseException('GetWidgetOrigin Window=nil');
{$ENDIF}
@ -5123,7 +5123,7 @@ var
{$ENDIF}
begin
{$IFDEF VerboseSizeMsg}
write('SaveSizeNotification Widget=',HexStr(Cardinal(Widget),8));
DbgOut('SaveSizeNotification Widget=',HexStr(Cardinal(Widget),8));
LCLControl:=TWinControl(GetLCLObject(Widget));
if (LCLControl<>nil) then begin
if LCLControl is TWinControl then
@ -5169,14 +5169,14 @@ begin
// ' FixWidget=',HexStr(Cardinal(FixWidget),8),
// ' MainWidget=',HexStr(Cardinal(MainWidget),8));
end else begin
write('ERROR: SaveClientSizeNotification ',
DbgOut('ERROR: SaveClientSizeNotification ',
' LCLControl=',LCLControl.ClassName,
' FixWidget=',HexStr(Cardinal(FixWidget),8),
' MainWidget=',HexStr(Cardinal(MainWidget),8));
RaiseGDBException('SaveClientSizeNotification');
end;
end else begin
write('ERROR: SaveClientSizeNotification LCLControl=nil',
DbgOut('ERROR: SaveClientSizeNotification LCLControl=nil',
' FixWidget=',HexStr(Cardinal(FixWidget),8),
' MainWIdget=',HexStr(Cardinal(MainWidget),8));
RaiseGDBException('SaveClientSizeNotification');
@ -7282,6 +7282,9 @@ end;
{ =============================================================================
$Log$
Revision 1.309 2004/09/17 20:30:13 vincents
replaced write by DbgOut
Revision 1.308 2004/09/17 10:56:25 micha
convert LM_SHORTCUT message to interface methods

View File

@ -192,7 +192,7 @@ var
AForm: TCustomForm;
begin
{$IFDEF VerboseFocus}
write('TGtkWidgetSet.BringWindowToTop hWnd=',HexStr(Cardinal(hWnd),8));
DbgOut('TGtkWidgetSet.BringWindowToTop hWnd=',HexStr(Cardinal(hWnd),8));
LCLObject:=TControl(GetLCLObject(Pointer(hWnd)));
if LCLObject<>nil then
DebugLn(' LCLObject=',LCLObject.Name,':',LCLObject.ClassName)
@ -8687,6 +8687,9 @@ end;
{ =============================================================================
$Log$
Revision 1.367 2004/09/17 20:30:13 vincents
replaced write by DbgOut
Revision 1.366 2004/09/10 16:28:51 mattias
implemented very rudimentary TTabControl