@@ -29,24 +29,35 @@ document ____executor_globals
29
29
end
30
30
31
31
define print_cvs
32
- ____executor_globals
33
- set $p = $eg .current_execute_data.CVs
34
- set $c = $eg .current_execute_data.op_array.last_var
35
- set $v = $eg .current_execute_data.op_array.vars
36
- set $i = 0
32
+ if $argc == 0
33
+ ____executor_globals
34
+ set $cv_ex_ptr = $eg .current_execute_data
35
+ else
36
+ set $cv_ex_ptr = (zend_execute_data *)$arg0
37
+ end
38
+ set $cv_count = $cv_ex_ptr .func.op_array.last_var
39
+ set $cv = $cv_ex_ptr .func.op_array.vars
40
+ set $cv_idx = 0
41
+ set $callFrameSize = (sizeof(zend_execute_data) + sizeof(zval) - 1 ) / sizeof(zval)
37
42
38
- printf " Compiled variables count: %d\n " , $c
39
- while $i < $c
40
- printf " %d = %s\n " , $i , $v [$i ].name
41
- if $p [$i ] != 0
42
- printzv *$p [$i ]
43
- else
44
- printf " *uninitialized*\n "
45
- end
46
- set $i = $i + 1
43
+ printf " Compiled variables count: %d\n\n " , $cv_count
44
+ while $cv_idx < $cv_count
45
+ printf " [%d] '%s'\n " , $cv_idx , $cv [$cv_idx ].val
46
+ set $zvalue = ((zval *) $cv_ex_ptr ) + $callFrameSize + $cv_idx
47
+ printzv $zvalue
48
+ set $cv_idx = $cv_idx + 1
47
49
end
48
50
end
49
51
52
+ document print_cvs
53
+ Prints the compiled variables and their values.
54
+ If a zend_execute_data pointer is set this will print the compiled
55
+ variables of that scope. If no parameter is used it will use
56
+ current_execute_data for scope.
57
+
58
+ usage: print_cvs [zend_execute_data *]
59
+ end
60
+
50
61
define dump_bt
51
62
set $ex = $arg0
52
63
while $ex
563
574
564
575
document print_zstr
565
576
print the length and contents of a zend string
566
- usage: print_zstr [ ptr]
577
+ usage: print_zstr < ptr>
567
578
end
568
579
569
580
define zbacktrace
0 commit comments