mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 15:59:09 +02:00
LazDebuggerFpGdbmi: fixed a crash in watches eval, after cancel of watch eval due to dbg error.
git-svn-id: trunk@61056 -
This commit is contained in:
parent
aea75fde5e
commit
142b226591
@ -94,6 +94,7 @@ type
|
|||||||
property CurrentCommand;
|
property CurrentCommand;
|
||||||
property TargetPID;
|
property TargetPID;
|
||||||
protected
|
protected
|
||||||
|
procedure ClearWatchEvalList;
|
||||||
procedure DoWatchFreed(Sender: TObject);
|
procedure DoWatchFreed(Sender: TObject);
|
||||||
function EvaluateExpression(AWatchValue: TWatchValue;
|
function EvaluateExpression(AWatchValue: TWatchValue;
|
||||||
AExpression: String;
|
AExpression: String;
|
||||||
@ -347,7 +348,7 @@ end;
|
|||||||
|
|
||||||
procedure TFpGDBMIDebuggerCommandEvaluate.DoCancel;
|
procedure TFpGDBMIDebuggerCommandEvaluate.DoCancel;
|
||||||
begin
|
begin
|
||||||
FOwner.FpDebugger.FWatchEvalList.Clear;
|
FOwner.FpDebugger.ClearWatchEvalList;
|
||||||
FOwner.FEvaluationCmdObj := nil;
|
FOwner.FEvaluationCmdObj := nil;
|
||||||
inherited DoCancel;
|
inherited DoCancel;
|
||||||
end;
|
end;
|
||||||
@ -735,13 +736,8 @@ begin
|
|||||||
if OldState in [dsPause, dsInternalPause] then begin
|
if OldState in [dsPause, dsInternalPause] then begin
|
||||||
for i := 0 to MAX_CTX_CACHE-1 do
|
for i := 0 to MAX_CTX_CACHE-1 do
|
||||||
ReleaseRefAndNil(FLastContext[i]);
|
ReleaseRefAndNil(FLastContext[i]);
|
||||||
if not(State in [dsPause, dsInternalPause]) then begin
|
if not(State in [dsPause, dsInternalPause]) then
|
||||||
for i := 0 to FWatchEvalList.Count - 1 do begin
|
ClearWatchEvalList;
|
||||||
TWatchValue(FWatchEvalList[i]).RemoveFreeNotification(@DoWatchFreed);
|
|
||||||
//TWatchValueBase(FWatchEvalList[i]).Validity := ddsInvalid;
|
|
||||||
end;
|
|
||||||
FWatchEvalList.Clear;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -950,6 +946,17 @@ begin
|
|||||||
// TODO Result.AddReference;
|
// TODO Result.AddReference;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFpGDBMIDebugger.ClearWatchEvalList;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
for i := 0 to FWatchEvalList.Count - 1 do begin
|
||||||
|
TWatchValue(FWatchEvalList[i]).RemoveFreeNotification(@DoWatchFreed);
|
||||||
|
//TWatchValueBase(FWatchEvalList[i]).Validity := ddsInvalid;
|
||||||
|
end;
|
||||||
|
FWatchEvalList.Clear;
|
||||||
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
TGDBMIDwarfTypeIdentifier = class(TFpDwarfSymbolType)
|
TGDBMIDwarfTypeIdentifier = class(TFpDwarfSymbolType)
|
||||||
public
|
public
|
||||||
@ -1164,6 +1171,7 @@ destructor TFpGDBMIDebugger.Destroy;
|
|||||||
begin
|
begin
|
||||||
CurrentDebugger := nil;
|
CurrentDebugger := nil;
|
||||||
UnLoadDwarf;
|
UnLoadDwarf;
|
||||||
|
ClearWatchEvalList;
|
||||||
FWatchEvalList.Free;
|
FWatchEvalList.Free;
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user