Quellcode durchsuchen

+ TBreakpoint and TWatch registering
+ WatchesCollection and BreakpointsCollection stored in desk file
* Syntax highlighting was broken

pierre vor 26 Jahren
Ursprung
Commit
a8827ebf5e
9 geänderte Dateien mit 378 neuen und 151 gelöschten Zeilen
  1. 6 2
      ide/text/fpcompil.pas
  2. 192 113
      ide/text/fpdebug.pas
  3. 121 14
      ide/text/fpdesk.pas
  4. 9 4
      ide/text/fpini.pas
  5. 10 2
      ide/text/fpintf.pas
  6. 7 2
      ide/text/fpmrun.inc
  7. 14 9
      ide/text/fpsymbol.pas
  8. 9 2
      ide/text/fpvars.pas
  9. 10 3
      ide/text/fpviews.pas

+ 6 - 2
ide/text/fpcompil.pas

@@ -458,7 +458,6 @@ begin
 {$ifdef redircompiler}
 {$ifdef redircompiler}
       RedirEnableAll;
       RedirEnableAll;
 {$endif}
 {$endif}
-
      { update memory usage }
      { update memory usage }
      { HeapView^.Update; }
      { HeapView^.Update; }
    end;
    end;
@@ -739,7 +738,12 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.38  1999-09-13 16:24:43  peter
+  Revision 1.39  1999-09-16 14:34:57  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.38  1999/09/13 16:24:43  peter
     + clock
     + clock
     * backspace unident like tp7
     * backspace unident like tp7
 
 

+ 192 - 113
ide/text/fpdebug.pas

@@ -74,6 +74,8 @@ type
      constructor Init_Empty;
      constructor Init_Empty;
      constructor Init_file_line(AFile : String; ALine : longint);
      constructor Init_file_line(AFile : String; ALine : longint);
      constructor Init_type(atyp : BreakpointType;Const AnExpr : String);
      constructor Init_type(atyp : BreakpointType;Const AnExpr : String);
+     constructor Load(var S: TStream);
+     procedure   Store(var S: TStream);
      procedure  Insert;
      procedure  Insert;
      procedure  Remove;
      procedure  Remove;
      procedure  Enable;
      procedure  Enable;
@@ -156,6 +158,8 @@ type
     PWatch = ^TWatch;
     PWatch = ^TWatch;
     TWatch =  Object(TObject)
     TWatch =  Object(TObject)
       constructor Init(s : string);
       constructor Init(s : string);
+      constructor Load(var S: TStream);
+      procedure   Store(var S: TStream);
       procedure rename(s : string);
       procedure rename(s : string);
       procedure Get_new_value;
       procedure Get_new_value;
       destructor done;virtual;
       destructor done;virtual;
@@ -252,7 +256,7 @@ const
 
 
 var
 var
   Debugger             : PDebugController;
   Debugger             : PDebugController;
-  BreakpointCollection : PBreakpointCollection;
+  BreakpointsCollection : PBreakpointCollection;
   WatchesCollection    : PwatchesCollection;
   WatchesCollection    : PwatchesCollection;
 
 
 procedure InitDebugger;
 procedure InitDebugger;
@@ -318,6 +322,34 @@ const
      Store:   @TFramesListBox.Store
      Store:   @TFramesListBox.Store
   );
   );
 
 
+  RBreakpoint: TStreamRec = (
+     ObjType: 1707;
+     VmtLink: Ofs(TypeOf(TBreakpoint)^);
+     Load:    @TBreakpoint.Load;
+     Store:   @TBreakpoint.Store
+  );
+
+  RWatch: TStreamRec = (
+     ObjType: 1708;
+     VmtLink: Ofs(TypeOf(TWatch)^);
+     Load:    @TWatch.Load;
+     Store:   @TWatch.Store
+  );
+
+  RBreakpointCollection: TStreamRec = (
+     ObjType: 1709;
+     VmtLink: Ofs(TypeOf(TBreakpointCollection)^);
+     Load:    @TBreakpointCollection.Load;
+     Store:   @TBreakpointCollection.Store
+  );
+
+  RWatchesCollection: TStreamRec = (
+     ObjType: 1710;
+     VmtLink: Ofs(TypeOf(TWatchesCollection)^);
+     Load:    @TWatchesCollection.Load;
+     Store:   @TWatchesCollection.Store
+  );
+
 {****************************************************************************
 {****************************************************************************
                             TDebugController
                             TDebugController
 ****************************************************************************}
 ****************************************************************************}
@@ -344,7 +376,7 @@ procedure TDebugController.InsertBreakpoints;
   end;
   end;
 
 
 begin
 begin
-  BreakpointCollection^.ForEach(@DoInsert);
+  BreakpointsCollection^.ForEach(@DoInsert);
 end;
 end;
 
 
 procedure TDebugController.ReadWatches;
 procedure TDebugController.ReadWatches;
@@ -366,7 +398,7 @@ procedure TDebugController.RemoveBreakpoints;
       PB^.Remove;
       PB^.Remove;
     end;
     end;
 begin
 begin
