Przeglądaj źródła

* fix for 12480, unify multiple styles of stderr debugmsgs

git-svn-id: trunk@12034 -
marco 16 lat temu
rodzic
commit
1f511e1b9a
4 zmienionych plików z 30 dodań i 30 usunięć
  1. 4 4
      ide/fptools.pas
  2. 9 9
      ide/wchmhwrap.pas
  3. 13 13
      ide/whtmlhlp.pas
  4. 4 4
      ide/wutils.pas

+ 4 - 4
ide/fptools.pas

@@ -150,7 +150,7 @@ const
 
 procedure RegisterFPTools;
 {$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}
 
 implementation
@@ -1652,13 +1652,13 @@ begin
 end;
 
 {$ifdef DEBUG}
-Procedure FpToolsDebugMessage(AFileName, AText : string; ALine, APos : sw_word);
+Procedure FpToolsDebugMessage(AFileName, AText : string; ALine, APos :string ;nrline,nrpos:sw_word);
 begin
-  AddToolMessage(AFileName,AText,Aline,APos);
+  AddToolMessage(AFileName,AText,nrline,nrPos);
   UpdateToolMessages;
 end;
 
 begin
-  DebugMessage:=@FpToolsDebugMessage;
+  DebugMessageS:=@FpToolsDebugMessage;
 {$endif DEBUG}
 END.

+ 9 - 9
ide/wchmhwrap.pas

@@ -45,7 +45,7 @@ function combinepaths(relpath,basepath:String):String;
 
 begin
   {$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}
 
   if relpath='' then exit;
@@ -58,7 +58,7 @@ begin
      end;
        
    {$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}
   
   result:=basepath+relpath;
@@ -78,12 +78,12 @@ begin
       exit;  
     end;      
   {$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}
   findex:=TChmSiteMap.create(stindex);
   ftopic:=TChmSiteMap.create(sttoc);
   {$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}
   floaded:=false;
 end;
@@ -108,7 +108,7 @@ begin
  if not assigned (fchmr) then exit;
  if floaded then exit;
  {$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}
   
   m:=fchmr.getobject(fchmr.indexfile);
@@ -116,7 +116,7 @@ begin
    if assigned(m) then
      begin
       {$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}
       findex.loadfromStream(m);
     end;
@@ -124,7 +124,7 @@ begin
     freeandnil(m);
     end;
    {$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}
   
   tli:=TopicLinks^.AddItem(fchmr.defaultpage); 
@@ -138,7 +138,7 @@ begin
       IndexEntries^.Insert(NewIndexEntry(  FormatAlias(item.text),ID,TLI));
     end;
    {$ifdef wdebug}
-     debugmessageS({$i %file%},'TCHMWrapper: endloadindex ',{$i %line%},'1'); 
+     debugmessageS({$i %file%},'TCHMWrapper: endloadindex ',{$i %line%},'1',0,0); 
   {$endif}
   floaded:=true;
   result:=true;
@@ -159,7 +159,7 @@ begin
   linedata:=Classes.TStringList.create;
   try
     {$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}
 //    if uppercase(name)='TABLE OF CONTENTS' Then
   //    m:=fchmr.getobject(fchmr.tocfile)

+ 13 - 13
ide/whtmlhlp.pas

@@ -635,7 +635,7 @@ begin
         begin
           Topic^.NamedMarks^.InsertStr(Name);
 {$IFDEF WDEBUG}
-          DebugMessageS({$i %file%},' Adding Name "'+Name+'"',{$i %line%},'1');
+          DebugMessageS({$i %file%},' Adding Name "'+Name+'"',{$i %line%},'1',0,0);
 {$endif WDEBUG}
           AddChar(hscNamedMark);
         end;
@@ -647,7 +647,7 @@ begin
               InAnchor:=true;
               AddChar(hscLink);
 {$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}
               
               if pos('#',HRef)=1 then
@@ -655,7 +655,7 @@ begin
               HRef:=canonicalizeURL(URL,HRef);
               LinkIndexes[LinkPtr]:=TopicLinks^.AddItem(HRef);
 {$IFDEF WDEBUG}
-              DebugMessageS({$i %file%},' Adding Link2 "'+HRef+'"',{$i %line%},'1');
+              DebugMessageS({$i %file%},' Adding Link2 "'+HRef+'"',{$i %line%},'1',0,0);
 {$ENDIF WDEBUG}
               Inc(LinkPtr);
             end;
@@ -671,7 +671,7 @@ end;
 procedure THTMLTopicRenderer.DocUnknownTag;
 begin
 {$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}
 end;
 
@@ -1300,7 +1300,7 @@ begin
           for I:=0 to Min(Topic^.LinkCount-1,High(LinkIndexes)-1) do
             begin
               {$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}
               Topic^.Links^[I].FileID:=Topic^.FileID;
               Topic^.Links^[I].Context:=EncodeHTMLCtx(Topic^.FileID,LinkIndexes[I]+1);
@@ -1381,12 +1381,12 @@ begin
         begin
           Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
 {$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}
           
           Link:=FormatPath(Link);
 {$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}
           P:=Pos('#',Link);
           if P>0 then
@@ -1422,11 +1422,11 @@ begin
         begin
           Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
 {$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}
           Link:=FormatPath(Link);
 {$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}
           P:=Pos('#',Link);
           if P>0 then
@@ -1450,7 +1450,7 @@ begin
       if (HTMLFile=nil) then
         begin
 {$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}
         end;
       if (p>1) and (HTMLFile=nil) then
@@ -1645,7 +1645,7 @@ begin
           Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
           Link:=FormatPath(Link);
 {$IFDEF WDEBUG}
-          DebugMessageS({$i %file%},' Looking for  "'+Link+'"',{$i %line%},'1');
+          DebugMessageS({$i %file%},' Looking for  "'+Link+'"',{$i %line%},'1',0,0);
 {$endif WDEBUG}
           P:=Pos('#',Link);
           if P>0 then
@@ -1681,11 +1681,11 @@ begin
         begin
           Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
 {$IFDEF WDEBUG}
-          DebugMessageS({$i %file%},' Looking for  "'+Link+'"',{$i %line%},'1');
+          DebugMessageS({$i %file%},' Looking for  "'+Link+'"',{$i %line%},'1',0,0);
 {$endif WDEBUG}
           Link:=FormatPath(Link);
 {$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}
           P:=Pos('#',Link);
           if P>0 then

+ 4 - 4
ide/wutils.pas

@@ -190,10 +190,10 @@ procedure RegisterWUtils;
 
 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
-  TDebugMessage = procedure(AFileName, AText : string; ALine, APos : String);
+  TDebugMessage = procedure(AFileName, AText : string; ALine, APos : String; nrLine, nrPos : sw_word);
 
 Const
   DebugMessageS : TDebugMessage = @WUtilsDebugMessage;
@@ -1276,10 +1276,10 @@ end;
 
 Procedure DebugMessage(AFileName, AText : string; ALine, APos : sw_word); // calls DebugMessage
 begin
- WUtilsDebugMessage(Afilename,AText,inttostr(aline),inttostr(apos));
+  DebugMessageS(Afilename,AText,'','',aline,apos);
 end;
 
-Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : string);
+Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : string;nrLine, nrPos : sw_word);
 begin
   writeln(stderr,AFileName,' (',ALine,',',APos,') ',AText);
   flush(stderr);