Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #1472: xdebug.trace_format: computer readable format #365

Open
wants to merge 4 commits into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,173 @@
--TEST--
Test computerized function traces (level1, comp, assignments)
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.trace_format=1
xdebug.dump_globals=0
xdebug.show_mem_delta=0
xdebug.collect_vars=0
xdebug.collect_params=1
xdebug.collect_return=0
xdebug.collect_assignments=1
xdebug.force_error_reporting=0
--FILE--
<?php
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE), XDEBUG_TRACE_COMPUTERIZED);
function foo( $a )
{
$aa = $a;
$bar11 = 1;
$bar11++;
++$bar11;
$bar11--;
--$bar11;
$bar11 += 1;
$bar11 -= 1;
$bar11 *= 2;
$bar11 %= 2;
$bar11 /= 2;
// do nothing really
}
$bar = 42;
@foo( $bar );
$bar1 = "string";
@foo( $bar1 );
$bar2 = "string\nwith\nnewline";
@foo( $bar2 );
$bar3 = 1;
$bar4 = false;
@foo( $bar3, $bar4 );
$bar5 = true;
$bar6 = null;
@foo( $bar5, $bar6 );
$bar7 = "foo";
$bar8 = "bar";
$bar9 = 3.1415;
@foo( $bar7, $bar8, $bar9 );
$bar10 = 1;
$bar10++;
++$bar10;
$bar10--;
--$bar10;
$bar10 += 1;
$bar10 -= 1;
$bar10 *= 2;
$bar10 %= 2;
$bar10 /= 2;
xdebug_stop_trace();
echo file_get_contents($tf);
unlink($tf);
?>
--EXPECTF--
Version: %s
File format: %d
TRACE START [%d-%d-%d %d:%d:%d]
2 3 1 %f %d%f
1 A %sfunctrace_comp_1a.php 2 $tf = '%s'
1 A %sfunctrace_comp_1a.php 20 $bar = 42
2 4 0 %f %d foo 1 %sfunctrace_comp_1a.php 21 1 long
2 A %sfunctrace_comp_1a.php 6 $aa = 42
2 A %sfunctrace_comp_1a.php 7 $bar11 = 1
2 A %sfunctrace_comp_1a.php 8 $bar11++
2 A %sfunctrace_comp_1a.php 9 ++$bar11
2 A %sfunctrace_comp_1a.php 10 $bar11--
2 A %sfunctrace_comp_1a.php 11 --$bar11
2 A %sfunctrace_comp_1a.php 12 $bar11 += 1
2 A %sfunctrace_comp_1a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_1a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_1a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_1a.php 16 $bar11 /= 2
2 4 1 %f %d
1 A %sfunctrace_comp_1a.php 22 $bar1 = 'string'
2 5 0 %f %d foo 1 %sfunctrace_comp_1a.php 23 1 string(6)
2 A %sfunctrace_comp_1a.php 6 $aa = 'string'
2 A %sfunctrace_comp_1a.php 7 $bar11 = 1
2 A %sfunctrace_comp_1a.php 8 $bar11++
2 A %sfunctrace_comp_1a.php 9 ++$bar11
2 A %sfunctrace_comp_1a.php 10 $bar11--
2 A %sfunctrace_comp_1a.php 11 --$bar11
2 A %sfunctrace_comp_1a.php 12 $bar11 += 1
2 A %sfunctrace_comp_1a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_1a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_1a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_1a.php 16 $bar11 /= 2
2 5 1 %f %d
1 A %sfunctrace_comp_1a.php 24 $bar2 = 'string\nwith\nnewline'
2 6 0 %f %d foo 1 %sfunctrace_comp_1a.php 25 1 string(19)
2 A %sfunctrace_comp_1a.php 6 $aa = 'string\nwith\nnewline'
2 A %sfunctrace_comp_1a.php 7 $bar11 = 1
2 A %sfunctrace_comp_1a.php 8 $bar11++
2 A %sfunctrace_comp_1a.php 9 ++$bar11
2 A %sfunctrace_comp_1a.php 10 $bar11--
2 A %sfunctrace_comp_1a.php 11 --$bar11
2 A %sfunctrace_comp_1a.php 12 $bar11 += 1
2 A %sfunctrace_comp_1a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_1a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_1a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_1a.php 16 $bar11 /= 2
2 6 1 %f %d
1 A %sfunctrace_comp_1a.php 26 $bar3 = 1
1 A %sfunctrace_comp_1a.php 27 $bar4 = FALSE
2 7 0 %f %d foo 1 %sfunctrace_comp_1a.php 28 2 long false
2 A %sfunctrace_comp_1a.php 6 $aa = 1
2 A %sfunctrace_comp_1a.php 7 $bar11 = 1
2 A %sfunctrace_comp_1a.php 8 $bar11++
2 A %sfunctrace_comp_1a.php 9 ++$bar11
2 A %sfunctrace_comp_1a.php 10 $bar11--
2 A %sfunctrace_comp_1a.php 11 --$bar11
2 A %sfunctrace_comp_1a.php 12 $bar11 += 1
2 A %sfunctrace_comp_1a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_1a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_1a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_1a.php 16 $bar11 /= 2
2 7 1 %f %d
1 A %sfunctrace_comp_1a.php 29 $bar5 = TRUE
1 A %sfunctrace_comp_1a.php %d $bar6 = NULL
2 8 0 %f %d foo 1 %sfunctrace_comp_1a.php %d 2 true null
2 A %sfunctrace_comp_1a.php 6 $aa = TRUE
2 A %sfunctrace_comp_1a.php 7 $bar11 = 1
2 A %sfunctrace_comp_1a.php 8 $bar11++
2 A %sfunctrace_comp_1a.php 9 ++$bar11
2 A %sfunctrace_comp_1a.php 10 $bar11--
2 A %sfunctrace_comp_1a.php 11 --$bar11
2 A %sfunctrace_comp_1a.php 12 $bar11 += 1
2 A %sfunctrace_comp_1a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_1a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_1a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_1a.php 16 $bar11 /= 2
2 8 1 %f %d
1 A %sfunctrace_comp_1a.php %d $bar7 = 'foo'
1 A %sfunctrace_comp_1a.php %d $bar8 = 'bar'
1 A %sfunctrace_comp_1a.php %d $bar9 = 3.1415
2 9 0 %f %d foo 1 %sfunctrace_comp_1a.php %d 3 string(3) string(3) double
2 A %sfunctrace_comp_1a.php 6 $aa = 'foo'
2 A %sfunctrace_comp_1a.php 7 $bar11 = 1
2 A %sfunctrace_comp_1a.php 8 $bar11++
2 A %sfunctrace_comp_1a.php 9 ++$bar11
2 A %sfunctrace_comp_1a.php 10 $bar11--
2 A %sfunctrace_comp_1a.php 11 --$bar11
2 A %sfunctrace_comp_1a.php 12 $bar11 += 1
2 A %sfunctrace_comp_1a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_1a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_1a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_1a.php 16 $bar11 /= 2
2 9 1 %f %d
1 A %sfunctrace_comp_1a.php %d $bar10 = 1
1 A %sfunctrace_comp_1a.php %d $bar10++
1 A %sfunctrace_comp_1a.php %d ++$bar10
1 A %sfunctrace_comp_1a.php 40 $bar10--
1 A %sfunctrace_comp_1a.php 41 --$bar10
1 A %sfunctrace_comp_1a.php 42 $bar10 += 1
1 A %sfunctrace_comp_1a.php 43 $bar10 -= 1
1 A %sfunctrace_comp_1a.php 44 $bar10 *= 2
1 A %sfunctrace_comp_1a.php 45 $bar10 %= 2
1 A %sfunctrace_comp_1a.php 46 $bar10 /= 2
2 10 0 %f %d xdebug_stop_trace 0 %sfunctrace_comp_1a.php 48 0
%f %d
TRACE END [%d-%d-%d %d:%d:%d]
@@ -0,0 +1,173 @@
--TEST--
Test computerized function traces (level2, comp, assignments)
--INI--
xdebug.default_enable=1
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.trace_format=1
xdebug.dump_globals=0
xdebug.show_mem_delta=0
xdebug.collect_vars=0
xdebug.collect_params=2
xdebug.collect_return=0
xdebug.collect_assignments=1
xdebug.force_error_reporting=0
--FILE--
<?php
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE), XDEBUG_TRACE_COMPUTERIZED);
function foo( $a )
{
$aa = $a;
$bar11 = 1;
$bar11++;
++$bar11;
$bar11--;
--$bar11;
$bar11 += 1;
$bar11 -= 1;
$bar11 *= 2;
$bar11 %= 2;
$bar11 /= 2;
// do nothing really
}
$bar = 42;
@foo( $bar );
$bar1 = "string";
@foo( $bar1 );
$bar2 = "string\nwith\nnewline";
@foo( $bar2 );
$bar3 = 1;
$bar4 = false;
@foo( $bar3, $bar4 );
$bar5 = true;
$bar6 = null;
@foo( $bar5, $bar6 );
$bar7 = "foo";
$bar8 = "bar";
$bar9 = 3.1415;
@foo( $bar7, $bar8, $bar9 );
$bar10 = 1;
$bar10++;
++$bar10;
$bar10--;
--$bar10;
$bar10 += 1;
$bar10 -= 1;
$bar10 *= 2;
$bar10 %= 2;
$bar10 /= 2;
xdebug_stop_trace();
echo file_get_contents($tf);
unlink($tf);
?>
--EXPECTF--
Version: %s
File format: %d
TRACE START [%d-%d-%d %d:%d:%d]
2 3 1 %f %d%f
1 A %sfunctrace_comp_2a.php 2 $tf = '%s'
1 A %sfunctrace_comp_2a.php 20 $bar = 42
2 4 0 %f %d foo 1 %sfunctrace_comp_2a.php 21 1 long
2 A %sfunctrace_comp_2a.php 6 $aa = 42
2 A %sfunctrace_comp_2a.php 7 $bar11 = 1
2 A %sfunctrace_comp_2a.php 8 $bar11++
2 A %sfunctrace_comp_2a.php 9 ++$bar11
2 A %sfunctrace_comp_2a.php 10 $bar11--
2 A %sfunctrace_comp_2a.php 11 --$bar11
2 A %sfunctrace_comp_2a.php 12 $bar11 += 1
2 A %sfunctrace_comp_2a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_2a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_2a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_2a.php 16 $bar11 /= 2
2 4 1 %f %d
1 A %sfunctrace_comp_2a.php 22 $bar1 = 'string'
2 5 0 %f %d foo 1 %sfunctrace_comp_2a.php 23 1 string(6)
2 A %sfunctrace_comp_2a.php 6 $aa = 'string'
2 A %sfunctrace_comp_2a.php 7 $bar11 = 1
2 A %sfunctrace_comp_2a.php 8 $bar11++
2 A %sfunctrace_comp_2a.php 9 ++$bar11
2 A %sfunctrace_comp_2a.php 10 $bar11--
2 A %sfunctrace_comp_2a.php 11 --$bar11
2 A %sfunctrace_comp_2a.php 12 $bar11 += 1
2 A %sfunctrace_comp_2a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_2a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_2a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_2a.php 16 $bar11 /= 2
2 5 1 %f %d
1 A %sfunctrace_comp_2a.php 24 $bar2 = 'string\nwith\nnewline'
2 6 0 %f %d foo 1 %sfunctrace_comp_2a.php 25 1 string(19)
2 A %sfunctrace_comp_2a.php 6 $aa = 'string\nwith\nnewline'
2 A %sfunctrace_comp_2a.php 7 $bar11 = 1
2 A %sfunctrace_comp_2a.php 8 $bar11++
2 A %sfunctrace_comp_2a.php 9 ++$bar11
2 A %sfunctrace_comp_2a.php 10 $bar11--
2 A %sfunctrace_comp_2a.php 11 --$bar11
2 A %sfunctrace_comp_2a.php 12 $bar11 += 1
2 A %sfunctrace_comp_2a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_2a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_2a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_2a.php 16 $bar11 /= 2
2 6 1 %f %d
1 A %sfunctrace_comp_2a.php 26 $bar3 = 1
1 A %sfunctrace_comp_2a.php 27 $bar4 = FALSE
2 7 0 %f %d foo 1 %sfunctrace_comp_2a.php 28 2 long false
2 A %sfunctrace_comp_2a.php 6 $aa = 1
2 A %sfunctrace_comp_2a.php 7 $bar11 = 1
2 A %sfunctrace_comp_2a.php 8 $bar11++
2 A %sfunctrace_comp_2a.php 9 ++$bar11
2 A %sfunctrace_comp_2a.php 10 $bar11--
2 A %sfunctrace_comp_2a.php 11 --$bar11
2 A %sfunctrace_comp_2a.php 12 $bar11 += 1
2 A %sfunctrace_comp_2a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_2a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_2a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_2a.php 16 $bar11 /= 2
2 7 1 %f %d
1 A %sfunctrace_comp_2a.php 29 $bar5 = TRUE
1 A %sfunctrace_comp_2a.php %d $bar6 = NULL
2 8 0 %f %d foo 1 %sfunctrace_comp_2a.php %d 2 true null
2 A %sfunctrace_comp_2a.php 6 $aa = TRUE
2 A %sfunctrace_comp_2a.php 7 $bar11 = 1
2 A %sfunctrace_comp_2a.php 8 $bar11++
2 A %sfunctrace_comp_2a.php 9 ++$bar11
2 A %sfunctrace_comp_2a.php 10 $bar11--
2 A %sfunctrace_comp_2a.php 11 --$bar11
2 A %sfunctrace_comp_2a.php 12 $bar11 += 1
2 A %sfunctrace_comp_2a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_2a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_2a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_2a.php 16 $bar11 /= 2
2 8 1 %f %d
1 A %sfunctrace_comp_2a.php %d $bar7 = 'foo'
1 A %sfunctrace_comp_2a.php %d $bar8 = 'bar'
1 A %sfunctrace_comp_2a.php %d $bar9 = 3.1415
2 9 0 %f %d foo 1 %sfunctrace_comp_2a.php %d 3 string(3) string(3) double
2 A %sfunctrace_comp_2a.php 6 $aa = 'foo'
2 A %sfunctrace_comp_2a.php 7 $bar11 = 1
2 A %sfunctrace_comp_2a.php 8 $bar11++
2 A %sfunctrace_comp_2a.php 9 ++$bar11
2 A %sfunctrace_comp_2a.php 10 $bar11--
2 A %sfunctrace_comp_2a.php 11 --$bar11
2 A %sfunctrace_comp_2a.php 12 $bar11 += 1
2 A %sfunctrace_comp_2a.php 13 $bar11 -= 1
2 A %sfunctrace_comp_2a.php 14 $bar11 *= 2
2 A %sfunctrace_comp_2a.php 15 $bar11 %= 2
2 A %sfunctrace_comp_2a.php 16 $bar11 /= 2
2 9 1 %f %d
1 A %sfunctrace_comp_2a.php %d $bar10 = 1
1 A %sfunctrace_comp_2a.php %d $bar10++
1 A %sfunctrace_comp_2a.php %d ++$bar10
1 A %sfunctrace_comp_2a.php 40 $bar10--
1 A %sfunctrace_comp_2a.php 41 --$bar10
1 A %sfunctrace_comp_2a.php 42 $bar10 += 1
1 A %sfunctrace_comp_2a.php 43 $bar10 -= 1
1 A %sfunctrace_comp_2a.php 44 $bar10 *= 2
1 A %sfunctrace_comp_2a.php 45 $bar10 %= 2
1 A %sfunctrace_comp_2a.php 46 $bar10 /= 2
2 10 0 %f %d xdebug_stop_trace 0 %sfunctrace_comp_2a.php 48 0
%f %d
TRACE END [%d-%d-%d %d:%d:%d]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.