-   BreakpointCollection^.ForEach(@DoDelete);
+   BreakpointsCollection^.ForEach(@DoDelete);
 end;
 end;
 
 
 procedure TDebugController.ResetBreakpointsValues;
 procedure TDebugController.ResetBreakpointsValues;
@@ -375,7 +407,7 @@ procedure TDebugController.ResetBreakpointsValues;
       PB^.ResetValues;
       PB^.ResetValues;
     end;
     end;
 begin
 begin
-   BreakpointCollection^.ForEach(@DoResetVal);
+   BreakpointsCollection^.ForEach(@DoResetVal);
 end;
 end;
 
 
 destructor TDebugController.Done;
 destructor TDebugController.Done;
@@ -565,7 +597,7 @@ begin
   Desktop^.UnLock;
   Desktop^.UnLock;
   if BreakIndex>0 then
   if BreakIndex>0 then
     begin
     begin
-      PB:=BreakpointCollection^.GetGDB(BreakIndex);
+      PB:=BreakpointsCollection^.GetGDB(BreakIndex);
       { For watch we should get old and new value !! }
       { For watch we should get old and new value !! }
       if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
       if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
          (PB^.typ<>bt_file_line) and (PB^.typ<>bt_function) then
          (PB^.typ<>bt_file_line) and (PB^.typ<>bt_function) then
@@ -696,6 +728,52 @@ begin
   CurrentValue:=nil;
   CurrentValue:=nil;
 end;
 end;
 
 
+constructor TBreakpoint.Load(var S: TStream);
+begin
+  S.Read(typ,SizeOf(BreakpointType));
+  S.Read(state,SizeOf(BreakpointState));
+  GDBState:=bs_deleted;
+  case typ of
+    bt_file_line :
+      begin
+        FileName:=S.ReadStr;
+        S.Read(Line,SizeOf(Line));
+        Name:=nil;
+      end;
+  else
+    begin
+        Name:=S.ReadStr;
+        Line:=0;
+        FileName:=nil;
+    end;
+  end;
+  S.Read(IgnoreCount,SizeOf(IgnoreCount));
+  Commands:=S.StrRead;
+  Conditions:=S.ReadStr;
+  OldValue:=nil;
+  CurrentValue:=nil;
+end;
+
+procedure TBreakpoint.Store(var S: TStream);
+begin
+  S.Write(typ,SizeOf(BreakpointType));
+  S.Write(state,SizeOf(BreakpointState));
+  case typ of
+    bt_file_line :
+      begin
+        S.WriteStr(FileName);
+        S.Write(Line,SizeOf(Line));
+      end;
+  else
+    begin
+        S.WriteStr(Name);
+    end;
+  end;
+  S.Write(IgnoreCount,SizeOf(IgnoreCount));
+  S.StrWrite(Commands);
+  S.WriteStr(Conditions);
+end;
+
 procedure TBreakpoint.Insert;
 procedure TBreakpoint.Insert;
 begin
 begin
   If not assigned(Debugger) then Exit;
   If not assigned(Debugger) then Exit;
@@ -1105,7 +1183,7 @@ begin
     P^.Breakpoint^.state:=bs_disabled
     P^.Breakpoint^.state:=bs_disabled
   else if P^.Breakpoint^.state=bs_disabled then
   else if P^.Breakpoint^.state=bs_disabled then
     P^.Breakpoint^.state:=bs_enabled;
     P^.Breakpoint^.state:=bs_enabled;
-  BreakpointCollection^.Update;
+  BreakpointsCollection^.Update;
   if P^.Breakpoint^.typ=bt_file_line then
   if P^.Breakpoint^.typ=bt_file_line then
     begin
     begin
       W:=TryToOpenFile(nil,GetStr(P^.Breakpoint^.FileName),1,P^.Breakpoint^.Line,false);
       W:=TryToOpenFile(nil,GetStr(P^.Breakpoint^.FileName),1,P^.Breakpoint^.Line,false);
@@ -1128,7 +1206,7 @@ begin
   P:=List^.At(Focused);
   P:=List^.At(Focused);
   if P=nil then Exit;
   if P=nil then Exit;
   Application^.ExecuteDialog(New(PBreakpointItemDialog,Init(P^.Breakpoint)),nil);
   Application^.ExecuteDialog(New(PBreakpointItemDialog,Init(P^.Breakpoint)),nil);
-  BreakpointCollection^.Update;
+  BreakpointsCollection^.Update;
 end;
 end;
 
 
 procedure TBreakpointsListBox.DeleteCurrent;
 procedure TBreakpointsListBox.DeleteCurrent;
@@ -1138,9 +1216,9 @@ begin
   if Range=0 then Exit;
   if Range=0 then Exit;
   P:=List^.At(Focused);
   P:=List^.At(Focused);
   if P=nil then Exit;
   if P=nil then Exit;
