-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NativeAOT] Fix formatting or assertion failures and fail-fasts (#91300)
Fix a long standing TODO. Formatting of assertion failures and fail-fasts in native AOT matches regular CoreCLR with this change. ```csharp Debug.Assert(false, "Something is not right."); ``` Before: ``` Unhandled Exception: System.Diagnostics.DebugProvider+DebugAssertException: Something is not right. at System.Diagnostics.DebugProvider.Fail(String, String) + 0x49 at System.Diagnostics.Debug.Fail(String, String) + 0x5a at System.Diagnostics.Debug.Assert(Boolean, String, String) + 0x2d at System.Diagnostics.Debug.Assert(Boolean, String) + 0x28 at Program.<Main>$(String[] args) + 0x1d at test!<BaseAddress>+0x1d3a67 at test!<BaseAddress>+0x1d3af5 ``` After: ``` Process terminated. Assertion failed. Something is not right. at System.Diagnostics.DebugProvider.Fail(String, String) + 0x49 at System.Diagnostics.Debug.Fail(String, String) + 0x5a at System.Diagnostics.Debug.Assert(Boolean, String, String) + 0x2d at System.Diagnostics.Debug.Assert(Boolean, String) + 0x28 at Program.<Main>$(String[] args) + 0x1d at repro!<BaseAddress>+0x1d51c7 at repro!<BaseAddress>+0x1d5255 ``` ```csharp Environment.FailFast("Fatal error!"); ``` Before: ``` Process terminated. Fatal error! ``` After: ``` Process terminated. Fatal error! at System.RuntimeExceptionHelpers.FailFast(String, Exception, String, RhFailFastReason, IntPtr, IntPtr) + 0x335 at System.Environment.FailFast(String) + 0x35 at Program.<Main>$(String[] args) + 0x1b at repro!<BaseAddress>+0x1d40c7 at repro!<BaseAddress>+0x1d4155 ```
- Loading branch information
Showing
6 changed files
with
51 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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