View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000997 | Xdebug | Tracing | public | 2013-10-31 23:08 | 2021-03-17 15:23 |
Reporter | mpdude | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 2.2.3 | ||||
Summary | 0000997: In trace output, show which object a method is called on | ||||
Description | It would be great if the trace output could convey the object instance a method is called on. A hint with the locally (in the caller's scope) used variable name would be an extra bonus; global object identity (so objects can be recognized when called multiple times) would be the main requirement. Background: Given this information, it should be straightforward to write a filter/converter that can compile trace files to PlantUML notation - that is, you can get UML sequence diagrams for your scripts :-) | ||||
Tags | No tags attached. | ||||
Attached Files | scratch_12.txt (2,602 bytes)
RACE START [2016-12-11 21:36:28] 0.0003 237640 -> OrdPrinter->setSplitter($s = class Splitter { }) /var/www/test/trace.php:53 [calling on @1, local name $op] 0.0004 237776 >=> NULL 0.0004 237760 -> OrdPrinter->setOrd($o = class Ord { }) /var/www/test/trace.php:54 [calling on @1, local name $op] 0.0004 237896 >=> NULL 0.0004 237976 -> OrdPrinter->run($string = 'Xdebug') /var/www/test/trace.php:55 [calling on @1, local name $op] 0.0004 238008 -> Splitter->split($str = 'Xdebug') /var/www/test/trace.php:42 [calling on @2, local name $this->splitter] 0.0004 238056 -> str_split('Xdebug') /var/www/test/trace.php:13 0.0004 239248 >=> array (0 => 'X', 1 => 'd', 2 => 'e', 3 => 'b', 4 => 'u', 5 => 'g') 0.0004 239248 >=> array (0 => 'X', 1 => 'd', 2 => 'e', 3 => 'b', 4 => 'u', 5 => 'g') 0.0008 239312 -> Ord->getOrd($char = 'X') /var/www/test/trace.php:43 [calling on @3, local name $this->ord] 0.0008 239360 -> ord('X') /var/www/test/trace.php:21 0.0008 239360 >=> 88 0.0008 239360 >=> 88 0.0016 239312 -> Ord->getOrd($char = 'd') /var/www/test/trace.php:43 [calling on @3, local name $this->ord] 0.0016 239360 -> ord('d') /var/www/test/trace.php:21 0.0016 239360 >=> 100 0.0016 239360 >=> 100 0.0024 239312 -> Ord->getOrd($char = 'e') /var/www/test/trace.php:43 [calling on @3, local name $this->ord] 0.0024 239360 -> ord('e') /var/www/test/trace.php:21 0.0024 239360 >=> 101 0.0024 239360 >=> 101 0.0032 239312 -> Ord->getOrd($char = 'b') /var/www/test/trace.php:43 [calling on @3, local name $this->ord] 0.0033 239360 -> ord('b') /var/www/test/trace.php:21 0.0033 239360 >=> 98 0.0033 239360 >=> 98 0.0040 239312 -> Ord->getOrd($char = 'u') /var/www/test/trace.php:43 [calling on @3, local name $this->ord] 0.0041 239360 -> ord('u') /var/www/test/trace.php:21 0.0041 239360 >=> 117 0.0042 239360 >=> 117 0.0051 239312 -> Ord->getOrd($char = 'g') /var/www/test/trace.php:43 [calling on @3, local name $this->ord] 0.0052 239360 -> ord('g') /var/www/test/trace.php:21 0.0052 239360 >=> 103 0.0052 239360 >=> 103 0.0056 238120 >=> NULL 0.0057 8240 TRACE END [2016-12-11 21:36:28] | ||||
Operating System | |||||
PHP Version | 5.3.5 | ||||
|
If you're still interested - could you give me a changed (originally generated) trace file with this extra information added by hand? |
|
Would it be OK to add the information needed to the "human readable" trace file, also if I ultimately probably will use trace_format=1? |
|
Certainly. Adding it to the 1 format is likely going to be trickier as I can't break the existing format. |
|
While preparing the example, I noticed that constructor invocations seem not to be logged in traces. Is that by design or impossible due to PHP internals? |
|
Trace file added. I added square brackets at the end of method invocation lines to note the information I'd like to see there. Most useful would be some kind of global (i. e. script-wide unique) object ID of whatever kind to identify the object a method is invoked on (the callee). With that information, the target of the invocation could be referenced/looked up in an UML sequence diagram. If the "local name" (field/variable name) holding the reference would be included, some additional information could be included in the diagram, but I guess it should work without this as well. Cheers! |
|
A constructor should end up in the trace as long as there is one defined in the class. I'll have A look at the trace soon. Could you add the script as well please? |
|
Is this issue still relevant to you? |
|
The honest answer is that I had forgotten about it. Of course it would be great to have such a tool in my toolbox, but the situation I had back then (discovering and documenting how a piece of legacy code works) is no longer pressing. |
|
Let me close this then. And when you might have a need for this in the future, feel free to open a new ticket. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-10-31 23:08 | mpdude | New Issue | |
2016-12-11 12:55 | derick | Note Added: 0003981 | |
2016-12-11 12:55 | derick | Assigned To | => derick |
2016-12-11 12:55 | derick | Status | new => feedback |
2016-12-11 20:46 | mpdude | Note Added: 0003996 | |
2016-12-11 20:46 | mpdude | Status | feedback => assigned |
2016-12-11 21:20 | derick | Note Added: 0003997 | |
2016-12-11 21:20 | derick | Status | assigned => feedback |
2016-12-11 21:42 | mpdude | Note Added: 0003998 | |
2016-12-11 21:42 | mpdude | Status | feedback => assigned |
2016-12-11 21:47 | mpdude | File Added: scratch_12.txt | |
2016-12-11 21:51 | mpdude | Note Added: 0003999 | |
2016-12-11 21:52 | mpdude | Note Edited: 0003999 | |
2016-12-11 22:13 | derick | Note Added: 0004000 | |
2016-12-11 22:13 | derick | Status | assigned => acknowledged |
2020-03-12 16:49 | derick | Category | Feature/Change request => Tracing |
2021-03-17 09:20 | derick | Status | acknowledged => feedback |
2021-03-17 09:20 | derick | Note Added: 0005736 | |
2021-03-17 11:43 | mpdude | Note Added: 0005782 | |
2021-03-17 11:43 | mpdude | Status | feedback => assigned |
2021-03-17 15:23 | derick | Status | assigned => closed |
2021-03-17 15:23 | derick | Resolution | open => no change required |
2021-03-17 15:23 | derick | Note Added: 0005792 |