Open
Conversation
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataMethodInstance.cs:475
- GetILAddressMap can throw before writing mapNeeded (e.g., when there’s no debug info). Even though this PR now throws InvalidCastException for the empty-map case, mapNeeded should still be set to 0 on all failure paths to avoid leaving an uninitialized out parameter.
if (map.Count == 0)
throw new InvalidCastException();
- Files reviewed: 3/3 changed files
- Comments generated: 5
| CLRDATA_SOURCE_TYPE_INVALID = 0, | ||
| } | ||
|
|
||
| public enum CLRDataILOffsetMarker : uint |
Comment on lines
+358
to
+365
| if (addressRanges is not null && hits < addressRanges.Length) | ||
| { | ||
| uint nativeEndOffset = i == map.Count - 1 ? 0 : map[i + 1].NativeOffset; | ||
| addressRanges[hits].startAddress = new TargetPointer(codeStart + entry.NativeOffset).ToClrDataAddress(_target); | ||
| addressRanges[hits].endAddress = entry.ILOffset == (uint)CLRDataILOffsetMarker.CLRDATA_IL_OFFSET_EPILOG && nativeEndOffset == 0 | ||
| ? default | ||
| : new TargetPointer(codeStart + nativeEndOffset).ToClrDataAddress(_target); | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/IXCLRData.cs:552
- Adding a new
publicenum here expands the surface area of the (packable) Legacy assembly, but the PR description doesn’t link anapi-approvedissue. If these marker values are only an implementation detail for interpretingilOffsetvalues, make the enuminternal(or replace withprivate const uintvalues) to avoid introducing a new public API type.
public enum CLRDataILOffsetMarker : uint
- Files reviewed: 3/3 changed files
- Comments generated: 2
Comment on lines
617
to
+621
| int GetAddressRangesByILOffset( | ||
| uint ilOffset, | ||
| uint rangesLen, | ||
| uint* rangesNeeded, | ||
| /*CLRDATA_ADDRESS_RANGE* */ void* addressRanges); | ||
| [In, Out, MarshalUsing(CountElementName = nameof(rangesLen))] ClrDataAddressRange[]? addressRanges); |
Comment on lines
+190
to
+199
| IXCLRDataMethodDefinition methodDefinition = Assert.IsAssignableFrom<IXCLRDataMethodDefinition>(definitionOut.Interface); | ||
| DacComNullableByRef<IXCLRDataModule> nullModule = new(isNullRef: true); | ||
| uint instanceToken; | ||
| hr = methodInstance.GetTokenAndScope(&instanceToken, nullModule); | ||
| AssertHResult(HResults.S_OK, hr); | ||
|
|
||
| uint definitionToken; | ||
| hr = methodDefinition.GetTokenAndScope(&definitionToken, nullModule); | ||
| AssertHResult(HResults.S_OK, hr); | ||
| Assert.Equal(instanceToken, definitionToken); |
noahfalk
reviewed
Jul 27, 2026
|
|
||
| try | ||
| { | ||
| if (canFallback && _legacyImpl is not null) |
Member
There was a problem hiding this comment.
If we can't fallback shouldn't we return E_NOTIMPL? Right now it looks like we return a ClrMethodDefinition that has a NULL legacyMethodDefinition embedded inside it or maybe that constructor throws some other error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
CLRDataMethodInstance.GetDefinitionandGetAddressRangesByILOffsetusing cDAC contracts.Changes
Method definitions
MethodDesc.IL address ranges
E_NOINTERFACEsemantics.Coverage