View Issue Details

IDProjectCategoryView StatusLast Update
0002280XdebugStep Debuggingpublic2024-12-15 21:21
Reporteranton.m4354 Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status resolvedResolutionnot fixable 
Summary0002280: PHP Exception breakpoints: Abitilty to stop on uncaught or caught exceptions only
Description

While in JS it is possible to separately stop only on caught or only on uncaught exceptions, this is not implemented in xdebug. The ticket was originally opened in jetbrains, but they said that this should be implemented on the xdebug side.

See more https://youtrack.jetbrains.com/issue/WI-60135/PHP-Exception-breakpoints-Option-to-stop-on-unhandled-exceptions-only

TagsNo tags attached.
Operating System
PHP Version8.2.0-8.2.9

Activities

derick

2024-07-17 09:42

administrator   ~0006994

When an exception is thrown, Xdebug can intercept this and break on it, as it currently allows through Exception breakpoints.

At this state, PHP (and hence Xdebug) does not yet know whether the exception is being caught so there is no possibility of discerning whether it is a "caught" or "uncaught" exception.

azad

2024-12-15 21:03

reporter   ~0007119

@derick Thanks for the note.

We need a way to stop execution ONLY when the exception is left uncaught in the entire call hierarchy and reaches the top (bottom?) of the stack. There should be a difference between an exception that is handled gracefully in a try block (xdebug shouldn't care; maybe log them at most) and an exception the code does not handle and is going to crash the application (xdebug should catch it, pausing on the line on which the exception is thrown).

I understand in the latter case the stack is already unwound, and stopping at the exception line may sound weird, but both JS and C# debuggers seem to have found a way to do exactly that, which is what inspires this ticket (and the original PHPStorm ticket).

azad

2024-12-15 21:21

reporter   ~0007120

Please take my saying that other debuggers can stop on exactly that line with a grain of salt; it's been a while since I worked with both of the languages and I may be misremembering. Other parts of the tooling or the IDE may also be helping to find the exact exception line. For example, C# exceptions store the entire stack trace and that's how even after the stack is unwound the IDE can still find the exception line.

Issue History

Date Modified Username Field Change
2024-07-09 19:22 anton.m4354 New Issue
2024-07-17 09:42 derick Assigned To => derick
2024-07-17 09:42 derick Status new => resolved
2024-07-17 09:42 derick Resolution open => not fixable
2024-07-17 09:42 derick Note Added: 0006994
2024-12-15 21:03 azad Note Added: 0007119
2024-12-15 21:21 azad Note Added: 0007120