Query IDebugDataSpaces2/4 in the TTD adapter#1142
Draft
xusheng6 wants to merge 1 commit into
Draft
Conversation
DbgEngTTDAdapter::Start() creates its own IDebugClient7 and queries the interfaces it needs, but the base class only ever queries IDebugDataSpaces2 in ConnectToDebugServerInternal(), which the TTD adapter never goes through (it opens the trace with OpenDumpFile()). So m_debugDataSpaces2 stayed null for the whole TTD session and anything built on it silently did nothing -- GetMemoryMap() in particular returns early on a null check, so it never even called into dbgeng. Also query IDebugDataSpaces4 on both the live-debug and TTD paths. Unlike QueryVirtual, which is unimplemented for TTD replay targets, its GetValidRegionVirtual / GetNextDifferentlyValidOffsetVirtual / GetOffsetInformation do work on a trace and are useful for validating an address range. This does not fix the empty memory map widget (#1132): QueryVirtual fails on TTD targets regardless of whether the interface pointer is valid. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xusheng6
marked this pull request as draft
July 24, 2026 18:28
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.
Fixes #1141.
DbgEngTTDAdapter::Start()creates its ownIDebugClient7and queries the interfaces it needs, butIDebugDataSpaces2was only ever queried by the base class inDbgEngAdapter::ConnectToDebugServerInternal()— a path the TTD adapter never takes, since it opens the trace withOpenDumpFile().m_debugDataSpaces2therefore stayednullptrfor the entire TTD session, and code depending on it silently did nothing instead of failing visibly.GetMemoryMap()is the reachable case: it returns early onif (!m_debugDataSpaces2), so under TTD it never called into dbgeng at all.This also queries
IDebugDataSpaces4on both the live-debug and TTD paths. UnlikeQueryVirtual,IDebugDataSpaces4'sGetValidRegionVirtual/GetNextDifferentlyValidOffsetVirtual/GetOffsetInformationdo work against a TTD trace and are useful for validating whether a given address range is present.What this does not do
It does not fix the empty memory map widget (#1132).
IDebugDataSpaces2::QueryVirtual— whichGetMemoryMap()walks — is unimplemented for TTD replay targets and returnsE_UNEXPECTEDeven for an address whose bytes read back fine. WinDbg's own!addressand!vprotare equally blank on a trace. Full analysis: #1132 (comment)So this is the latent half of that investigation: worth landing on its own so the interfaces are actually available and the null-pointer path stops masking real engine behavior.
Testing
IDebugDataSpaces2;IDebugDataSpaces4is purely additive.IDebugDataSpaces2andIDebugDataSpaces4were confirmed toQueryInterfacesuccessfully (S_OK) against a TTD trace using the pinned WinDbg'sdbgeng.dll(TTD 1.01.11, release 1.11.592.0), via a standalone harness. This matters becauseQUERY_DEBUG_INTERFACEthrows on failure — both interfaces are long-standing and were observed present.BN_API_PATHand no Qt 6.11.1, so the plugin was not compiled. The changes are 10 lines following the exact pattern of the adjacentQUERY_DEBUG_INTERFACE/SAFE_RELEASElines, but CI should be the real check.🤖 Generated with Claude Code