[xdebug-dev] xdebug xdebug/xdebug_code_coverage.h First commit to branch. Added declarations for structures to count instructions.

From: Allister Beharry <allister.beharry[@]gmail.com>
Date: Fri, 17 Jul 2009 08:20:58 +0200

Date: Fri Jul 17 08:20:58 CEST 2009
User: Allister Beharry
Directory: xdebug

Log Message:
First commit to branch. Added declarations for structures to count instructions.
Modified files:
           xdebug/xdebug_code_coverage.h (version: 1.13.4.1)

[FILE: /xdebug/xdebug_code_coverage.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.13
retrieving revision 1.13.4.1
diff -u -r1.13 -r1.13.4.1
--- xdebug/xdebug_code_coverage.h:1.13 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_code_coverage.h Fri Jul 17 04:20:58 2009 GMT
@@ -22,23 +22,91 @@
 #include "php.h"
 #include "xdebug_hash.h"
 #include "xdebug_mm.h"
+#include "xdebug_set.h"
+#include "srm_oparray.h"
 
-typedef struct xdebug_coverage_line {
- int lineno;
+typedef struct xdebug_coverage_decision
+{
+ int lineno;
+ int instruction_position;
+ int executed;
+ int branch1_lineno;
+ int branch1_position;
+ int branch1_executed;
+ xdebug_set *branch1_set;
+ int branch2_lineno;
+ int branch2_position;
+ int branch2_executed;
+ xdebug_set *branch2_set;
+} xdebug_coverage_decision;
+
+typedef struct xdebug_coverage_instruction
+{
+ zend_op op;
+ int position;
+ char *opcode_name;
+ zend_execute_data* execute_data;
+ int executed;
+ int lineno;
+ int dead;
+ int count;
+ int decision;
+ int decision_branch1_position;
+ int decision_branch2_position;
+ int decision_branch1_set;
+ int decision_branch2_set;
+} xdebug_coverage_instruction;
+
+typedef struct xdebug_coverage_line
+{
+ int dead;
         int count;
- int executable;
+ int executed;
+ int lineno;
+ int decision;
+ int decision_branch1_lineno;
+ int decision_branch2_lineno;
+ int decision_branch1_set;
+ int decision_branch2_set;
+ int previous_total_instructions;
+ int total_instructions;
+ int instructions_counted;
+ xdebug_hash *instructions;
 } xdebug_coverage_line;
 
-typedef struct xdebug_coverage_file {
- char *name;
- xdebug_hash *lines;
+typedef struct xdebug_coverage_function
+{
+ char *name;
+ int dead;
+ int count;
+ int executed;
+ xdebug_hash *lines;
+ int total_lines;
+ int lines_counted;
+ xdebug_hash *decisions;
+ int total_branches;
+ xdebug_set *total_branches_set;
+ int branches_counted;
+ xdebug_set *branches_counted_set;
+} xdebug_coverage_function;
+
+typedef struct xdebug_coverage_file
+{
+ char *name;
+ xdebug_hash *functions;
+ int total_lines;
+ int lines_counted;
+ int total_branches;
+ int branches_counted;
 } xdebug_coverage_file;
 
 void xdebug_coverage_line_dtor(void *data);
 void xdebug_coverage_file_dtor(void *data);
 
-void xdebug_count_line(char *file, int lineno, int executable, int deadcode TSRMLS_DC);
+static void prefill_from_opcode(char *filename, zend_op_array *op_array, zend_op op, unsigned int position, unsigned int *instructions_prefilled, int deadcode TSRMLS_DC);
+void xdebug_count_instruction(zend_op *op, zend_execute_data *execute_data TSRMLS_DC);
 void xdebug_prefill_code_coverage(zend_op_array *op_array TSRMLS_DC);
+static void xdebug_analyse_branch(zend_op_array *opa, unsigned int position, xdebug_set *set);
 
 PHP_FUNCTION(xdebug_start_code_coverage);
 PHP_FUNCTION(xdebug_stop_code_coverage);
Received on Fri Jul 17 2009 - 08:21:41 BST

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