Permalink
Browse files

Merge branch 'xdebug_2_2'

Conflicts:
	xdebug.ini
  • Loading branch information...
2 parents a191144 + 9da6d93 commit 72fd4b1c2877f2501ec783439d5239502fb7ff6a @derickr committed Oct 21, 2012
Showing with 125 additions and 2 deletions.
  1. +7 −0 tests/bug00879.inc
  2. +59 −0 tests/bug00879.phpt
  3. +8 −0 tests/bug00885.phpt
  4. +4 −0 xdebug.c
  5. +41 −0 xdebug.ini
  6. +6 −2 xdebug_stack.c
View
@@ -0,0 +1,7 @@
+<?php
+
+trait T {}
+
+class WithTrait {
+ use T;
+}
View
@@ -0,0 +1,59 @@
+--TEST--
+Test for bug #879: Closing brace in trait-using class definitions is counted towards code coverage. (PHP >= 5.4)
+--SKIPIF--
+<?php if (version_compare(phpversion(), "5.4", '<')) echo "skip >= PHP 5.4 needed\n"; ?>
+--INI--
+xdebug.default_enable=1
+xdebug.auto_trace=0
+xdebug.trace_options=0
+xdebug.trace_output_dir=/tmp
+xdebug.collect_params=1
+xdebug.collect_return=0
+xdebug.collect_assignments=0
+xdebug.auto_profile=0
+xdebug.profiler_enable=0
+xdebug.dump_globals=0
+xdebug.show_mem_delta=0
+xdebug.trace_format=0
+xdebug.extended_info=1
+xdebug.coverage_enable=1
+xdebug.overload_var_dump=0
+--FILE--
+<?php
+
+xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
+
+$file = realpath('./tests/bug00879.inc');
+include $file;
+
+new WithTrait;
+
+var_dump(xdebug_get_code_coverage());
+?>
+--EXPECTF--
+array(2) {
+ ["%sbug00879.inc"]=>
+ array(5) {
+ [3]=>
+ int(1)
+ [5]=>
+ int(1)
+ [6]=>
+ int(1)
+ [7]=>
+ int(1)
+ [8]=>
+ int(1)
+ }
+ ["%sbug00879.php"]=>
+ array(4) {
+ [5]=>
+ int(1)
+ [6]=>
+ int(1)
+ [8]=>
+ int(1)
+ [10]=>
+ int(1)
+ }
+}
View
@@ -0,0 +1,8 @@
+--TEST--
+Test for bug #885: missing validation point returned by strchr in xdebug_error_cb.
+--FILE--
+<?php
+throw new Exception("long message ".str_repeat('.', 10240));
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'Exception' with message 'long message ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... in %sbug00885.php on line 2
View
@@ -630,6 +630,10 @@ PHP_MINIT_FUNCTION(xdebug)
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION >= 6
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_DECLARE_LAMBDA_FUNCTION);
#endif
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4)
+ XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_ADD_TRAIT);
+ XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_BIND_TRAITS);
+#endif
}
XDEBUG_SET_OPCODE_OVERRIDE_ASSIGN(include_or_eval, ZEND_INCLUDE_OR_EVAL);
View
@@ -19,6 +19,8 @@
;
; Type: integer, Default value: 0
;
+; Only in Xdebug versions > 2.2
+;
; If this setting is 1, Xdebug will color var_dumps and stack traces output when
; in CLI mode and when the output is a tty. On Windows, the ANSICON [1] tool
; needs to be installed.
@@ -39,6 +41,8 @@
; -----------------------------------------------------------------------------
; xdebug.collect_assignments
;
+; Only in Xdebug versions > 2.1
+;
; Type: boolean, Default value: 0
;
; This setting, defaulting to 0, controls whether Xdebug should add variable
@@ -132,6 +136,8 @@
; -----------------------------------------------------------------------------
; xdebug.coverage_enable
;
+; Only in Xdebug versions > 2.2
+;
; Type: boolean, Default value: 1
;
; If this setting is set to 0, then Xdebug will not set-up internal structures
@@ -222,6 +228,8 @@
; -----------------------------------------------------------------------------
; xdebug.file_link_format
;
+; Only in Xdebug versions > 2.1
+;
; Type: string, Default value:
;
; This setting determines the format of the links that are made in the display
@@ -349,6 +357,8 @@
; -----------------------------------------------------------------------------
; xdebug.manual_url
;
+; Only in Xdebug versions < 2.2.1
+;
; Type: string, Default value: http://www.php.net
;
; This is the base url for the links from the function traces and error message
@@ -373,6 +383,8 @@
; -----------------------------------------------------------------------------
; xdebug.overload_var_dump
;
+; Only in Xdebug versions > 2.1
+;
; Type: boolean, Default value: 1
;
; By default Xdebug overloads var_dump() with its own improved version for
@@ -467,6 +479,8 @@
; -----------------------------------------------------------------------------
; xdebug.remote_connect_back
;
+; Only in Xdebug versions > 2.1
+;
; Type: boolean, Default value: 0
;
; If enabled, the xdebug.remote_host setting is ignored and Xdebug will try to
@@ -482,6 +496,8 @@
; -----------------------------------------------------------------------------
; xdebug.remote_cookie_expire_time
;
+; Only in Xdebug versions > 2.1
+;
; Type: integer, Default value: 3600
;
; This setting can be used to increase (or decrease) the time that the remote
@@ -586,6 +602,8 @@
; -----------------------------------------------------------------------------
; xdebug.scream
;
+; Only in Xdebug versions > 2.1
+;
; Type: boolean, Default value: 0
;
; If this setting is 1, then Xdebug will disable the @ (shut-up) operator so
@@ -634,6 +652,8 @@
; -----------------------------------------------------------------------------
; xdebug.trace_enable_trigger
;
+; Only in Xdebug versions > 2.2
+;
; Type: boolean, Default value: 0
;
; When this setting is set to 1, you can trigger the generation of trace files
@@ -671,13 +691,34 @@
;
; Fields for the computerized format:
;
+<<<<<<< HEAD
; =========== ===== =========== =========== ========== ============ ============= =========================================== ================================ ======== ===========
; Record type 1 2 3 4 5 6 7 8 9 10
; =========== ===== =========== =========== ========== ============ ============= =========================================== ================================ ======== ===========
; Entry level function # always '0' time index memory usage function name user-defined (1) or internal function (0) name of the include/require file filename line number
; ----------- ----- ----------- ----------- ---------- ------------ ------------- ------------------------------------------- -------------------------------- -------- -----------
; Exit level function # always '1' time index memory usage empty
; =========== ===== =========== =========== ========== ============ ============= =========================================== ================================ ======== ===========
+=======
+<<<<<<< HEAD
+; =========== ===== ========== ========== ========== ============ ============= ========================================= ================================ ======== ===========
+; Record type 1 2 3 4 5 6 7 8 9 10
+; =========== ===== ========== ========== ========== ============ ============= ========================================= ================================ ======== ===========
+; Entry level function # always '0' time index memory usage function name user-defined (1) or internal name of the include/require file filename line number
+; function (0)
+; ----------- ----- ---------- ---------- ---------- ------------ ------------- ----------------------------------------- -------------------------------- -------- -----------
+; Exit level function # always '1' time index memory usage empty
+; =========== ===== ========== ========== ========== ============ ============= ========================================= ================================ ======== ===========
+=======
+; =========== ===== =========== =========== ========== ============ ============= =========================================== ================================ ======== ===========
+; Record type 1 2 3 4 5 6 7 8 9 10
+; =========== ===== =========== =========== ========== ============ ============= =========================================== ================================ ======== ===========
+; Entry level function # always '0' time index memory usage function name user-defined (1) or internal function (0) name of the include/require file filename line number
+; ----------- ----- ----------- ----------- ---------- ------------ ------------- ------------------------------------------- -------------------------------- -------- -----------
+; Exit level function # always '1' time index memory usage empty
+; =========== ===== =========== =========== ========== ============ ============= =========================================== ================================ ======== ===========
+>>>>>>> 6444e03... Update the changed xdebug.ini.
+>>>>>>> xdebug_2_2
;
; See the introduction of Function Traces for a few examples.
;
View
@@ -622,8 +622,12 @@ void xdebug_error_cb(int type, const char *error_filename, const uint error_line
/* find first new line */
p = strchr(buffer, '\n');
- /* find last quote */
- p = ((char *) zend_memrchr(buffer, '\'', p - buffer)) + 1;
+ if (!p) {
+ p = buffer + strlen(buffer);
+ } else {
+ /* find last quote */
+ p = ((char *) zend_memrchr(buffer, '\'', p - buffer)) + 1;
+ }
/* Create new buffer */
tmp_buf = calloc(p - buffer + 1, 1);
strncpy(tmp_buf, buffer, p - buffer );

0 comments on commit 72fd4b1

Please sign in to comment.