Skip to content

Delete debugger regdisplay - #129671

Merged
rcj1 merged 5 commits into
dotnet:mainfrom
rcj1:delete-DebuggerREGDISPLAY
Jun 25, 2026
Merged

Delete debugger regdisplay#129671
rcj1 merged 5 commits into
dotnet:mainfrom
rcj1:delete-DebuggerREGDISPLAY

Conversation

@rcj1

@rcj1rcj1 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

This is not intended to be the final form; I intend to delete these platform-specific register readers altogether. This is just the first stage of a larger refactor, separated out such that we can remove the associated DacDbi API as well as remove the data structure from the API surface.

@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.

CopilotAI 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.

Pull request overview

This PR removes the DebuggerREGDISPLAY plumbing from the DacDbi surface area and migrates the right-side/debugger register and stack-walk codepaths to operate directly on DT_CONTEXT (including deleting multiple platform-specific regdisplay conversion helpers).

Changes:

  • Remove DebuggerREGDISPLAY from native and managed DacDbi APIs (Debugger_STRData no longer carries rd, and ConvertContextToDebuggerRegDisplay is deleted).
  • Delete platform-specific SetDebuggerREGDISPLAYFromREGDISPLAY helpers and update callers to use DT_CONTEXT-based accessors.
  • Refactor CordbRegisterSet/CordbNativeFrame to store and consume DT_CONTEXT directly, and adjust CORDbgGetSP to return CORDB_ADDRESS.
Show a summary per file
FileDescription
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.csUpdates managed interop definitions to match the removed regdisplay pointer/method.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.csDrops the regdisplay conversion method and updates frame enumeration commentary.
src/coreclr/inc/dacdbi.idlRemoves DebuggerREGDISPLAY forward decl and the regdisplay conversion method from the COM IDL.
src/coreclr/debug/shared/riscv64/primitives.cppDeletes RISCV64 regdisplay conversion helper.
src/coreclr/debug/shared/loongarch64/primitives.cppDeletes LoongArch64 regdisplay conversion helper.
src/coreclr/debug/shared/i386/primitives.cppDeletes x86 context/regdisplay conversion helpers.
src/coreclr/debug/shared/arm64/primitives.cppDeletes ARM64 regdisplay conversion helper.
src/coreclr/debug/shared/arm/primitives.cppDeletes ARM regdisplay conversion helpers.
src/coreclr/debug/shared/amd64/primitives.cppDeletes AMD64 context/regdisplay conversion helpers.
src/coreclr/debug/inc/riscv64/primitives.hChanges CORDbgGetSP to return CORDB_ADDRESS.
src/coreclr/debug/inc/loongarch64/primitives.hChanges CORDbgGetSP to return CORDB_ADDRESS.
src/coreclr/debug/inc/i386/primitives.hChanges CORDbgGetSP to return CORDB_ADDRESS.
src/coreclr/debug/inc/dbgipcevents.hRemoves DebuggerREGDISPLAY struct and switches SP/FP address helpers to DT_CONTEXT.
src/coreclr/debug/inc/dacdbistructures.hRemoves the DebuggerREGDISPLAY* field from Debugger_STRData.
src/coreclr/debug/inc/dacdbiinterface.hRemoves ConvertContextToDebuggerRegDisplay from the native interface.
src/coreclr/debug/inc/common.hRemoves the DebuggerREGDISPLAY forward decl and related helper declaration.
src/coreclr/debug/inc/arm64/primitives.hChanges CORDbgGetSP to return CORDB_ADDRESS.
src/coreclr/debug/inc/arm/primitives.hChanges CORDbgGetSP to return CORDB_ADDRESS.
src/coreclr/debug/inc/amd64/primitives.hChanges CORDbgGetSP to return CORDB_ADDRESS.
src/coreclr/debug/ee/i386/regdisplayhelper.cppRenames/rebrands helper file header comment to REGDISPLAY-to-REGDISPLAY transfer.
src/coreclr/debug/ee/debugger.hRemoves regdisplay helper declarations/macros no longer applicable.
src/coreclr/debug/ee/CMakeLists.txtUpdates source list to new helper filename.
src/coreclr/debug/ee/amd64/regdisplayhelper.cppRenames/rebrands helper file header comment to REGDISPLAY-to-REGDISPLAY transfer.
src/coreclr/debug/di/shimstackwalk.cppAdjusts stack pointer handling to the new CORDbgGetSP return type.
src/coreclr/debug/di/rsthread.cppRefactors register set + native frame code to use DT_CONTEXT instead of DebuggerREGDISPLAY.
src/coreclr/debug/di/rsstackwalk.cppStops allocating/passing regdisplay buffers; passes only DT_CONTEXT through Debugger_STRData.
src/coreclr/debug/di/rsregsetcommon.cppUpdates CordbRegisterSet to store a copied DT_CONTEXT and use CORDbgCopyThreadContext.
src/coreclr/debug/di/rspriv.hUpdates type members and constructor signatures to remove DebuggerREGDISPLAY usage.
src/coreclr/debug/di/riscv64/cordbregisterset.cppRemoves the unused regdisplay-to-context helper (RISCV64 still NYI for GetRegisters).
src/coreclr/debug/di/loongarch64/cordbregisterset.cppRefactors register reads to use DT_CONTEXT and deduplicates mapping via a helper.
src/coreclr/debug/di/i386/cordbregisterset.cppSwitches register reads from regdisplay fields to DT_CONTEXT.
src/coreclr/debug/di/arm64/cordbregisterset.cppSwitches register reads from regdisplay fields to DT_CONTEXT.
src/coreclr/debug/di/arm/cordbregisterset.cppSwitches register reads from regdisplay fields to DT_CONTEXT.
src/coreclr/debug/di/amd64/cordbregisterset.cppSwitches register reads from regdisplay fields to DT_CONTEXT.
src/coreclr/debug/daccess/dacdbiimplstackwalk.cppDeletes regdisplay conversion implementation and stops populating Debugger_STRData::rd.
src/coreclr/debug/daccess/dacdbiimpl.hRemoves the regdisplay conversion method declaration from the DAC implementation.

