Browse Source

* use -dGDB for the compiler
* only use gdb_file when -dDEBUG is used
* profiler switch is now a toggle instead of radiobutton

peter 26 years ago
parent
commit
70c1def540
5 changed files with 70 additions and 114 deletions
  1. 12 7
      ide/text/Makefile
  2. 15 6
      ide/text/fpdebug.pas
  3. 14 2
      ide/text/fpide.pas
  4. 29 13
      ide/text/fpmopts.inc
  5. 0 86
      ide/text/fprun.pas

+ 12 - 7
ide/text/Makefile

@@ -16,10 +16,6 @@
 # Defaults
 # Defaults
 #####################################################################
 #####################################################################
 
 
-ifdef inlinux
-LIBDIR=/usr/lib/gcc-lib/i486-linux/2.7.2.3
-endif
-
 # We always need the API and FV
 # We always need the API and FV
 NEEDUNITDIR=../../api ../../fv
 NEEDUNITDIR=../../api ../../fv
 # Adding these is not possible, because it will then find views.pas before
 # Adding these is not possible, because it will then find views.pas before
@@ -29,7 +25,7 @@ NEEDUNITDIR=../../api ../../fv
 # when making a full version include the compiler
 # when making a full version include the compiler
 ifdef FULL
 ifdef FULL
 override NEEDUNITDIR+=../../compiler
 override NEEDUNITDIR+=../../compiler
-override NEEDOPT+=-dBrowserCol -Sg
+override NEEDOPT+=-dBrowserCol -dGDB -Sg
 else
 else
 override NEEDUNITDIR+=../fake/compiler
 override NEEDUNITDIR+=../fake/compiler
 endif
 endif
@@ -86,12 +82,16 @@ endif
 # Dependencies
 # Dependencies
 #####################################################################
 #####################################################################
 
 
+ifdef inlinux
+LIBDIR=/usr/lib/gcc-lib/i486-linux/2.7.2.3
+endif
+
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
 
 
 full:
 full:
 	make all FULL=1
 	make all FULL=1
 
 
-fullgdb: clean_compiler
+fullgdb:
 	make all FULL=1 GDB=1
 	make all FULL=1 GDB=1
 
 
 clean_compiler:
 clean_compiler:
@@ -99,7 +99,12 @@ clean_compiler:
 
 
 #
 #
 # $Log$
 # $Log$
-# Revision 1.8  1999-02-04 17:19:23  peter
+# Revision 1.9  1999-02-16 10:43:53  peter
+#   * use -dGDB for the compiler
+#   * only use gdb_file when -dDEBUG is used
+#   * profiler switch is now a toggle instead of radiobutton
+#
+# Revision 1.8  1999/02/04 17:19:23  peter
 #   * linux fixes
 #   * linux fixes
 #
 #
 # Revision 1.7  1999/02/04 13:32:00  pierre
 # Revision 1.7  1999/02/04 13:32:00  pierre

+ 15 - 6
ide/text/fpdebug.pas

@@ -95,7 +95,7 @@ const
 var
 var
   Debugger : PDebugController;
   Debugger : PDebugController;
   BreakpointCollection : PBreakpointCollection;
   BreakpointCollection : PBreakpointCollection;
-  
+
 procedure InitDebugger;
 procedure InitDebugger;
 procedure DoneDebugger;
 procedure DoneDebugger;
 procedure InitGDBWindow;
 procedure InitGDBWindow;
@@ -132,7 +132,7 @@ procedure TDebugController.InsertBreakpoints;
   begin
   begin
     PB^.Insert;
     PB^.Insert;
   end;
   end;
-    
+
 begin
 begin
   BreakpointCollection^.ForEach(@DoInsert);
   BreakpointCollection^.ForEach(@DoInsert);
 end;
 end;
@@ -534,7 +534,7 @@ function  TBreakpointCollection.GetGDB(index : longint) : PBreakpoint;
   begin
   begin
     IsNum:=P^.GDBIndex=index;
     IsNum:=P^.GDBIndex=index;
   end;
   end;
-  
+
 begin
 begin
   if index=0 then
   if index=0 then
     GetGDB:=nil
     GetGDB:=nil
