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

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

@barosiak barosiak self-assigned this Jun 11, 2026
Copilot AI 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.

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.

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
File Description
src/native/managed/cdac/tests/UnitTests/DacDbiImplTests.cs Adds unit tests for VarLoc kind/field mapping and SourceTypes flag conversion.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs Adds managed interop structs/enums and updates method signature to callback-based pattern.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.NativeCodeInfo.cs Adds conversion helpers, fixed-arg counting helper, and DEBUG legacy validation.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs Implements callback-based GetNativeCodeSequencePointsAndVarInfo using cDAC contracts.
src/coreclr/inc/dacdbi.idl Updates the COM IDL to define callback typedefs and the new method signature.
src/coreclr/inc/cordebuginfo.h Documents that specific debug-info types are mirrored in managed code.
src/coreclr/debug/inc/dacdbiinterface.h Updates the native interface signature and adds callback typedefs.
src/coreclr/debug/di/module.cpp Updates CordbNativeCode::LoadNativeInfo to collect entries via callbacks and initialize its internal containers.
src/coreclr/debug/daccess/dacdbiimpl.h Updates the native DAC implementation signature to the new callback-based shape.
src/coreclr/debug/daccess/dacdbiimpl.cpp Rewrites the DAC implementation to enumerate var info / sequence points and invoke callbacks.

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

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.

Pull request overview

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

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

Copilot AI review requested due to automatic review settings July 2, 2026 19:31

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

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

Copilot AI review requested due to automatic review settings July 9, 2026 17:35

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

  • Files reviewed: 35/35 changed files
  • Comments generated: 1

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

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

  • Files reviewed: 36/36 changed files
  • Comments generated: 0 new

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

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

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

Comment thread src/coreclr/debug/daccess/dacdbiimpl.cpp
Copilot AI review requested due to automatic review settings July 9, 2026 18:53

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

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

Comment thread src/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:main Jul 10, 2026
152 of 154 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot 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>
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.

6 participants