Skip to content

[cDAC] Implement GetNativeCodeSequencePointsAndVarInfo for cDAC - #129267

Merged
rcj1 merged 16 commits into
dotnet:mainfrom
barosiak:barosiak/GetNativeCodeSequencePointsAndVarInfo
Jul 10, 2026
Merged

[cDAC] Implement GetNativeCodeSequencePointsAndVarInfo for cDAC#129267
rcj1 merged 16 commits into
dotnet:mainfrom
barosiak:barosiak/GetNativeCodeSequencePointsAndVarInfo

Conversation

@barosiak

@barosiakbarosiak commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Implement GetNativeCodeSequencePointsAndVarInfo in the cDAC DacDbiImpl. The interface is changed from output-pointer parameters (NativeVarData*, SequencePoints*) to a callback pattern (FP_NATIVEVARINFO_CALLBACK, FP_SEQUENCEPOINT_CALLBACK), since the managed cDAC cannot use the native forDbi allocator.
Also adds TryGetMethodSignature to IRuntimeTypeSystem to fix GetArgCount and ClrDataFrame methods failing on methods without metadata tokens (e.g. async variants), and removes the unused vlMemory member from ICorDebugInfo::VarLoc (with a JIT/EE version GUID bump).

Changes

  • dacdbi.idl / dacdbiinterface.h / dacdbiimpl.h - Add callback typedefs, update method signature
  • dacdbiimpl.cpp - Rewrite method to use callbacks, remove GetNativeVarData/GetSequencePoints helpers
  • module.cpp - Rewrite LoadNativeInfo with callback struct
  • IDacDbiInterface.cs - Add VarLocType, VarLoc, NativeVarInfo, DbiOffsetMapping structs, DbiSourceTypes enum and update method signature
  • DacDbiImpl.cs - Implement GetNativeCodeSequencePointsAndVarInfo
  • DacDbiImpl.NativeCodeInfo.cs - conversion helpers and DEBUG validation
  • RuntimeTypeSystem.md - Document TryGetMethodSignature and AsyncMethodData descriptors
  • DacDbiImplTests.cs - unit tests for VarLoc type mapping, field-level conversion, and SourceTypes flag conversion
  • IRuntimeTypeSystem.cs / RuntimeTypeSystem_1.cs - Add TryGetMethodSignature
  • AsyncMethodData.cs / method.hpp / siginfo.hpp / datadescriptor.inc - Expose Sig and cSig fields from AsyncMethodData
  • ClrDataFrame.cs - Extract GetFrameMethodDesc helper, update callers to use TryGetMethodSignature
  • TypeNameBuilder.cs / MethodSignatureHelpers.cs - Use TryGetMethodSignature for signature resolution

@barosiakbarosiak self-assigned this Jun 11, 2026
CopilotAI review requested due to automatic review settings June 11, 2026 00:10
@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 updates the DAC↔DBI contract for GetNativeCodeSequencePointsAndVarInfo to use a callback-based enumeration model (instead of DBI-allocated output buffers), and wires up the managed cDAC (DacDbiImpl) implementation plus supporting interop structs and unit tests.

Changes:

  • Replaces out-pointer buffer parameters with callback delegates for native var info and sequence points (IDL + native headers + native implementation + DBI consumer).
  • Adds managed interop representations for native debug-info types and implements the cDAC-side method that enumerates var info and sequence points via callbacks.
  • Adds unit tests for var location kind mapping and SourceTypes flag conversion.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
FileDescription
src/native/managed/cdac/tests/UnitTests/DacDbiImplTests.csAdds unit tests for VarLoc kind/field mapping and SourceTypes flag conversion.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.csAdds managed interop structs/enums and updates method signature to callback-based pattern.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.NativeCodeInfo.csAdds conversion helpers, fixed-arg counting helper, and DEBUG legacy validation.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.csImplements callback-based GetNativeCodeSequencePointsAndVarInfo using cDAC contracts.
src/coreclr/inc/dacdbi.idlUpdates the COM IDL to define callback typedefs and the new method signature.
src/coreclr/inc/cordebuginfo.hDocuments that specific debug-info types are mirrored in managed code.
src/coreclr/debug/inc/dacdbiinterface.hUpdates the native interface signature and adds callback typedefs.
src/coreclr/debug/di/module.cppUpdates CordbNativeCode::LoadNativeInfo to collect entries via callbacks and initialize its internal containers.
src/coreclr/debug/daccess/dacdbiimpl.hUpdates the native DAC implementation signature to the new callback-based shape.
src/coreclr/debug/daccess/dacdbiimpl.cppRewrites the DAC implementation to enumerate var info / sequence points and invoke callbacks.

