From b958490b6cbc3f0106d328378bce57bbf80ecd41 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 9 Jan 2006 07:48:19 +0000 Subject: [PATCH] Add print_ft to dump function tables (lists the names) --- .gdbinit | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.gdbinit b/.gdbinit index 7c58e86fda..2973147c78 100644 --- a/.gdbinit +++ b/.gdbinit @@ -165,7 +165,7 @@ define ____print_const_table end if $p->nKeyLength > 0 - printf "\"%s\" => ", $p->arKey + printf "\"%s\" => ", $p->key.u.string else printf "%d => ", $p->h end @@ -196,7 +196,7 @@ define ____print_ht end if $p->nKeyLength > 0 - printf "\"%s\" => ", $p->arKey + printf "\"%s\" => ", (char*)$p->key.u.string else printf "%d => ", $p->h end @@ -217,6 +217,41 @@ document print_ht dumps elements of HashTable made of zval end +define ____print_ft + set $ht = $arg0 + set $p = $ht->pListHead + + while $p != 0 + set $func = (zend_function*)$p->pData + + set $i = $ind + while $i > 0 + printf " " + set $i = $i - 1 + end + + if $p->nKeyLength > 0 + printf "\"%s\" => ", (char*)$p->key.u.string + else + printf "%d => ", $p->h + end + + printf "\"%s\"\n", $func->common.function_name + set $p = $p->pListNext + end +end + +define print_ft + set $ind = 1 + printf "[0x%08x] {\n", $arg0 + ____print_ft $arg0 + printf "}\n" +end + +document print_ft + dumps a function table (HashTable) +end + define printzn ____executor_globals set $ind = 0 -- 2.50.1