Commit graph

8 commits

Author SHA1 Message Date
Marc Durdin
a160a5c709 chore(developer): move source files to /developer/src 2022-05-18 10:34:48 +10:00
Marc Durdin
82a8bd3242 fix(developer): handle Core failure to load
If Core fails to load when starting the debugger, avoid a crash and
report details of the error back to the user.
2022-01-24 07:17:52 +11:00
Marc Durdin
3d488c4ead feat(developer): Debugger keyboard options
Fixes #5642.
Relates to #5013.

This adds support for viewing and setting keyboard options in the
debugger. This initial implementation does not have 100% coverage of
keyboard options; specifically:

1. keyboard options are not saved between debug sessions.
2. in single-step debugging, the keyboard options will be shown as
   updated at the start of a keystroke batch, not when the rule which
   calls `set()` is fired. This level of granularity is not currently
   visible from the engine. It does not impact the correctness of the
   rule processing, only the view of the current state of the keyboard
   option.

I do not anticipate supporting either of those functions in 15.0.

This commit renames the existing `TfrmDebugStatus_Options` to
`TfrmDebugStatus_Platform`. I had originally planned to show both the
platform and keyboard options in the same debug status window, but for
space reasons I have split them. (I'm sorry if this makes reading the
PR a little more challenging.)

There is a significant amount of rewriting of kmxfileutils.pas and
debugkeyboard.pas. This extends support for working with kmx files and
modernises the code (e.g. using generics for list types).

Note in particular the `ExpandSentinel` function in kmxfileutils.pas.
This is copied from CompileKeymanWeb.pas but has different internal
references, so cannot be used as-is -- CompileKeymanWeb works with
intermediate object 'files' from the kmx compiler, whereas the debugger
works with final binary .kmx files which have a different in-memory
layout. It may be possible to unify this in future but that would
involve additional risk. (Seriously, I would probably prefer to rewrite
CompileKeymanWeb.pas in C++, Rust or TypeScript than to invest in
merging these two use cases.)
2021-08-27 11:07:00 +10:00
Marc Durdin
1f6aac7fd7 feat(developer): Debugger platform option
Relates to #5013.

Adds a debug status page to allow the user to select an alternative
platform so they can debug rules relating to those platforms which
are constrained by the `platform()` statement in the keyboard source.

Note that while touch platforms are listed here, there is not yet any
method of activating touch key events (e.g. `[T_foo]`). This
functionality is planned for a future update.
2021-08-26 10:12:57 +10:00
Marc Durdin
142d0807a3 refactor(developer): move FDeadkeys back into frmDebug 2021-08-04 13:09:32 +10:00
Marc Durdin
4ed4aeebf6 refactor(developer): keyman core library path 2021-08-04 12:46:07 +10:00
Marc Durdin
63f8137005 refactor(developer): rename and move debugging.pas
Removes a lot of unused functions and one unit. Cleanup for debugging.
2021-08-04 09:44:56 +10:00
Marc Durdin
c5eb0a4d3f feat(developer): refactoring debugging code 2021-08-03 17:06:31 +10:00