-  BreakpointCollection^.free(P^.Breakpoint);
+  BreakpointsCollection^.free(P^.Breakpoint);
   List^.free(P);
   List^.free(P);
-  BreakpointCollection^.Update;
+  BreakpointsCollection^.Update;
 end;
 end;
 
 
 procedure TBreakpointsListBox.EditNew;
 procedure TBreakpointsListBox.EditNew;
@@ -1150,8 +1228,8 @@ begin
   P:=New(PBreakpoint,Init_Empty);
   P:=New(PBreakpoint,Init_Empty);
   if Application^.ExecuteDialog(New(PBreakpointItemDialog,Init(P)),nil)<>cmCancel then
   if Application^.ExecuteDialog(New(PBreakpointItemDialog,Init(P)),nil)<>cmCancel then
     begin
     begin
-      BreakpointCollection^.Insert(P);
-      BreakpointCollection^.Update;
+      BreakpointsCollection^.Insert(P);
+      BreakpointsCollection^.Update;
     end
     end
   else
   else
     dispose(P,Done);
     dispose(P,Done);
@@ -1344,9 +1422,9 @@ procedure TBreakpointsWindow.ReloadBreakpoints;
     BreakLB^.AddBreakpoint(New(PBreakpointItem, Init(P)));
     BreakLB^.AddBreakpoint(New(PBreakpointItem, Init(P)));
   end;
   end;
 begin
 begin
-  If not assigned(BreakpointCollection) then
+  If not assigned(BreakpointsCollection) then
     exit;
     exit;
-  BreakpointCollection^.ForEach(@InsertInBreakLB);
+  BreakpointsCollection^.ForEach(@InsertInBreakLB);
   ReDraw;
   ReDraw;
 end;
 end;
 
 
@@ -1524,84 +1602,97 @@ end;
                          TWatch
                          TWatch
 ****************************************************************************}
 ****************************************************************************}
 
 
