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

[cDAC] Remove superfluous modifiers from contract interfaces #113983

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -8,7 +8,7 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts;
public interface IDacStreams : IContract
{
static string IContract.Name { get; } = nameof(DacStreams);
public virtual string? StringFromEEAddress(TargetPointer address) => throw new NotImplementedException();
string? StringFromEEAddress(TargetPointer address) => throw new NotImplementedException();
}

public readonly struct DacStreams : IDacStreams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts;
public interface IEcmaMetadata : IContract
{
static string IContract.Name { get; } = nameof(EcmaMetadata);
public virtual TargetSpan GetReadOnlyMetadataAddress(ModuleHandle handle) => throw new NotImplementedException();
public virtual MetadataReader? GetMetadata(ModuleHandle module) => throw new NotImplementedException();
TargetSpan GetReadOnlyMetadataAddress(ModuleHandle handle) => throw new NotImplementedException();
MetadataReader? GetMetadata(ModuleHandle module) => throw new NotImplementedException();
}

public readonly struct EcmaMetadata : IEcmaMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public interface IException : IContract
{
static string IContract.Name { get; } = nameof(Exception);

public virtual TargetPointer GetNestedExceptionInfo(TargetPointer exception, out TargetPointer nextNestedException) => throw new NotImplementedException();
public virtual ExceptionData GetExceptionData(TargetPointer managedException) => throw new NotImplementedException();
TargetPointer GetNestedExceptionInfo(TargetPointer exception, out TargetPointer nextNestedException) => throw new NotImplementedException();
ExceptionData GetExceptionData(TargetPointer managedException) => throw new NotImplementedException();
}

public readonly struct Exception : IException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ public interface ILoader : IContract
{
static string IContract.Name => nameof(Loader);

public virtual ModuleHandle GetModuleHandle(TargetPointer modulePointer) => throw new NotImplementedException();
ModuleHandle GetModuleHandle(TargetPointer modulePointer) => throw new NotImplementedException();

public virtual TargetPointer GetAssembly(ModuleHandle handle) => throw new NotImplementedException();
public virtual ModuleFlags GetFlags(ModuleHandle handle) => throw new NotImplementedException();
public virtual string GetPath(ModuleHandle handle) => throw new NotImplementedException();
public virtual string GetFileName(ModuleHandle handle) => throw new NotImplementedException();
TargetPointer GetAssembly(ModuleHandle handle) => throw new NotImplementedException();
ModuleFlags GetFlags(ModuleHandle handle) => throw new NotImplementedException();
string GetPath(ModuleHandle handle) => throw new NotImplementedException();
string GetFileName(ModuleHandle handle) => throw new NotImplementedException();

public virtual TargetPointer GetLoaderAllocator(ModuleHandle handle) => throw new NotImplementedException();
public virtual TargetPointer GetILBase(ModuleHandle handle) => throw new NotImplementedException();
public virtual ModuleLookupTables GetLookupTables(ModuleHandle handle) => throw new NotImplementedException();
TargetPointer GetLoaderAllocator(ModuleHandle handle) => throw new NotImplementedException();
TargetPointer GetILBase(ModuleHandle handle) => throw new NotImplementedException();
ModuleLookupTables GetLookupTables(ModuleHandle handle) => throw new NotImplementedException();

public virtual TargetPointer GetModuleLookupMapElement(TargetPointer table, uint token, out TargetNUInt flags) => throw new NotImplementedException();
public virtual bool IsCollectible(ModuleHandle handle) => throw new NotImplementedException();
TargetPointer GetModuleLookupMapElement(TargetPointer table, uint token, out TargetNUInt flags) => throw new NotImplementedException();
bool IsCollectible(ModuleHandle handle) => throw new NotImplementedException();
}

public readonly struct Loader : ILoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts;
public interface IObject : IContract
{
static string IContract.Name { get; } = nameof(Object);
public virtual TargetPointer GetMethodTableAddress(TargetPointer address) => throw new NotImplementedException();
public virtual string GetStringValue(TargetPointer address) => throw new NotImplementedException();
public virtual TargetPointer GetArrayData(TargetPointer address, out uint count, out TargetPointer boundsStart, out TargetPointer lowerBounds) => throw new NotImplementedException();
public virtual bool GetBuiltInComData(TargetPointer address, out TargetPointer rcw, out TargetPointer ccw) => throw new NotImplementedException();
TargetPointer GetMethodTableAddress(TargetPointer address) => throw new NotImplementedException();
string GetStringValue(TargetPointer address) => throw new NotImplementedException();
TargetPointer GetArrayData(TargetPointer address, out uint count, out TargetPointer boundsStart, out TargetPointer lowerBounds) => throw new NotImplementedException();
bool GetBuiltInComData(TargetPointer address, out TargetPointer rcw, out TargetPointer ccw) => throw new NotImplementedException();
}

public readonly struct Object : IObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,96 +80,96 @@ public interface IRuntimeTypeSystem : IContract
static string IContract.Name => nameof(RuntimeTypeSystem);

#region TypeHandle inspection APIs
public virtual TypeHandle GetTypeHandle(TargetPointer address) => throw new NotImplementedException();
public virtual TargetPointer GetModule(TypeHandle typeHandle) => throw new NotImplementedException();
TypeHandle GetTypeHandle(TargetPointer address) => throw new NotImplementedException();
TargetPointer GetModule(TypeHandle typeHandle) => throw new NotImplementedException();

// A canonical method table is either the MethodTable itself, or in the case of a generic instantiation, it is the
// MethodTable of the prototypical instance.
public virtual TargetPointer GetCanonicalMethodTable(TypeHandle typeHandle) => throw new NotImplementedException();
public virtual TargetPointer GetParentMethodTable(TypeHandle typeHandle) => throw new NotImplementedException();
TargetPointer GetCanonicalMethodTable(TypeHandle typeHandle) => throw new NotImplementedException();
TargetPointer GetParentMethodTable(TypeHandle typeHandle) => throw new NotImplementedException();

public virtual uint GetBaseSize(TypeHandle typeHandle) => throw new NotImplementedException();
uint GetBaseSize(TypeHandle typeHandle) => throw new NotImplementedException();
// The component size is only available for strings and arrays. It is the size of the element type of the array, or the size of an ECMA 335 character (2 bytes)
public virtual uint GetComponentSize(TypeHandle typeHandle) => throw new NotImplementedException();
uint GetComponentSize(TypeHandle typeHandle) => throw new NotImplementedException();

// True if the MethodTable is the sentinel value associated with unallocated space in the managed heap
public virtual bool IsFreeObjectMethodTable(TypeHandle typeHandle) => throw new NotImplementedException();
public virtual bool IsString(TypeHandle typeHandle) => throw new NotImplementedException();
bool IsFreeObjectMethodTable(TypeHandle typeHandle) => throw new NotImplementedException();
bool IsString(TypeHandle typeHandle) => throw new NotImplementedException();
// True if the MethodTable represents a type that contains managed references
public virtual bool ContainsGCPointers(TypeHandle typeHandle) => throw new NotImplementedException();
public virtual bool IsDynamicStatics(TypeHandle typeHandle) => throw new NotImplementedException();
public virtual ushort GetNumMethods(TypeHandle typeHandle) => throw new NotImplementedException();
public virtual ushort GetNumInterfaces(TypeHandle typeHandle) => throw new NotImplementedException();
bool ContainsGCPointers(TypeHandle typeHandle) => throw new NotImplementedException();
bool IsDynamicStatics(TypeHandle typeHandle) => throw new NotImplementedException();
ushort GetNumMethods(TypeHandle typeHandle) => throw new NotImplementedException();
ushort GetNumInterfaces(TypeHandle typeHandle) => throw new NotImplementedException();

// Returns an ECMA-335 TypeDef table token for this type, or for its generic type definition if it is a generic instantiation
public virtual uint GetTypeDefToken(TypeHandle typeHandle) => throw new NotImplementedException();
uint GetTypeDefToken(TypeHandle typeHandle) => throw new NotImplementedException();
// Returns the ECMA 335 TypeDef table Flags value (a bitmask of TypeAttributes) for this type,
// or for its generic type definition if it is a generic instantiation
public virtual uint GetTypeDefTypeAttributes(TypeHandle typeHandle) => throw new NotImplementedException();
uint GetTypeDefTypeAttributes(TypeHandle typeHandle) => throw new NotImplementedException();

public virtual ReadOnlySpan<TypeHandle> GetInstantiation(TypeHandle typeHandle) => throw new NotImplementedException();
public virtual bool IsGenericTypeDefinition(TypeHandle typeHandle) => throw new NotImplementedException();
ReadOnlySpan<TypeHandle> GetInstantiation(TypeHandle typeHandle) => throw new NotImplementedException();
bool IsGenericTypeDefinition(TypeHandle typeHandle) => throw new NotImplementedException();

public virtual bool HasTypeParam(TypeHandle typeHandle) => throw new NotImplementedException();
bool HasTypeParam(TypeHandle typeHandle) => throw new NotImplementedException();

