Permalink
Browse files

Merged pull request #375

  • Loading branch information...
derickr committed Oct 30, 2017
2 parents 283a62b + 47b50d6 commit 331c3ec9071ba739951530ec6686d67859291f6a
Showing with 1,401 additions and 215 deletions.
  1. +6 −9 .travis.scripts/compile.sh
  2. +10 −0 .travis.scripts/show-errors.sh
  3. +5 −1 .travis.yml
  4. +69 −0 tests/assignment-trace1-php72-opcache.phpt
  5. +5 −1 tests/assignment-trace1.phpt
  6. +71 −0 tests/assignment-trace2-php72-opcache.phpt
  7. +69 −0 tests/assignment-trace2-php73-opcache.phpt
  8. +5 −1 tests/assignment-trace2.phpt
  9. +2 −1 tests/assignment-trace6-opcache.phpt
  10. +58 −0 tests/assignment-trace6-php72-opcache.phpt
  11. +4 −2 tests/assignment-trace6.phpt
  12. +69 −0 tests/assignment-trace7-php72-opcache.phpt
  13. +5 −1 tests/assignment-trace7.phpt
  14. +1 −3 tests/bug00213-php70-opcache.phpt
  15. +1 −3 tests/bug00334-php70-opcache.phpt
  16. +2 −2 tests/bug00565.phpt
  17. +3 −3 tests/bug00567-php70-nts-opcache.phpt
  18. +3 −2 tests/bug00567-php71-zts-opcache.phpt
  19. +22 −0 tests/bug00567-php72-zts-opcache.phpt
  20. +5 −1 tests/bug00757b-php7.phpt
  21. +62 −0 tests/bug00757b-php72.phpt
  22. +55 −0 tests/bug01247-php72-opcache.phpt
  23. +13 −9 tests/bug01247.phpt
  24. +3 −1 tests/bug01258-php7.phpt
  25. +60 −0 tests/bug01258-php72.phpt
  26. +3 −2 tests/bug01270-php714-opcache.phpt
  27. +52 −0 tests/bug01270-php72-opcache.phpt
  28. +2 −6 tests/bug01386-php70-opcache.phpt
  29. +38 −0 tests/bug01420-php72-opcache.phpt
  30. +40 −0 tests/bug01420-php72.phpt
  31. +17 −0 tests/bug01420.inc
  32. +7 −23 tests/dump-branch-coverage.inc
  33. +94 −0 tests/get_declared_vars-php72-opcache.phpt
  34. +5 −1 tests/get_declared_vars.phpt
  35. +1 −1 tests/local_vars_in_error-php7.phpt
  36. +4 −4 tests/xdebug_debug_zval-php70-nts.phpt
  37. +2 −2 tests/xdebug_debug_zval-php70-zts.phpt
  38. +3 −2 tests/xdebug_debug_zval-php71-nts-opcache.phpt
  39. +3 −2 tests/xdebug_debug_zval-php71-zts-opcache.phpt
  40. +53 −0 tests/xdebug_debug_zval-php72-nts-opcache.phpt
  41. +51 −0 tests/xdebug_debug_zval-php72-zts-opcache.phpt
  42. +4 −4 tests/xdebug_debug_zval_cli_color-php70-nts.phpt
  43. +2 −2 tests/xdebug_debug_zval_cli_color-php70-zts.phpt
  44. +3 −2 tests/xdebug_debug_zval_cli_color-php71-nts-opcache.phpt
  45. +3 −2 tests/xdebug_debug_zval_cli_color-php71-zts-opcache.phpt
  46. +85 −0 tests/xdebug_debug_zval_cli_color-php72-nts-opcache.phpt
  47. +83 −0 tests/xdebug_debug_zval_cli_color-php72-zts-opcache.phpt
  48. +4 −4 tests/xdebug_debug_zval_stdout-php70-nts.phpt
  49. +2 −2 tests/xdebug_debug_zval_stdout-php70-zts.phpt
  50. +3 −2 tests/xdebug_debug_zval_stdout-php71-nts-opcache.phpt
  51. +3 −2 tests/xdebug_debug_zval_stdout-php71-zts-opcache.phpt
  52. +53 −0 tests/xdebug_debug_zval_stdout-php72-nts-opcache.phpt
  53. +51 −0 tests/xdebug_debug_zval_stdout-php72-zts-opcache.phpt
  54. +29 −48 xdebug_branch_info.c
  55. +8 −5 xdebug_branch_info.h
  56. +85 −59 xdebug_code_coverage.c
View
@@ -7,18 +7,15 @@ EXTENSIONDIR=`php -r 'echo ini_get("extension_dir");'`
echo "zend_extension=${EXTENSIONDIR}/xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
echo "zend_extension=${EXTENSIONDIR}/xdebug.so" > /tmp/temp-php-config.ini
if [[ ${USE_OPCACHE} == "0" ]]; then
if [ "${USE_OPCACHE}" = "0" ]; then
echo "Removing OPcache"
cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini | grep -v opcache > /tmp/temp-without-opcache.ini
mv /tmp/temp-without-opcache.ini /home/travis/.phpenv/versions/$(phpenv version-name)/etc/php.ini
else
echo "Keeping OPcache"
echo "zend_extension=${EXTENSIONDIR}/opcache.so" >> /tmp/temp-php-config.ini
echo "opcache.enable=1" >> /tmp/temp-php-config.ini
echo "opcache.enable_cli=1" >> /tmp/temp-php-config.ini
echo "opcache.enable=1" >> /home/travis/.phpenv/versions/$(phpenv version-name)/etc/php.ini
echo "opcache.enable_cli=1" >> /home/travis/.phpenv/versions/$(phpenv version-name)/etc/php.ini
fi
echo
echo "temp-php-config.ini"
cat /tmp/temp-php-config.ini
echo
echo "travis.ini"
cat /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
@@ -0,0 +1,10 @@
#!/bin/bash
for i in tests/*.diff; do
echo "=========================================================================="
echo $i
echo "--------------------------------------------------------------------------"
cat $i
echo "=========================================================================="
echo
done
View
@@ -27,8 +27,12 @@ notifications:
script:
- MYPHP=`make findphp`
- export PATH=`dirname $MYPHP`:$PATH
- export TEST_PHP_ARGS="-dfoo=1 -n -dzend_extension=opcache.so -dopcache.enable=${USE_OPCACHE} -dopcache.enable_cli=${USE_OPCACHE} -dzend_extension=xdebug.so"
- $MYPHP -c /tmp/temp-php-config.ini -v
- REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=$MYPHP $MYPHP -c /tmp/temp-php-config.ini -dxdebug.auto_trace=0 run-tests.php -q -x --show-diff
after_script:
- ./.travis.scripts/show-errors.sh
notifications:
irc: "irc.freenode.net#xdebug"
irc: "chat.freenode.net#xdebug"
@@ -0,0 +1,69 @@
--TEST--
Test for tracing property assignments in user-readable function traces (>= PHP 7.2, opcache)
--SKIPIF--
<?php
if ( ! ( version_compare(phpversion(), "7.2", '>=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.2 && opcache loaded needed\n"; };
?>
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.trace_format=0
xdebug.collect_vars=1
xdebug.collect_params=4
xdebug.collect_return=0
xdebug.collect_assignments=1
--FILE--
<?php
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE));
function test($a, $b, $c)
{
$d = 89;
$a += $b;
$c /= 7;
$b *= 9;
}
class testClass
{
public $a;
private $b;
protected $c;
function __construct()
{
$this->a = 98;
$this->b = 4;
$this->b -= 8;
$this->b *= -0.5;
$this->b <<= 1;
$this->c = $this->b / 32;
}
}
test(1, 2, 3);
$a = new testClass;
xdebug_stop_trace();
echo file_get_contents($tf);
unlink($tf);
?>
--EXPECTF--
TRACE START [%d-%d-%d %d:%d:%d]
=> $tf = '%sxt' %sassignment-trace1-php72-opcache.php:2
%w%f %w%d -> test($a = 1, $b = 2, $c = 3) %sassignment-trace1-php72-opcache.php:29
=> $a += 2 %sassignment-trace1-php72-opcache.php:7
=> $c /= 7 %sassignment-trace1-php72-opcache.php:8
=> $b *= 9 %sassignment-trace1-php72-opcache.php:9
%w%f %w%d -> testClass->__construct() %sassignment-trace1-php72-opcache.php:30
=> $this->a = 98 %sassignment-trace1-php72-opcache.php:20
=> $this->b = 4 %sassignment-trace1-php72-opcache.php:21
=> $this->b -= 8 %sassignment-trace1-php72-opcache.php:22
=> $this->b *= -0.5 %sassignment-trace1-php72-opcache.php:23
=> $this->b <<= 1 %sassignment-trace1-php72-opcache.php:24
=> $this->c = 0.125 %sassignment-trace1-php72-opcache.php:25
=> $a = class testClass { public $a = 98; private $b = 4; protected $c = 0.125 } %sassignment-trace1-php72-opcache.php:30
%w%f %w%d -> xdebug_stop_trace() %sassignment-trace1-php72-opcache.php:32
%w%f %w%d
TRACE END [%d-%d-%d %d:%d:%d]
@@ -1,5 +1,9 @@
--TEST--
Test for tracing property assignments in user-readable function traces
Test for tracing property assignments in user-readable function traces (< PHP 7.2 || no opcache)
--SKIPIF--
<?php
if ( ( version_compare(phpversion(), "7.2", '>=') && extension_loaded('zend opcache'))) { echo "skip < PHP 7.2 || !opcache loaded needed\n"; };
?>
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
@@ -0,0 +1,71 @@
--TEST--
Test for tracing array assignments in user-readable function traces (= PHP 7.2, opcache)
--SKIPIF--
<?php if (!version_compare(phpversion(), "7.2", '>=')) echo "skip = PHP 7.2 needed\n"; ?>
<?php if (!version_compare(phpversion(), "7.3", '<')) echo "skip = PHP 7.2 needed\n"; ?>
<?php if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; ?>
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.trace_format=0
xdebug.collect_vars=1
xdebug.collect_params=3
xdebug.collect_return=0
xdebug.collect_assignments=1
xdebug.dump.GET=
xdebug.dump.SERVER=
xdebug.show_local_vars=0
xdebug.force_error_reporting=0
--FILE--
<?php
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE));
function test()
{
$t = array( 'a' => 4, 'b' => 9, 'c' => 13 );
$t['d'] = 89;
$t['a'] += $b;
@$t['a'] += $b;
$t['c'] /= 7;
$t['b'] *= 9;
}
$t = array();
$t['a'] = 98;
$t['b'] = 4;
$t['b'] -= 8;
$t['b'] *= -0.5;
$t['b'] <<= 1;
$t['c'] = $t['b'] / 32;
test(1, 2, 3);
xdebug_stop_trace();
echo file_get_contents($tf);
unlink($tf);
?>
--EXPECTF--
Notice: Undefined variable: b in %sassignment-trace2-php72-opcache.php on line 8
Call Stack:
%w%f %w%d 1. {main}() %sassignment-trace2-php72-opcache.php:0
%w%f %w%d 2. test(1, 2, 3) %sassignment-trace2-php72-opcache.php:21
TRACE START [%d-%d-%d %d:%d:%d]
=> $tf = '%s.xt' %sassignment-trace2-php72-opcache.php:2
=> $t = array () %sassignment-trace2-php72-opcache.php:13
=> $t['a'] = 98 %sassignment-trace2-php72-opcache.php:14
=> $t['b'] = 4 %sassignment-trace2-php72-opcache.php:15
=> $t['b'] -= 8 %sassignment-trace2-php72-opcache.php:16
=> $t['b'] *= -0.5 %sassignment-trace2-php72-opcache.php:17
=> $t['b'] <<= 1 %sassignment-trace2-php72-opcache.php:18
=> $t['c'] = 0.125 %sassignment-trace2-php72-opcache.php:19
%w%f %w%d -> test(1, 2, 3) %sassignment-trace2-php72-opcache.php:21
=> $t = array ('a' => 4, 'b' => 9, 'c' => 13, 'd' => 89) %sassignment-trace2-php72-opcache.php:7
=> $t['a'] += %r(NULL|\*uninitialized\*)%r %sassignment-trace2-php72-opcache.php:8
=> $t['a'] += %r(NULL|\*uninitialized\*)%r %sassignment-trace2-php72-opcache.php:9
=> $t['c'] /= 7 %sassignment-trace2-php72-opcache.php:10
=> $t['b'] *= 9 %sassignment-trace2-php72-opcache.php:11
%w%f %w%d -> xdebug_stop_trace() %sassignment-trace2-php72-opcache.php:23
%w%f %w%d
TRACE END [%d-%d-%d %d:%d:%d]
@@ -0,0 +1,69 @@
--TEST--
Test for tracing array assignments in user-readable function traces (>= PHP 7.3, opcache)
--SKIPIF--
<?php
if ( ! ( version_compare(phpversion(), "7.3", '>=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.3 && opcache loaded needed\n"; };
?>
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.trace_format=0
xdebug.collect_vars=1
xdebug.collect_params=3
xdebug.collect_return=0
xdebug.collect_assignments=1
xdebug.dump.GET=
xdebug.dump.SERVER=
xdebug.show_local_vars=0
xdebug.force_error_reporting=0
--FILE--
<?php
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE));
function test()
{
$t = array( 'a' => 4, 'b' => 9, 'c' => 13 );
$t['d'] = 89;
$t['a'] += $b;
@$t['a'] += $b;
$t['c'] /= 7;
$t['b'] *= 9;
}
$t = array();
$t['a'] = 98;
$t['b'] = 4;
$t['b'] -= 8;
$t['b'] *= -0.5;
$t['b'] <<= 1;
$t['c'] = $t['b'] / 32;
test(1, 2, 3);
xdebug_stop_trace();
echo file_get_contents($tf);
unlink($tf);
?>
--EXPECTF--
Notice: Undefined variable: b in %sassignment-trace2-php73-opcache.php on line 8
Call Stack:
%w%f %w%d 1. {main}() %sassignment-trace2-php73-opcache.php:0
%w%f %w%d 2. test(1, 2, 3) %sassignment-trace2-php73-opcache.php:21
TRACE START [%d-%d-%d %d:%d:%d]
=> $tf = '%s.xt' %sassignment-trace2-php73-opcache.php:2
=> $t = array () %sassignment-trace2-php73-opcache.php:13
=> $t['a'] = 98 %sassignment-trace2-php73-opcache.php:14
=> $t['b'] = 4 %sassignment-trace2-php73-opcache.php:15
=> $t['b'] -= 8 %sassignment-trace2-php73-opcache.php:16
=> $t['b'] *= -0.5 %sassignment-trace2-php73-opcache.php:17
=> $t['b'] <<= 1 %sassignment-trace2-php73-opcache.php:18
=> $t['c'] = 0.125 %sassignment-trace2-php73-opcache.php:19
%w%f %w%d -> test(1, 2, 3) %sassignment-trace2-php73-opcache.php:21
=> $t = array ('a' => 4, 'b' => 9, 'c' => 13, 'd' => 89) %sassignment-trace2-php73-opcache.php:7
=> $t['a'] += %r(NULL|\*uninitialized\*)%r %sassignment-trace2-php73-opcache.php:8
=> $t['a'] += %r(NULL|\*uninitialized\*)%r %sassignment-trace2-php73-opcache.php:9
%w%f %w%d -> xdebug_stop_trace() %sassignment-trace2-php73-opcache.php:23
%w%f %w%d
TRACE END [%d-%d-%d %d:%d:%d]
@@ -1,5 +1,9 @@
--TEST--
Test for tracing array assignments in user-readable function traces
Test for tracing array assignments in user-readable function traces (< PHP 7.2 || no opcache)
--SKIPIF--
<?php
if ( ( version_compare(phpversion(), "7.2", '>=') && extension_loaded('zend opcache'))) { echo "skip < PHP 7.2 || !opcache loaded needed\n"; };
?>
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
@@ -1,6 +1,7 @@
--TEST--
Test for tracing assignments in user-readable function traces (opcache)
Test for tracing assignments in user-readable function traces (< PHP 7.2, opcache)
--SKIPIF--
<?php if (version_compare(phpversion(), "7.2", '>=')) echo "skip < PHP 7.2 && opcache loaded needed\n"; ?>
<?php if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; ?>
--INI--
xdebug.default_enable=1
@@ -0,0 +1,58 @@
--TEST--
Test for tracing assignments in user-readable function traces (>= PHP 7.2, opcache)
--SKIPIF--
<?php
if ( ! ( version_compare(phpversion(), "7.2", '>=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.2 && opcache loaded needed\n"; };
?>
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.trace_format=0
xdebug.collect_vars=1
xdebug.collect_params=3
xdebug.collect_return=0
xdebug.collect_assignments=1
--FILE--
<?php
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE));
class foo {
static public $foo;
static private $var;
static public $var2;
static public $bar;
static function test()
{
self::$foo = array();
self::$foo[] = 42;
self::$var = 'var';
self::$var2 = self::$var;
$id = 42;
self::$foo[$id] = 44;
self::$bar['test'] = array();
$id = 'test';
self::$bar[$id][] = 55;
}
}
foo::test();
xdebug_stop_trace();
echo file_get_contents($tf);
unlink($tf);
?>
--EXPECTF--
TRACE START [%d-%d-%d %d:%d:%d]
=> $tf = '%s' %sassignment-trace6-php72-opcache.php:2
%w%f %w%d -> foo::test() %sassignment-trace6-php72-opcache.php:23
=> self::foo = array () %sassignment-trace6-php72-opcache.php:11
=> self::foo[] = 42 %sassignment-trace6-php72-opcache.php:12
=> self::var = 'var' %sassignment-trace6-php72-opcache.php:13
=> self::var2 = 'var' %sassignment-trace6-php72-opcache.php:14
=> self::foo[42] = 44 %sassignment-trace6-php72-opcache.php:16
=> self::bar['test'] = array () %sassignment-trace6-php72-opcache.php:18
=> self::bar['test'][] = 55 %sassignment-trace6-php72-opcache.php:20
%w%f %w%d -> xdebug_stop_trace() %sassignment-trace6-php72-opcache.php:25
%w%f %w%d
TRACE END [%d-%d-%d %d:%d:%d]
@@ -1,7 +1,9 @@
--TEST--
Test for tracing assignments in user-readable function traces
Test for tracing assignments in user-readable function traces (< PHP 7.2 || no opcache)
--SKIPIF--
<?php if (extension_loaded('zend opcache')) echo "skip opcache should not be loaded\n"; ?>
<?php
if ( ( version_compare(phpversion(), "7.2", '>=') && extension_loaded('zend opcache'))) { echo "skip < PHP 7.2 || !opcache loaded needed\n"; };
?>
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
Oops, something went wrong.

0 comments on commit 331c3ec

Please sign in to comment.