php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #72680
Patch EX_CV_NUM_and_Variable_i_conflict_patch revision 2016-07-26 15:08 UTC by th3s3v3n dot shell at gmail dot com

Patch EX_CV_NUM_and_Variable_i_conflict_patch for *General Issues Bug #72680

Patch version 2016-07-26 15:08 UTC

Return to Bug #72680 | Download this patch
Patch Revisions:

Developer: th3s3v3n.shell@gmail.com

--- php-5.6.24/.gdbinit	2016-07-21 00:23:03.000000000 +0000
+++ .gdbinit	2016-07-25 19:59:27.397728735 +0000
@@ -28,25 +28,30 @@
 	ZTS detection is automatically based on ext/standard module struct
 end
 
-define print_cvs
-	____executor_globals
-	set $p = $eg.current_execute_data.CVs
-	set $c = $eg.current_execute_data.op_array.last_var
-	set $v = $eg.current_execute_data.op_array.vars
-	set $i = 0
+define print_cvs_at
+	set $e = (zend_execute_data *)$arg0
+	set $c = $e.op_array.last_var
+	set $v = $e.op_array.vars
+	set $xel = 0
 
 	printf "Compiled variables count: %d\n", $c
-	while $i < $c
-		printf "%d = %s\n", $i, $v[$i].name
-		if $p[$i] != 0
-			printzv *$p[$i]
+	while $xel < $c
+		printf "%d = %s\n", $xel, $v[$xel].name
+		set $val = *(((zval***)(((char*)($e))+sizeof(zend_execute_data)))+($xel))
+		if $val
+			printzv *$val
 		else
-			printf "*uninitialized*\n"
+			printf "(uninitialised)\n"
 		end
-		set $i = $i + 1
+		set $xel = $xel + 1
 	end
 end
 
+define print_cvs
+	____executor_globals
+	print_cvs_at $eg.current_execute_data
+end
+
 define dump_bt
 	set $t = $arg0
 	while $t
@@ -106,7 +111,7 @@
 						printf "%ld", $zvalue->value.lval
 					end
 					if $type == 2
-						printf "%f", $zvalue->value.dval
+						printf "%lf", $zvalue->value.dval
 					end
 					if $type == 3
 						if $zvalue->value.lval
@@ -185,7 +190,7 @@
 		printf "long: %ld", $zvalue->value.lval
 	end
 	if $type == 2
-		printf "double: %f", $zvalue->value.dval
+		printf "double: %lf", $zvalue->value.dval
 	end
 	if $type == 3
 		printf "bool: "
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 23:01:28 2024 UTC