summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_btree.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg/phpdbg_btree.c')
-rw-r--r--sapi/phpdbg/phpdbg_btree.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_btree.c b/sapi/phpdbg/phpdbg_btree.c
index 491445399b..918bc0d68f 100644
--- a/sapi/phpdbg/phpdbg_btree.c
+++ b/sapi/phpdbg/phpdbg_btree.c
@@ -219,3 +219,18 @@ check_branch_existence:
return SUCCESS;
}
+
+void phpdbg_btree_branch_dump(phpdbg_btree_branch *branch, zend_ulong depth) {
+ if (branch) {
+ if (depth--) {
+ phpdbg_btree_branch_dump(branch->branches[0], depth);
+ phpdbg_btree_branch_dump(branch->branches[1], depth);
+ } else {
+ fprintf(stderr, "%p: %p\n", (void *) branch->result.idx, branch->result.ptr);
+ }
+ }
+}
+
+void phpdbg_btree_dump(phpdbg_btree *tree) {
+ phpdbg_btree_branch_dump(tree->branch, tree->depth);
+}