]> granicus.if.org Git - php/commitdiff
- Improve/fix debugging experience
authorMarcus Boerger <helly@php.net>
Sun, 13 Jul 2008 21:26:53 +0000 (21:26 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 13 Jul 2008 21:26:53 +0000 (21:26 +0000)
.gdbinit

index 522f16de2d4d12ee880c84810471ed27230b9a44..fbc211a36c7aeac2c03ae4b820beb8af5db2790e 100644 (file)
--- a/.gdbinit
+++ b/.gdbinit
@@ -95,8 +95,8 @@ define ____printzv_contents
        set $zvalue = $arg0
        set $type = $zvalue->type
 
-       printf "(refcount=%d", $zvalue->refcount
-       if $zvalue->is_ref
+       printf "(refcount=%d", $zvalue->refcount__gc
+       if $zvalue->is_ref__gc
                printf ",is_ref"
        end
        printf ") "
@@ -181,7 +181,20 @@ define ____printzv_contents
        if $type == 9
        end
        if $type == 10
-               printf "(%d): [%p]", $zvalue->value.str.len, $zvalue->value.str.val
+               printf "(%d): [%p]: \"", $zvalue->value.str.len, $zvalue->value.str.val
+               set $pos = 0
+               while $pos < 20 && $pos < $zvalue->value.str.len
+                       if $zvalue->value.ustr.val[$pos] < 256
+                               printf "%c", $zvalue->value.ustr.val[$pos]
+                       else
+                               printf "\\u%04X", $zvalue->value.ustr.val[$pos]
+                       end
+                       set $pos = $pos + 1
+               end
+               printf "\""
+               if $pos < $zvalue->value.str.len
+                       printf "[...]"
+               end
        end
        if $type > 10
        end