]> granicus.if.org Git - php/commitdiff
- treat interfaces and classes gracefully in print_inh
authorMichael Wallner <mike@php.net>
Fri, 5 May 2006 15:49:41 +0000 (15:49 +0000)
committerMichael Wallner <mike@php.net>
Fri, 5 May 2006 15:49:41 +0000 (15:49 +0000)
.gdbinit

index c08018e2d038772233b315bd7b2ac2c5933a2e64..067613fba95410cd3a21701389556bb8d19dbbd4 100644 (file)
--- a/.gdbinit
+++ b/.gdbinit
@@ -259,6 +259,44 @@ document print_ft
        dumps a function table (HashTable)
 end
 
+define ____print_inh_class
+       set $ce = $arg0
+       if $ce->ce_flags & 0x10 || $ce->ce_flags & 0x20
+               printf "abstract "
+       else
+               if $ce->ce_flags & 0x40
+                       printf "final "
+               end
+       end
+       printf "class %s", $ce->name
+       if $ce->parent != 0
+               printf " extends %s", $ce->parent->name
+       end
+       if $ce->num_interfaces != 0
+               printf " implements"
+               set $tmp = 0
+               while $tmp < $ce->num_interfaces
+                       printf " %s", $ce->interfaces[$tmp]->name
+                       set $tmp = $tmp + 1
+                       if $tmp < $ce->num_interfaces
+                               printf ","
+                       end
+               end
+       end
+       set $ce = $ce->parent
+end
+
+define ____print_inh_iface
+       set $ce = $arg0
+       printf "interface %s", $ce->name
+       if $ce->num_interfaces != 0
+               set $ce = $ce->interfaces[0]
+               printf " extends %s", $ce->name
+       else
+               set $ce = 0
+       end
+end
+
 define print_inh
        set $ce = $arg0
        set $depth = 0
@@ -268,13 +306,13 @@ define print_inh
                        printf " "
                        set $tmp = $tmp - 1
                end
-               printf "class %s", $ce->name
-               if $ce->parent != 0
-                       printf " extends %s", $ce->parent->name
+               set $depth = $depth + 1
+               if $ce->ce_flags & 0x80
+                       ____print_inh_iface $ce
+               else
+                       ____print_inh_class $ce
                end
                printf " {\n"
-               set $depth = $depth + 1
-               set $ce = $ce->parent
        end
        while $depth != 0
                set $tmp = $depth