-      constructor TWatch.Init(s : string);
-        begin
-          expr:=NewStr(s);
-          last_value:=nil;
-          current_value:=nil;
-          Get_new_value;
-        end;
+constructor TWatch.Init(s : string);
+  begin
+    expr:=NewStr(s);
+    last_value:=nil;
+    current_value:=nil;
+    Get_new_value;
+  end;
 
 
-      procedure TWatch.rename(s : string);
-        begin
-          if assigned(expr) then
-            begin
-              if GetStr(expr)=S then
-                exit;
-              DisposeStr(expr);
-            end;
-          expr:=NewStr(s);
-          if assigned(last_value) then
-            StrDispose(last_value);
-          last_value:=nil;
-          if assigned(current_value) then
-            StrDispose(current_value);
-          current_value:=nil;
-          Get_new_value;
-        end;
+constructor TWatch.Load(var S: TStream);
+  begin
+    expr:=S.ReadStr;
+    last_value:=nil;
+    current_value:=nil;
+    Get_new_value;
+  end;
 
 
-      procedure TWatch.Get_new_value;
-        var p,q : pchar;
-            i : longint;
-            last_removed : boolean;
-        begin
-          If not assigned(Debugger) then
-            exit;
-          if assigned(last_value) then
-            strdispose(last_value);
-          last_value:=current_value;
-          Debugger^.Command('p '+GetStr(expr));
-          if Debugger^.Error then
-            p:=StrNew(Debugger^.GetError)
-          else
-            p:=StrNew(Debugger^.GetOutput);
-          { do not open a messagebox for such errors }
-          Debugger^.got_error:=false;
-          q:=nil;
-          if assigned(p) and (p[0]='$') then
-            q:=StrPos(p,'=');
-          if not assigned(q) then
-            q:=p;
-          if assigned(q) then
-            i:=strlen(q)
-          else
-            i:=0;
-          if (i>0) and (q[i-1]=#10) then
-            begin
-              q[i-1]:=#0;
-              last_removed:=true;
-            end
-          else
-            last_removed:=false;
-          if assigned(q) then
-            current_value:=strnew(q)
-          else
-            current_value:=strnew('');
-          if last_removed then
-            q[i-1]:=#10;
-          strdispose(p);
-        end;
+procedure TWatch.Store(var S: TStream);
+  begin
+    S.WriteStr(expr);
+  end;
 
 
-      destructor TWatch.Done;
-        begin
-          if assigned(expr) then
-            disposestr(expr);
-          if assigned(last_value) then
-            strdispose(last_value);
-          if assigned(current_value) then
-            strdispose(current_value);
-          inherited done;
-        end;
+procedure TWatch.rename(s : string);
+  begin
+    if assigned(expr) then
+      begin
+        if GetStr(expr)=S then
+          exit;
+        DisposeStr(expr);
+      end;
+    expr:=NewStr(s);
+    if assigned(last_value) then
+      StrDispose(last_value);
+    last_value:=nil;
+    if assigned(current_value) then
+      StrDispose(current_value);
+    current_value:=nil;
+    Get_new_value;
+  end;
+
+procedure TWatch.Get_new_value;
+  var p,q : pchar;
+      i : longint;
+      last_removed : boolean;
+  begin
+    If not assigned(Debugger) then
+      exit;
+    if assigned(last_value) then
+      strdispose(last_value);
+    last_value:=current_value;
+    Debugger^.Command('p '+GetStr(expr));
+    if Debugger^.Error then
+      p:=StrNew(Debugger^.GetError)
+    else
+      p:=StrNew(Debugger^.GetOutput);
+    { do not open a messagebox for such errors }
+    Debugger^.got_error:=false;
+    q:=nil;
+    if assigned(p) and (p[0]='$') then
+      q:=StrPos(p,'=');
+    if not assigned(q) then
+      q:=p;
+    if assigned(q) then
+      i:=strlen(q)
+    else
+      i:=0;
+    if (i>0) and (q[i-1]=#10) then
+      begin
+        q[i-1]:=#0;
+        last_removed:=true;
+      end
+    else
+      last_removed:=false;
+    if assigned(q) then
+      current_value:=strnew(q)
+    else
+      current_value:=strnew('');
+    if last_removed then
+      q[i-1]:=#10;
+    strdispose(p);
+  end;
+
+destructor TWatch.Done;
+  begin
+    if assigned(expr) then
+      disposestr(expr);
+    if assigned(last_value) then
+      strdispose(last_value);
+    if assigned(current_value) then
+      strdispose(current_value);
+    inherited done;
+  end;
 
 
 {****************************************************************************
 {****************************************************************************
                          TWatchesCollection
                          TWatchesCollection
@@ -1648,9 +1739,6 @@ end;
                          TWatchesListBox
                          TWatchesListBox
 ****************************************************************************}
 ****************************************************************************}
 
 
-    (* PWatchesListBox = ^TWatchesListBox;
-    TWatchesListBox = object(THSListBox)
-      MaxWidth    : Sw_integer; *)
 constructor TWatchesListBox.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
 constructor TWatchesListBox.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
   begin
   begin
     inherited Init(Bounds,1,AHScrollBar,AVScrollBar);
     inherited Init(Bounds,1,AHScrollBar,AVScrollBar);
@@ -1711,14 +1799,6 @@ begin
    end;
    end;
 end;
 end;
 
 
-      (* function    TWatchesListBox.GetLocalMenu: PMenu;virtual;
-      procedure   TWatchesListBox.Clear; virtual;
-      procedure   TWatchesListBox.TrackSource; virtual;
-      procedure   TWatchesListBox.EditNew; virtual;
-      procedure   TWatchesListBox.EditCurrent; virtual;
-      procedure   TWatchesListBox.DeleteCurrent; virtual;
-      procedure   TWatchesListBox.ToggleCurrent; *)
-
 procedure TWatchesListBox.EditCurrent;
 procedure TWatchesListBox.EditCurrent;
 var
 var
   P: PWatch;
   P: PWatch;
@@ -1984,16 +2064,6 @@ end;
 {****************************************************************************
 {****************************************************************************
                          TWatchItemDialog
                          TWatchItemDialog
 ****************************************************************************}
 ****************************************************************************}
-    (* TWatchItemDialog = object(TCenterDialog)
-      constructor Init(AWatch: PWatch);
-      function    Execute: Word; virtual;
-    private
-      Watch : PWatch;
-      NameIL  : PInputLine;
-      TextST : PAdvancedStaticText;
-      CurrentIL: PLabel;
-      LastIL    : PLabel;
-    end;  *)
 
 
 constructor TWatchItemDialog.Init(AWatch: PWatch);
 constructor TWatchItemDialog.Init(AWatch: PWatch);
 var R,R2: TRect;
 var R,R2: TRect;
@@ -2265,13 +2335,13 @@ end;
 
 
 procedure InitBreakpoints;
 procedure InitBreakpoints;
 begin
 begin
-  New(BreakpointCollection,init(10,10));
+  New(BreakpointsCollection,init(10,10));
 end;
 end;
 
 
 procedure DoneBreakpoints;
 procedure DoneBreakpoints;
 begin
 begin
-  Dispose(BreakpointCollection,Done);
-  BreakpointCollection:=nil;
+  Dispose(BreakpointsCollection,Done);
+  BreakpointsCollection:=nil;
 end;
 end;
 
 
 procedure InitWatches;
 procedure InitWatches;
@@ -2293,13 +2363,22 @@ begin
   RegisterType(RBreakpointsListBox);
   RegisterType(RBreakpointsListBox);
   RegisterType(RStackWindow);
   RegisterType(RStackWindow);
   RegisterType(RFramesListBox);
   RegisterType(RFramesListBox);
+  RegisterType(RBreakpoint);
+  RegisterType(RWatch);
+  RegisterType(RBreakpointCollection);
+  RegisterType(RWatchesCollection);
 end;
 end;
 
 
 end.
 end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.31  1999-09-13 16:24:43  peter
+  Revision 1.32  1999-09-16 14:34:57  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.31  1999/09/13 16:24:43  peter
     + clock
     + clock
     * backspace unident like tp7
     * backspace unident like tp7
 
 

+ 121 - 14
ide/text/fpdesk.pas

@@ -18,7 +18,7 @@ unit FPDesk;
 interface
 interface
 
 
 const
 const
-     DesktopVersion     = $0002; { <- if you change any Load&Store methods,
+     DesktopVersion     = $0003; { <- if you change any Load&Store methods,
                                       then you should also change this }
                                       then you should also change this }
 
 
      ResDesktopFlags    = 'FLAGS';
      ResDesktopFlags    = 'FLAGS';
@@ -39,6 +39,9 @@ implementation
 uses Dos,
 uses Dos,
      Objects,Drivers,Views,App,HistList,BrowCol,
      Objects,Drivers,Views,App,HistList,BrowCol,
      WResource,WViews,WEditor,
      WResource,WViews,WEditor,
+{$ifndef NODEBUG}
+     fpdebug,
+{$endif ndef NODEBUG}
      FPConst,FPVars,FPUtils,FPViews,FPCompile,FPTools,FPHelp;
      FPConst,FPVars,FPUtils,FPViews,FPCompile,FPTools,FPHelp;
 
 
 procedure InitDesktopFile;
 procedure InitDesktopFile;
@@ -106,14 +109,102 @@ begin
   WriteClipboard:=true;
   WriteClipboard:=true;
 end;*)
 end;*)
 
 
