[xdebug-dev] svn: /xdebug/ branches/xdebug_2_1/tests/bug00631.phpt branches/xdebug_2_1/xdebug.c trunk/tests/bug00631.phpt trunk/xdebug.c

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Sun, 07 Nov 2010 05:05:00 +0000

derick Sun, 07 Nov 2010 05:05:00 +0000

Revision: http://svn.xdebug.org/cgi-bin/viewvc.cgi?view=rev&revision=3369&root=xdebug

Log:
- Fixed bug #631: Summary not written when script ended with "exit()".

Changed paths:
    A xdebug/branches/xdebug_2_1/tests/bug00631.phpt
    U xdebug/branches/xdebug_2_1/xdebug.c
    A xdebug/trunk/tests/bug00631.phpt
    U xdebug/trunk/xdebug.c

Added: xdebug/branches/xdebug_2_1/tests/bug00631.phpt
===================================================================
--- xdebug/branches/xdebug_2_1/tests/bug00631.phpt (rev 0)
+++ xdebug/branches/xdebug_2_1/tests/bug00631.phpt 2010-11-07 05:05:00 UTC (rev 3369)
@@ -0,0 +1,45 @@
+--TEST--
+Test for bug #631: Summary not written when script ended with "exit()".
+--INI--
+xdebug.profiler_enable=1
+--FILE--
+<?php
+function capture() {
+ echo file_get_contents(xdebug_get_profiler_filename());
+}
+
+register_shutdown_function('capture');
+strlen("5");
+exit();
+?>
+--EXPECTF--
+version: 0.9.6
+cmd: /home/derick/dev/php/xdebug/trunk/tests/bug00XXX.php
+part: 1
+
+events: Time
+
+fl=php:internal
+fn=php::register_shutdown_function
+%d %d
+
+fl=php:internal
+fn=php::strlen
+%d %d
+
+fl=/home/derick/dev/php/xdebug/trunk/tests/bug00XXX.php
+fn={main}
+
+summary: %d
+
+%d %d
+cfn=php::register_shutdown_function
+calls=1 0 0
+%d %d
+cfn=php::strlen
+calls=1 0 0
+%d %d
+
+fl=php:internal
+fn=php::xdebug_get_profiler_filename
+%d %d

Modified: xdebug/branches/xdebug_2_1/xdebug.c
===================================================================
--- xdebug/branches/xdebug_2_1/xdebug.c 2010-11-07 05:02:37 UTC (rev 3368)
+++ xdebug/branches/xdebug_2_1/xdebug.c 2010-11-07 05:05:00 UTC (rev 3369)
@@ -507,7 +507,8 @@
         zend_xdebug_global_offset = zend_get_resource_handle(&dummy_ext);

         /* Overload the "exit" opcode */
- XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_EXIT);
+ XDEBUG_SET_OPCODE_OVERRIDE_ASSIGN(exit, ZEND_EXIT);
+
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMP);
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPZ);
         XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_JMPNZ);

Added: xdebug/trunk/tests/bug00631.phpt
===================================================================
--- xdebug/trunk/tests/bug00631.phpt (rev 0)
+++ xdebug/trunk/tests/bug00631.phpt 2010-11-07 05:05:00 UTC (rev 3369)
@@ -0,0 +1,45 @@
+--TEST--
+Test for bug #631: Summary not written when script ended with "exit()".
+--INI--
+xdebug.profiler_enable=1
+--FILE--
+<?php
+function capture() {
+ echo file_get_contents(xdebug_get_profiler_filename());
+}
+
+register_shutdown_function('capture');
+strlen("5");
+exit();
+?>
+--EXPECTF--
+version: 0.9.6
+cmd: /home/derick/dev/php/xdebug/trunk/tests/bug00XXX.php
+part: 1
+
+events: Time
+
+fl=php:internal
+fn=php::register_shutdown_function
+%d %d
+
+fl=php:internal
+fn=php::strlen
+%d %d
+
+fl=/home/derick/dev/php/xdebug/trunk/tests/bug00XXX.php
+fn={main}
+
+summary: %d
+
+%d %d
+cfn=php::register_shutdown_function
+calls=1 0 0
+%d %d
+cfn=php::strlen
+calls=1 0 0
+%d %d
+
+fl=php:internal
+fn=php::xdebug_get_profiler_filename
+%d %d

Modified: xdebug/trunk/xdebug.c
===================================================================
--- xdebug/trunk/xdebug.c 2010-11-07 05:02:37 UTC (rev 3368)
+++ xdebug/trunk/xdebug.c 2010-11-07 05:05:00 UTC (rev 3369)
@@ -534,7 +534,7 @@
         zend_xdebug_global_offset = zend_get_resource_handle(&dummy_ext);

         /* Overload the "exit" opcode */
- XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_EXIT);
+ XDEBUG_SET_OPCODE_OVERRIDE_ASSIGN(exit, ZEND_EXIT);

         /* Overload opcodes for code coverage */
         if (XG(coverage_enable)) {
Received on Sun Nov 07 2010 - 05:05:00 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST