Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Charlamb committed Dec 4, 2024
1 parent bdf9894 commit 5e9c139
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/coreclr/debug/runtimeinfo/datadescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include "methodtable.h"
#include "threads.h"

#ifdef HAVE_GCCOVER
#include "gccover.h"
#endif // HAVE_GCCOVER

// begin blob definition

extern "C"
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/debug/runtimeinfo/datadescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ CDAC_TYPE_END(ProfControlBlock)

#ifdef HAVE_GCCOVER
CDAC_TYPE_BEGIN(GCCoverageInfo)
CDAC_TYPE_FIELD(GCCoverageInfo, /*pointer*/, SavedCode, offsetof(GCCoverageInfo, SavedCode))
CDAC_TYPE_INDETERMINATE(GCCoverageInfo)
CDAC_TYPE_FIELD(GCCoverageInfo, /*pointer*/, SavedCode, offsetof(GCCoverageInfo, savedCode))
CDAC_TYPE_END(GCCoverageInfo)
#endif // HAVE_GCCOVER

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts;

internal interface IGCCover : IContract
{
static string IContract.Name { get; } = nameof(GCCover);

public virtual TargetPointer? GetGCCoverageInfo(NativeCodeVersionHandle codeVersionHandle) => throw new NotImplementedException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public MethodDesc(Target target, TargetPointer address)
CodeData = target.ReadPointer(address + (ulong)type.Fields[nameof(CodeData)].Offset);
if (type.Fields.ContainsKey(nameof(GCCoverageInfo)))
{
GCCoverageInfo = target.Read<byte>(address + (ulong)type.Fields[nameof(GCCoverageInfo)].Offset);
GCCoverageInfo = target.ReadPointer(address + (ulong)type.Fields[nameof(GCCoverageInfo)].Offset);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public CachingContractRegistry(Target target, TryGetContractVersionDelegate tryG
[typeof(IPlatformMetadata)] = new PlatformMetadataFactory(),
[typeof(IPrecodeStubs)] = new PrecodeStubsFactory(),
[typeof(IReJIT)] = new ReJITFactory(),
[typeof(IGCCover)] = new GCCoverFactory(),
};
configureFactories?.Invoke(_factories);
}
Expand Down

0 comments on commit 5e9c139

Please sign in to comment.