View Issue Details

IDProjectCategoryView StatusLast Update
0000821XdebugTracingpublic2020-03-12 17:34
Reportershdwjk Assigned Toderick  
PrioritylowSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
PlatformlinuxOScentos 
Product Version2.2.0RC2 
Target Version2.2.1Fixed in Version2.2.1 
Summary0000821: Variable assignments (beginning with =>) should be indented one more scope
Description

Currently Variable assignments within a function have the same scope indentation as the function they are in. Example:

-> SomeFunc() /some/file/path.php:1234
=> $var = "foo" /some/file/path.php:1236

=> true

I believe these should be indented so that they show up inside the scope of the function:

-> SomeFunc() /some/file/path.php:1234
=> $var = "foo" /some/file/path.php:1236

=> true

Steps To Reproduce

(in current behavior)

Tagstrace, xt file format
Operating Systemlinux
PHP Version5.3.10

Activities

shdwjk

2012-06-14 14:36

reporter   ~0002257

The "cheap" fix would be to change line 76 of xdebug_tracing.c from:
xdebug_str_addl(&str, " => ", 6, 0);
to:
xdebug_str_addl(&str, " => ", 8, 0);

That would fix the output, though it doesn't fix the fact the function_stack_entry->level is off by one. The level could just be considered one deeper for the purposes of this function, changing lines 73-75 of the same file from:
for (j = 0; j < i->level; j++) {
xdebug_str_addl(&str, " ", 2, 0);
}
to:
for (j = 0; j < (i->level+1); j++) {
xdebug_str_addl(&str, " ", 2, 0);
}

Where xdebug_return_trace_assignment() is called in xdebug_code_coverage.c, the deepest stack frame is used for the first parameter. I'm not sure why this frame is not sufficiently deep. It may have something to do with the point at which variable definitions are determined from the Zend engine.

Hope this additional info helps!

derick

2012-06-27 21:09

administrator   ~0002295

Fixed for 2.2.1 and 2.3 on github.

Issue History

Date Modified Username Field Change
2012-04-27 00:58 shdwjk New Issue
2012-04-27 23:53 derick Target Version => 2.2.1
2012-06-14 14:36 shdwjk Note Added: 0002257
2012-06-14 14:41 shdwjk Tag Attached: trace
2012-06-14 14:41 shdwjk Tag Attached: xt file format
2012-06-27 21:09 derick Note Added: 0002295
2012-06-27 21:09 derick Status new => closed
2012-06-27 21:09 derick Assigned To => derick
2012-06-27 21:09 derick Resolution open => fixed
2012-06-27 21:09 derick Fixed in Version => 2.2.1
2020-03-12 16:55 derick Severity minor => feature
2020-03-12 17:34 derick Category Feature/Change request => Tracing