+function ReadWatches(F: PResourceFile): boolean;
+var S: PMemoryStream;
+    OK: boolean;
+    OWC : PWatchesCollection;
+begin
+{$ifndef NODEBUG}
+  PushStatus('Reading watches...');
+  New(S, Init(32*1024,4096));
+  OK:=F^.ReadResourceEntryToStream(resWatches,langDefault,S^);
+  S^.Seek(0);
+  if OK then
+    begin
+      OWC:=WatchesCollection;
+      New(WatchesCollection,Load(S^));
+      OK:=(S^.Status=stOK);
+      if OK and assigned(OWC) then
+        Dispose(OWC,Done);
+    end;
+  ReadWatches:=OK;
+  Dispose(S, Done);
+  PopStatus;
+{$else NODEBUG}
+  ReadWatches:=true;
+{$endif NODEBUG}
+end;
+
 function WriteWatches(F: PResourceFile): boolean;
 function WriteWatches(F: PResourceFile): boolean;
+var
+  S : PMemoryStream;
+begin
+{$ifndef NODEBUG}
+  if not assigned(WatchesCollection) then
+{$endif NODEBUG}
+    WriteWatches:=true
+{$ifndef NODEBUG}
+  else
+    begin
+      PushStatus('Storing watches...');
+      New(S, Init(30*1024,4096));
+      S^.Put(WatchesCollection);
+      S^.Seek(0);
+      F^.CreateResource(resWatches,rcBinary,0);
+      WriteWatches:=F^.AddResourceEntryFromStream(resWatches,langDefault,0,S^,S^.GetSize);
+      Dispose(S, Done);
+      PopStatus;
+    end;
+{$endif NODEBUG}
+end;
+
+function ReadBreakpoints(F: PResourceFile): boolean;
+var S: PMemoryStream;
+    OK: boolean;
+    OBC : PBreakpointCollection;
 begin
 begin
-  WriteWatches:=true;
+{$ifndef NODEBUG}
+  PushStatus('Reading breakpoints...');
+  New(S, Init(32*1024,4096));
+  OK:=F^.ReadResourceEntryToStream(resBreakpoints,langDefault,S^);
+  S^.Seek(0);
+  if OK then
+    begin
+      OBC:=BreakpointsCollection;
+      New(BreakpointsCollection,Load(S^));
+      OK:=(S^.Status=stOK);
+      If OK and assigned(OBC) then
+        Dispose(OBC,Done);
+    end;
+  ReadBreakpoints:=OK;
+  Dispose(S, Done);
+  PopStatus;
+{$else NODEBUG}
+  ReadBreakpoints:=true;
+{$endif NODEBUG}
 end;
 end;
 
 
 function WriteBreakpoints(F: PResourceFile): boolean;
 function WriteBreakpoints(F: PResourceFile): boolean;
+var
+  S : PMemoryStream;
 begin
 begin
-  WriteBreakPoints:=true;
+{$ifndef NODEBUG}
+  if not assigned(BreakpointsCollection) then
+{$endif NODEBUG}
+    WriteBreakPoints:=true
+{$ifndef NODEBUG}
+  else
+    begin
+      PushStatus('Storing breakpoints...');
+      New(S, Init(30*1024,4096));
+      BreakpointsCollection^.Store(S^);
+      S^.Seek(0);
+      F^.CreateResource(resWatches,rcBinary,0);
+      WriteBreakPoints:=F^.AddResourceEntryFromStream(resWatches,langDefault,0,S^,S^.GetSize);
+      Dispose(S, Done);
+      PopStatus;
+    end;
+{$endif NODEBUG}
 end;
 end;
 
 
 function ReadOpenWindows(F: PResourceFile): boolean;
 function ReadOpenWindows(F: PResourceFile): boolean;
