Repository navigation
Fix the monitor for the current dmod API and for Renode's GDB server - #56
Merged
Merged
Conversation
dmod now requires DMOD_CURRENT_ALLOCATOR on the system side and Dmod_Malloc/Dmod_Free became macros over Dmod_MallocEx/Dmod_FreeEx, with the plain Dmod_Malloc/Dmod_Free functions removed. - tools/monitor/monitor.c never included dmod.h and relied on implicit declarations of Dmod_Malloc/Dmod_Free/Dmod_File*; with no Dmod_Malloc symbol left, linking dmlog_monitor failed (this is what breaks the dmod-boot Renode test, which builds the monitor on the host). Include dmod.h so the macros expand; dmod_add_tool() already defines the allocator for the tool. - tests/CMakeLists.txt: the test executables are raw add_executable targets, so they hit dmod_sal.h's #error. Call dmod_set_current_allocator() for each of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv
With the GDB backend each ring read interrupts the target and resumes it afterwards, and monitor_wait_for_new_data() polled every 10 ms. Under Renode such a short window lets the firmware execute next to nothing, so once the monitor had caught up with the ring the target effectively stopped: dmod-boot's boot never got past loading its drivers while monitor-gdb was attached. Poll every 200 ms with the GDB backend; OpenOCD keeps the 10 ms interval. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv
JohnAmadis
pushed a commit
to choco-technologies/dmod-boot
that referenced
this pull request
Sep 30, 2026
choco-technologies/dmlog#56 is merged; fb05e82 is its merge commit, with the same tree as the branch commit tested here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv
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.
Problem
This PR fixes two problems that together broke the dmod-boot Renode test (choco-technologies/dmod-boot#102).
develop(which dmlog fetches) now requiresDMOD_CURRENT_ALLOCATORon the system side.Dmod_MallocandDmod_Freebecame macros overDmod_MallocEx/Dmod_FreeEx, and the plain functions are gone.tools/monitor/monitor.cnever includeddmod.hand relied on implicit declarations, sodmlog_monitorfailed to link:undefined reference to 'Dmod_Malloc'.add_executabletargets, so they hit the#error DMOD_CURRENT_ALLOCATOR must be definedindmod_sal.h.monitor_wait_for_new_data()polled every 10 ms. Under Renode that window lets the firmware execute almost nothing. Once the monitor catches up with the ring, the target is effectively stopped. The dmod-boot boot never got past configuring its drivers whilemonitor-gdbwas attached: 240 s with the ring head not moving.Fix
monitor.c:#include "dmod.h".tests/CMakeLists.txt: calldmod_set_current_allocator()for each test executable.monitor_wait_for_new_data(): poll every 200 ms with the GDB backend. OpenOCD keeps 10 ms.Verification
develop:ctestpasses 5/5, andtests/test_automated_gdb.shpasses 7/7 (gdbserver backend, including the file transfer scenarios).scripts/run_renode_tests.sh, run locally inchocotechnologies/dmboot:1.0.0with this monitor:DMOD-Boot started ... ✓ FOUND,Renode emulation tests PASSED(3 runs). Without the poll change the same setup fails.🤖 Generated with Claude Code
https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv