[xdebug-general] Incorrect code coverage reading from Xdebug 2.0.0 Beta 2

From: Nimish Pachapurkar <npac[@]spikesource.com>
Date: Mon, 18 Apr 2005 14:15:36 -0700
Hello,

I am using Xdebug 2.0.0 Beta 2 with PHP 5.0.3. I have configured the Xdebug extension on Fedora Core 3.

When I try to run the example given on Xdebug site for code coverage measurement (http://xdebug.org/docs-functions.php#coverage), I get incorrect readings.  Specifically, the frequency of execution is always returned as "1" - even for statements in the loop. It seems that the coverage recordings are consistent with respect to which lines were covered (executed at least once) and which were not.


Here is the output that I got by running the sample code from Xdebug documentation (as is). Line 10 is inside a for loop and is definitely executed more than once. There are other lines also that are executed more than once. However, as you can see below, the frequency for all the lines is 1.

array(1) {
  ["/tmp/sample.php"]=>
  array(11) {
    [4]=>
    int(1)
    [5]=>
    int(1)
    [6]=>
    int(1)
    [8]=>
    int(1)
    [9]=>
    int(1)
    [10]=>
    int(1)
    [11]=>
    int(1)
    [12]=>
    int(1)
    [14]=>
    int(1)
    [15]=>
    int(1)
    [17]=>
    int(1)
  }
}


Following is the relevant output from PHP Info (php -i) for the Xdebug extension:

xdebug
xdebug support => enabled
Version => 2.0.0beta2
Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.66 $
GDB - GNU Debugger protocol => $Revision: 1.77 $
PHP3 - PHP 3 Debugger protocol => $Revision: 1.19 $
Directive => Local Value => Master Value
xdebug.allowed_clients => no value => no value
xdebug.auto_trace => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => Off => Off
xdebug.collect_return => Off => Off
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.idekey => npac => no value
xdebug.manual_url => http://www.php.net => http://www.php.net
xdebug.max_nesting_level => 100 => 100
xdebug.profiler_enable => Off => Off
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => crc32 => crc32
xdebug.remote_autostart => Off => Off
xdebug.remote_enable => Off => Off
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => crc32 => crc32

Can someone please let me know if this is a known issue with this version or I have not configured the extension properly.

Thanks,
Nimish

Received on Mon Apr 18 2005 - 23:17:48 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST