View Issue Details

IDProjectCategoryView StatusLast Update
0000360XdebugUncategorizedpublic2011-09-26 09:50
Reporteroetting Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Target Version2.2dev 
Summary0000360: Function line number in profile not correct
Description

Please consider the example script and profile below. In the part of the profile that describes the invocation of the function "func" the line number in the cost line is 6. This is the line from where it was called(as described in the cfn block for that function) and not the line where the function is defined.

http://valgrind.org/docs/manual/cl-format.html section 3.1.2 paragraph 3 states:
"Thus, the first cost line specifies that in line 15 of source file "file.f" there is code belonging to function "main"."

As I understand that, the line number should point to code belonging to the function, just as the fl parameter is the file containing the function.

Script (line numbers added)

1 <?php
2 function func(){
3 1+1;
4 }
5
6 func();

Profile

version: 0.9.6
cmd: /Users/jacob/development/webdev/docroot/webgrind/test.php
part: 1

events: Time

fl=/Users/jacob/development/webdev/docroot/webgrind/test.php
fn=func
6 51

fl=/Users/jacob/development/webdev/docroot/webgrind/test.php
fn={main}

summary: 135

0 83
cfn=func
calls=1 0 0
6 51

TagsNo tags attached.
Operating SystemOS X
PHP Version5.2.4

Activities

toddw

2009-11-20 03:21

reporter   ~0001144

This is annoying when using KCacheGrind, as after clicking on a function and then using the "Source Code" view, it takes you to the function call - instead of seeing the function definition.

derick

2011-09-26 09:50

administrator   ~0001818

Xdebug 2.2-dev produces:

version: 1
creator: xdebug 2.1.2
cmd: /home/derick/dev/php/xdebug/tests/bug00360.php
part: 1
positions: line

events: Time

fl=/home/derick/dev/php/xdebug/tests/bug00360.php
fn=func
2 7

which seems correct.