Browse Source

* linux fixes

peter 26 years ago
parent
commit
e4f80a077b
5 changed files with 156 additions and 78 deletions
  1. 24 1
      ide/fake/gdb/gdbcon.pas
  2. 8 2
      ide/text/Makefile
  3. 36 33
      ide/text/fpini.pas
  4. 78 35
      ide/text/fpredir.pas
  5. 10 7
      ide/text/weditor.pas

+ 24 - 1
ide/fake/gdb/gdbcon.pas

@@ -11,6 +11,9 @@ type
   TGDBInterface=object
     constructor Init;
     destructor  Done;
+    { functions }
+    function  error:boolean;
+    function  error_num:longint;
     { Hooks }
     procedure DoSelectSourceline(const fn:string;line:longint);virtual;
     procedure DoStartSession;virtual;
@@ -34,6 +37,7 @@ type
     procedure StartTrace;
     procedure TraceStep;
     procedure TraceNext;
+    procedure Continue;
     { needed for dos because newlines are only #10 (PM) }
     procedure WriteErrorBuf;
     procedure WriteOutputBuf;
@@ -68,6 +72,7 @@ end;
 
 function TGDBController.LoadFile(const fn:string):boolean;
 begin
+  LoadFile:=true;
 end;
 
 
@@ -98,6 +103,11 @@ begin
 end;
 
 
+procedure TGDBController.Continue;
+begin
+end;
+
+
 procedure TGDBController.ClearSymbols;
 begin
 end;
@@ -123,6 +133,16 @@ begin
 end;
 
 
+function tgdbinterface.error:boolean;
+begin
+  error:=false;
+end;
+
+function tgdbinterface.error_num:longint;
+begin
+  error_num:=0;
+end;
+
 procedure TGDBInterface.DoSelectSourceline(const fn:string;line:longint);
 begin
 end;
@@ -157,7 +177,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  1999-02-02 16:38:05  peter
+  Revision 1.2  1999-02-04 17:19:22  peter
+    * linux fixes
+
+  Revision 1.1  1999/02/02 16:38:05  peter
     * renamed for better tp7 usage
 
   Revision 1.1  1999/01/28 19:56:12  peter

+ 8 - 2
ide/text/Makefile

@@ -21,7 +21,10 @@ LIBDIR=/usr/lib/gcc-lib/i486-linux/2.7.2.3
 endif
 
 # We always need the API and FV
-NEEDUNITDIR=../../api ../../fv ../../fv/base ../../fv/app ../../fv/dialogs
+NEEDUNITDIR=../../api ../../fv
+# Adding these is not possible, because it will then find views.pas before
+# it finds views.ppu !! (PFV)
+# ../../fv/base ../../fv/app ../../fv/dialogs
 
 # when making a full version include the compiler
 ifdef FULL
@@ -96,7 +99,10 @@ clean_compiler:
 
 #
 # $Log$
-# Revision 1.7  1999-02-04 13:32:00  pierre
+# Revision 1.8  1999-02-04 17:19:23  peter
+#   * linux fixes
+#
+# Revision 1.7  1999/02/04 13:32:00  pierre
 #   * Several things added (I cannot commit them independently !)
 #   + added TBreakpoint and TBreakpointCollection
 #   + added cmResetDebugger,cmGrep,CmToggleBreakpoint

+ 36 - 33
ide/text/fpini.pas

@@ -41,25 +41,25 @@ uses
 
 const
   { INI file sections }
-  secFiles	   = 'Files';
-  secRun	     = 'Run';
-  secCompile	 = 'Compile';
-  secColors	  = 'Colors';
-  secHelp	    = 'Help';
-  secEditor	  = 'Editor';
+  secFiles       = 'Files';
+  secRun         = 'Run';
+  secCompile     = 'Compile';
+  secColors      = 'Colors';
+  secHelp        = 'Help';
+  secEditor      = 'Editor';
   secBreakpoint  = 'Breakpoints';
-  secHighlight       = 'Highlight';
-  secMouse	   = 'Mouse';
-  secSearch	  = 'Search';
-  secTools	   = 'Tools';
+  secHighlight   = 'Highlight';
+  secMouse       = 'Mouse';
+  secSearch      = 'Search';
+  secTools       = 'Tools';
 
   { INI file tags }
   ieRecentFile       = 'RecentFile';
   ieRunParameters    = 'Parameters';
   iePrimaryFile      = 'PrimaryFile';
-  ieCompileMode      = 'CompileMode';																									
-  iePalette	     = 'Palette';
-  ieHelpFiles	     = 'Files';
+  ieCompileMode      = 'CompileMode';
+  iePalette          = 'Palette';
+  ieHelpFiles        = 'Files';
   ieDefaultTabSize   = 'DefaultTabSize';
   ieDefaultEditorFlags='DefaultFlags';
   ieHighlightExts    = 'Exts';
@@ -68,8 +68,8 @@ const
   ieReverseButtons   = 'ReverseButtons';
   ieAltClickAction   = 'AltClickAction';
   ieCtrlClickAction  = 'CtrlClickAction';
-  ieFindFlags	= 'FindFlags';
-  ieToolName	 = 'Title';
+  ieFindFlags        = 'FindFlags';
+  ieToolName         = 'Title';
   ieToolProgram      = 'Program';
   ieToolParams       = 'Params';
   ieToolHotKey       = 'HotKey';
@@ -122,13 +122,13 @@ begin
     P:=Pos('#',copy(S,I,255)); if P>0 then P:=I+P-1 else P:=length(S)+1;
     if Hex=false then
       begin
-	X:=StrToInt(copy(S,I,P-I));
-	OK:=(LastStrToIntResult=0) and (0<=X) and (X<=255);
+        X:=StrToInt(copy(S,I,P-I));
+        OK:=(LastStrToIntResult=0) and (0<=X) and (X<=255);
       end
     else
       begin
-	X:=HexToInt(copy(S,I,P-I));
-	OK:=(LastHexToIntResult=0) and (0<=X) and (X<=255);
+        X:=HexToInt(copy(S,I,P-I));
+        OK:=(LastHexToIntResult=0) and (0<=X) and (X<=255);
       end;
     if OK then C:=C+chr(X);
     Inc(I,P-I);
@@ -165,7 +165,7 @@ var PB : PBreakpoint;
     Line : longint;
     typ : BreakpointType;
     state : BreakpointState;
-    
+
 begin
   Str(I,S2);
   typ:=bt_invalid;
@@ -218,12 +218,12 @@ begin
       if (S='') and (RecentFileCount>I-1) then RecentFileCount:=I-1;
       with RecentFiles[I] do
       begin
-	P:=Pos(',',S); if P=0 then P:=length(S)+1;
-	FileName:=copy(S,1,P-1); Delete(S,1,P);
-	P:=Pos(',',S); if P=0 then P:=length(S)+1;
-	LastPos.X:=Max(0,StrToInt(copy(S,1,P-1))); Delete(S,1,P);
-	P:=Pos(',',S); if P=0 then P:=length(S)+1;
-	LastPos.Y:=Max(0,StrToInt(copy(S,1,P-1))); Delete(S,1,P);
+        P:=Pos(',',S); if P=0 then P:=length(S)+1;
+        FileName:=copy(S,1,P-1); Delete(S,1,P);
+        P:=Pos(',',S); if P=0 then P:=length(S)+1;
+        LastPos.X:=Max(0,StrToInt(copy(S,1,P-1))); Delete(S,1,P);
+        P:=Pos(',',S); if P=0 then P:=length(S)+1;
+        LastPos.Y:=Max(0,StrToInt(copy(S,1,P-1))); Delete(S,1,P);
       end;
     end;
   SetRunParameters(INIFile^.GetEntry(secRun,ieRunParameters,GetRunParameters));
@@ -234,9 +234,9 @@ begin
   for ts:=low(TSwitchMode) to high(TSwitchMode) do
     begin
       if SwitchesModeStr[ts]=S then
-	begin
-	  SwitchesMode:=ts;
-	end;
+        begin
+          SwitchesMode:=ts;
+        end;
     end;
   S:=INIFile^.GetEntry(secHelp,ieHelpFiles,'');
   repeat
@@ -260,7 +260,7 @@ begin
   BreakpointCount:=INIFile^.GetIntEntry(secBreakpoint,ieBreakpointCount,0);
   for i:=1 to BreakpointCount do
     ReadOneBreakPointEntry(i-1,INIFile);
-    
+
   for I:=1 to MaxToolCount do
     begin
       S:=IntToStr(I);
@@ -302,9 +302,9 @@ begin
   for I:=1 to High(RecentFiles) do
     begin
       if I<=RecentFileCount then
-	 with RecentFiles[I] do S:=FileName+','+IntToStr(LastPos.X)+','+IntToStr(LastPos.Y)
+         with RecentFiles[I] do S:=FileName+','+IntToStr(LastPos.X)+','+IntToStr(LastPos.Y)
       else
-	 S:='';
+         S:='';
       INIFile^.SetEntry(secFiles,ieRecentFile+IntToStr(I),S);
     end;
   INIFile^.SetEntry(secRun,ieRunParameters,GetRunParameters);
@@ -363,7 +363,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.6  1999-02-04 13:32:04  pierre
+  Revision 1.7  1999-02-04 17:19:24  peter
+    * linux fixes
+
+  Revision 1.6  1999/02/04 13:32:04  pierre
     * Several things added (I cannot commit them independently !)
     + added TBreakpoint and TBreakpointCollection
     + added cmResetDebugger,cmGrep,CmToggleBreakpoint

+ 78 - 35
ide/text/fpredir.pas

@@ -4,7 +4,7 @@
     Copyright (c) 1998 by Berczi Gabor
 
     Unit to redirect output and error to files
-    
+
     Adapted from code donated to public domain by Schwartz Gabriel.   20/03/1993.
 
     See the file COPYING.FPC, included in this distribution,
@@ -15,13 +15,21 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
  **********************************************************************}
