-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[cDAC] Use specific exception for virtual read failures #118895
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] Use specific exception for virtual read failures #118895
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new specific exception type VirtualReadException to replace the generic InvalidOperationException for virtual memory read failures in the cDAC diagnostic component. This provides better error handling specificity and clearer debugging information.
Key changes:
- Introduces
VirtualReadExceptionclass with appropriate HResult for virtual read failures - Replaces
InvalidOperationExceptioncatches/throws withVirtualReadExceptionthroughout the codebase - Updates method signatures and documentation to reflect the new exception type
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VirtualReadException.cs | New exception class specifically for virtual read failures with proper HResult |
| CorDbHResults.cs | Made class public and moved to correct namespace for wider accessibility |
| ContractDescriptorTarget.cs | Updated read methods to throw VirtualReadException and updated method signatures |
| Target.cs | Added exception documentation to abstract methods and updated Write method signature |
| ClrDataModule.cs | Updated catch block to handle VirtualReadException instead of InvalidOperationException |
| SOSDacImpl.cs | Removed redundant catch block for InvalidOperationException |
| PrintfStressMessageFormatter.cs | Updated exception handling for string read operations |
| AMD64Unwinder.cs | Updated exception handling for memory read failures |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Target.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Target.cs
Outdated
Show resolved
Hide resolved
|
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#118702 (review)
Modifies the
Targetto throwVirtualReadExceptionwhen there is a failure when doing a virtual read. This has an HResult ofCORDBG_E_READVIRTUAL_FAILUREmatching the DACs return in the same scenario.Note, global reads continue to throw
InvalidOperationExceptionas these don't trigger a virtual read, but return a value from a dictionary.