mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 13:59:20 +02:00
Fix IDE does not end debugger state (processdebugger / dbg=none), if exe can not be started. issue #0024809
git-svn-id: trunk@42358 -
This commit is contained in:
parent
8df83a3209
commit
380a764b8c
@ -91,7 +91,8 @@ end;
|
||||
procedure TProcessDebugger.ProcessDestroyed(Sender: TObject);
|
||||
begin
|
||||
FProcess := nil;
|
||||
SetState(dsStop);
|
||||
if State <> dsIdle then
|
||||
SetState(dsStop);
|
||||
end;
|
||||
|
||||
function TProcessDebugger.ProcessEnvironment(const AVariable: String; const ASet: Boolean): Boolean;
|
||||
@ -111,8 +112,12 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
SetState(dsInit);
|
||||
FProcess := TDBGProcess.Create(nil);
|
||||
try
|
||||
TDBGProcess(FProcess).OnDestroy := @ProcessDestroyed;
|
||||
GetDefaultProcessList.Add(FProcess);
|
||||
|
||||
FProcess.CommandLine := '"'+FileName + '" ' + Arguments;
|
||||
FProcess.CurrentDirectory := WorkingDir;
|
||||
FProcess.Environment.Assign(Environment);
|
||||
@ -120,13 +125,12 @@ begin
|
||||
then FProcess.Options:= [poNewConsole]
|
||||
else FProcess.Options:= [poNoConsole];
|
||||
FProcess.ShowWindow := swoShowNormal;
|
||||
TDBGProcess(FProcess).OnDestroy := @ProcessDestroyed;
|
||||
FProcess.Execute;
|
||||
GetDefaultProcessList.Add(FProcess);
|
||||
except
|
||||
on E: exception do begin
|
||||
MessageDlg('Debugger', Format('Exception while creating process: %s', [E.Message]), mtError, [mbOK], 0);
|
||||
Result := False;
|
||||
SetState(dsIdle);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user