Skip to content
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
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ ClrDataAccess::GetModuleData(CLRDATA_ADDRESS addr, struct DacpModuleData *Module
ModuleData->Assembly = HOST_CDADDR(pModule->GetAssembly());
ModuleData->dwModuleID = 0; // CoreCLR no longer has this concept
ModuleData->dwModuleIndex = 0; // CoreCLR no longer has this concept
ModuleData->dwTransientFlags = pModule->m_dwTransientFlags;
ModuleData->dwTransientFlags = (pModule->m_dwTransientFlags & Module::IS_EDIT_AND_CONTINUE) ? DacpModuleData::IsEditAndContinue : 0;
ModuleData->LoaderAllocator = HOST_CDADDR(pModule->m_loaderAllocator);

EX_TRY
Expand Down
6 changes: 5 additions & 1 deletion src/coreclr/inc/dacprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,13 @@ struct MSLAYOUT DacpThreadLocalModuleData
CLRDATA_ADDRESS pNonGCStaticDataStart = 0;
};


struct MSLAYOUT DacpModuleData
{
enum TransientFlags
{
IsEditAndContinue = 0x00000208, // Flags for .NET Framework (0x00000200) and .NET Core (0x00000008)
};

CLRDATA_ADDRESS Address = 0;
CLRDATA_ADDRESS PEAssembly = 0; // Actually the module address in .NET 9+
CLRDATA_ADDRESS ilBase = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,8 @@ public ModuleHandle(TargetPointer address)
public enum ModuleFlags
{
Tenured = 0x1, // Set once we know for sure the Module will not be freed until the appdomain itself exits
ClassFreed = 0x4,
EditAndContinue = 0x8, // Edit and Continue is enabled for this module

ProfilerNotified = 0x10,
EtwNotified = 0x20,

ReflectionEmit = 0x40, // Reflection.Emit was used to create this module
ProfilerDisableOptimizations = 0x80,
ProfilerDisableInlining = 0x100,

DebuggerUserOverridePriv = 0x400,
DebuggerAllowJitOptsPriv = 0x800,
DebuggerTrackJitInfoPriv = 0x1000,
DebuggerEnCEnabledPriv = 0x2000,
DebuggerPDBsCopied = 0x4000,
DebuggerIgnorePDbs = 0x8000,

IJWFixedUp = 0x80000,
BeingUnloaded = 0x100000,
}

[Flags]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,8 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts;
private enum ModuleFlags_1 : uint
{
Tenured = 0x1, // Set once we know for sure the Module will not be freed until the appdomain itself exits
ClassFreed = 0x4,
EditAndContinue = 0x8, // Edit and Continue is enabled for this module

ProfilerNotified = 0x10,
EtwNotified = 0x20,

ReflectionEmit = 0x40, // Reflection.Emit was used to create this module
ProfilerDisableOptimizations = 0x80,
ProfilerDisableInlining = 0x100,

DebuggerUserOverridePriv = 0x400,
DebuggerAllowJitOptsPriv = 0x800,
DebuggerTrackJitInfoPriv = 0x1000,
DebuggerEnCEnabledPriv = 0x2000,
DebuggerPDBsCopied = 0x4000,
DebuggerIgnorePDbs = 0x8000,

IJWFixedUp = 0x80000,
BeingUnloaded = 0x100000,
}

private enum PEImageFlags : uint
Expand Down Expand Up @@ -328,36 +311,10 @@ private static ModuleFlags GetFlags(Data.Module module)
ModuleFlags flags = default;
if (runtimeFlags.HasFlag(ModuleFlags_1.Tenured))
flags |= ModuleFlags.Tenured;
if (runtimeFlags.HasFlag(ModuleFlags_1.ClassFreed))
flags |= ModuleFlags.ClassFreed;
if (runtimeFlags.HasFlag(ModuleFlags_1.EditAndContinue))
flags |= ModuleFlags.EditAndContinue;
if (runtimeFlags.HasFlag(ModuleFlags_1.ProfilerNotified))
flags |= ModuleFlags.ProfilerNotified;
if (runtimeFlags.HasFlag(ModuleFlags_1.EtwNotified))
flags |= ModuleFlags.EtwNotified;
if (runtimeFlags.HasFlag(ModuleFlags_1.ReflectionEmit))
flags |= ModuleFlags.ReflectionEmit;
if (runtimeFlags.HasFlag(ModuleFlags_1.ProfilerDisableOptimizations))
flags |= ModuleFlags.ProfilerDisableOptimizations;
if (runtimeFlags.HasFlag(ModuleFlags_1.ProfilerDisableInlining))
flags |= ModuleFlags.ProfilerDisableInlining;
if (runtimeFlags.HasFlag(ModuleFlags_1.DebuggerUserOverridePriv))
flags |= ModuleFlags.DebuggerUserOverridePriv;
if (runtimeFlags.HasFlag(ModuleFlags_1.DebuggerAllowJitOptsPriv))
flags |= ModuleFlags.DebuggerAllowJitOptsPriv;
if (runtimeFlags.HasFlag(ModuleFlags_1.DebuggerTrackJitInfoPriv))
flags |= ModuleFlags.DebuggerTrackJitInfoPriv;
if (runtimeFlags.HasFlag(ModuleFlags_1.DebuggerEnCEnabledPriv))
flags |= ModuleFlags.DebuggerEnCEnabledPriv;
if (runtimeFlags.HasFlag(ModuleFlags_1.DebuggerPDBsCopied))
flags |= ModuleFlags.DebuggerPDBsCopied;
if (runtimeFlags.HasFlag(ModuleFlags_1.DebuggerIgnorePDbs))
flags |= ModuleFlags.DebuggerIgnorePDbs;
if (runtimeFlags.HasFlag(ModuleFlags_1.IJWFixedUp))
flags |= ModuleFlags.IJWFixedUp;
if (runtimeFlags.HasFlag(ModuleFlags_1.BeingUnloaded))
flags |= ModuleFlags.BeingUnloaded;

return flags;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ public struct DacpThreadData

public struct DacpModuleData
{
public enum TransientFlags : uint
{
IsEditAndContinue = 0x00000208, // Flags for .NET Framework (0x00000200) and .NET Core (0x00000008)
};

public ClrDataAddress Address;
public ClrDataAddress PEAssembly; // Actually the module address in .NET 9+
public ClrDataAddress ilBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,7 @@ int ISOSDacInterface.GetModuleData(ClrDataAddress moduleAddr, DacpModuleData* da
bool isReflectionEmit = flags.HasFlag(Contracts.ModuleFlags.ReflectionEmit);
data->isReflection = (uint)(isReflectionEmit ? 1 : 0);
data->isPEFile = (uint)(isReflectionEmit ? 0 : 1); // ReflectionEmit module means it is not a PE file
data->dwTransientFlags = (uint)flags;
data->dwTransientFlags = (uint)(flags & Contracts.ModuleFlags.EditAndContinue) != 0 ? (uint)DacpModuleData.TransientFlags.IsEditAndContinue : 0;

data->ilBase = contract.GetILBase(handle).ToClrDataAddress(_target);

Expand Down
Loading