This commit is contained in:
Ivan Bondarev 2021-08-11 13:55:30 +02:00
parent 8ca0a00baf
commit 3ca817cf80
2 changed files with 9 additions and 2 deletions

View file

@ -279,11 +279,12 @@ namespace VisualPascalABC
StartedProcesses.Add(fileName, PRunner);
StartedFiles.Add(PRunner, fileName);
string ReadSignalName=null;
if (Starting != null)
Starting(fileName);
try
{
PRunner.Start(fileName, args, redirectIO, redirectErrors, RunWithPause, attachDebugger, fictive_attach);
if (Starting != null)
Starting(fileName);
if ((PRunner.TempBatFile != null) && !TempBatFiles.ContainsKey(fileName))
TempBatFiles.Add(fileName, PRunner.TempBatFile);
if (redirectIO)
@ -301,7 +302,11 @@ namespace VisualPascalABC
#if DEBUG
File.AppendAllText("logRun.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
#endif
if (!WorkbenchServiceFactory.Workbench.UserOptions.AlwaysAttachDebuggerAtStart)
WorkbenchServiceFactory.Workbench.DebuggerManager.NullProcessHandleIfNeed(fileName);
RemoveFromTables(fileName);
if (Exited != null)
Exited(fileName);
throw; // Это не перехватывается и приводит к вылету оболочки - SSM 22/04/19
}
}

View file

@ -206,8 +206,10 @@ namespace VisualPascalABC
{
// SSM 22/04/19 - исправляю вылет оболочки при отсутствии exe файла
// this.RunnerManager_Exited(OutputFileName); // - это всё равно не срабатывает. Кнопки оказываются в заблокированном состоянии
WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(OutputFileName, "Произошла непредвиденная ошибка. Вероятно, на диске отсутствует .exe-файл. Повторите запуск");
//throw;
return false;
}
if (!ProjectFactory.Instance.ProjectLoaded)
DocumentService.ActiveCodeFileDocument = tabPage;