From 2e918ba89337ff2a1b6da39773bbf6144403d79f Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Fri, 25 May 2018 14:00:29 +0700 Subject: [PATCH] Fixes #762. The debugger should check that build succeeded before attempting to start. --- .../developer/TIKE/child/UfrmKeymanWizard.pas | 19 ++++++++++++++++++- .../src/developer/TIKE/rel/keymanstrings.pas | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas index 4fb2fa1607..5667d1aea8 100644 --- a/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas +++ b/windows/src/developer/TIKE/child/UfrmKeymanWizard.pas @@ -564,6 +564,7 @@ uses kmxfile, OnlineConstants, Project, + ProjectFileUI, RegExpr, ErrorControlledRegistry, RedistFiles, @@ -989,6 +990,9 @@ procedure TfrmKeymanWizard.StartDebugging(FStartTest: Boolean); ki: TKeyboardInfo; buf: WideString; begin + if not FileExists((ProjectFile as TkmnProjectFile).TargetFilename) then + Exit(False); + try GetKeyboardInfo((ProjectFile as TkmnProjectFile).TargetFilename, True, ki); // I4695 try @@ -1038,7 +1042,20 @@ begin FDebugForm.CanDebug := True; FDebugForm.UIStatus := duiReadyForInput; (ProjectFileUI as TkmnProjectFileUI).Debug := True; // I4687 - modActionsKeyboardEditor.actKeyboardCompile.Execute; + + frmMessages.Clear; // I4686 + + if not (ProjectFileUI as TkmnProjectFileUI).DoAction(pfaCompile, False) then + begin + ShowMessage(SKErrorsInCompile); + Exit; + end; + + if not FileExists((ProjectFile as TkmnProjectFile).TargetFilename) then + begin + ShowMessage(SKKeyboardKMXDoesNotExist); + Exit; + end; if not KeyboardContainsDebugInformation then begin diff --git a/windows/src/developer/TIKE/rel/keymanstrings.pas b/windows/src/developer/TIKE/rel/keymanstrings.pas index 4bcb618e82..8e3e441a4f 100644 --- a/windows/src/developer/TIKE/rel/keymanstrings.pas +++ b/windows/src/developer/TIKE/rel/keymanstrings.pas @@ -21,6 +21,8 @@ interface const SKMustIncludeDebug = 'You must include debug information to start the debugger. Check ''Include debug information'' in the Keyboard menu.'; + SKErrorsInCompile = 'The keyboard did not compile successfully. Unable to start debugger.'; + SKKeyboardKMXDoesNotExist = 'The keyboard .kmx output file does not exist. The keyboard must target Windows or macOS for interactive debugging.'; implementation