]> granicus.if.org Git - php/commitdiff
gdbinit: use ____print_str to print htable keys
authorDylan K. Taylor <odigiman@gmail.com>
Mon, 4 Jan 2021 23:13:00 +0000 (23:13 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 5 Jan 2021 09:11:56 +0000 (10:11 +0100)
I noticed this problem while dumping the contents of EG(function_table),
where keys for closures start with a null byte. printf interprets this
as a zero-length string and emits nothing. This allows the key to be
rendered properly in readable form.

Closes GH-6577.

.gdbinit

index 8e54830ef2a1b46b4258ae76a15fb0f7630765ab..a163bcc47374a27fcf63a2fb7b59a8956982624f 100644 (file)
--- a/.gdbinit
+++ b/.gdbinit
@@ -352,7 +352,8 @@ define ____print_ht
                        end
                        printf "[%d] ", $i
                        if $p->key
-                               printf "%s => ", $p->key->val
+                               ____print_str $p->key->val $p->key->len
+                               printf " => "
                        else
                                printf "%d => ", $p->h
                        end