This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Repository navigation
Revert "Change Debug.Assert on Windows when no debugger attached" - #4220
Merged
Merged
Conversation
Contributor
|
LGTM. |
Contributor
|
Merging without CI being complete because we will want this change for our nightly TFS build. |
ellismg
added a commit
that referenced
this pull request
Oct 29, 2015
Revert "Change Debug.Assert on Windows when no debugger attached"
stephentoub
added a commit
to stephentoub/corefx
that referenced
this pull request
Oct 29, 2015
This is another attempt at dotnet#4212, which was then immediately reverted in dotnet#4220 because it broke some internal build stuff due to the APIs being used. Changes on Windows: - When an Assert fires and the debugger isn't attached, instead of Environment.FailFast'ing, we throw an exception. - When an Assert fires, we were previously calling Debug.WriteLine twice; now we only call it once. Changes on Unix: - Made the Assert functionality match that of Windows in terms of the APIs being called. - Changed WriteCore to check Debugger.IsLogging and, if it's true, do a Debugger.Log, just as we do on Windows. Right now these are nops, but when that changes this will become useful. The fallback when IsLogging is false remains the same: write to syslog. - Fixed the WriteToStderr function to ignore errors from Write, as we don't want this function throwing exceptions due to failed attempts to output to stderr, such as if it was piped to another program that ended before this one (as with dotnet#4221).
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…rite_stderr Revert "Change Debug.Assert on Windows when no debugger attached" Commit migrated from dotnet/corefx@c2e697b
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
This is another attempt at dotnet/corefx#4212, which was then immediately reverted in dotnet/corefx#4220 because it broke some internal build stuff due to the APIs being used. Changes on Windows: - When an Assert fires and the debugger isn't attached, instead of Environment.FailFast'ing, we throw an exception. - When an Assert fires, we were previously calling Debug.WriteLine twice; now we only call it once. Changes on Unix: - Made the Assert functionality match that of Windows in terms of the APIs being called. - Changed WriteCore to check Debugger.IsLogging and, if it's true, do a Debugger.Log, just as we do on Windows. Right now these are nops, but when that changes this will become useful. The fallback when IsLogging is false remains the same: write to syslog. - Fixed the WriteToStderr function to ignore errors from Write, as we don't want this function throwing exceptions due to failed attempts to output to stderr, such as if it was piped to another program that ended before this one (as with dotnet/corefx#4221). Commit migrated from dotnet/corefx@68e46ff
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Reverts #4212
Breaks the internal TFS build. Will try another approach later.
cc: @ellismg