Skip to content

Add documentation for DBI versioning - #134610

Open
rcj1 wants to merge 8 commits into
dotnet:mainfrom
rcj1:add-doc
Open

rcj1 wants to merge 8 commits into
dotnet:mainfrom
rcj1:add-doc

Conversation

@rcj1

@rcj1 rcj1 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Now that we are planning for the DBI to be shipping in a separate package as opposed to with the runtime - and in the long term to be built outside of the runtime repo - we have to consider the circumstance in which a DBI targets multiple runtime versions. Such runtime-specific concerns are largely delegated to the DacDbiInterface - however, the IPC events between runtime and DBI are an exception. #127772 was an attempt at routing some of this through the DacDbi; however, it proved to be cumbersome and did not cover adding or deleting IPC events.

We already expose version numbers in the DebuggerIPCControlBlock. The runtime and debugger version numbers must be bumped for a variety of changes. We also have to track the minimum supported runtime version for a given DBI version; this version must be bumped when a narrower set of changes to the IPC events are made. Specifically, the runtime version number is available to the DBI via memory read. This enables us to detect the runtime IPC event version, and create logic that accommodates changes; if no such logic is created, for example if the logic becomes very hard to maintain or prohibitively increases binary size, then dropping support would be indicated through the minimum supported runtime version.

To ensure compatibility, we check the runtime version, and ensure that it falls between the DBI current and minimum supported versions; otherwise we throw CORDBG_E_INCOMPATIBLE_PROTOCOL.

@rcj1
rcj1 requested a review from hoyosjs September 24, 2026 18:47
@rcj1 rcj1 self-assigned this Sep 24, 2026
Copilot AI lite review requested due to automatic review settings September 24, 2026 18:47
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Moderate compatibility issues remain around handling newly added IPC events.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

Documents runtime/debugger IPC protocol versioning to support DBI separation and compatibility checks.

Changes:

  • Renames protocol fields and updates transport/runtime initialization.
  • Adds runtime and debugger protocol history documentation.
  • Validates runtime versions against debugger-supported bounds.
File Reviewed changes
src/​coreclr/​debug/​shared/​dbgtransportsession.cpp Updates protocol field marshalling.
src/​coreclr/​debug/​inc/​IPCRuntimeProtocol.md Documents runtime protocol history.
src/​coreclr/​debug/​inc/​IPCDebuggerProtocol.md Documents debugger protocol history.
src/​coreclr/​debug/​inc/​dbgipcevents.h Defines versioning rules and renamed fields.
src/​coreclr/​debug/​ee/​rcthread.cpp Initializes runtime protocol versions.
src/​coreclr/​debug/​di/​process.cpp Publishes debugger versions and validates compatibility.

Comment thread src/coreclr/debug/di/process.cpp Outdated
Comment on lines +223 to +227
ULONG m_runtimeProtocol; // Current protocol version for the Left Side.
ULONG m_runtimeProtocolMinSupported; // Minimum protocol the Left Side can support. Equal to m_runtimeProtocol.

ULONG m_rightSideProtocolCurrent; // Current protocol version for the Right Side.
ULONG m_rightSideProtocolMinSupported; // Minimum protocol the Right Side requires.
ULONG m_debuggerProtocolCurrent; // Current protocol version for the Right Side.
ULONG m_debuggerProtocolMinSupported; // Minimum protocol the Right Side requires.
Clarify comments regarding protocol version requirements.
@rcj1
rcj1 requested a review from tommcdon September 25, 2026 19:04
@@ -0,0 +1,5 @@
### List of Debugger IPC protocol changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a place where we baseline the definitions. Particularly we'll need to baseline the DCB which is needed to initiate protocol and the current set of events.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with the current protocol.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants