Skip to content

Commit 257bac4

Browse files
lewingCopilot
andauthored
[cDAC][wasm] Map portable entry points to interpreter code and R2R virtual IPs (#134756)
> [!IMPORTANT] > Stacked on #134754 (targets its branch). Only the commits above #134754's head belong to this PR; retarget to `main` once #134754 merges. ## Problem On `FEATURE_PORTABLE_ENTRYPOINTS` targets (WebAssembly), a method's entry point slot holds a `PortableEntryPoint` address. Native maps it before handing it to diagnostics (`GetInterpreterCodeFromEntryPointIfPresent` / `GetDiagnosticCodeStartFromEntryPoint` in `precode.cpp`), but the cDAC returned the raw address. SOS values such as `DacpMethodDescData.NativeCodeAddr` and rejit `NativeCodeAddr`, plus the DBI/`ClrDataMethodInstance` paths, therefore reported an address that doesn't resolve through `ExecutionManager` for both interpreted and R2R methods. ## Change Adds `IExecutionManager.GetDiagnosticCodeStartFromEntryPoint`, which mirrors the native `GetDiagnosticCodeStartFromEntryPoint`: - **Without portable entrypoints:** delegates to `PrecodeStubs.GetInterpreterCodeFromInterpreterPrecodeIfPresent`. Behavior is unchanged. - **With portable entrypoints:** 1. Returns the address unchanged if it lies in a code range. This is the native `FindCodeRange` check and includes Wasm R2R virtual-IP ranges from #133917. 2. Maps interpreted methods to `MethodDesc::m_interpreterCode`. 3. Maps native R2R methods from the function-table index in `PortableEntryPoint._pActualCode` to the synthetic virtual IP, stepping back past funclet entries. This matches `ExecutionManager::GetWasmVirtualIPFromFunctionTableIndex`. As in native code, it applies only to the method's own (temporary) entry point, and only when the entry point doesn't prefer the interpreter. The mapping lives in ExecutionManager rather than PrecodeStubs because ExecutionManager owns the virtual-IP ranges and R2R lookup. ExecutionManager already depends on PrecodeStubs, so this adds no contract cycle. Function-table-index resolution moves into `ExecutionManagerHelpers.WasmFunctionTableIndexLookup`, which now bounds the list walk and detects cycles, like the virtual-IP list walk. The stack walk's `WasmR2RInfo` becomes a thin wrapper over it. The Legacy SOS/DBI callers (`SOSDacImpl`, `ClrDataMethodInstance`, `DacDbiImpl`) now call the new API. `DacDbiImpl.EnumerateAsyncLocals` also maps its code address before querying async debug info. The native DAC's `EnumerateAsyncLocals` gets the matching `GetInterpreterCodeFromEntryPointIfPresent` mapping (as `GetMethodVarInfo` already does), so the debug-build cDAC/DAC cross-check stays consistent. ### Data descriptors - `PortableEntryPoint.ActualCode` and `PortableEntryPoint.Flags` (only under `FEATURE_PORTABLE_ENTRYPOINTS`). - `MethodDesc.InterpreterCode` (only under `FEATURE_INTERPRETER`). - The contract relies on `kPrefersInterpreterEntryPoint` and `INTERPRETER_CODE_POISON`; the native side now has `[cDAC]` comments marking that dependency. ### Interaction with #133890 #133890 adds `TryGetFunctionIdentity` and `TryIsFunclet` to `WasmR2RInfo`. Whichever PR lands second should add those two methods to `WasmFunctionTableIndexLookup` and have `WasmR2RInfo` forward to them. The `FunctionTableIndexRange*` descriptor meanings here already use #133890's exact wording, so that JSON should merge cleanly. ## Validation - cDAC: `./build.sh -s tools.cdac+tools.cdactests -c Debug -test` passes: 3196 unit tests (17 new), usage tests (contract cycles and generated docs up to date), and generator tests. - New ExecutionManager tests cover: - interpreted, R2R, funclet, poison, prefers-interpreter, not-own-entry-point and unknown-index cases; - an end-to-end check that the resolved virtual IP maps back to the MethodDesc through `GetCodeBlockHandle`; - readable `PortableEntryPoint`-shaped bytes inside a registered code range staying unchanged. This test fails if the range check is removed. - a cyclic function-table range list; - the non-portable delegation path. - CoreCLR `clr.runtime` builds for osx-arm64 Debug (with `FEATURE_INTERPRETER`) and browser-wasm Debug. The generated wasm descriptor has `PortableEntryPoint {ActualCode@0, MethodDesc@4, Flags@12}`. - A new `DacDbiImplTests` test covers `EnumerateAsyncLocals` mapping for both the code-address and MethodDesc paths. It fails without the fix. - cDAC dump tests (osx-arm64, local runtime): 260 passed, 0 failed. The 746 skips are net10.0 configurations plus by-design skips (Windows-only COM debuggees, and dump types a debuggee doesn't produce). - CoreCLR `clr.runtime` Release (osx-arm64) builds with the `dacdbiimpl.cpp` change. - Not run: any check against a live wasm target. Fixes #134753 > [!NOTE] > This PR description was generated with GitHub Copilot. --------- Co-authored-by: Copilot App <[email protected]>
1 parent 316ae72 commit 257bac4

21 files changed

Lines changed: 603 additions & 101 deletions

File tree

‎docs/design/datacontracts/ExecutionManager.md‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public struct CodeBlockHandle
2828
void GetMethodRegionInfo(CodeBlockHandle codeInfoHandle, out uint hotSize, out TargetPointer coldStart, out uint coldSize);
2929
// Attempt to get the method desc of an entrypoint
3030
TargetPointer NonVirtualEntry2MethodDesc(TargetCodePointer entrypoint);
31+
// Map a method entry point to the code start that diagnostics report and that resolves through
32+
// GetCodeBlockHandle. Other addresses are returned unchanged.
33+
TargetCodePointer GetDiagnosticCodeStartFromEntryPoint(TargetCodePointer entryPoint);
3134

3235
// Gets the unwind info of the code block at the specified code pointer
3336
TargetPointer GetUnwindInfo(CodeBlockHandle codeInfoHandle);
@@ -216,6 +219,10 @@ virtual-IP ranges bypass native thunk classification.
216219
| `ExceptionLookupTableEntry` | *(type size)* | `uint32` | Size of an exception lookup table entry in bytes |
217220
| `ExceptionLookupTableEntry` | `ExceptionInfoRVA` | `uint32` | RVA of the exception clause data |
218221
| `ExceptionLookupTableEntry` | `MethodStartRVA` | `uint32` | RVA of the method start |
222+
| `FunctionTableIndexRangeSection` | `MinFunctionTableIndex` | `uint32` | First runtime-global shared function-table index owned by the R2R module |
223+
| `FunctionTableIndexRangeSection` | `Next` | `pointer` | Pointer to the next registered WASM R2R function-table range |
224+
| `FunctionTableIndexRangeSection` | `NumRuntimeFunctions` | `uint32` | Number of consecutive RUNTIME_FUNCTION entries owned by the R2R module |
225+
| `FunctionTableIndexRangeSection` | `R2RModule` | `pointer` | Pointer to the Module that owns this function-table range |
219226
| `HashMap` | `Buckets` | `pointer` | Pointer to the buckets of a `HashMap` |
220227
| `HostCodeHeap` | `BaseAddress` | `pointer` | Pointer to the base of the committed memory region |
221228
| `HostCodeHeap` | `CurrentAddress` | `pointer` | Pointer to the last available committed byte in the region |
@@ -226,7 +233,12 @@ virtual-IP ranges bypass native thunk classification.
226233
| `InterpreterRealCodeHeader` | `JitEHInfo` | `pointer` | Pointer to the `EE_ILEXCEPTION` containing exception clauses for interpreter code |
227234
| `InterpreterRealCodeHeader` | `MethodDesc` | `pointer` | Pointer to the corresponding `MethodDesc` for interpreter code |
228235
| `LoaderCodeHeap` | `LoaderHeap` | `pointer` | Offset of the embedded `ExplicitControlLoaderHeap` within the `LoaderCodeHeap` object; adding this to the object's base address yields the loader heap address |
236+
| `MethodDesc` | `CodeData` | `pointer` | Pointer to per-method code data containing entry-point and code-versioning state |
237+
| `MethodDesc` | `InterpreterCode` | `pointer` | Pointer to the method's `InterpByteCodeStart`, or the poison value 1 if the method will never be interpreted (only defined if `FEATURE_INTERPRETER` is enabled) |
238+
| `MethodDescCodeData` | `TemporaryEntryPoint` | `CodePointer` | Temporary code entry point used before the method has a stable entry point |
229239
| `Module` | `ReadyToRunInfo` | `pointer` | Pointer to the module's ReadyToRun information |
240+
| `PortableEntryPoint` | `ActualCode` | `pointer` | Native code for the entrypoint; on WebAssembly R2R code this is a function-table index (only defined if `FeaturePortableEntrypoints` is enabled) |
241+
| `PortableEntryPoint` | `Flags` | `int32` | Portable entrypoint flags; `0x4` means the interpreter entrypoint is preferred over `ActualCode` (only defined if `FeaturePortableEntrypoints` is enabled) |
230242
| `PortableEntryPoint` | `MethodDesc` | `pointer` | Method desc of portable entrypoint (only defined if `FeaturePortableEntrypoints` is enabled) |
231243
| `R2RExceptionClause` | *(type size)* | `uint32` | Size of a ReadyToRun exception clause in bytes |
232244
| `R2RExceptionClause` | `ClassToken` | `uint32` | Union field: ClassToken or FilterOffset |
@@ -287,6 +299,7 @@ virtual-IP ranges bypass native thunk classification.
287299
| --- | --- | --- |
288300
| `EEJitManagerAddress` | `pointer` | Address of the global pointer to the EEJitManager instance (read a TargetPointer from this address to obtain the instance address) |
289301
| `ExecutionManagerCodeRangeMapAddress` | `pointer` | Pointer to the global RangeSectionMap |
302+
| `FunctionTableIndexRangeList` | `pointer` | Pointer to the head pointer of the registered WASM R2R function-table range list |
290303
| `GCInfoVersion` | `uint32` | JITted code GCInfo version |
291304
| `HashMapSlotsPerBucket` | `uint32` | Number of slots in each bucket of a `HashMap` |
292305
| `HashMapValueMask` | `uint64` | Bitmask used when storing values in a `HashMap` |
@@ -491,6 +504,60 @@ TargetPointer IExecutionManager.NonVirtualEntry2MethodDesc(TargetCodePointer ent
491504
```
492505

493506

507+
`GetDiagnosticCodeStartFromEntryPoint` mirrors the native `GetDiagnosticCodeStartFromEntryPoint` (`src/coreclr/vm/precode.cpp`). Without portable entrypoints it maps an interpreter precode to its bytecode through `PrecodeStubs.GetInterpreterCodeFromInterpreterPrecodeIfPresent`. With portable entrypoints (WebAssembly), an entry point is a `PortableEntryPoint` rather than code: an interpreted method maps to its `InterpByteCodeStart`, and a native ReadyToRun method maps its function-table index to the synthetic virtual IP registered in the virtual-IP range list, so that the result resolves through `GetCodeBlockHandle`.
508+
509+
```csharp
510+
// Constants from native code
511+
const int PortableEntryPointPrefersInterpreterEntryPoint = 0x4; // PortableEntryPoint::kPrefersInterpreterEntryPoint
512+
const ulong InterpreterCodePoison = 1; // INTERPRETER_CODE_POISON
513+
514+
TargetCodePointer IExecutionManager.GetDiagnosticCodeStartFromEntryPoint(TargetCodePointer entryPoint)
515+
{
516+
if (entryPoint == TargetCodePointer.Null)
517+
return entryPoint;
518+
519+
if (!FeatureFlags.IsEnabled(RuntimeFeature.PortableEntrypoints))
520+
return PrecodeStubs.GetInterpreterCodeFromInterpreterPrecodeIfPresent(entryPoint);
521+
522+
// On any read failure, entryPoint is returned unchanged.
523+
// An address in a code range (including a Wasm R2R virtual IP) is already a code start.
524+
if (/* range section found for entryPoint - see RangeSectionMap and the virtual-IP range list */)
525+
return entryPoint;
526+
527+
Data.PortableEntryPoint pep = // read PortableEntryPoint at entryPoint
528+
if (pep.MethodDesc == TargetPointer.Null)
529+
return entryPoint;
530+
531+
Data.MethodDesc md = // read MethodDesc at pep.MethodDesc
532+
if (md.InterpreterCode is TargetPointer interpreterCode && interpreterCode != TargetPointer.Null && interpreterCode != InterpreterCodePoison)
533+
return new TargetCodePointer(interpreterCode);
534+
535+
// Native R2R portable entry points store a Wasm function-table index in ActualCode. As in native code,
536+
// this applies only to the method's own portable entry point, which is currently its temporary entry point.
537+
if (pep.ActualCode == TargetPointer.Null
538+
|| (pep.Flags & PortableEntryPointPrefersInterpreterEntryPoint) != 0
539+
|| md.CodeData == TargetPointer.Null
540+
|| /* MethodDescCodeData.TemporaryEntryPoint at md.CodeData */ != entryPoint)
541+
{
542+
return entryPoint;
543+
}
544+
545+
return TryGetWasmVirtualIPFromFunctionTableIndex((uint)pep.ActualCode, out ulong virtualIP)
546+
? new TargetCodePointer(virtualIP)
547+
: entryPoint;
548+
}
549+
550+
// Mirrors ExecutionManager::GetWasmVirtualIPFromFunctionTableIndex. Also used by the WebAssembly stack walk.
551+
bool TryGetWasmVirtualIPFromFunctionTableIndex(uint functionTableIndex, out ulong virtualIP)
552+
{
553+
// Walk the FunctionTableIndexRangeSection list headed by *FunctionTableIndexRangeList (with cycle
554+
// detection) to the section where MinFunctionTableIndex <= functionTableIndex < MinFunctionTableIndex + NumRuntimeFunctions.
555+
// Starting at RuntimeFunctions[functionTableIndex - MinFunctionTableIndex] of the section's
556+
// R2RModule's ReadyToRunInfo, step back past funclet entries to the controlling function, then
557+
// virtualIP = ReadyToRunInfo.MinVirtualIP + RuntimeFunction.BeginAddress.
558+
}
559+
```
560+
494561
The `CodeBlock` encapsulates the `MethodDesc` data from the target runtime together with the start of the jitted method
495562

496563
```csharp

‎docs/design/datacontracts/RuntimeTypeSystem.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ static class RuntimeTypeSystem_1_Helpers
603603
| `MethodDesc` | `Flags` | `uint16` | The method's flags |
604604
| `MethodDesc` | `Flags3AndTokenRemainder` | `uint16` | More flags for the method, and the low bits of the method's token's RID |
605605
| `MethodDesc` | `GCCoverageInfo` | `pointer` | The method's GCCover debug info, if supported |
606+
| `MethodDesc` | `InterpreterCode` | `pointer` | Pointer to the method's `InterpByteCodeStart`, or the poison value 1 if the method will never be interpreted (only defined if `FEATURE_INTERPRETER` is enabled) |
606607
| `MethodDesc` | `Slot` | `uint16` | The method's slot |
607608
| `MethodDescChunk` | *(type size)* | `uint32` | Size of the data descriptor layout |
608609
| `MethodDescChunk` | `Count` | `uint8` | The number of MethodDesc entries in this chunk, minus 1. |

‎docs/design/datacontracts/data-descriptor-meanings.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@
199199
"FramedMethodFrame.TransitionBlockPtr": "Pointer to Frame's TransitionBlock",
200200
"FuncEvalFrame.DebuggerEvalPtr": "Pointer to the Frame's DebuggerEval object",
201201
"FuncEvalFrame.ReturnAddress": "Return address of the frame",
202+
"FunctionTableIndexRangeSection.MinFunctionTableIndex": "First runtime-global shared function-table index owned by the R2R module",
203+
"FunctionTableIndexRangeSection.Next": "Pointer to the next registered WASM R2R function-table range",
204+
"FunctionTableIndexRangeSection.NumRuntimeFunctions": "Number of consecutive RUNTIME_FUNCTION entries owned by the R2R module",
205+
"FunctionTableIndexRangeSection.R2RModule": "Pointer to the Module that owns this function-table range",
202206
"GCAllocContext.AllocBytes": "Number of bytes allocated on SOH by this context",
203207
"GCAllocContext.AllocBytesLoh": "Number of bytes allocated not on SOH by this context",
204208
"GCAllocContext.Limit": "Allocation limit pointer",
@@ -362,6 +366,7 @@
362366
"MethodDesc.Flags": "The method's flags",
363367
"MethodDesc.Flags3AndTokenRemainder": "More flags for the method, and the low bits of the method's token's RID",
364368
"MethodDesc.GCCoverageInfo": "The method's GCCover debug info, if supported",
369+
"MethodDesc.InterpreterCode": "Pointer to the method's `InterpByteCodeStart`, or the poison value 1 if the method will never be interpreted (only defined if `FEATURE_INTERPRETER` is enabled)",
365370
"MethodDesc.Size": "Base size for mcIL classification",
366371
"MethodDesc.Slot": "The method's slot",
367372
"MethodDescChunk.Count": "The number of MethodDesc entries in this chunk, minus 1.",
@@ -457,6 +462,8 @@
457462
"PInvokeMethodDesc.Size": "Base size for mcPInvoke classification",
458463
"PlatformMetadata.CodePointerFlags": "fields describing the behavior of target code pointers",
459464
"PlatformMetadata.PrecodeMachineDescriptor": "precode stub-related platform specific properties",
465+
"PortableEntryPoint.ActualCode": "Native code for the entrypoint; on WebAssembly R2R code this is a function-table index (only defined if `FeaturePortableEntrypoints` is enabled)",
466+
"PortableEntryPoint.Flags": "Portable entrypoint flags; `0x4` means the interpreter entrypoint is preferred over `ActualCode` (only defined if `FeaturePortableEntrypoints` is enabled)",
460467
"PortableEntryPoint.MethodDesc": "Method desc of portable entrypoint (only defined if `FeaturePortableEntrypoints` is enabled)",
461468
"PrecodeMachineDescriptor.FixupBytes": "Assembly code of a FixupStub",
462469
"PrecodeMachineDescriptor.FixupIgnoredBytes": "Bytes to ignore when comparing FixupBytes to an actual block of memory in the target process.",
@@ -760,6 +767,7 @@
760767
"FieldOffsetDynamicRVA": "Sentinel FieldDesc offset for an EnC-added RVA field whose enclosing type is not yet loaded",
761768
"FieldOffsetNewEnc": "Sentinel offset value stored in FieldDesc::DWord2 for added fields whose storage has not yet been allocated.",
762769
"FinalizerThread": "Pointer to the finalizer thread",
770+
"FunctionTableIndexRangeList": "Pointer to the head pointer of the registered WASM R2R function-table range list",
763771
"FreeObjectMethodTable": "A pointer to the address of a MethodTable used by the GC to indicate reclaimed memory",
764772
"GCGlobalMechanisms": "Pointer to counters recording use of global GC mechanisms",
765773
"GCHeapAllocAllocated": "Highest address allocated by Alloc (in workstation builds)",

‎src/coreclr/debug/daccess/dacdbiimpl.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7715,11 +7715,11 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::EnumerateAsyncLocals(VMPTR_Method
77157715
{
77167716
return hr;
77177717
}
7718-
nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());
7718+
nativeCodeStartAddr = PCODEToPINSTR(GetInterpreterCodeFromEntryPointIfPresent(requestedNativeCodeVersion.GetNativeCode()));
77197719
}
77207720
else
77217721
{
7722-
nativeCodeStartAddr = PCODEToPINSTR(pMethodDesc->GetNativeCode());
7722+
nativeCodeStartAddr = PCODEToPINSTR(GetInterpreterCodeFromEntryPointIfPresent(pMethodDesc->GetNativeCode()));
77237723
}
77247724

77257725
DebugInfoRequest request;

‎src/coreclr/vm/datadescriptor/datadescriptor.inc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,9 @@ CDAC_TYPE_FIELD(MethodDesc, T_UINT16, Flags, cdac_data<MethodDesc>::Flags)
782782
CDAC_TYPE_FIELD(MethodDesc, T_UINT16, Flags3AndTokenRemainder, cdac_data<MethodDesc>::Flags3AndTokenRemainder)
783783
CDAC_TYPE_FIELD(MethodDesc, T_UINT8, EntryPointFlags, cdac_data<MethodDesc>::EntryPointFlags)
784784
CDAC_TYPE_FIELD(MethodDesc, T_POINTER, CodeData, cdac_data<MethodDesc>::CodeData)
785+
#ifdef FEATURE_INTERPRETER
786+
CDAC_TYPE_FIELD(MethodDesc, T_POINTER, InterpreterCode, cdac_data<MethodDesc>::InterpreterCode)
787+
#endif // FEATURE_INTERPRETER
785788
#ifdef HAVE_GCCOVER
786789
CDAC_TYPE_FIELD(MethodDesc, T_POINTER, GCCoverageInfo, offsetof(MethodDesc, m_GcCover))
787790
#endif // HAVE_GCCOVER
@@ -862,7 +865,9 @@ CDAC_TYPE_END(CodePointer)
862865
#ifdef FEATURE_PORTABLE_ENTRYPOINTS
863866
CDAC_TYPE_BEGIN(PortableEntryPoint)
864867
CDAC_TYPE_INDETERMINATE(PortableEntryPoint)
868+
CDAC_TYPE_FIELD(PortableEntryPoint, T_POINTER, ActualCode, cdac_data<PortableEntryPoint>::ActualCode)
865869
CDAC_TYPE_FIELD(PortableEntryPoint, T_POINTER, MethodDesc, cdac_data<PortableEntryPoint>::MethodDesc)
870+
CDAC_TYPE_FIELD(PortableEntryPoint, T_INT32, Flags, cdac_data<PortableEntryPoint>::Flags)
866871
CDAC_TYPE_END(PortableEntryPoint)
867872
#endif
868873

‎src/coreclr/vm/method.hpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,6 +1963,7 @@ class MethodDesc
19631963
WORD m_wFlags; // See MethodDescFlags
19641964
PTR_MethodDescCodeData m_codeData;
19651965
#ifdef FEATURE_INTERPRETER
1966+
// [cDAC] [ExecutionManager]: Contract depends on the value of INTERPRETER_CODE_POISON.
19661967
#define INTERPRETER_CODE_POISON 1
19671968
PTR_InterpByteCodeStart m_interpreterCode;
19681969
public:
@@ -2408,6 +2409,9 @@ template<> struct cdac_data<MethodDesc>
24082409
static constexpr size_t Flags3AndTokenRemainder = offsetof(MethodDesc, m_wFlags3AndTokenRemainder);
24092410
static constexpr size_t EntryPointFlags = offsetof(MethodDesc, m_bFlags4);
24102411
static constexpr size_t CodeData = offsetof(MethodDesc, m_codeData);
2412+
#ifdef FEATURE_INTERPRETER
2413+
static constexpr size_t InterpreterCode = offsetof(MethodDesc, m_interpreterCode);
2414+
#endif // FEATURE_INTERPRETER
24112415
};
24122416

24132417
#ifndef DACCESS_COMPILE

‎src/coreclr/vm/precode_portable.hpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class PortableEntryPoint final
3030
MethodDesc* _pMD;
3131
Volatile<void*> _pInterpreterData;
3232

33+
// [cDAC] [ExecutionManager]: Contract depends on the value of kPrefersInterpreterEntryPoint.
3334
enum PortableEntryPointFlag
3435
{
3536
kNone = 0,
@@ -257,7 +258,9 @@ static_assert(offsetof(ClosedStaticRetBufPortableEntryPoint, _entryPoint) == TAR
257258
template<>
258259
struct cdac_data<PortableEntryPoint>
259260
{
261+
static constexpr size_t ActualCode = offsetof(PortableEntryPoint, _pActualCode);
260262
static constexpr size_t MethodDesc = offsetof(PortableEntryPoint, _pMD);
263+
static constexpr size_t Flags = offsetof(PortableEntryPoint, _flags);
261264

262265
static_assert(offsetof(PortableEntryPoint, _pActualCode) == 0, "CLR ABI requires _pActualCode to be at offset 0 of PortableEntryPoint");
263266
};

‎src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IExecutionManager.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ public interface IExecutionManager : IContract
110110
TargetPointer GetFuncletStartAddress(CodeBlockHandle codeInfoHandle) => throw new NotImplementedException();
111111
void GetMethodRegionInfo(CodeBlockHandle codeInfoHandle, out uint hotSize, out TargetPointer coldStart, out uint coldSize) => throw new NotImplementedException();
112112
TargetPointer NonVirtualEntry2MethodDesc(TargetCodePointer entrypoint) => throw new NotImplementedException();
113+
// Map a method entry point to the code start that diagnostics report and that resolves through
114+
// GetCodeBlockHandle: interpreter bytecode for interpreter precodes and interpreted portable entry
115+
// points, or the synthetic virtual IP for Wasm ReadyToRun portable entry points. Other addresses
116+
// are returned unchanged. Mirrors GetDiagnosticCodeStartFromEntryPoint in native code (precode.cpp).
117+
TargetCodePointer GetDiagnosticCodeStartFromEntryPoint(TargetCodePointer entryPoint) => throw new NotImplementedException();
113118
bool IsFunclet(CodeBlockHandle codeInfoHandle) => throw new NotImplementedException();
114119
bool IsFilterFunclet(CodeBlockHandle codeInfoHandle) => throw new NotImplementedException();
115120
TargetPointer GetUnwindInfo(CodeBlockHandle codeInfoHandle) => throw new NotImplementedException();

0 commit comments

Comments
 (0)