@@ -549,7 +549,7 @@ procedure TBreakpointCollection.ShowBreakpoints(W : PSourceWindow);
     If assigned(P^.FileName) and (P^.FileName^=W^.Editor^.FileName) then
     If assigned(P^.FileName) and (P^.FileName^=W^.Editor^.FileName) then
       W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled);
       W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled);
   end;
   end;
-  
+
 begin
 begin
   ForEach(@SetInSource);
   ForEach(@SetInSource);
 end;
 end;
@@ -560,7 +560,7 @@ function TBreakpointCollection.GetType(typ : BreakpointType;Const s : String) :
   begin
   begin
     IsThis:=(P^.typ=typ) and (P^.Name^=S);
     IsThis:=(P^.typ=typ) and (P^.Name^=S);
   end;
   end;
-  
+
 begin
 begin
   GetType:=FirstThat(@IsThis);
   GetType:=FirstThat(@IsThis);
 end;
 end;
@@ -603,9 +603,11 @@ end;
 
 
 procedure InitDebugger;
 procedure InitDebugger;
 begin
 begin
+{$ifdef DEBUG}
   Assign(gdb_file,'gdb$$$.out');
   Assign(gdb_file,'gdb$$$.out');
   Rewrite(gdb_file);
   Rewrite(gdb_file);
   Use_gdb_file:=true;
   Use_gdb_file:=true;
+{$endif}
   if (not ExistsFile(ExeFile)) or (CompilationPhase<>cpDone) then
   if (not ExistsFile(ExeFile)) or (CompilationPhase<>cpDone) then
     DoCompile(cRun);
     DoCompile(cRun);
   if CompilationPhase<>cpDone then
   if CompilationPhase<>cpDone then
@@ -630,9 +632,11 @@ begin
   if assigned(Debugger) then
   if assigned(Debugger) then
    dispose(Debugger,Done);
    dispose(Debugger,Done);
   Debugger:=nil;
   Debugger:=nil;
+{$ifdef DEBUG}
   If Use_gdb_file then
   If Use_gdb_file then
     Close(GDB_file);
     Close(GDB_file);
   Use_gdb_file:=false;
   Use_gdb_file:=false;
+{$endif}
   {DoneGDBWindow;}
   {DoneGDBWindow;}
 end;
 end;
 
 
@@ -672,7 +676,12 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-02-11 19:07:20  pierre
+  Revision 1.13  1999-02-16 10:43:54  peter
+    * use -dGDB for the compiler
+    * only use gdb_file when -dDEBUG is used
+    * profiler switch is now a toggle instead of radiobutton
+
+  Revision 1.12  1999/02/11 19:07:20  pierre
     * GDBWindow redesigned :
     * GDBWindow redesigned :
       normal editor apart from
       normal editor apart from
       that any kbEnter will send the line (for begin to cursor)
       that any kbEnter will send the line (for begin to cursor)

+ 14 - 2
ide/text/fpide.pas

@@ -107,6 +107,9 @@ var
 implementation
 implementation
 
 
 uses
 uses
+{$ifdef linux}
+  linux,
+{$endif}
   Video,Mouse,Keyboard,
   Video,Mouse,Keyboard,
   Dos,Objects,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx,
   Dos,Objects,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx,
   Systems,BrowCol,
   Systems,BrowCol,
@@ -408,7 +411,7 @@ begin
                if assigned(Debugger) and (PView(Event.InfoPtr)=Debugger^.LastSource) then
                if assigned(Debugger) and (PView(Event.InfoPtr)=Debugger^.LastSource) then
                  Debugger^.LastSource:=nil;
                  Debugger^.LastSource:=nil;
              end;
              end;
-               
+
          end;
          end;
   end;
   end;
   inherited HandleEvent(Event);
   inherited HandleEvent(Event);
@@ -463,7 +466,11 @@ begin
     WriteShellMsg;
     WriteShellMsg;
 
 
   SwapVectors;
   SwapVectors;
+{$ifdef linux}
+  Shell(ProgramPath+' '+Params);
+{$else}
   Dos.Exec(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params);
   Dos.Exec(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params);
+{$endif}
   SwapVectors;
   SwapVectors;
 
 
   ShowIDEScreen;
   ShowIDEScreen;
@@ -657,7 +664,12 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  1999-02-11 19:07:22  pierre
+  Revision 1.15  1999-02-16 10:43:55  peter
+    * use -dGDB for the compiler
+    * only use gdb_file when -dDEBUG is used
+    * profiler switch is now a toggle instead of radiobutton
+
+  Revision 1.14  1999/02/11 19:07:22  pierre
     * GDBWindow redesigned :
     * GDBWindow redesigned :
       normal editor apart from
       normal editor apart from
       that any kbEnter will send the line (for begin to cursor)
       that any kbEnter will send the line (for begin to cursor)

+ 29 - 13
ide/text/fpmopts.inc

@@ -346,7 +346,8 @@ end;
 procedure TIDEApp.DoDebuggerSwitch;
 procedure TIDEApp.DoDebuggerSwitch;
 var R,R2: TRect;
 var R,R2: TRect;
     D: PCenterDialog;
     D: PCenterDialog;
-    RB1,RB2: PRadioButtons;
+    RB : PRadioButtons;
+    CB: PCheckBoxes;
     IL2: PInputLine;
     IL2: PInputLine;
     L,I: longint;
     L,I: longint;
     Items: PSItem;
     Items: PSItem;
@@ -361,23 +362,26 @@ begin
     Items:=nil;
     Items:=nil;
     for I:=DebugInfoSwitches^.ItemCount-1 downto 0 do
     for I:=DebugInfoSwitches^.ItemCount-1 downto 0 do
       Items:=NewSItem(DebugInfoSwitches^.ItemName(I), Items);
       Items:=NewSItem(DebugInfoSwitches^.ItemName(I), Items);
-    New(RB1, Init(R2, Items));
+    New(RB, Init(R2, Items));
     L:=DebugInfoSwitches^.GetCurrSel;
     L:=DebugInfoSwitches^.GetCurrSel;
-    RB1^.SetData(L);
-    Insert(RB1);
+    RB^.SetData(L);
+    Insert(RB);
     R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+1;
     R2.Copy(R); Inc(R2.A.Y); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, 'Debugging information', RB1)));
+    Insert(New(PLabel, Init(R2, 'Debugging information', RB)));
 
 
     R2.Copy(R); Inc(R2.A.Y,2+DebugInfoSwitches^.ItemCount+2); R2.B.Y:=R2.A.Y+ProfileInfoSwitches^.ItemCount;
     R2.Copy(R); Inc(R2.A.Y,2+DebugInfoSwitches^.ItemCount+2); R2.B.Y:=R2.A.Y+ProfileInfoSwitches^.ItemCount;
     Items:=nil;
     Items:=nil;
     for I:=ProfileInfoSwitches^.ItemCount-1 downto 0 do
     for I:=ProfileInfoSwitches^.ItemCount-1 downto 0 do
       Items:=NewSItem(ProfileInfoSwitches^.ItemName(I), Items);
       Items:=NewSItem(ProfileInfoSwitches^.ItemName(I), Items);
-    New(RB2, Init(R2, Items));
+    New(CB, Init(R2, Items));
     L:=ProfileInfoSwitches^.GetCurrSel;
     L:=ProfileInfoSwitches^.GetCurrSel;
-    RB2^.SetData(L);
-    Insert(RB2);
+    If L = 1 then
+      CB^.SetData(3)
+    else
+      CB^.SetData(1);
+    Insert(CB);
     R2.Copy(R); Inc(R2.A.Y,6); R2.B.Y:=R2.A.Y+1;
     R2.Copy(R); Inc(R2.A.Y,6); R2.B.Y:=R2.A.Y+1;
-    Insert(New(PLabel, Init(R2, 'Profiling Switches', RB2)));
+    Insert(New(PLabel, Init(R2, 'Profiling Switches', CB)));
 
 
     {custom }
     {custom }
     R2.A.Y:=R2.B.Y+2;
     R2.A.Y:=R2.B.Y+2;
