LazDebuggerFp (pure): Resolved problems with freeing breakpoints after the debuggee has ended.

git-svn-id: trunk@44771 -
This commit is contained in:
joost 2014-04-20 19:39:35 +00:00
parent 87bfbf6372
commit fc35f675bc
3 changed files with 28 additions and 2 deletions

View File

@ -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)

View File

@ -225,6 +225,7 @@ end;
destructor TDbgWinProcess.Destroy;
begin
CloseHandle(FInfo.hProcess);
FInfo.hProcess:=0;
inherited Destroy;
end;

View File

@ -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);