mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 01:11:07 +02:00
FpDebug: fix race condition, during exit debug session (new command started while FDbgControllerProcessExitEvent called ProcessMessages)
This commit is contained in:
parent
efae02fac3
commit
b1a29e7546
@ -48,6 +48,7 @@ uses
|
||||
|
||||
type
|
||||
TFPDEvent = (
|
||||
deNone,
|
||||
deExitProcess, deCreateProcess,
|
||||
deLoadLibrary, deUnloadLibrary,
|
||||
deFinishedStep, deBreakpoint, deHardCodedBreakpoint,
|
||||
@ -1098,6 +1099,7 @@ type
|
||||
|
||||
const
|
||||
FPDEventNames: array[TFPDEvent] of string = (
|
||||
'deNone',
|
||||
'deExitProcess', 'deCreateProcess',
|
||||
'deLoadLibrary', 'deUnloadLibrary',
|
||||
'deFinishedStep', 'deBreakpoint', 'deHardCodedBreakpoint',
|
||||
|
@ -2101,10 +2101,12 @@ begin
|
||||
if assigned(OnProcessExitEvent) then
|
||||
OnProcessExitEvent(FCurrentProcess.ExitCode);
|
||||
|
||||
FProcessMap.Delete(FCurrentProcess.ProcessID);
|
||||
if FCurrentProcess <> nil then
|
||||
FProcessMap.Delete(FCurrentProcess.ProcessID);
|
||||
FCurrentProcess.Free;
|
||||
FCurrentProcess := nil;
|
||||
HasPauseRequest := False;
|
||||
FPDEvent := deNone;
|
||||
continue := false;
|
||||
end;
|
||||
deException:
|
||||
|
@ -4131,6 +4131,10 @@ begin
|
||||
if assigned(FDbgController) then
|
||||
FDbgController.NextOnlyStopOnStartLine := TFpDebugDebuggerProperties(GetProperties).NextOnlyStopOnStartLine;
|
||||
|
||||
// don't start new commands while exit event is processed
|
||||
if FDbgController.Event in [deExitProcess, deDetachFromProcess] then
|
||||
exit;
|
||||
|
||||
if (ACommand in [dcRun, dcStepOver, dcStepInto, dcStepOut, dcStepTo, dcRunTo, dcJumpto,
|
||||
dcStepOverInstr, dcStepIntoInstr, dcAttach]) and
|
||||
not assigned(FDbgController.MainProcess)
|
||||
|
Loading…
Reference in New Issue
Block a user