From 190b5e77a75354bb74c9690c40ec2c79299a748b Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 9 May 2024 14:24:28 +0200 Subject: [PATCH] FpDebug: Return errors when the debugger can't start. --- components/fpdebug/fpdbgcontroller.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/fpdebug/fpdbgcontroller.pas b/components/fpdebug/fpdbgcontroller.pas index 33c4e642ab..8bb702b4e7 100644 --- a/components/fpdebug/fpdbgcontroller.pas +++ b/components/fpdebug/fpdbgcontroller.pas @@ -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;