]> granicus.if.org Git - php/commitdiff
Adds print_global_vars to gdbinit
authorMitch Hagstrand <mhagstrand@gmail.com>
Wed, 16 May 2018 20:01:24 +0000 (15:01 -0500)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 26 May 2018 20:05:06 +0000 (22:05 +0200)
.gdbinit

index 5a2675d37e4c88d125a3bb240e601f3abd3fddf2..f33a72bc681c21e52b344760f1eacdad3f361929 100644 (file)
--- a/.gdbinit
+++ b/.gdbinit
@@ -16,9 +16,11 @@ define ____executor_globals
                end
                set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
                set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
+               set $eg_ptr = $eg
        else
                set $eg = executor_globals
                set $cg = compiler_globals
+               set $eg_ptr = (zend_executor_globals*) &executor_globals
        end
 end
 
@@ -289,6 +291,16 @@ define ____printzv
        end
 end
 
+define print_global_vars
+       ____executor_globals
+       set $symtable = ((HashTable *)&($eg_ptr->symbol_table))
+       print_ht $symtable
+end
+
+document print_global_vars
+       Prints the global variables
+end
+
 define print_const_table
        set $ind = 1
        printf "[%p] {\n", $arg0