Copilot's findings

  • Files reviewed: 36/36 changed files
  • Comments generated: 4

Comment threadsrc/coreclr/debug/di/rsregsetcommon.cpp
Comment threadsrc/coreclr/debug/di/rsstackwalk.cpp Outdated
Comment threadsrc/coreclr/debug/di/loongarch64/cordbregisterset.cpp
CopilotAI review requested due to automatic review settings June 21, 2026 18:21

CopilotAI 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's findings

  • Files reviewed: 36/36 changed files
  • Comments generated: 2

Comment threadsrc/coreclr/debug/di/loongarch64/cordbregisterset.cpp
Comment threadsrc/coreclr/debug/di/rspriv.h
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 22, 2026 05:56

CopilotAI 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's findings

  • Files reviewed: 36/36 changed files
  • Comments generated: 2

Comment threadsrc/coreclr/debug/di/rsthread.cpp
Comment threadsrc/coreclr/debug/di/loongarch64/cordbregisterset.cpp

@max-charlambmax-charlamb left a comment

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.

Seems reasonable to me, but @noahfalk may want to take a look.

Looks like there is a build break caused by these changes.

Comment threadsrc/coreclr/debug/inc/amd64/primitives.h

@noahfalknoahfalk left a comment

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.

LGTM!

@rcj1

rcj1 commented Jun 25, 2026

Copy link
Copy Markdown
ContributorAuthor

/ba-g x86 was down

@rcj1
rcj1 merged commit abaf96f into dotnet:mainJun 25, 2026
128 of 136 checks passed
@rcj1
rcj1 deleted the delete-DebuggerREGDISPLAY branch June 25, 2026 13:37
HRESULT hr = S_OK;
EX_TRY
{
pThread->LoadFloatState();

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.

This is not implemented on loomgarch64 and riscv64, synced them both in #129854

@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview7 milestone Jun 26, 2026
jkotas pushed a commit that referenced this pull request Jul 3, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
This is not intended to be the final form; I intend to delete these
platform-specific register readers altogether. This is just the first
stage of a larger refactor, separated out such that we can remove the
associated DacDbi API as well as remove the data structure from the API
surface.
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 27, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@rcj1@am11@noahfalk@jkotas@max-charlamb