monitor: honor the address argument in the /transport_dbg route#87
Open
Jordanplus wants to merge 1 commit into
Open
monitor: honor the address argument in the /transport_dbg route#87Jordanplus wants to merge 1 commit into
Jordanplus wants to merge 1 commit into
Conversation
The /transport_dbg/<int>/<str> REST route parses an address from the URL but never uses it: the payload address is hardcoded to 0, so every debug read returns the word at offset 0 of the target socket. Use the parsed address instead. Signed-off-by: McGrady Chen <jordanplus@gmail.com>
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
The monitor's
/transport_dbg/<int>/<str>REST route parses an address from the URL but never uses it. The TLM payload address is hardcoded to0, so every debug read returns the word at offset 0 of the target socket, regardless of the requested address:qbox/systemc-components/monitor/src/monitor.cc
Lines 358 to 371 in c00e7f7
This contradicts the documented behavior ("Read 4 bytes at address
<decimal_addr>"):qbox/docs/monitor-debugging-guide.md
Lines 78 to 90 in c00e7f7
Root cause
txn.set_address(0);at monitor.cc#L371 — theaddrlambda parameter is accepted but unused.Fix
One line: use the parsed
addras the transaction address.The two other
set_address(0)calls in this file (the object-hierarchy JSON preview helpers, L162 and L200) are intentional first-word previews with no address parameter available, and are left untouched.How verified
Verified on a v7.3.0-based aarch64 platform by reading device registers at non-zero offsets through the platform router via
/transport_dbg:+0x004/+0x008/+0x00Cinside a device's register window all returned the register at offset 0.Note: this likely also explains the "GIC debug transport" limitation recorded in the debugging guide (docs/monitor-debugging-guide.md#L98-L104 and #L268-L270) — the offset was being dropped by the monitor route itself, not by the GIC model. Happy to update those doc paragraphs in this PR or a follow-up, as maintainers prefer.