-
-{$R-,S-}
-
 Unit FPRedir;
-
 Interface
 
+{$R-}
+{$ifndef linux}
+  {$S-}
+{$endif}
+
+{$ifdef TP}
+  {$define in_dos}
+{$endif TP}
+{$ifdef Go32v2}
+  {$define in_dos}
+{$endif}
+
 Var
   IOStatus      : Integer;
   RedirError    : Integer;
@@ -36,44 +44,38 @@ procedure RestoreRedir;
 function ChangeErrorRedir(Const Redir : String; AppendToFile : Boolean) : Boolean;
 procedure RestoreErrorRedir;
 
+
 Implementation
 
 Uses
-{$ifdef FPC}
- {$ifdef go32v2}
- go32,
- {$define in_dos}
- {$endif go32v2}
-{$else : not FPC}
- {$ifdef TP}
-  {$define in_dos}
- {$endif TP}
-{$endif not FPC}
+{$ifdef go32v2}
+  go32,
+{$endif go32v2}
   dos;
 
-Type
 
-  PtrRec = record
+{*****************************************************************************
+                                     Dos
+*****************************************************************************}
+
+{$ifdef in_dos}
+
+Type
+  PtrRec = packed record
              Ofs, Seg : Word;
            end;
 
+  PHandles = ^THandles;
+  THandles = Array [Byte] of Byte;
+
+  PWord = ^Word;
+
 Var
   PrefSeg      : Word;
   MinBlockSize : Word;
   FName        : PathStr;
   F,FE         : File;
   MyBlockSize  : Word;
-
-{------------------------------------------------------------------------------}
-
-
-type
-  PHandles = ^THandles;
-  THandles = Array [Byte] of Byte;
-
-  PWord = ^Word;
-
-var
   RedirChanged : Boolean;
   RedirErrorChanged : Boolean;
   Handles      : PHandles;
@@ -300,7 +302,6 @@ Begin
   RedirError:=0;
   ExecuteResult:=0;
   IOStatus:=0;
-{$ifdef in_dos}
   if RedirStdOut<>'' then
     ChangeRedir(RedirStdOut,false);
   if RedirStdErr<>'stderr' then
@@ -308,14 +309,12 @@ Begin
   DosExecute(ProgName,ComLine);
   RestoreRedir;
   RestoreErrorRedir;
-{$else : not in_dos}
-  DosExecute(ProgName,ComLine+' 1!>'+RedirStdOut+' 2!>'+RedirStdErr);
-{$endif in_dos}
   ExecuteRedir:=(IOStatus=0) and (RedirError=0) and (ExecuteResult=0);
 End;
 
-{------------------------------------------------------------------------------}
-Begin
+
+procedure InitRedir;
+begin
 {$ifndef FPC}
   PrefSeg:=PrefixSeg;
 {$else FPC}
@@ -324,6 +323,50 @@ Begin
   HandlesOffset:=Memw[prefseg:$34];
  {$else }
   PrefSeg:=0;
