Fixes #762. The debugger should check that build succeeded before attempting to start.

This commit is contained in:
Marc Durdin 2018-05-25 14:00:29 +07:00
parent 0cdb3d46c4
commit 2e918ba893
2 changed files with 20 additions and 1 deletions

View file

@ -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

View file

@ -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