View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000292 | Xdebug | Uncategorized | public | 2007-07-12 07:13 | 2007-07-14 14:54 |
| Reporter | mathieuk | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | resolved | Resolution | no change required | ||
| Summary | 0000292: xdebug doesn't provide a stacktrace after an uncaught exception | ||||
| Description | <?php function test() test(); ?> Consider the following code and a debugging session that has an exception breakpoint set on "Fatal error": function test() test(); ?> Expected behaviour:An uncaught exception triggers a fatal error, which is caught as a breakpoint by Xdebug. Xdebug transfers control over to the client. When the client asks for a stacktrace using the DBGp command 'stack_get', the user gets back a proper DBGp response, containing a stacktrace containing entries for the function 'test' and the function '{main}'. Actual behaviour in 2.0RC4The uncaught exception indeed triggers a fatal error which is properly caught by Xdebug. When requesting the stacktrace (without a depth specificier) you get an empty response: (cmd) stack_get -i waa3 Full debugclient conversation:Waiting for debug server to connect. (cmd) breakpoint_set -i waa0 -t exception -x "Fatal error" (cmd) run -i waa (cmd) stack_get -i waa3 (cmd) stack_get -i waa4 -d 0 (cmd) stack_get -i waa5 -d 1 | ||||
| Tags | No tags attached. | ||||
| Operating System | |||||
| PHP Version | 5.2.1 | ||||
|
|
This is not a bug. The uncaught fatal error happens after PHP wind down all the stack to find a matching catch block. If it can't find one it's basically back to stack level -1, which is even before the script starts. There is nothing that Xdebug can do about this. It works for just showing the uncaught exception stack trace because Xdebug keeps internally a full stack in a formatted message for every exception. |