Browse Source

+ Disable all invalid breakpoints feature added

pierre 23 years ago
parent
commit
7f2460890b
2 changed files with 30 additions and 15 deletions
  1. 25 14
      ide/fpdebug.pas
  2. 5 1
      ide/fpstre.inc

+ 25 - 14
ide/fpdebug.pas

@@ -33,6 +33,7 @@ type
      { if true the current debugger raw will stay in middle of
      { if true the current debugger raw will stay in middle of
        editor window when debugging PM }
        editor window when debugging PM }
      CenterDebuggerRow : boolean;
      CenterDebuggerRow : boolean;
+     Disableallinvalidbreakpoints : boolean;
      LastFileName : string;
      LastFileName : string;
      LastSource   : PView; {PsourceWindow !! }
      LastSource   : PView; {PsourceWindow !! }
      HiddenStepsCount : longint;
      HiddenStepsCount : longint;
@@ -396,7 +397,7 @@ uses
   Systems,Globals,
   Systems,Globals,
   FPString,FPVars,FPUtils,FPConst,FPSwitch,
   FPString,FPVars,FPUtils,FPConst,FPSwitch,
   FPIntf,FPCompil,FPIde,FPHelp,
   FPIntf,FPCompil,FPIde,FPHelp,
-  Validate,WEditor,WUtils;
+  Validate,WEditor,WUtils,Wconsts;
 
 
 const
 const
   RBreakpointsWindow: TStreamRec = (
   RBreakpointsWindow: TStreamRec = (
@@ -603,6 +604,7 @@ constructor TDebugController.Init;
 begin
 begin
   inherited Init;
   inherited Init;
   CenterDebuggerRow:=IniCenterDebuggerRow;
   CenterDebuggerRow:=IniCenterDebuggerRow;
+  Disableallinvalidbreakpoints:=false;
   NoSwitch:=False;
   NoSwitch:=False;
   HasExe:=false;
   HasExe:=false;
   Debugger:=@self;
   Debugger:=@self;
@@ -695,6 +697,7 @@ procedure TDebugController.InsertBreakpoints;
 
 
 begin
 begin
   BreakpointsCollection^.ForEach(@DoInsert);
   BreakpointsCollection^.ForEach(@DoInsert);
+  Disableallinvalidbreakpoints:=false;
 end;
 end;
 
 
 procedure TDebugController.ReadWatches;
 procedure TDebugController.ReadWatches;
@@ -1511,19 +1514,24 @@ begin
       { Here there was a problem !! }
       { Here there was a problem !! }
         begin
         begin
           GDBIndex:=0;
           GDBIndex:=0;
-          if (typ=bt_file_line) and assigned(FileName) then
+          if not Debugger^.Disableallinvalidbreakpoints then
             begin
             begin
-              ClearFormatParams;
-              AddFormatParamStr(NameAndExtOf(FileName^));
-              AddFormatParamInt(Line);
-              ErrorBox(msg_couldnotsetbreakpointat,@FormatParams);
-            end
-          else
-            begin
-              ClearFormatParams;
-              AddFormatParamStr(BreakpointTypeStr[typ]);
-              AddFormatParamStr(GetStr(Name));
-              ErrorBox(msg_couldnotsetbreakpointtype,@FormatParams);
+              if (typ=bt_file_line) and assigned(FileName) then
+                begin
+                  ClearFormatParams;
+                  AddFormatParamStr(NameAndExtOf(FileName^));
+                  AddFormatParamInt(Line);
+                  if ChoiceBox(msg_couldnotsetbreakpointat,@FormatParams,[btn_ok,btn_disableallbreakpoints],false)=cmUserBtn2 then
+                    Debugger^.Disableallinvalidbreakpoints:=true;
+                end
+              else
+                begin
+                  ClearFormatParams;
+                  AddFormatParamStr(BreakpointTypeStr[typ]);
+                  AddFormatParamStr(GetStr(Name));
+                  if ChoiceBox(msg_couldnotsetbreakpointtype,@FormatParams,[btn_ok,btn_disableallbreakpoints],false)=cmUserBtn2 then
+                    Debugger^.Disableallinvalidbreakpoints:=true;
+                end;
             end;
             end;
           state:=bs_disabled;
           state:=bs_disabled;
         end;
         end;
@@ -4133,7 +4141,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.21  2002-06-10 19:26:48  pierre
+  Revision 1.22  2002-08-13 07:15:02  pierre
+   + Disable all invalid breakpoints feature added
+
+  Revision 1.21  2002/06/10 19:26:48  pierre
    * check if DebuggeTTY is a valid terminal
    * check if DebuggeTTY is a valid terminal
 
 
   Revision 1.20  2002/06/06 14:11:25  pierre
   Revision 1.20  2002/06/06 14:11:25  pierre

+ 5 - 1
ide/fpstre.inc

@@ -850,6 +850,7 @@ const
                                     #3+'%s:%d';
                                     #3+'%s:%d';
       msg_couldnotsetbreakpointtype = #3'Could not set Breakpoint'#13+
       msg_couldnotsetbreakpointtype = #3'Could not set Breakpoint'#13+
                                       #3+'%s %s';
                                       #3+'%s %s';
+      btn_disableallbreakpoints = 'Disable all invalid';
 
 
       { standard button texts }
       { standard button texts }
       button_OK          = 'O~K~';
       button_OK          = 'O~K~';
@@ -1032,7 +1033,10 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2002-04-12 08:59:42  pierre
+  Revision 1.10  2002-08-13 07:15:02  pierre
+   + Disable all invalid breakpoints feature added
+
+  Revision 1.9  2002/04/12 08:59:42  pierre
    + two new dialogs in case of internal errors
    + two new dialogs in case of internal errors
 
 
   Revision 1.8  2002/03/27 11:23:18  pierre
   Revision 1.8  2002/03/27 11:23:18  pierre