// Element type of the type. NOTE: this drops the CorElementType.GenericInst, and CorElementType.String is returned as CorElementType.Class.
// If this returns CorElementType.ValueType it may be a normal valuetype or a "NATIVE" valuetype used to represent an interop view on a structure
// HasTypeParam will return true for cases where this is the interop view
public virtual CorElementType GetSignatureCorElementType(TypeHandle typeHandle) => throw new NotImplementedException();
CorElementType GetSignatureCorElementType(TypeHandle typeHandle) => throw new NotImplementedException();

// return true if the TypeHandle represents an array, and set the rank to either 0 (if the type is not an array), or the rank number if it is.
public virtual bool IsArray(TypeHandle typeHandle, out uint rank) => throw new NotImplementedException();
public virtual TypeHandle GetTypeParam(TypeHandle typeHandle) => throw new NotImplementedException();
public virtual bool IsGenericVariable(TypeHandle typeHandle, out TargetPointer module, out uint token) => throw new NotImplementedException();
public virtual bool IsFunctionPointer(TypeHandle typeHandle, out ReadOnlySpan<TypeHandle> retAndArgTypes, out byte callConv) => throw new NotImplementedException();
bool IsArray(TypeHandle typeHandle, out uint rank) => throw new NotImplementedException();
TypeHandle GetTypeParam(TypeHandle typeHandle) => throw new NotImplementedException();
bool IsGenericVariable(TypeHandle typeHandle, out TargetPointer module, out uint token) => throw new NotImplementedException();
bool IsFunctionPointer(TypeHandle typeHandle, out ReadOnlySpan<TypeHandle> retAndArgTypes, out byte callConv) => throw new NotImplementedException();
// Returns null if the TypeHandle is not a class/struct/generic variable
#endregion TypeHandle inspection APIs

#region MethodDesc inspection APIs
public virtual MethodDescHandle GetMethodDescHandle(TargetPointer targetPointer) => throw new NotImplementedException();
public virtual TargetPointer GetMethodTable(MethodDescHandle methodDesc) => throw new NotImplementedException();
MethodDescHandle GetMethodDescHandle(TargetPointer targetPointer) => throw new NotImplementedException();
TargetPointer GetMethodTable(MethodDescHandle methodDesc) => throw new NotImplementedException();

// Return true for an uninstantiated generic method
public virtual bool IsGenericMethodDefinition(MethodDescHandle methodDesc) => throw new NotImplementedException();
public virtual ReadOnlySpan<TypeHandle> GetGenericMethodInstantiation(MethodDescHandle methodDesc) => throw new NotImplementedException();
bool IsGenericMethodDefinition(MethodDescHandle methodDesc) => throw new NotImplementedException();
ReadOnlySpan<TypeHandle> GetGenericMethodInstantiation(MethodDescHandle methodDesc) => throw new NotImplementedException();

// Return mdtMethodDef (0x06000000) if the method doesn't have a token, otherwise return the token of the method
public virtual uint GetMethodToken(MethodDescHandle methodDesc) => throw new NotImplementedException();
uint GetMethodToken(MethodDescHandle methodDesc) => throw new NotImplementedException();

// Return true if a MethodDesc represents an array method
// An array method is also a StoredSigMethodDesc
public virtual bool IsArrayMethod(MethodDescHandle methodDesc, out ArrayFunctionType functionType) => throw new NotImplementedException();
bool IsArrayMethod(MethodDescHandle methodDesc, out ArrayFunctionType functionType) => throw new NotImplementedException();

// Return true if a MethodDesc represents a method without metadata, either an IL Stub dynamically
// generated by the runtime, or a MethodDesc that describes a method represented by the System.Reflection.Emit.DynamicMethod class
// Or something else similar.
// A no metadata method is also a StoredSigMethodDesc
public virtual bool IsNoMetadataMethod(MethodDescHandle methodDesc, out string methodName) => throw new NotImplementedException();
bool IsNoMetadataMethod(MethodDescHandle methodDesc, out string methodName) => throw new NotImplementedException();
// A StoredSigMethodDesc is a MethodDesc for which the signature isn't found in metadata.
public virtual bool IsStoredSigMethodDesc(MethodDescHandle methodDesc, out ReadOnlySpan<byte> signature) => throw new NotImplementedException();
bool IsStoredSigMethodDesc(MethodDescHandle methodDesc, out ReadOnlySpan<byte> signature) => throw new NotImplementedException();

// Return true for a MethodDesc that describes a method represented by the System.Reflection.Emit.DynamicMethod class
// A DynamicMethod is also a StoredSigMethodDesc, and a NoMetadataMethod
public virtual bool IsDynamicMethod(MethodDescHandle methodDesc) => throw new NotImplementedException();
bool IsDynamicMethod(MethodDescHandle methodDesc) => throw new NotImplementedException();

