No debug hooks (AddHook, breakpoints, watchpoints throw) #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
All of the
BaseCPUdebug-hook APIs throwRecoverableException("This feature is not implemented yet")(M68HC12.cs:146-184):AddHookAtInterruptBegin/AddHookAtInterruptEndAddHookAtWfiStateChangeAddHookRemoveHookRemoveHooksAtRemoveHooksRemoveAllHooksImpact
Because
AddHook(ulong, CpuAddressHook)is what the Renode monitor uses toimplement address breakpoints and watchpoints, none of these work for the
m68hc12 CPU:
cpu AddHook 0x.../ monitorbreakpointcommands throw.cpu AddHook ... "LogRegisters"etc.) areunavailable.
This is the standard debugging surface every other Renode CPU exposes; its
absence makes the port hard to use for interactive firmware bring-up.
Current behavior
Every hook method unconditionally throws. The CPU is otherwise fully wired into
Renode (GDB server, stepping, register access all work), so the gap is isolated
to the hook plumbing.
Affected files
src/Infrastructure/src/Emulator/Peripherals/Peripherals/CPU/M68HC12/M68HC12.cs:146-184src/Infrastructure/src/Emulator/Main/Tests/UnitTests/M68HC12GdbTests.csDesired behavior
Implement the hook semantics, matching how other pure-C# interpreter CPUs in
Renode do it (the MSP430X or the ARM translator's BPU, or a simpler
interpreter that stores a dictionary of
ulong → CpuAddressHook):AddHook(addr, hook)registers a hook fired when the PC equalsaddr.RemoveHook/RemoveHooksAt/RemoveAllHooksmanage them correctly.AddHookAtInterruptBegin/Endfire on interrupt entry/return.AddHookAtWfiStateChangefires whenWAI/STOPstate changes.The natural hook point is the
ExecuteInstructionsloop (M68HC12.cs:49-70)and
HandleInterrupts/HandleInterrupt(M68HC12.cs:631-677), checking thePC against registered hooks before dispatching each instruction.
Acceptance criteria
cpu AddHook 0x...succeeds and fires at the right address (verified via ahook that logs or changes state, and via the monitor).
RemoveHook/RemoveHooksAt/RemoveAllHooksbehave correctly.Suggested approach
AddHookand reuse that pattern verbatim where license-compatible.cpu AddHookno longer throws.