Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 01:13
· 16 commits to main since this release

v4_cli v0.4.0 - Debugging Meta-Commands

This release adds powerful debugging meta-commands to the v4_cli REPL, enabling real-time VM introspection over the V4-link serial protocol.

New Features

Debugging Meta-Commands

  • .stack - Display data stack and return stack contents

    • Shows stack depth and all values
    • Displays values in both hex and decimal
  • .rstack - Display return stack with call trace

    • Useful for debugging nested word calls
    • Shows execution flow through return addresses
  • .dump [addr] [len] - Hexdump memory at specified address

    • Default: 256 bytes from address 0
    • 16-byte rows with hex and ASCII representation
    • Essential for inspecting VM memory state
  • .see <word_idx> - Show word bytecode disassembly

    • Displays word name and bytecode length
    • Shows raw bytecode in hexadecimal
    • Helps understand compiled word structure

V4-link Protocol Extensions

Added three new query commands to enable remote debugging:

  • QueryStack (0x30) - Query stack state from device
  • QueryMemory (0x40) - Query memory dump from device
  • QueryWord (0x50) - Query word information from device

All query responses include structured data payloads for parsing on the host.

Internal Improvements

  • Enhanced Response struct with data field for query payloads
  • Added serial protocol methods: query_stack(), query_memory(), query_word()
  • Added V4Error::Cli variant for user input validation
  • Updated .help command to document new debugging features

Example Usage

```forth
v4> : SQUARE DUP * ;
ok

v4> 5 SQUARE
ok

v4> .stack
Data Stack (depth: 1 / 256):
[0]: 0x00000019 (25)

Return Stack (depth: 0 / 64):

v4> .dump 0 64
Memory dump at 0x00000000 (64 bytes):

00000000 A5 00 10 20 42 00 00 00 00 00 00 00 00 00 00 00 |... B...........|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
```

Breaking Changes

None - this release is fully backward compatible.

Requirements

  • V4-link v0.3.0+ with query command support
  • V4-runtime v0.3.0+ or compatible firmware

Full Changelog: v0.3.0...v0.4.0