@@ -204,14 +295,19 @@ end;
 
 
 function WriteFlags(F: PResourceFile): boolean;
 function WriteFlags(F: PResourceFile): boolean;
 begin
 begin
-  WriteFlags:=true;
-  {$ifndef DEV}Exit;{$endif}
-
   F^.CreateResource(resDesktopFlags,rcBinary,0);
   F^.CreateResource(resDesktopFlags,rcBinary,0);
-  F^.AddResourceEntry(resDesktopFlags,langDefault,0,DesktopFileFlags,
+  WriteFlags:=F^.AddResourceEntry(resDesktopFlags,langDefault,0,DesktopFileFlags,
     SizeOf(DesktopFileFlags));
     SizeOf(DesktopFileFlags));
 end;
 end;
 
 
+function ReadFlags(F: PResourceFile): boolean;
+var
+  size : sw_word;
+begin
+  ReadFlags:=F^.ReadResourceEntry(resDesktopFlags,langDefault,DesktopFileFlags,
+    size);
+end;
+
 function ReadSymbols(F: PResourceFile): boolean;
 function ReadSymbols(F: PResourceFile): boolean;
 var S: PMemoryStream;
 var S: PMemoryStream;
     OK: boolean;
     OK: boolean;
@@ -241,7 +337,7 @@ begin
     StoreBrowserCol(S);
     StoreBrowserCol(S);
     S^.Seek(0);
     S^.Seek(0);
     F^.CreateResource(resSymbols,rcBinary,0);
     F^.CreateResource(resSymbols,rcBinary,0);
-    F^.AddResourceEntryFromStream(resSymbols,langDefault,0,S^,S^.GetSize);
+    OK:=F^.AddResourceEntryFromStream(resSymbols,langDefault,0,S^,S^.GetSize);
     Dispose(S, Done);
     Dispose(S, Done);
     PopStatus;
     PopStatus;
   end;
   end;
@@ -259,13 +355,17 @@ begin
 
 
   if OK then
   if OK then
   begin
   begin
-    ReadHistory(F);
-    ReadOpenWindows(F);
-    ReadSymbols(F);
+    OK:=ReadFlags(F);
+    if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then
+      OK:=ReadHistory(F);
+    if OK and ((DesktopFileFlags and dfWatches)<>0) then
+      OK:=ReadWatches(F);
+    if OK and ((DesktopFileFlags and dfBreakpoints)<>0) then
+      OK:=ReadBreakpoints(F);
   end;
   end;
 
 
   PopStatus;
   PopStatus;
-  LoadDesktop:=true;
+  LoadDesktop:=OK;
 end;
 end;
 
 
 function SaveDesktop: boolean;
 function SaveDesktop: boolean;
@@ -282,6 +382,8 @@ begin
       Clipboard^.Flags:=Clipboard^.Flags and not efStoreContent;
       Clipboard^.Flags:=Clipboard^.Flags and not efStoreContent;
 
 
   OK:=Assigned(F);
   OK:=Assigned(F);
+  if OK then
+    OK:=WriteFlags(F);
   if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then
   if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then
     OK:=WriteHistory(F);
     OK:=WriteHistory(F);
   if OK and ((DesktopFileFlags and dfWatches)<>0) then
   if OK and ((DesktopFileFlags and dfWatches)<>0) then
@@ -290,7 +392,7 @@ begin
     OK:=WriteBreakpoints(F);
     OK:=WriteBreakpoints(F);
   if OK and ((DesktopFileFlags and dfOpenWindows)<>0) then
   if OK and ((DesktopFileFlags and dfOpenWindows)<>0) then
     OK:=WriteOpenWindows(F);
     OK:=WriteOpenWindows(F);
-  { no errors if no browser info available PM }  
+  { no errors if no browser info available PM }
   if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then
   if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then
     OK:=WriteSymbols(F) or not Assigned(Modules);
     OK:=WriteSymbols(F) or not Assigned(Modules);
   Dispose(F, Done);
   Dispose(F, Done);
@@ -301,7 +403,12 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1999-09-07 09:23:00  pierre
+  Revision 1.10  1999-09-16 14:34:58  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.9  1999/09/07 09:23:00  pierre
    * no errors if no browser info available
    * no errors if no browser info available
 
 
   Revision 1.8  1999/08/16 18:25:16  peter
   Revision 1.8  1999/08/16 18:25:16  peter

+ 9 - 4
ide/text/fpini.pas

@@ -165,7 +165,7 @@ var PB : PBreakpoint;
     S : String;
     S : String;
 begin
 begin
   Str(I,S);
   Str(I,S);
-  PB:=BreakpointCollection^.At(I);
+  PB:=BreakpointsCollection^.At(I);
   If assigned(PB) then
   If assigned(PB) then
    With PB^ do
    With PB^ do
     Begin
     Begin
