-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
Description
In .NET 9, exceptions caught by the debugger's func-eval backstop no longer raise DEBUG_EXCEPTION_CATCH_HANDLER_FOUND notifications when they are caught. This does NOT happen if DOTNET_LegacyExceptionHandling is enabled.
Reproduction Steps
- Create the following program targeting .NET 9
- Set a breakpoint on the specified line
- Evaluate
Divide(5, 0)in the debugger. If using Visual Studio, use the immediate Window so that the debugger will stop on the exception
using System.Diagnostics;
static class Program
{
static int Divide(int n, int m)
{
return n / m;
}
static void Main(string[] args)
{
Console.WriteLine("10/2 = {0}", Divide(10, 2)); // breakpoint here
}
};Expected behavior
ICorDebug should raise an exception callback with DEBUG_EXCEPTION_CATCH_HANDLER_FOUND. In Visual Studio, if evaluating from the immediate Window, this will cause the debugger to break on the exception.
Actual behavior
No catch-handler-found event is raised
Regression?
Regression from .NET 8
Known Workarounds
Use legacy exception handling.
Configuration
Issue reproduces on Windows x64 and does not reproduce on Windows x86. I didn't try any other configurations.
Other information
No response