Comment threadsrc/coreclr/debug/di/module.cpp Outdated
Comment threadsrc/native/managed/cdac/tests/UnitTests/DacDbiImplTests.cs Outdated
Comment threadsrc/coreclr/debug/di/module.cpp Outdated

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

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

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

I agree with the outstanding comments, but otherwise LGTM

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: 32/32 changed files
  • Comments generated: 2

rcj1
rcj1 approved these changes Jul 2, 2026
CopilotAI review requested due to automatic review settings July 9, 2026 17:35

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: 35/35 changed files
  • Comments generated: 1

CopilotAI review requested due to automatic review settings July 9, 2026 17:46

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: 0 new

CopilotAI review requested due to automatic review settings July 9, 2026 17:58

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/daccess/dacdbiimpl.cpp
CopilotAI review requested due to automatic review settings July 9, 2026 18:53

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: 1

Comment threadsrc/coreclr/debug/daccess/dacdbiimpl.cpp
@rcj1

rcj1 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

/ba-g unrelated wasm tests

@rcj1
rcj1 merged commit 34379cf into dotnet:mainJul 10, 2026
152 of 154 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview7 milestone Jul 11, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
)
### Summary
Implement `GetNativeCodeSequencePointsAndVarInfo` in the cDAC
`DacDbiImpl`. The interface is changed from output-pointer parameters
(`NativeVarData*`, `SequencePoints*`) to a callback pattern
(`FP_NATIVEVARINFO_CALLBACK`, `FP_SEQUENCEPOINT_CALLBACK`), since the
managed cDAC cannot use the native `forDbi` allocator.
Also adds `TryGetMethodSignature` to `IRuntimeTypeSystem` to fix
`GetArgCount` and `ClrDataFrame` methods failing on methods without
metadata tokens (e.g. async variants), and removes the unused vlMemory
member from ICorDebugInfo::VarLoc (with a JIT/EE version GUID bump).
### Changes
- `dacdbi.idl` / `dacdbiinterface.h` / `dacdbiimpl.h` - Add callback
typedefs, update method signature
- `dacdbiimpl.cpp` - Rewrite method to use callbacks, remove
`GetNativeVarData`/`GetSequencePoints` helpers
- `module.cpp` - Rewrite `LoadNativeInfo` with callback struct
- `IDacDbiInterface.cs` - Add `VarLocType`, `VarLoc`, `NativeVarInfo`,
`DbiOffsetMapping` structs, DbiSourceTypes enum and update method
signature
- `DacDbiImpl.cs` - Implement `GetNativeCodeSequencePointsAndVarInfo`
- `DacDbiImpl.NativeCodeInfo.cs` - conversion helpers and DEBUG
validation
- RuntimeTypeSystem.md - Document TryGetMethodSignature and
AsyncMethodData descriptors
- `DacDbiImplTests.cs` - unit tests for VarLoc type mapping, field-level
conversion, and SourceTypes flag conversion
- `IRuntimeTypeSystem.cs` / `RuntimeTypeSystem_1.cs` - Add
`TryGetMethodSignature`
- `AsyncMethodData.cs` / `method.hpp` / `siginfo.hpp` /
`datadescriptor.inc` - Expose `Sig` and `cSig` fields from
`AsyncMethodData`
- `ClrDataFrame.cs` - Extract `GetFrameMethodDesc` helper, update
callers to use `TryGetMethodSignature`
- `TypeNameBuilder.cs` / `MethodSignatureHelpers.cs` - Use
`TryGetMethodSignature` for signature resolution
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: rcj1 <rachel.jarvi@gmail.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Aug 11, 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

@barosiak@rcj1@noahfalk@mdh1418@max-charlamb