@@ -234,7 +234,7 @@ begin
        PB^.state:=state;
        PB^.state:=state;
        If SC<>'' then
        If SC<>'' then
          PB^.conditions:=NewStr(SC);
          PB^.conditions:=NewStr(SC);
-       BreakpointCollection^.Insert(PB);
+       BreakpointsCollection^.Insert(PB);
      end;
      end;
 end;
 end;
 {$endif NODEBUG}
 {$endif NODEBUG}
@@ -478,7 +478,7 @@ begin
   INIFile^.SetIntEntry(secSearch,ieFindFlags,FindFlags);
   INIFile^.SetIntEntry(secSearch,ieFindFlags,FindFlags);
   { Breakpoints }
   { Breakpoints }
 {$ifndef NODEBUG}
 {$ifndef NODEBUG}
-  BreakPointCount:=BreakpointCollection^.Count;
+  BreakPointCount:=BreakpointsCollection^.Count;
   INIFile^.SetIntEntry(secBreakpoint,ieBreakpointCount,BreakpointCount);
   INIFile^.SetIntEntry(secBreakpoint,ieBreakpointCount,BreakpointCount);
   for i:=1 to BreakpointCount do
   for i:=1 to BreakpointCount do
     WriteOneBreakPointEntry(I-1,INIFile);
     WriteOneBreakPointEntry(I-1,INIFile);
@@ -529,7 +529,12 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.23  1999-09-13 16:24:43  peter
+  Revision 1.24  1999-09-16 14:34:59  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.23  1999/09/13 16:24:43  peter
     + clock
     + clock
     * backspace unident like tp7
     * backspace unident like tp7
 
 

+ 10 - 2
ide/text/fpintf.pas

@@ -29,7 +29,10 @@ implementation
 
 
 uses
 uses
   Compiler,
   Compiler,
