FpDebug: Return errors when the debugger can't start.

This commit is contained in:
Martin 2024-05-09 14:24:28 +02:00
parent 0697e71dbf
commit 190b5e77a7

View File

@ -2157,10 +2157,12 @@ begin
if FExecutableFilename = '' then begin
DebugLn(DBG_WARNINGS, 'No filename given to execute.');
FLastError := CreateError(fpInternalErr, ['No filename given to execute.']);
Exit;
end;
if not FileExists(FExecutableFilename) then begin
DebugLn(DBG_WARNINGS, 'File %s does not exist.',[FExecutableFilename]);
FLastError := CreateError(fpInternalErr, ['File does not exist: ' + FExecutableFilename]);
Exit;
end;
@ -2168,6 +2170,7 @@ begin
CheckExecutableAndLoadClasses;
if not Assigned(OsDbgClasses) then begin
DebugLn(DBG_WARNINGS, 'Error - No support registered for debug target');
FLastError := CreateError(fpInternalErr, ['Unknown target for file: ' + FExecutableFilename]);
Exit;
end;
@ -2176,6 +2179,7 @@ begin
if not Assigned(Result) then begin
DebugLn(DBG_WARNINGS, 'Error - could not create TDbgProcess');
FLastError := CreateError(fpInternalErr, ['could not create TDbgProcess']);
Exit;
end;
end;