Modified: xdebug/branches/xdebug_2_1/tests/assert_test.phpt =================================================================== --- xdebug/branches/xdebug_2_1/tests/assert_test.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/branches/xdebug_2_1/tests/assert_test.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -49,5 +49,5 @@ %w%f %w%d -> assert_options(5, 1) /%s/assert_test.php:7 %w%f %w%d -> assert_options(2, 'my_assert_handler') /%s/assert_test.php:18 %w%f %w%d -> assert(FALSE) /%s/assert_test.php:21 -%w%f %w%d -> my_assert_handler('/%s/assert_test.php', 21, '') /%s/assert_test.php:0 +%w%f %w%d -> my_assert_handler('/%s/assert_test.php', 21, '') /%s/assert_test.php:21 %w%f %w%d -> file_get_contents('/tmp/%s') /%s/assert_test.php:23 Modified: xdebug/branches/xdebug_2_1/tests/bug00241.phpt =================================================================== --- xdebug/branches/xdebug_2_1/tests/bug00241.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/branches/xdebug_2_1/tests/bug00241.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -68,7 +68,7 @@ ["file"]=> string(%d) "%sbug00241.php" ["line"]=> - int(0) + int(32) ["params"]=> array(5) { ["errno"]=> Modified: xdebug/branches/xdebug_2_1/tests/bug00562.phpt =================================================================== --- xdebug/branches/xdebug_2_1/tests/bug00562.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/branches/xdebug_2_1/tests/bug00562.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -20,9 +20,7 @@ --EXPECTF-- array(1) { ["%sbug00562.php"]=> - array(8) { - [0]=> - int(1) + array(7) { [4]=> int(1) [6]=> Added: xdebug/branches/xdebug_2_1/tests/bug00642.phpt =================================================================== --- xdebug/branches/xdebug_2_1/tests/bug00642.phpt (rev 0) +++ xdebug/branches/xdebug_2_1/tests/bug00642.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -0,0 +1,51 @@ +--TEST-- +Test for bug #642: No line number for offsetGet and offsetSet +--INI-- +xdebug.default_enable=1 +xdebug.profiler_enable=0 +xdebug.auto_trace=0 +xdebug.trace_format=0 +xdebug.collect_vars=0 +xdebug.collect_params=1 +xdebug.collect_return=0 +xdebug.collect_assignments=0 +--FILE-- +container[$offset] = $value; + } + public function offsetExists($offset) { + return isset($this->container[$offset]); + } + public function offsetUnset($offset) { + unset($this->container[$offset]); + } + public function offsetGet($offset) { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } +} + +$test = new Test(); +$test['test'] = 'test'; +$foo = $test['test']; +isset($test['test']); +unset($test['test']); + +xdebug_stop_trace(); +echo file_get_contents($tf); +unlink($tf); +?> +--EXPECTF-- +TRACE START [%d-%d-%d %d:%d:%d] +%w%f %w%d -> Test->offsetSet(string(4), string(4)) %sbug00642.php:22 +%w%f %w%d -> Test->offsetGet(string(4)) %sbug00642.php:23 +%w%f %w%d -> Test->offsetExists(string(4)) %sbug00642.php:24 +%w%f %w%d -> Test->offsetUnset(string(4)) %sbug00642.php:25 +%w%f %w%d -> xdebug_stop_trace() %sbug00642.php:27 +%w%f %w%d +TRACE END [%d-%d-%d %d:%d:%d] Modified: xdebug/branches/xdebug_2_1/tests/call_user_func_array.phpt =================================================================== --- xdebug/branches/xdebug_2_1/tests/call_user_func_array.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/branches/xdebug_2_1/tests/call_user_func_array.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -37,10 +37,10 @@ --EXPECTF-- TRACE START [%d-%d-%d %d:%d:%d] %w%f %w%d -> call_user_func_array('debug', array (0 => 'foo', 1 => array (0 => 1, 1 => 2))) /%s/call_user_func_array.php:13 -%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array.php:0 +%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array.php:13 %w%f %w%d -> is_array(array (0 => 1, 1 => 2)) /%s/call_user_func_array.php:5 %w%f %w%d -> call_user_func_array('debug', array (0 => 'bar', 1 => 'bar')) /%s/call_user_func_array.php:16 -%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array.php:0 +%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array.php:16 %w%f %w%d -> is_array('bar') /%s/call_user_func_array.php:5 %w%f %w%d -> is_object('bar') /%s/call_user_func_array.php:5 %w%f %w%d -> is_resource('bar') /%s/call_user_func_array.php:5 Modified: xdebug/branches/xdebug_2_1/tests/call_user_func_array2.phpt =================================================================== --- xdebug/branches/xdebug_2_1/tests/call_user_func_array2.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/branches/xdebug_2_1/tests/call_user_func_array2.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -32,10 +32,10 @@ TRACE START [%d-%d-%d %d:%d:%d] %w%f %w%d -> include(/%s/call_user_func_array2.inc) /%s/call_user_func_array2.php:4 %w%f %w%d -> call_user_func_array('debug', array (0 => 'foo', 1 => array (0 => 1, 1 => 2))) /%s/call_user_func_array2.php:7 -%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array2.php:0 +%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array2.php:7 %w%f %w%d -> is_array(array (0 => 1, 1 => 2)) /%s/call_user_func_array2.inc:4 %w%f %w%d -> call_user_func_array('debug', array (0 => 'bar', 1 => 'bar')) /%s/call_user_func_array2.php:10 -%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array2.php:0 +%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array2.php:10 %w%f %w%d -> is_array('bar') /%s/call_user_func_array2.inc:4 %w%f %w%d -> is_object('bar') /%s/call_user_func_array2.inc:4 %w%f %w%d -> is_resource('bar') /%s/call_user_func_array2.inc:4 Added: xdebug/branches/xdebug_2_1/tests/trace_with_magic_methods.phpt =================================================================== --- xdebug/branches/xdebug_2_1/tests/trace_with_magic_methods.phpt (rev 0) +++ xdebug/branches/xdebug_2_1/tests/trace_with_magic_methods.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -0,0 +1,61 @@ +--TEST-- +Test for line numbers for __get, __set, __isset, __unset and __call. +--INI-- +xdebug.default_enable=1 +xdebug.profiler_enable=0 +xdebug.auto_trace=0 +xdebug.trace_format=0 +xdebug.collect_vars=0 +xdebug.collect_params=1 +xdebug.collect_return=0 +xdebug.collect_assignments=0 +--FILE-- +container[$offset] = $value; + } + public function __isset($offset) { + return isset($this->container[$offset]); + } + public function __unset($offset) { + unset($this->container[$offset]); + } + public function __get($offset) { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + public function __call($func, $args) { + return $this->$func($args); + } + public function test($args) { + count($args); + } +} + +$test = new Test(); +$test->test = 'test'; +$foo = $test->test; +isset($test->test); +unset($test->test); +$test->test('test1', 'test2'); + +xdebug_stop_trace(); +echo file_get_contents($tf); +unlink($tf); +?> +--EXPECTF-- +TRACE START [%d-%d-%d %d:%d:%d] +%w%f %w%d -> Test->__construct() %strace_with_magic_methods.php:27 +%w%f %w%d -> Test->__set(string(4), string(4)) %strace_with_magic_methods.php:28 +%w%f %w%d -> Test->__get(string(4)) %strace_with_magic_methods.php:29 +%w%f %w%d -> Test->__isset(string(4)) %strace_with_magic_methods.php:30 +%w%f %w%d -> Test->__unset(string(4)) %strace_with_magic_methods.php:31 +%w%f %w%d -> Test->test(string(5), string(5)) %strace_with_magic_methods.php:32 +%w%f %w%d -> count(string(5)) %strace_with_magic_methods.php:23 +%w%f %w%d -> xdebug_stop_trace() %strace_with_magic_methods.php:34 +%w%f %w%d +TRACE END [%d-%d-%d %d:%d:%d] Modified: xdebug/branches/xdebug_2_1/xdebug_stack.c =================================================================== --- xdebug/branches/xdebug_2_1/xdebug_stack.c 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/branches/xdebug_2_1/xdebug_stack.c 2011-01-03 22:53:28 UTC (rev 3381) @@ -858,6 +858,11 @@ if (cur_opcode) { tmp->lineno = cur_opcode->lineno; } + } else if (edata->prev_execute_data && edata->prev_execute_data->opline) { + cur_opcode = edata->prev_execute_data->opline; + if (cur_opcode) { + tmp->lineno = cur_opcode->lineno; + } } if (XG(remote_enabled) || XG(collect_params) || XG(collect_vars)) { Modified: xdebug/trunk/tests/assert_test.phpt =================================================================== --- xdebug/trunk/tests/assert_test.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/trunk/tests/assert_test.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -49,5 +49,5 @@ %w%f %w%d -> assert_options(5, 1) /%s/assert_test.php:7 %w%f %w%d -> assert_options(2, 'my_assert_handler') /%s/assert_test.php:18 %w%f %w%d -> assert(FALSE) /%s/assert_test.php:21 -%w%f %w%d -> my_assert_handler('/%s/assert_test.php', 21, '') /%s/assert_test.php:0 +%w%f %w%d -> my_assert_handler('/%s/assert_test.php', 21, '') /%s/assert_test.php:21 %w%f %w%d -> file_get_contents('/tmp/%s') /%s/assert_test.php:23 Modified: xdebug/trunk/tests/bug00241.phpt =================================================================== --- xdebug/trunk/tests/bug00241.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/trunk/tests/bug00241.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -68,7 +68,7 @@ ["file"]=> string(%d) "%sbug00241.php" ["line"]=> - int(0) + int(32) ["params"]=> array(5) { ["errno"]=> Modified: xdebug/trunk/tests/bug00562.phpt =================================================================== --- xdebug/trunk/tests/bug00562.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/trunk/tests/bug00562.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -22,9 +22,7 @@ --EXPECTF-- array(1) { ["%sbug00562.php"]=> - array(8) { - [0]=> - int(1) + array(7) { [4]=> int(1) [6]=> Added: xdebug/trunk/tests/bug00642.phpt =================================================================== --- xdebug/trunk/tests/bug00642.phpt (rev 0) +++ xdebug/trunk/tests/bug00642.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -0,0 +1,51 @@ +--TEST-- +Test for bug #642: No line number for offsetGet and offsetSet +--INI-- +xdebug.default_enable=1 +xdebug.profiler_enable=0 +xdebug.auto_trace=0 +xdebug.trace_format=0 +xdebug.collect_vars=0 +xdebug.collect_params=1 +xdebug.collect_return=0 +xdebug.collect_assignments=0 +--FILE-- +container[$offset] = $value; + } + public function offsetExists($offset) { + return isset($this->container[$offset]); + } + public function offsetUnset($offset) { + unset($this->container[$offset]); + } + public function offsetGet($offset) { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } +} + +$test = new Test(); +$test['test'] = 'test'; +$foo = $test['test']; +isset($test['test']); +unset($test['test']); + +xdebug_stop_trace(); +echo file_get_contents($tf); +unlink($tf); +?> +--EXPECTF-- +TRACE START [%d-%d-%d %d:%d:%d] +%w%f %w%d -> Test->offsetSet(string(4), string(4)) %sbug00642.php:22 +%w%f %w%d -> Test->offsetGet(string(4)) %sbug00642.php:23 +%w%f %w%d -> Test->offsetExists(string(4)) %sbug00642.php:24 +%w%f %w%d -> Test->offsetUnset(string(4)) %sbug00642.php:25 +%w%f %w%d -> xdebug_stop_trace() %sbug00642.php:27 +%w%f %w%d +TRACE END [%d-%d-%d %d:%d:%d] Modified: xdebug/trunk/tests/call_user_func_array.phpt =================================================================== --- xdebug/trunk/tests/call_user_func_array.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/trunk/tests/call_user_func_array.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -37,10 +37,10 @@ --EXPECTF-- TRACE START [%d-%d-%d %d:%d:%d] %w%f %w%d -> call_user_func_array('debug', array (0 => 'foo', 1 => array (0 => 1, 1 => 2))) /%s/call_user_func_array.php:13 -%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array.php:0 +%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array.php:13 %w%f %w%d -> is_array(array (0 => 1, 1 => 2)) /%s/call_user_func_array.php:5 %w%f %w%d -> call_user_func_array('debug', array (0 => 'bar', 1 => 'bar')) /%s/call_user_func_array.php:16 -%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array.php:0 +%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array.php:16 %w%f %w%d -> is_array('bar') /%s/call_user_func_array.php:5 %w%f %w%d -> is_object('bar') /%s/call_user_func_array.php:5 %w%f %w%d -> is_resource('bar') /%s/call_user_func_array.php:5 Modified: xdebug/trunk/tests/call_user_func_array2.phpt =================================================================== --- xdebug/trunk/tests/call_user_func_array2.phpt 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/trunk/tests/call_user_func_array2.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -32,10 +32,10 @@ TRACE START [%d-%d-%d %d:%d:%d] %w%f %w%d -> include(/%s/call_user_func_array2.inc) /%s/call_user_func_array2.php:4 %w%f %w%d -> call_user_func_array('debug', array (0 => 'foo', 1 => array (0 => 1, 1 => 2))) /%s/call_user_func_array2.php:7 -%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array2.php:0 +%w%f %w%d -> debug('foo', array (0 => 1, 1 => 2)) /%s/call_user_func_array2.php:7 %w%f %w%d -> is_array(array (0 => 1, 1 => 2)) /%s/call_user_func_array2.inc:4 %w%f %w%d -> call_user_func_array('debug', array (0 => 'bar', 1 => 'bar')) /%s/call_user_func_array2.php:10 -%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array2.php:0 +%w%f %w%d -> debug('bar', 'bar') /%s/call_user_func_array2.php:10 %w%f %w%d -> is_array('bar') /%s/call_user_func_array2.inc:4 %w%f %w%d -> is_object('bar') /%s/call_user_func_array2.inc:4 %w%f %w%d -> is_resource('bar') /%s/call_user_func_array2.inc:4 Added: xdebug/trunk/tests/trace_with_magic_methods.phpt =================================================================== --- xdebug/trunk/tests/trace_with_magic_methods.phpt (rev 0) +++ xdebug/trunk/tests/trace_with_magic_methods.phpt 2011-01-03 22:53:28 UTC (rev 3381) @@ -0,0 +1,61 @@ +--TEST-- +Test for line numbers for __get, __set, __isset, __unset and __call. +--INI-- +xdebug.default_enable=1 +xdebug.profiler_enable=0 +xdebug.auto_trace=0 +xdebug.trace_format=0 +xdebug.collect_vars=0 +xdebug.collect_params=1 +xdebug.collect_return=0 +xdebug.collect_assignments=0 +--FILE-- +container[$offset] = $value; + } + public function __isset($offset) { + return isset($this->container[$offset]); + } + public function __unset($offset) { + unset($this->container[$offset]); + } + public function __get($offset) { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + public function __call($func, $args) { + return $this->$func($args); + } + public function test($args) { + count($args); + } +} + +$test = new Test(); +$test->test = 'test'; +$foo = $test->test; +isset($test->test); +unset($test->test); +$test->test('test1', 'test2'); + +xdebug_stop_trace(); +echo file_get_contents($tf); +unlink($tf); +?> +--EXPECTF-- +TRACE START [%d-%d-%d %d:%d:%d] +%w%f %w%d -> Test->__construct() %strace_with_magic_methods.php:27 +%w%f %w%d -> Test->__set(string(4), string(4)) %strace_with_magic_methods.php:28 +%w%f %w%d -> Test->__get(string(4)) %strace_with_magic_methods.php:29 +%w%f %w%d -> Test->__isset(string(4)) %strace_with_magic_methods.php:30 +%w%f %w%d -> Test->__unset(string(4)) %strace_with_magic_methods.php:31 +%w%f %w%d -> Test->test(string(5), string(5)) %strace_with_magic_methods.php:32 +%w%f %w%d -> count(string(5)) %strace_with_magic_methods.php:23 +%w%f %w%d -> xdebug_stop_trace() %strace_with_magic_methods.php:34 +%w%f %w%d +TRACE END [%d-%d-%d %d:%d:%d] Modified: xdebug/trunk/xdebug_stack.c =================================================================== --- xdebug/trunk/xdebug_stack.c 2011-01-02 23:38:37 UTC (rev 3380) +++ xdebug/trunk/xdebug_stack.c 2011-01-03 22:53:28 UTC (rev 3381) @@ -901,6 +901,11 @@ if (cur_opcode) { tmp->lineno = cur_opcode->lineno; } + } else if (edata->prev_execute_data && edata->prev_execute_data->opline) { + cur_opcode = edata->prev_execute_data->opline; + if (cur_opcode) { + tmp->lineno = cur_opcode->lineno; + } } if (XG(remote_enabled) || XG(collect_params) || XG(collect_vars)) {