Fix DCC GDB/MI debugging integration - #38
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve ntvcm's DCC GDB/MI integration after end-to-end testing with the current MIR-based DCC emitter and VS Code's
OpenDebugAD7adapter.This fixes source lookup and stepping edge cases, supports line-oriented CP/M input while debugging interactive programs, handles runtime-sized VLA watches, and substantially expands the cross-toolchain debugger regression suite.
User-visible fixes
fullnamefor source records while preserving the recordedfilevalue.CHATC11.Cagainstchatc11.cmetadata.[]and allow indexed watch access when the static outer dimension is unknown (0in DCC metadata).--interpreter=mi/-interpreter=mioption spelling so similarly prefixed CP/M arguments cannot accidentally start the MI server.Interactive CP/M input
The Debug Console is owned by GDB/MI, so plain text is normally treated as a debugger expression. This PR adds an explicit target-input bridge:
When a CP/M program requests input through blocking console input or a BDOS 6 polling loop, ntvcm reports a normal step stop.
-exec input <text>then:This was validated against the interactive DCC CALC app, including breakpoints immediately after the BDOS polling loop.
Normal-mode isolation
g_miMode.x80.cxxandx80.hxxare unchanged by this branch.main.Regression coverage
Expand
tests/debugger_mi.pyto validate both emitted metadata and debugger behavior:DCCDBG 2record class;OpenDebugAD7;The old fixed entry-byte assertion was also replaced with a protocol-level four-byte hex assertion so the MI memory-read test does not depend on a particular DCC backend encoding.
Validation
Passed locally on macOS:
./mmac.shpython3 tests/debugger_mi.py --dcc-root /Users/dave/GitHub/dcc --ntvcm ./ntvcmOpenDebugAD7via--adapterpython3 tests/cyclecheck.py ./ntvcmCPUTEST.COM(CPU TESTS OK)8080EXER.COMcomparison against cleanmain: identical output and23,835,739,337emulated cyclesNotes
The test suite remains cross-toolchain by design: it builds compact DCC fixtures, loads their generated
.COM/.DBGpairs into ntvcm, and exercises the same MI protocol used by VS Code.