[xdebug-dev] xdebug xdebug/xdebug_code_coverage.c Removed test for previous instruction in test for branch - assume all JMPZ, JMPNZ et.al are decisions.

From: Allister Beharry <allister.beharry[@]gmail.com>
Date: Sat, 18 Jul 2009 09:26:26 +0200

Date: Sat Jul 18 09:26:26 CEST 2009
User: Allister Beharry
Directory: xdebug

Log Message:
[2.1-dev]
Removed test for previous instruction in test for branch - assume all JMPZ, JMPNZ et.al are decisions.
Prefill and count class methods.
-
Modified files:
           xdebug/xdebug_code_coverage.c (version: 1.53.4.2)

[FILE: /xdebug/xdebug_code_coverage.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.53.4.1
retrieving revision 1.53.4.2
diff -u -r1.53.4.1 -r1.53.4.2
--- xdebug/xdebug_code_coverage.c:1.53.4.1 Fri Jul 17 04:20:21 2009 GMT
+++ xdebug/xdebug_code_coverage.c Sat Jul 18 05:26:26 2009 GMT
@@ -163,13 +163,13 @@
   int num_known_opcodes = sizeof(op_array) / sizeof(op_array[0]);
   /*fprintf(stderr, "XDEBUG_CC: prefill_from_opcode: starting...sline = %s sposition = %s filename = %s \n", sline, xdebug_sprintf("%d", position), filename);*/
   
- if (op_array->type == ZEND_USER_FUNCTION) {
- if (op_array->function_name == NULL)
- function_name = "0" ;
- else
- function_name = op_array->function_name ;
- /*fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode: setting function name to %s...\n", function_name);*/
- } else return; //don'tcount classes as yet
+
+ if (op_array->function_name == NULL)
+ function_name = "0" ;
+ else
+ function_name = op_array->function_name ;
+ /*fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode: setting function name to %s...\n", function_name);*/
+
 
                 /* Check if the file already exists in the hash */
          if (!xdebug_hash_find(XG(code_coverage), filename, strlen(filename), (void *) &file)) {
@@ -260,13 +260,15 @@
   {
     previous_op = op_array->opcodes[position - 1];
     if (previous_op.opcode == ZEND_EXT_STMT) previous_op = op_array->opcodes[position - 2];
- if (
+ /*if (
     previous_op.opcode == ZEND_IS_SMALLER ||
     previous_op.opcode == ZEND_IS_IDENTICAL ||
     previous_op.opcode == ZEND_IS_NOT_IDENTICAL ||
     previous_op.opcode == ZEND_IS_EQUAL ||
     previous_op.opcode == ZEND_IS_NOT_EQUAL ||
     previous_op.opcode == ZEND_IS_SMALLER)
+ */
+ if (1) /*Bypass this test for now - assume every JMPZ et.al is a branch*/
     {
       if (op.opcode == ZEND_JMPZ || op.opcode == ZEND_JMPNZ || op.opcode == ZEND_JMPZ_EX || op.opcode == ZEND_JMPNZ_EX)
              {
Received on Sat Jul 18 2009 - 09:26:40 BST

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