diff --git a/debugger/dbgutils.pp b/debugger/dbgutils.pp index d4c97aff1d..11e1332868 100644 --- a/debugger/dbgutils.pp +++ b/debugger/dbgutils.pp @@ -42,7 +42,7 @@ function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String): St function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; const AnIgnoreCase: Boolean): String; overload; function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; const AnIgnoreCase, AnUpdateSource: Boolean): String; overload; function ConvertToCString(const AText: String): String; -function DeleteBackSlashes(const AText: String): String; +function DeleteEscapeChars(const AText: String; const AEscapeChar: Char): String; const {$IFDEF WIN32} @@ -202,16 +202,19 @@ begin end; end; -function DeleteBackSlashes(const AText: String): String; +function DeleteEscapeChars(const AText: String; const AEscapeChar: Char): String; var i: Integer; l: Integer; + Escape: Boolean; begin Result:=AText; + Escape := False; i:=1; l:=length(Result); while inil then begin - // switch the debugger into a state, where the IDE can change its items - - // quick hack: simply forbid editing during run - if FDebugger.State in dsRunStates then begin - Result:=mrCancel; - MessageDlg('Program is running', - 'You can not change any debugger item while the program is running.'#13 - +'Pause or Stop it first.',mtError,[mbCancel],0); - end else - Result:=mrOk; - if Result<>mrOk then begin - dec(FDebuggerUpdateLock); - exit; - end; - end; - end; - Result:=mrOk; -end; - -function TDebugManager.DoEndChangeDebugger: TModalResult; -begin - if FDebuggerUpdateLock<=0 then - RaiseException('TDebugManager.DoEndChangeDebugger'); - dec(FDebuggerUpdateLock); - if FDebuggerUpdateLock=0 then begin - // the update has ended -> restore the debugger state - if FDebugger<>nil then begin - Result:=mrOk; - - if Result<>mrOk then exit; - end; - end; - Result:=mrOk; -end; - procedure TDebugManager.DoToggleCallStack; begin ViewDebugDialog(ddtCallStack); @@ -1308,10 +1267,8 @@ end; function TDebugManager.DoCreateBreakPoint(const AFilename: string; ALine: integer): TModalResult; begin - Result:=DoBeginChangeDebugger; - if Result<>mrOk then exit; FBreakPoints.Add(AFilename, ALine); - Result:=DoEndChangeDebugger; + Result := mrOK end; function TDebugManager.DoDeleteBreakPoint(const AFilename: string; @@ -1319,13 +1276,11 @@ function TDebugManager.DoDeleteBreakPoint(const AFilename: string; var OldBreakPoint: TIDEBreakPoint; begin - Result:=DoBeginChangeDebugger; - if Result<>mrOk then exit; OldBreakPoint:=FBreakPoints.Find(AFilename,ALine); if OldBreakPoint=nil then exit; OldBreakPoint.Free; Project1.Modified:=true; - Result:=DoEndChangeDebugger; + Result := mrOK end; function TDebugManager.DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark @@ -1339,13 +1294,11 @@ begin RaiseException('TDebugManager.DoDeleteBreakPointAtMark'); writeln('TDebugManager.DoDeleteBreakPointAtMark A ',ASourceMark.GetFilename,' ',ASourceMark.Line); - Result:=DoBeginChangeDebugger; - if Result<>mrOk then exit; OldBreakPoint:=TIDEBreakPoint(ASourceMark.Data); writeln('TDebugManager.DoDeleteBreakPointAtMark B ',OldBreakPoint.ClassName,' ',OldBreakPoint.Source,' ',OldBreakPoint.Line); OldBreakPoint.Free; Project1.Modified:=true; - Result:=DoEndChangeDebugger; + Result := mrOK end; function TDebugManager.DoViewBreakPointProperties(ABreakpoint: TIDEBreakPoint @@ -1359,13 +1312,11 @@ function TDebugManager.DoCreateWatch(const AExpression: string): TModalResult; var NewWatch: TDBGWatch; begin - Result:=DoBeginChangeDebugger; - if Result<>mrOk then exit; NewWatch := FWatches.Add(AExpression); NewWatch.Enabled := True; NewWatch.InitialEnabled := True; Project1.Modified:=true; - Result:=DoEndChangeDebugger; + Result := mrOK end; function TDebugManager.DoRunToCursor: TModalResult; @@ -1420,6 +1371,9 @@ end. { ============================================================================= $Log$ + Revision 1.51 2003/06/10 23:48:26 marc + MWE: * Enabled modification of breakpoints while running + Revision 1.50 2003/06/09 15:58:05 mattias implemented view call stack key and jumping to last stack frame with debug info