// Return true if a MethodDesc represents an IL Stub dynamically generated by the runtime
// A IL Stub method is also a StoredSigMethodDesc, and a NoMetadataMethod
public virtual bool IsILStub(MethodDescHandle methodDesc) => throw new NotImplementedException();
bool IsILStub(MethodDescHandle methodDesc) => throw new NotImplementedException();

public virtual bool IsCollectibleMethod(MethodDescHandle methodDesc) => throw new NotImplementedException();
public virtual bool IsVersionable(MethodDescHandle methodDesc) => throw new NotImplementedException();
bool IsCollectibleMethod(MethodDescHandle methodDesc) => throw new NotImplementedException();
bool IsVersionable(MethodDescHandle methodDesc) => throw new NotImplementedException();

public virtual TargetPointer GetMethodDescVersioningState(MethodDescHandle methodDesc) => throw new NotImplementedException();
TargetPointer GetMethodDescVersioningState(MethodDescHandle methodDesc) => throw new NotImplementedException();

public virtual TargetCodePointer GetNativeCode(MethodDescHandle methodDesc) => throw new NotImplementedException();
TargetCodePointer GetNativeCode(MethodDescHandle methodDesc) => throw new NotImplementedException();

public virtual ushort GetSlotNumber(MethodDescHandle methodDesc) => throw new NotImplementedException();
ushort GetSlotNumber(MethodDescHandle methodDesc) => throw new NotImplementedException();

public virtual bool HasNativeCodeSlot(MethodDescHandle methodDesc) => throw new NotImplementedException();
bool HasNativeCodeSlot(MethodDescHandle methodDesc) => throw new NotImplementedException();

public virtual TargetPointer GetAddressOfNativeCodeSlot(MethodDescHandle methodDesc) => throw new NotImplementedException();
TargetPointer GetAddressOfNativeCodeSlot(MethodDescHandle methodDesc) => throw new NotImplementedException();

public virtual TargetPointer GetGCStressCodeCopy(MethodDescHandle methodDesc) => throw new NotImplementedException();
TargetPointer GetGCStressCodeCopy(MethodDescHandle methodDesc) => throw new NotImplementedException();
#endregion MethodDesc inspection APIs
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public interface IStackWalk : IContract
static string IContract.Name => nameof(StackWalk);

public virtual IEnumerable<IStackDataFrameHandle> CreateStackWalk(ThreadData threadData) => throw new NotImplementedException();
public virtual byte[] GetRawContext(IStackDataFrameHandle stackDataFrameHandle) => throw new NotImplementedException();
public virtual TargetPointer GetFrameAddress(IStackDataFrameHandle stackDataFrameHandle) => throw new NotImplementedException();
public virtual string GetFrameName(TargetPointer frameIdentifier) => throw new NotImplementedException();
byte[] GetRawContext(IStackDataFrameHandle stackDataFrameHandle) => throw new NotImplementedException();
TargetPointer GetFrameAddress(IStackDataFrameHandle stackDataFrameHandle) => throw new NotImplementedException();
string GetFrameName(TargetPointer frameIdentifier) => throw new NotImplementedException();
}

public struct StackWalk : IStackWalk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public record struct StressMsgData(
public interface IStressLog : IContract
{
static string IContract.Name { get; } = nameof(StressLog);
public virtual bool HasStressLog() => throw new NotImplementedException();
public virtual StressLogData GetStressLogData() => throw new NotImplementedException();
public virtual StressLogData GetStressLogData(TargetPointer stressLog) => throw new NotImplementedException();
public virtual IEnumerable<ThreadStressLogData> GetThreadStressLogs(TargetPointer Logs) => throw new NotImplementedException();
public virtual IEnumerable<StressMsgData> GetStressMessages(ThreadStressLogData threadLog) => throw new NotImplementedException();
public virtual bool IsPointerInStressLog(StressLogData stressLog, TargetPointer pointer) => throw new NotImplementedException();
bool HasStressLog() => throw new NotImplementedException();
StressLogData GetStressLogData() => throw new NotImplementedException();
StressLogData GetStressLogData(TargetPointer stressLog) => throw new NotImplementedException();
IEnumerable<ThreadStressLogData> GetThreadStressLogs(TargetPointer Logs) => throw new NotImplementedException();
IEnumerable<StressMsgData> GetStressMessages(ThreadStressLogData threadLog) => throw new NotImplementedException();
bool IsPointerInStressLog(StressLogData stressLog, TargetPointer pointer) => throw new NotImplementedException();
}

public readonly struct StressLog : IStressLog
Expand Down
Loading