Skip to content

ManagedNativeIndex

Namespace: Dotsider.Core.Analysis

Assembly: Dotsider.Core.dll

Joins pre-ILC managed methods to the native evidence of the AOT image they were compiled into: native symbols (via IlcNameDemangler, keyed from real companion metadata instead of the binary’s reduced recovered types) and mstat size rows. Built once, queried per-frame — every lookup is a dictionary hit.

public sealed class ManagedNativeIndex

ObjectManagedNativeIndex

Methods whose native evidence is shared with sibling overloads.

Returns: Int32

public int AmbiguousCount { get; }

Methods that own native evidence outright.

Returns: Int32

public int ExactCount { get; }

Every managed method’s correlation, in source order.

Returns: IReadOnlyList<MethodCorrelation>

public IReadOnlyList<MethodCorrelation> Methods { get; }

Methods with mstat size evidence but no native symbol to disassemble.

Returns: Int32

public int MstatOnlyCount { get; }

Methods with no native evidence — trimmed, fully inlined, or bodiless.

Returns: Int32

public int NotInImageCount { get; }

The correlated native bytes, deduplicated: every evidence pool — owned or shared — contributes exactly once, with mstat sizes preferred over symbol sizes.

Returns: Int64

public long TotalCorrelatedSize { get; }

Build(IReadOnlyList<ManagedMethodSource>, IReadOnlyList<NativeSymbol>, MstatData?)

Section titled “Build(IReadOnlyList<ManagedMethodSource>, IReadOnlyList<NativeSymbol>, MstatData?)”

Builds the index from managed method sources, the image’s native symbols, and its mstat report. Deliberately data-shaped — no analyzer required — so synthetic inputs exercise every join rule without real binaries.

Parameters:

Returns: ManagedNativeIndex

public static ManagedNativeIndex Build(IReadOnlyList<ManagedMethodSource> sources, IReadOnlyList<NativeSymbol> nativeSymbols, MstatData? mstat)

Finds a method’s correlation by its assembly simple name and metadata token. Tokens collide across assemblies, so the composite key is required.

Parameters:

  • assemblyName (String): The assembly simple name the method is defined in.
  • methodToken (Int32): The method’s metadata token.

Returns: MethodCorrelation

public MethodCorrelation? Find(string assemblyName, int methodToken)

Finds the correlation whose native code covers virtualAddress — an address anywhere inside a correlated symbol, not only its entry point — or null for uncorrelated (runtime/stub) code.

Parameters:

  • virtualAddress (UInt64): A virtual address, e.g. from a stack trace or a call target.

Returns: MethodCorrelation

public MethodCorrelation? FindByAddress(ulong virtualAddress)

Finds the correlation a native symbol belongs to, keyed by its virtual address. For a shared (overload) pool the first candidate is returned; its Status reveals the ambiguity.

Parameters:

Returns: MethodCorrelation

public MethodCorrelation? FindByNativeSymbol(NativeSymbol symbol)

The join is grouped by (assembly, declaring type, method name): ILC’s mangling collapses signatures, so overloads form one evidence pool that no single candidate owns. A single-method group owns its evidence (CorrelatedExact, several symbols meaning generic instantiations); a multi-method group is shared (CorrelatedAmbiguous), reported on every sibling but counted once in TotalCorrelatedSize. Overload-suffix assignment (_0/_1) is never guessed — the same policy the demangler applies.