-  FPDebug,FPVars,FPUtils,FPSwitch;
+{$ifndef NODEBUG}
+  FPDebug,
+{$endif NODEBUG}
+  FPVars,FPUtils,FPSwitch;
 
 
 {****************************************************************************
 {****************************************************************************
                                    Run
                                    Run
@@ -108,7 +111,12 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1999-06-30 23:58:15  pierre
+  Revision 1.7  1999-09-16 14:34:59  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.6  1999/06/30 23:58:15  pierre
     + BreakpointsList Window implemented
     + BreakpointsList Window implemented
       with Edit/New/Delete functions
       with Edit/New/Delete functions
     + Individual breakpoint dialog with support for all types
     + Individual breakpoint dialog with support for all types

+ 7 - 2
ide/text/fpmrun.inc

@@ -219,7 +219,7 @@ begin
     begin
     begin
       FileName:=W^.Editor^.FileName;
       FileName:=W^.Editor^.FileName;
       LineNr:=W^.Editor^.CurPos.Y+1;
       LineNr:=W^.Editor^.CurPos.Y+1;
-      b:=BreakpointCollection^.ToggleFileLine(FileName,LineNr);
+      b:=BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
       W^.Editor^.SetLineBreakState(LineNr,b);
       W^.Editor^.SetLineBreakState(LineNr,b);
     end;
     end;
 {$else NODEBUG}
 {$else NODEBUG}
@@ -229,7 +229,12 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.20  1999-09-09 14:11:56  pierre
+  Revision 1.21  1999-09-16 14:34:59  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.20  1999/09/09 14:11:56  pierre
    * GDB needs lowercase filenames for tbreak
    * GDB needs lowercase filenames for tbreak
 
 
   Revision 1.19  1999/08/31 16:20:37  pierre
   Revision 1.19  1999/08/31 16:20:37  pierre

+ 14 - 9
ide/text/fpsymbol.pas

@@ -1077,9 +1077,9 @@ begin
                l:=Length(PS^);
                l:=Length(PS^);
                If PS^[l]='*' then
                If PS^[l]='*' then
                  begin
                  begin
-                   PB:=BreakpointCollection^.GetType(bt_function,copy(GetStr(PS),1,l-1));
+                   PB:=BreakpointsCollection^.GetType(bt_function,copy(GetStr(PS),1,l-1));
                    If Assigned(PB) then
                    If Assigned(PB) then
-                     BreakpointCollection^.Delete(PB);
+                     BreakpointsCollection^.Delete(PB);
                    Sym^.Name:=NewStr(copy(GetStr(PS),1,l-1));
                    Sym^.Name:=NewStr(copy(GetStr(PS),1,l-1));
                    DrawView;
                    DrawView;
                    DisposeStr(PS);
                    DisposeStr(PS);
@@ -1090,8 +1090,8 @@ begin
                    DrawView;
                    DrawView;
                    New(PB,init_function(GetStr(PS)));
                    New(PB,init_function(GetStr(PS)));
                    DisposeStr(PS);
                    DisposeStr(PS);
-                   BreakpointCollection^.Insert(PB);
-                   BreakpointCollection^.Update;
+                   BreakpointsCollection^.Insert(PB);
+                   BreakpointsCollection^.Update;
                  end;
                  end;
             end
             end
           else if pos('var',Sym^.GetText)>0 then
           else if pos('var',Sym^.GetText)>0 then
@@ -1102,9 +1102,9 @@ begin
                l:=Length(PS^);
                l:=Length(PS^);
                If PS^[l]='*' then
                If PS^[l]='*' then
                  begin
                  begin
-                   PB:=BreakpointCollection^.GetType(bt_awatch,copy(PS^,1,l-1));
+                   PB:=BreakpointsCollection^.GetType(bt_awatch,copy(PS^,1,l-1));
                    If Assigned(PB) then
                    If Assigned(PB) then
-                     BreakpointCollection^.Delete(PB);
+                     BreakpointsCollection^.Delete(PB);
                    Sym^.Name:=NewStr(copy(PS^,1,l-1));
                    Sym^.Name:=NewStr(copy(PS^,1,l-1));
                    DrawView;
                    DrawView;
                    DisposeStr(PS);
                    DisposeStr(PS);
@@ -1115,8 +1115,8 @@ begin
                    DrawView;
                    DrawView;
                    New(PB,init_type(bt_awatch,GetStr(PS)));
                    New(PB,init_type(bt_awatch,GetStr(PS)));
                    DisposeStr(PS);
                    DisposeStr(PS);
-                   BreakpointCollection^.Insert(PB);
-                   BreakpointCollection^.Update;
+                   BreakpointsCollection^.Insert(PB);
+                   BreakpointsCollection^.Update;
                  end;
                  end;
             end;
             end;
         end;
         end;
@@ -1160,7 +1160,12 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.18  1999-07-28 23:11:22  peter
+  Revision 1.19  1999-09-16 14:34:59  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.18  1999/07/28 23:11:22  peter
     * fixes from gabor
     * fixes from gabor
 
 
   Revision 1.17  1999/06/28 12:35:05  pierre
   Revision 1.17  1999/06/28 12:35:05  pierre

+ 9 - 2
ide/text/fpvars.pas

@@ -19,7 +19,9 @@ interface
 
 
 uses Objects,Views,App,
 uses Objects,Views,App,
      WUtils,
      WUtils,
-     FPConst,FPDebug,FPUtils,FPViews,FPCalc;
+     FPConst,
+     FPDebug,
+     FPUtils,FPViews,FPCalc;
 
 
 type
 type
     TRecentFileEntry = record
     TRecentFileEntry = record
@@ -87,7 +89,12 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.24  1999-09-13 16:24:43  peter
+  Revision 1.25  1999-09-16 14:34:59  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.24  1999/09/13 16:24:43  peter
     + clock
     + clock
     * backspace unident like tp7
     * backspace unident like tp7
 
 

+ 10 - 3
ide/text/fpviews.pas

@@ -629,6 +629,7 @@ procedure InitReservedWords;
 var WordS: string;
 var WordS: string;
     Idx,I: integer;
     Idx,I: integer;
 begin
 begin
+  InitTokens;
   for I:=Low(ReservedWords) to High(ReservedWords) do
   for I:=Low(ReservedWords) to High(ReservedWords) do
     New(ReservedWords[I], Init(50,10));
     New(ReservedWords[I], Init(50,10));
   for I:=1 to GetReservedWordCount do
   for I:=1 to GetReservedWordCount do
@@ -647,6 +648,7 @@ begin
         dispose(ReservedWords[I],done);
         dispose(ReservedWords[I],done);
         ReservedWords[I]:=nil;
         ReservedWords[I]:=nil;
       end;
       end;
+  DoneTokens;
 end;
 end;
 
 
 function IsFPReservedWord(S: string): boolean;
 function IsFPReservedWord(S: string): boolean;
@@ -2324,8 +2326,8 @@ begin
        end;
        end;
     W^.HelpCtx:=hcSourceWindow;
     W^.HelpCtx:=hcSourceWindow;
     Desktop^.Insert(W);
     Desktop^.Insert(W);
-    If assigned(BreakpointCollection) then
-      BreakPointCollection^.ShowBreakpoints(W);
+    If assigned(BreakpointsCollection) then
+      BreakpointsCollection^.ShowBreakpoints(W);
     Message(Application,evBroadcast,cmUpdate,nil);
     Message(Application,evBroadcast,cmUpdate,nil);
   end;
   end;
   PopStatus;
   PopStatus;
@@ -2777,7 +2779,12 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  1999-09-13 16:24:43  peter
+  Revision 1.42  1999-09-16 14:34:59  pierre
+    + TBreakpoint and TWatch registering
+    + WatchesCollection and BreakpointsCollection stored in desk file
+    * Syntax highlighting was broken
+
+  Revision 1.41  1999/09/13 16:24:43  peter
     + clock
     + clock
     * backspace unident like tp7
     * backspace unident like tp7