mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 06:16:12 +02:00
LazDebuggerFp (pure): Resolved problems with freeing breakpoints after the debuggee has ended.
git-svn-id: trunk@44771 -
This commit is contained in:
parent
87bfbf6372
commit
fc35f675bc
@ -557,7 +557,23 @@ begin
|
||||
end;
|
||||
|
||||
destructor TDbgProcess.Destroy;
|
||||
var
|
||||
Bp: TDbgBreakpoint;
|
||||
Iterator: TMapIterator;
|
||||
begin
|
||||
iterator := TMapIterator.Create(FBreakMap);
|
||||
try
|
||||
Iterator.First;
|
||||
while not Iterator.EOM do
|
||||
begin
|
||||
Iterator.GetData(bp);
|
||||
Bp.Free;
|
||||
iterator.Next;
|
||||
end;
|
||||
finally
|
||||
Iterator.Free;
|
||||
end;
|
||||
|
||||
FreeAndNil(FBreakMap);
|
||||
FreeAndNil(FThreadMap);
|
||||
FreeAndNil(FLibMap);
|
||||
@ -917,6 +933,10 @@ end;
|
||||
|
||||
procedure TDbgBreakpoint.ResetBreak;
|
||||
begin
|
||||
if FProcess.Handle=0 then
|
||||
// The process is already exited.
|
||||
Exit;
|
||||
|
||||
if FOrgValue = $CC then Exit; // breakpoint on a hardcoded breakpoint
|
||||
|
||||
if not FProcess.WriteData(FLocation, 1, FOrgValue)
|
||||
|
@ -225,6 +225,7 @@ end;
|
||||
destructor TDbgWinProcess.Destroy;
|
||||
begin
|
||||
CloseHandle(FInfo.hProcess);
|
||||
FInfo.hProcess:=0;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
|
@ -205,8 +205,8 @@ begin
|
||||
begin
|
||||
TFpDebugDebugger(Debugger).FDbgController.CurrentProcess.RemoveBreak(FInternalBreakpoint.Location);
|
||||
FreeAndNil(FInternalBreakpoint);
|
||||
FIsSet:=false;
|
||||
end;
|
||||
FIsSet:=false;
|
||||
end;
|
||||
|
||||
destructor TFPBreakpoint.Destroy;
|
||||
@ -229,6 +229,11 @@ begin
|
||||
FResetBreakFlag:=true;
|
||||
Changed;
|
||||
end;
|
||||
end
|
||||
else if Debugger.State = dsStop then
|
||||
begin
|
||||
FInternalBreakpoint := nil;
|
||||
FIsSet:=false;
|
||||
end;
|
||||
inherited DoStateChange(AOldState);
|
||||
end;
|
||||
@ -579,8 +584,8 @@ begin
|
||||
{$PUSH}{$R-}
|
||||
DoDbgEvent(ecProcess, etProcessExit, Format('Process exited with exit-code %d',[AExitCode]));
|
||||
{$POP}
|
||||
FreeDebugThread;
|
||||
SetState(dsStop);
|
||||
FreeDebugThread;
|
||||
end;
|
||||
|
||||
procedure TFpDebugDebugger.FDbgControllerExceptionEvent(var continue: boolean);
|
||||
|
Loading…
Reference in New Issue
Block a user