Skip to content

DEBUG_EXCEPTION_CATCH_HANDLER_FOUND events missing for exceptions caught by func-eval #102178

@gregg-miskelly

Description

@gregg-miskelly

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

  1. Create the following program targeting .NET 9
  2. Set a breakpoint on the specified line
  3. 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions