View Issue Details

IDProjectCategoryView StatusLast Update
0000450XdebugUncategorizedpublic2023-11-30 14:49
ReporterFreeaqingme Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version2.0.0dev 
Target Version3.3devFixed in Version3.3.0 
Summary0000450: "Incomplete" backtraces when an exception gets rethrown
Description

Try the attached 'script'. I would have liked to know the exception was thrown in f6() however, unfortunately xdebug does show no more steps after f4(). This on itself is fairly well explainable, if it were not for php (without xdebug) to actually do show the exception was thrown in f6().

php version: 5.2.9, xdebug version 2.0.4

Additional Information
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
class test {
        function f4() {
                try {
                        $this->f5();
                } catch(exception $e) {
                        throw $e;
                }
        }

        function f5() {
                $this->f6();
        }

        function f6() {
                throw new exception('foo');
        }
}

$test = new test();

$test->f4();
?>
TagsNo tags attached.
Operating SystemGNU Linux
PHP Version5.2.8

Relationships

has duplicate 0001298 resolvedderick Incomplete stack trace when re-throwing exception 

Activities

derick

2016-12-13 21:38

administrator   ~0004054

This is likely going to be difficult to fix.

AndreKR

2020-12-11 16:33

reporter   ~0005586

This is likely going to be difficult to fix.

Why would that be? The information is in the Exception, it can be shown from within PHP with $e->getTrace(). Xdebug cannot access it?

In fact, my long time workaround for this issue is:

// Re-throw the exception
if (!extension_loaded('xdebug'))
  throw $e;
else
  throw new Exception(null, null, $e);

Then Xdebug does show the stack trace of the exception in addition to the (usually useless) stack trace of the re-throw.

derick

2023-08-24 16:22

administrator   ~0006642

https://github.com/xdebug/xdebug/pull/904

Freeaqingme

2023-08-24 17:50

reporter   ~0006643

Thanks for fixing!

I'll have to admit I had totally forgotten this 14 year old issue, but it's great to see that even though it's been sitting idle for a while it was still picked up. Thanks & have a good one!

ps I have no idea why I used f4,f5 and f6, instead of e.g. f1-3. Guess we'll never know...

Issue History

Date Modified Username Field Change
2009-07-03 18:58 Freeaqingme New Issue
2009-07-03 18:58 Freeaqingme Operating System => GNU Linux
2009-07-03 18:58 Freeaqingme PHP Version => 5.2.8
2009-07-03 18:58 Freeaqingme Xdebug Version => 2.0.4-dev
2016-12-11 23:50 derick Relationship added has duplicate 0001298
2016-12-13 21:38 derick Note Added: 0004054
2016-12-13 21:38 derick Assigned To => derick
2016-12-13 21:38 derick Status new => acknowledged
2020-03-12 16:55 derick Severity tweak => feature
2020-03-12 17:01 derick Category Feature/Change request => Uncategorized
2020-12-11 16:33 AndreKR Note Added: 0005586
2021-03-17 08:32 derick Target Version => 3.1dev
2021-08-26 23:33 derick Target Version 3.1dev => 3.2dev
2022-06-06 15:27 derick Target Version 3.2dev => 3.3dev
2023-08-23 11:39 derick Additional Information Updated
2023-08-24 16:22 derick Status acknowledged => closed
2023-08-24 16:22 derick Resolution open => fixed
2023-08-24 16:22 derick Fixed in Version => 3.3dev
2023-08-24 16:22 derick Note Added: 0006642
2023-08-24 17:50 Freeaqingme Note Added: 0006643
2023-09-05 17:46 derick Fixed in Version 3.3dev => 3.3.0alpha1
2023-11-30 14:49 derick Fixed in Version 3.3.0alpha1 => 3.3.0