Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back intenral EE APIs used by the debugger until the debugger switches to the new overloads #76912

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ internal static EvaluationContext CreateTypeContext(
methodDebugInfo: MethodDebugInfo<TypeSymbol, LocalSymbol>.None);
}

// Used by VS debugger (/src/debugger/ProductionDebug/CodeAnalysis/CodeAnalysis/ExpressionEvaluator.cs)
internal static EvaluationContext CreateMethodContext(
ImmutableArray<MetadataBlock> metadataBlocks,
object symReader,
Guid moduleId,
int methodToken,
int methodVersion,
uint ilOffset,
int localSignatureToken)
=> CreateMethodContext(metadataBlocks, symReader, new ModuleId(moduleId, "<unknown>"), methodToken, methodVersion, ilOffset, localSignatureToken);

/// <summary>
/// Create a context for evaluating expressions within a method scope.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,32 @@ namespace Microsoft.CodeAnalysis.ExpressionEvaluator
/// Module metadata block
/// </summary>
[DebuggerDisplay("{GetDebuggerDisplay(), nq}")]
internal readonly struct MetadataBlock : IEquatable<MetadataBlock>
internal readonly struct MetadataBlock(ModuleId moduleId, Guid generationId, IntPtr pointer, int size) : IEquatable<MetadataBlock>
{
/// <summary>
/// Module id.
/// </summary>
internal readonly ModuleId ModuleId;
internal readonly ModuleId ModuleId = moduleId;

/// <summary>
/// Module generation id.
/// </summary>
internal readonly Guid GenerationId;
internal readonly Guid GenerationId = generationId;

/// <summary>
/// Pointer to memory block managed by the caller.
/// </summary>
internal readonly IntPtr Pointer;
internal readonly IntPtr Pointer = pointer;

/// <summary>
/// Size of memory block.
/// </summary>
internal readonly int Size;
internal readonly int Size = size;

internal MetadataBlock(ModuleId moduleId, Guid generationId, IntPtr pointer, int size)
// Used by VS debugger (/src/debugger/ProductionDebug/CodeAnalysis/CodeAnalysis/ExpressionEvaluator.cs)
internal MetadataBlock(Guid moduleId, Guid generationId, IntPtr pointer, int size)
: this(new ModuleId(moduleId, "<unknown>"), generationId, pointer, size)
{
ModuleId = moduleId;
GenerationId = generationId;
Pointer = pointer;
Size = size;
}

public bool Equals(MetadataBlock other)
Expand Down
Loading