MantisBT - Xdebug
View Issue Details
0000821XdebugFeature/Change requestpublic2012-04-27 01:582012-06-27 22:09
shdwjk 
derick 
lowminoralways
closedfixed 
linuxcentos
2.2.0RC2 
2.2.12.2.1 
linux
5.3.10
0000821: Variable assignments (beginning with =>) should be indented one more scope
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
(in current behavior)
trace, xt file format
Issue History
2012-04-27 01:58shdwjkNew Issue
2012-04-28 00:53derickTarget Version => 2.2.1
2012-06-14 15:36shdwjkNote Added: 0002257
2012-06-14 15:41shdwjkTag Attached: trace
2012-06-14 15:41shdwjkTag Attached: xt file format
2012-06-27 22:09derickNote Added: 0002295
2012-06-27 22:09derickStatusnew => closed
2012-06-27 22:09derickAssigned To => derick
2012-06-27 22:09derickResolutionopen => fixed
2012-06-27 22:09derickFixed in Version => 2.2.1

Notes
(0002257)
shdwjk   
2012-06-14 15:36   
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!
(0002295)
derick   
2012-06-27 22:09   
Fixed for 2.2.1 and 2.3 on github.