- {$endif } 
+ {$endif }
 {$endif FPC}
+end;
+
+{$endif in_dos}
+
+
+{*****************************************************************************
+                                 Linux
+*****************************************************************************}
+
+
+function ExecuteRedir (Const ProgName, ComLine, RedirStdOut, RedirStdErr : String) : boolean;
+begin
+  ExecuteRedir:=false;
+end;
+
+function ChangeRedir(Const Redir : String; AppendToFile : Boolean) : Boolean;
+begin
+  ChangeRedir:=false;
+end;
+
+procedure RestoreRedir;
+begin
+end;
+
+function ChangeErrorRedir(Const Redir : String; AppendToFile : Boolean) : Boolean;
+begin
+  ChangeErrorRedir:=false;
+end;
+
+procedure RestoreErrorRedir;
+begin
+end;
+
+procedure InitRedir;
+begin
+end;
+
+
+{*****************************************************************************
+                                  Initialize
+*****************************************************************************}
+
+Begin
+  InitRedir;
 End.

+ 10 - 7
ide/text/weditor.pas

@@ -94,7 +94,7 @@ const
       ffFromCursor       = $0000;
       ffEntireScope      = $0020;
 
-      coTextColor  = 0;
+      coTextColor         = 0;
       coWhiteSpaceColor   = 1;
       coCommentColor      = 2;
       coReservedWordColor = 3;
@@ -105,10 +105,10 @@ const
       coSymbolColor       = 8;
       coDirectiveColor    = 9;
       coHexNumberColor    = 10;
-      coTabColor    = 11;
-      coBreakColor   = 12;
-      coFirstColor   = 0;
-      coLastColor  = coTabColor;
+      coTabColor          = 11;
+      coBreakColor        = 12;
+      coFirstColor  = 0;
+      coLastColor   = coBreakColor;
 
       CIndicator    = #2#3#1;
       CEditor       = #33#34#35#36#37#38#39#40#41#42#43#44#45#46#47#48#49;
@@ -1393,7 +1393,7 @@ begin
         Color:=ColorTab[coBreakColor];
         FreeFormat[X]:=false;
       end;
-      
+
       if (0<=X-1-Delta.X) and (X-1-Delta.X<MaxViewWidth) then
       MoveChar(B[X-1-Delta.X],C,Color,1);
     end;
@@ -3290,7 +3290,10 @@ end;
 END.
 {
   $Log$
-  Revision 1.10  1999-02-04 10:13:00  pierre
+  Revision 1.11  1999-02-04 17:19:26  peter
+    * linux fixes
+
+  Revision 1.10  1999/02/04 10:13:00  pierre
     + GetCurrentWord (used in Find/Replace)
     + DefUseTabsPattern (pattern forcing tabs to be kept)
       used for all makefiles !!