While in the midst of writing my own GDB scripts to anylize PHP core files, I was informed through a response to the xdebug mailing list that these functions already exist in the php-src/.gdbinit file. How clever! Some useful functions are:
(gdb) zbacktrace
[0xfff40040] arsort() mail.php:287
[0xfff40040] send_message() lib.php:18
[0xfff40040] post_reply() lib.php:312
[0xfff40040] ??? index.php:15
(gdb) printzv return_value
[0xdd474c90] (refcount=1) NULL
Some other usefull commands…
dump_bt — Dumps the current execution stack
print_const_table — User-defined
print_ft — Dumps a function table (HashTable)
print_ht — Dumps elements of HashTable made of zval
print_inh — User-defined
print_pi — User-defined
printzn — Print type and content of znode
printzops — Dump operands of the current opline
printzv — Prints content of zval
zbacktrace — Prints backtrace
zmemcheck — Show status of a memory block
More information on GDB command files here
Leave a reply