@@ -389,17 +393,24 @@ begin
     Insert(New(PLabel, Init(R2,'~A~dditional compiler args', IL2)));
     Insert(New(PLabel, Init(R2,'~A~dditional compiler args', IL2)));
   end;
   end;
   InsertButtons(D);
   InsertButtons(D);
-  RB1^.Select;
+  RB^.Select;
   if Desktop^.ExecView(D)=cmOK then
   if Desktop^.ExecView(D)=cmOK then
   begin
   begin
-    DebugInfoSwitches^.SetCurrSel(RB1^.Value);
-    ProfileInfoSwitches^.SetCurrSel(RB2^.Value);
+    DebugInfoSwitches^.SetCurrSel(RB^.Value);
+    Writeln(':',CB^.Value,':');
+    readln;
+    if CB^.Value = 3 then
+      I := 1
+    else
+      I := 0;
+    ProfileInfoSwitches^.SetCurrSel(I);
     CustomArg[SwitchesMode]:=IL2^.Data^;
     CustomArg[SwitchesMode]:=IL2^.Data^;
   end;
   end;
   Dispose(D, Done);
   Dispose(D, Done);
 end;
 end;
 
 
 
 
+
 procedure TIDEApp.Directories;
 procedure TIDEApp.Directories;
 var R,R2: TRect;
 var R,R2: TRect;
     D: PCenterDialog;
     D: PCenterDialog;
@@ -713,7 +724,12 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1999-02-10 09:52:43  pierre
+  Revision 1.14  1999-02-16 10:43:56  peter
+    * use -dGDB for the compiler
+    * only use gdb_file when -dDEBUG is used
+    * profiler switch is now a toggle instead of radiobutton
+
+  Revision 1.13  1999/02/10 09:52:43  pierre
    * MemorySizeSwitches -> MemorySwitches (were duplicates)
    * MemorySizeSwitches -> MemorySwitches (were duplicates)
 
 
   Revision 1.12  1999/02/08 17:41:34  pierre
   Revision 1.12  1999/02/08 17:41:34  pierre

+ 0 - 86
ide/text/fprun.pas

@@ -1,86 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Pascal Integrated Development Environment
-    Copyright (c) 1998 by Berczi Gabor
-
-    Compiler call routines for the IDE
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-unit FPRun;
-interface
-
-procedure DoRun;
-
-
-implementation
-
-uses
-  Dos,Mouse,Video,
-  FPViews,FPVars,FPUtils,FPIntf,
-  FPCompile,FPUsrScr
-{
-  ;
-
-procedure TIDEApp.DoRun;
-var
-  ExeFile : string;
-begin
-  if (MainFile='') or (CompilationPhase<>cpDone) then
-   DoCompile(cRun);
-  if (MainFile='') or (CompilationPhase<>cpDone) then
-   begin
-     ErrorBox('Oooops, nothing to run.',nil);
-     Exit;
-   end;
-  ExeFile:=MakeExeName(MainFile);
-
-  if UserScreen=nil then
-   begin
-     ErrorBox('Sorry, user screen not available.',nil);
-     Exit;
-   end;
-  DoneMouse;
-  DoneVideo;
-
-  UserScreen^.SwitchTo;
-
-//  Exec(ExeFile,GetRunParameters);
-
-  UserScreen^.SwitchBack;
-
-  InitVideo;
-  InitMouse;
-  ReDraw;
-  UpdateScreen(true);
-end;
-
-end.
-{
-  $Log$
-  Revision 1.3  1999-02-08 09:31:01  florian
-    + some split heap stuff, in $ifdef TEMPHEAP
-
-  Revision 1.2  1999/01/12 14:29:38  peter
-    + Implemented still missing 'switch' entries in Options menu
-    + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
-      ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
-      ASCII chars and inserted directly in the text.
-    + Added symbol browser
-    * splitted fp.pas to fpide.pas
-
-  Revision 1.1  1998/12/28 15:47:52  peter
-    + Added user screen support, display & window
-    + Implemented Editor,Mouse Options dialog
-    + Added location of .INI and .CFG file
-    + Option (INI) file managment implemented (see bottom of Options Menu)
-    + Switches updated
-    + Run program
-
-}