View Issue Details

IDProjectCategoryView StatusLast Update
0001188XdebugUncategorizedpublic2015-10-22 22:58
ReporterStrate Assigned Toderick  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionno change required 
Product Version2.3.2 
Summary0001188: Improve stacktraces inside catch blocks
Description

Try to debug this code:

<?php

function a() {
b();
}

function b() {
c();
}

function c() {
throw new \Exception();
}

try {
a();
} catch (\Exception $e) {
xdebug_break();
}

Open this code in IDE, i.e. PhpStorm put breakpoint to xdebug_break(); statement, and run script. On script breaks, try to look to stacktrace. You will see only main() call (see attached screenshot). But real stacktrace is:

  • xdebug_trace.php:16 (call to function a)
  • xdebug_trace.php:4 (call to function b)
  • xdebug_trace.php:8 (call to function c)
  • xdebug_trace.php:12 (throwing new exception in function c)
  • xdebug)trace.php:18 (catching thac exception)

It would be great improvement, if caught stacktrace be closer to real stack trace

TagsNo tags attached.
Attached Files
2015-09-23-c2abef.png (39,081 bytes)   
2015-09-23-c2abef.png (39,081 bytes)   
Operating SystemLinux
PHP Version5.6.10-5.6.14

Activities

derick

2015-10-22 22:58

administrator   ~0003184

At the moment your exception is caught, the whole stack has been rolled up already. That means that because it's not there, we can't show it any more.

If you want to see the full stack when an exception gets thrown in PHP Storm, set an Exception break point on "Exception" or "*".

Issue History

Date Modified Username Field Change
2015-09-23 10:23 Strate New Issue
2015-09-23 10:23 Strate File Added: 2015-09-23-c2abef.png
2015-10-22 22:58 derick Note Added: 0003184
2015-10-22 22:58 derick Status new => resolved
2015-10-22 22:58 derick Resolution open => no change required
2015-10-22 22:58 derick Assigned To => derick
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized