mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 14:56:00 +02:00
LazDebuggerFp: improve error handling
This commit is contained in:
parent
c8d378a70d
commit
552fd1dce8
@ -1032,13 +1032,15 @@ end;
|
||||
procedure TFpThreadWorkerWatchValueEvalUpdate.UpdateWatch_DecRef(Data: PtrInt);
|
||||
var
|
||||
dbg: TFpDebugDebuggerBase;
|
||||
w: TWatchValueIntf;
|
||||
begin
|
||||
assert(system.ThreadID = classes.MainThreadID, 'TFpThreadWorkerWatchValueEval.UpdateWatch_DecRef: system.ThreadID = classes.MainThreadID');
|
||||
|
||||
if FWatchValue <> nil then begin
|
||||
FWatchValue.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
FWatchValue.EndUpdate;
|
||||
w := FWatchValue;
|
||||
FWatchValue := nil;
|
||||
w.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
w.EndUpdate;
|
||||
end;
|
||||
|
||||
dbg := FDebugger;
|
||||
@ -1047,13 +1049,16 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFpThreadWorkerWatchValueEvalUpdate.DoRemovedFromLinkedList;
|
||||
var
|
||||
w: TWatchValueIntf;
|
||||
begin
|
||||
if FWatchValue <> nil then begin
|
||||
FWatchValue.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
if FWatchValue.Validity = ddsRequested then
|
||||
FWatchValue.Validity := ddsInvalid;
|
||||
FWatchValue.EndUpdate;
|
||||
FWatchValue := nil;
|
||||
w := FWatchValue;
|
||||
w.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
if w.Validity = ddsRequested then
|
||||
w.Validity := ddsInvalid;
|
||||
w.EndUpdate;
|
||||
end;
|
||||
UnQueue_DecRef;
|
||||
end;
|
||||
|
@ -423,14 +423,17 @@ begin
|
||||
exit;
|
||||
FLocked := True;
|
||||
WorkItem := FNextWorker;
|
||||
while (WorkItem <> nil) and (WorkItem.RefCount = 1) do begin
|
||||
w := WorkItem;
|
||||
WorkItem := w.FNextWorker;
|
||||
w.DoRemovedFromLinkedList;
|
||||
w.DecRef;
|
||||
try
|
||||
while (WorkItem <> nil) and (WorkItem.RefCount = 1) do begin
|
||||
w := WorkItem;
|
||||
WorkItem := w.FNextWorker;
|
||||
w.DoRemovedFromLinkedList;
|
||||
w.DecRef;
|
||||
end;
|
||||
finally
|
||||
FNextWorker := WorkItem;
|
||||
FLocked := False;
|
||||
end;
|
||||
FNextWorker := WorkItem;
|
||||
FLocked := False;
|
||||
end;
|
||||
|
||||
procedure TFpDbgDebggerThreadWorkerLinkedList.RequestStopForWorkers;
|
||||
@ -456,17 +459,20 @@ begin
|
||||
FLocked := True;
|
||||
WorkItem := FNextWorker;
|
||||
FNextWorker := nil;
|
||||
while (WorkItem <> nil) do begin
|
||||
w := WorkItem;
|
||||
WorkItem := w.FNextWorker;
|
||||
if w.IsCancelled then
|
||||
w.FDebugger.WorkQueue.RemoveItem(w)
|
||||
else
|
||||
w.FDebugger.WorkQueue.WaitForItem(w);
|
||||
w.DoRemovedFromLinkedList;
|
||||
w.DecRef;
|
||||
try
|
||||
while (WorkItem <> nil) do begin
|
||||
w := WorkItem;
|
||||
WorkItem := w.FNextWorker;
|
||||
if w.IsCancelled then
|
||||
w.FDebugger.WorkQueue.RemoveItem(w)
|
||||
else
|
||||
w.FDebugger.WorkQueue.WaitForItem(w);
|
||||
w.DoRemovedFromLinkedList;
|
||||
w.DecRef;
|
||||
end;
|
||||
finally
|
||||
FLocked := False;
|
||||
end;
|
||||
FLocked := False;
|
||||
end;
|
||||
|
||||
{ TFpThreadWorkerControllerRun }
|
||||
|
Loading…
Reference in New Issue
Block a user