mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 22:46:01 +02:00
* fix for 12480, unify multiple styles of stderr debugmsgs
git-svn-id: trunk@12034 -
This commit is contained in:
parent
4f8838d731
commit
1f511e1b9a
@ -150,7 +150,7 @@ const
|
|||||||
|
|
||||||
procedure RegisterFPTools;
|
procedure RegisterFPTools;
|
||||||
{$ifdef DEBUG}
|
{$ifdef DEBUG}
|
||||||
Procedure FpToolsDebugMessage(AFileName, AText : string; ALine, APos : sw_word);
|
Procedure FpToolsDebugMessage(AFileName, AText : string; ALine, APos : string;nrline,nrpos:sw_word);
|
||||||
{$endif DEBUG}
|
{$endif DEBUG}
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -1652,13 +1652,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef DEBUG}
|
{$ifdef DEBUG}
|
||||||
Procedure FpToolsDebugMessage(AFileName, AText : string; ALine, APos : sw_word);
|
Procedure FpToolsDebugMessage(AFileName, AText : string; ALine, APos :string ;nrline,nrpos:sw_word);
|
||||||
begin
|
begin
|
||||||
AddToolMessage(AFileName,AText,Aline,APos);
|
AddToolMessage(AFileName,AText,nrline,nrPos);
|
||||||
UpdateToolMessages;
|
UpdateToolMessages;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
DebugMessage:=@FpToolsDebugMessage;
|
DebugMessageS:=@FpToolsDebugMessage;
|
||||||
{$endif DEBUG}
|
{$endif DEBUG}
|
||||||
END.
|
END.
|
||||||
|
@ -45,7 +45,7 @@ function combinepaths(relpath,basepath:String):String;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
{$ifdef combinedebug}
|
{$ifdef combinedebug}
|
||||||
debugmessageS({$i %file%},'combine in "'+relpath+'" and "'+basepath+'"',{$i %line%},'1');
|
debugmessageS({$i %file%},'combine in "'+relpath+'" and "'+basepath+'"',{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
if relpath='' then exit;
|
if relpath='' then exit;
|
||||||
@ -58,7 +58,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef combinedebug}
|
{$ifdef combinedebug}
|
||||||
debugmessageS({$i %file%},'combine out "'+relpath+'" and "'+basepath+'"',{$i %line%},'1');
|
debugmessageS({$i %file%},'combine out "'+relpath+'" and "'+basepath+'"',{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
result:=basepath+relpath;
|
result:=basepath+relpath;
|
||||||
@ -78,12 +78,12 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
{$ifdef wdebug}
|
{$ifdef wdebug}
|
||||||
debugmessageS({$i %file%},'TCHMWrapper: before sitemap creation ',{$i %line%},'1');
|
debugmessageS({$i %file%},'TCHMWrapper: before sitemap creation ',{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
findex:=TChmSiteMap.create(stindex);
|
findex:=TChmSiteMap.create(stindex);
|
||||||
ftopic:=TChmSiteMap.create(sttoc);
|
ftopic:=TChmSiteMap.create(sttoc);
|
||||||
{$ifdef wdebug}
|
{$ifdef wdebug}
|
||||||
debugmessageS({$i %file%},'TCHMWrapper: after sitemap creation ',{$i %line%},'1');
|
debugmessageS({$i %file%},'TCHMWrapper: after sitemap creation ',{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
floaded:=false;
|
floaded:=false;
|
||||||
end;
|
end;
|
||||||
@ -108,7 +108,7 @@ begin
|
|||||||
if not assigned (fchmr) then exit;
|
if not assigned (fchmr) then exit;
|
||||||
if floaded then exit;
|
if floaded then exit;
|
||||||
{$ifdef wdebug}
|
{$ifdef wdebug}
|
||||||
debugmessageS({$i %file%},'TCHMWrapper: indexfilename:'+fchmr.indexfile,{$i %line%},'1');
|
debugmessageS({$i %file%},'TCHMWrapper: indexfilename:'+fchmr.indexfile,{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
m:=fchmr.getobject(fchmr.indexfile);
|
m:=fchmr.getobject(fchmr.indexfile);
|
||||||
@ -116,7 +116,7 @@ begin
|
|||||||
if assigned(m) then
|
if assigned(m) then
|
||||||
begin
|
begin
|
||||||
{$ifdef wdebug}
|
{$ifdef wdebug}
|
||||||
debugmessageS({$i %file%},'TCHMWrapper: stream size loaded :'+inttostr(m.size),{$i %line%},'1');
|
debugmessageS({$i %file%},'TCHMWrapper: stream size loaded :'+inttostr(m.size),{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
findex.loadfromStream(m);
|
findex.loadfromStream(m);
|
||||||
end;
|
end;
|
||||||
@ -124,7 +124,7 @@ begin
|
|||||||
freeandnil(m);
|
freeandnil(m);
|
||||||
end;
|
end;
|
||||||
{$ifdef wdebug}
|
{$ifdef wdebug}
|
||||||
debugmessageS({$i %file%},'TCHMWrapper: loadindex after final ',{$i %line%},'1');
|
debugmessageS({$i %file%},'TCHMWrapper: loadindex after final ',{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
tli:=TopicLinks^.AddItem(fchmr.defaultpage);
|
tli:=TopicLinks^.AddItem(fchmr.defaultpage);
|
||||||
@ -138,7 +138,7 @@ begin
|
|||||||
IndexEntries^.Insert(NewIndexEntry( FormatAlias(item.text),ID,TLI));
|
IndexEntries^.Insert(NewIndexEntry( FormatAlias(item.text),ID,TLI));
|
||||||
end;
|
end;
|
||||||
{$ifdef wdebug}
|
{$ifdef wdebug}
|
||||||
debugmessageS({$i %file%},'TCHMWrapper: endloadindex ',{$i %line%},'1');
|
debugmessageS({$i %file%},'TCHMWrapper: endloadindex ',{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
floaded:=true;
|
floaded:=true;
|
||||||
result:=true;
|
result:=true;
|
||||||
@ -159,7 +159,7 @@ begin
|
|||||||
linedata:=Classes.TStringList.create;
|
linedata:=Classes.TStringList.create;
|
||||||
try
|
try
|
||||||
{$ifdef wdebug}
|
{$ifdef wdebug}
|
||||||
debugmessageS({$i %file%},'TCHMWrapper: Getting file '+name,{$i %line%},'1');
|
debugmessageS({$i %file%},'TCHMWrapper: Getting file '+name,{$i %line%},'1',0,0);
|
||||||
{$endif}
|
{$endif}
|
||||||
// if uppercase(name)='TABLE OF CONTENTS' Then
|
// if uppercase(name)='TABLE OF CONTENTS' Then
|
||||||
// m:=fchmr.getobject(fchmr.tocfile)
|
// m:=fchmr.getobject(fchmr.tocfile)
|
||||||
|
@ -635,7 +635,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Topic^.NamedMarks^.InsertStr(Name);
|
Topic^.NamedMarks^.InsertStr(Name);
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Adding Name "'+Name+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},' Adding Name "'+Name+'"',{$i %line%},'1',0,0);
|
||||||
{$endif WDEBUG}
|
{$endif WDEBUG}
|
||||||
AddChar(hscNamedMark);
|
AddChar(hscNamedMark);
|
||||||
end;
|
end;
|
||||||
@ -647,7 +647,7 @@ begin
|
|||||||
InAnchor:=true;
|
InAnchor:=true;
|
||||||
AddChar(hscLink);
|
AddChar(hscLink);
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Adding Link1 "'+HRef+'"'+' "'+url+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},' Adding Link1 "'+HRef+'"'+' "'+url+'"',{$i %line%},'1',0,0);
|
||||||
{$ENDIF WDEBUG}
|
{$ENDIF WDEBUG}
|
||||||
|
|
||||||
if pos('#',HRef)=1 then
|
if pos('#',HRef)=1 then
|
||||||
@ -655,7 +655,7 @@ begin
|
|||||||
HRef:=canonicalizeURL(URL,HRef);
|
HRef:=canonicalizeURL(URL,HRef);
|
||||||
LinkIndexes[LinkPtr]:=TopicLinks^.AddItem(HRef);
|
LinkIndexes[LinkPtr]:=TopicLinks^.AddItem(HRef);
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Adding Link2 "'+HRef+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},' Adding Link2 "'+HRef+'"',{$i %line%},'1',0,0);
|
||||||
{$ENDIF WDEBUG}
|
{$ENDIF WDEBUG}
|
||||||
Inc(LinkPtr);
|
Inc(LinkPtr);
|
||||||
end;
|
end;
|
||||||
@ -671,7 +671,7 @@ end;
|
|||||||
procedure THTMLTopicRenderer.DocUnknownTag;
|
procedure THTMLTopicRenderer.DocUnknownTag;
|
||||||
begin
|
begin
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Unknown tag "'+TagName+'" params "'+TagParams+'"' ,{$i %line%},'1');
|
DebugMessageS({$i %file%},' Unknown tag "'+TagName+'" params "'+TagParams+'"' ,{$i %line%},'1',0,0);
|
||||||
{$endif WDEBUG}
|
{$endif WDEBUG}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1300,7 +1300,7 @@ begin
|
|||||||
for I:=0 to Min(Topic^.LinkCount-1,High(LinkIndexes)-1) do
|
for I:=0 to Min(Topic^.LinkCount-1,High(LinkIndexes)-1) do
|
||||||
begin
|
begin
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Indexing links ('+inttostr(i)+')'+topiclinks^.at(linkindexes[i])^,{$i %line%},'1');
|
DebugMessageS({$i %file%},' Indexing links ('+inttostr(i)+')'+topiclinks^.at(linkindexes[i])^,{$i %line%},'1',0,0);
|
||||||
{$endif WDEBUG}
|
{$endif WDEBUG}
|
||||||
Topic^.Links^[I].FileID:=Topic^.FileID;
|
Topic^.Links^[I].FileID:=Topic^.FileID;
|
||||||
Topic^.Links^[I].Context:=EncodeHTMLCtx(Topic^.FileID,LinkIndexes[I]+1);
|
Topic^.Links^[I].Context:=EncodeHTMLCtx(Topic^.FileID,LinkIndexes[I]+1);
|
||||||
@ -1381,12 +1381,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},'(Topicinfo) Link before formatpath "'+link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},'(Topicinfo) Link before formatpath "'+link+'"',{$i %line%},'1',0,0);
|
||||||
{$ENDIF WDEBUG}
|
{$ENDIF WDEBUG}
|
||||||
|
|
||||||
Link:=FormatPath(Link);
|
Link:=FormatPath(Link);
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},'(Topicinfo) Link after formatpath "'+link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},'(Topicinfo) Link after formatpath "'+link+'"',{$i %line%},'1',0,0);
|
||||||
{$ENDIF WDEBUG}
|
{$ENDIF WDEBUG}
|
||||||
P:=Pos('#',Link);
|
P:=Pos('#',Link);
|
||||||
if P>0 then
|
if P>0 then
|
||||||
@ -1422,11 +1422,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},'(ReadTopic) Link before formatpath "'+link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},'(ReadTopic) Link before formatpath "'+link+'"',{$i %line%},'1',0,0);
|
||||||
{$ENDIF WDEBUG}
|
{$ENDIF WDEBUG}
|
||||||
Link:=FormatPath(Link);
|
Link:=FormatPath(Link);
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},'(ReadTopic) Link before formatpath "'+link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},'(ReadTopic) Link before formatpath "'+link+'"',{$i %line%},'1',0,0);
|
||||||
{$ENDIF WDEBUG}
|
{$ENDIF WDEBUG}
|
||||||
P:=Pos('#',Link);
|
P:=Pos('#',Link);
|
||||||
if P>0 then
|
if P>0 then
|
||||||
@ -1450,7 +1450,7 @@ begin
|
|||||||
if (HTMLFile=nil) then
|
if (HTMLFile=nil) then
|
||||||
begin
|
begin
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},'(ReadTopic) Filename not known: "'+link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},'(ReadTopic) Filename not known: "'+link+'"',{$i %line%},'1',0,0);
|
||||||
{$ENDIF WDEBUG}
|
{$ENDIF WDEBUG}
|
||||||
end;
|
end;
|
||||||
if (p>1) and (HTMLFile=nil) then
|
if (p>1) and (HTMLFile=nil) then
|
||||||
@ -1645,7 +1645,7 @@ begin
|
|||||||
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
||||||
Link:=FormatPath(Link);
|
Link:=FormatPath(Link);
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Looking for "'+Link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},' Looking for "'+Link+'"',{$i %line%},'1',0,0);
|
||||||
{$endif WDEBUG}
|
{$endif WDEBUG}
|
||||||
P:=Pos('#',Link);
|
P:=Pos('#',Link);
|
||||||
if P>0 then
|
if P>0 then
|
||||||
@ -1681,11 +1681,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Looking for "'+Link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},' Looking for "'+Link+'"',{$i %line%},'1',0,0);
|
||||||
{$endif WDEBUG}
|
{$endif WDEBUG}
|
||||||
Link:=FormatPath(Link);
|
Link:=FormatPath(Link);
|
||||||
{$IFDEF WDEBUG}
|
{$IFDEF WDEBUG}
|
||||||
DebugMessageS({$i %file%},' Looking for (after formatpath) "'+Link+'"',{$i %line%},'1');
|
DebugMessageS({$i %file%},' Looking for (after formatpath) "'+Link+'"',{$i %line%},'1',0,0);
|
||||||
{$endif WDEBUG}
|
{$endif WDEBUG}
|
||||||
P:=Pos('#',Link);
|
P:=Pos('#',Link);
|
||||||
if P>0 then
|
if P>0 then
|
||||||
|
@ -190,10 +190,10 @@ procedure RegisterWUtils;
|
|||||||
|
|
||||||
Procedure DebugMessage(AFileName, AText : string; ALine, APos : sw_word); // calls DebugMessage
|
Procedure DebugMessage(AFileName, AText : string; ALine, APos : sw_word); // calls DebugMessage
|
||||||
|
|
||||||
Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : string);
|
Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : string; nrLine, nrPos : sw_word);
|
||||||
|
|
||||||
type
|
type
|
||||||
TDebugMessage = procedure(AFileName, AText : string; ALine, APos : String);
|
TDebugMessage = procedure(AFileName, AText : string; ALine, APos : String; nrLine, nrPos : sw_word);
|
||||||
|
|
||||||
Const
|
Const
|
||||||
DebugMessageS : TDebugMessage = @WUtilsDebugMessage;
|
DebugMessageS : TDebugMessage = @WUtilsDebugMessage;
|
||||||
@ -1276,10 +1276,10 @@ end;
|
|||||||
|
|
||||||
Procedure DebugMessage(AFileName, AText : string; ALine, APos : sw_word); // calls DebugMessage
|
Procedure DebugMessage(AFileName, AText : string; ALine, APos : sw_word); // calls DebugMessage
|
||||||
begin
|
begin
|
||||||
WUtilsDebugMessage(Afilename,AText,inttostr(aline),inttostr(apos));
|
DebugMessageS(Afilename,AText,'','',aline,apos);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : string);
|
Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : string;nrLine, nrPos : sw_word);
|
||||||
begin
|
begin
|
||||||
writeln(stderr,AFileName,' (',ALine,',',APos,') ',AText);
|
writeln(stderr,AFileName,' (',ALine,',',APos,') ',AText);
|
||||||
flush(stderr);
|
flush(stderr);
|
||||||
|
Loading…
Reference in New Issue
Block a user