]> granicus.if.org Git - php/commitdiff
add dump_entry
authorGreg Beaver <cellog@php.net>
Thu, 16 Aug 2007 19:56:02 +0000 (19:56 +0000)
committerGreg Beaver <cellog@php.net>
Thu, 16 Aug 2007 19:56:02 +0000 (19:56 +0000)
ext/phar/gdbhelp

index 16e28058985cc3e83d4ba7359b21433b1337ba5f..0a578307f8ffba3e73819bf7ca176fe3509dbd92 100644 (file)
@@ -76,4 +76,42 @@ end
 
 document print_pharfp
        displays all open file pointers in phar, and the phars plus entries that are open with reference counts
+end
+
+define dump_entry
+       ___pharglobals
+       set $ht = $pharglobals.phar_fname_map
+       set $p = $ht.pListHead
+       set $done = 0
+       while $p != 0
+               set $t = (*(phar_archive_data*)$p->pDataPtr)
+               if $t.fname[0] == $arg0[0] || $t.alias[0] == $arg0[0]
+                       set $manifest = (*(phar_archive_data*)$p->pDataPtr).manifest
+                       set $m = $manifest.pListHead
+                       while $m != 0
+                               if (*(phar_entry_info *)$m->pData).filename[0] == $arg1[0]
+                                       if $argc == 3
+                                               output *((phar_entry_info *)$m->pData)->fp
+                                       end
+                                       if $argc == 2
+                                               output *(phar_entry_info *)$m->pData
+                                       end
+                                       printf "\n"
+                                       set $done = 1
+                                       loop_break
+                               end
+                       end
+                       set $m = $m->pListNext
+               end
+               if $done == 1
+                       loop_break
+               end
+               set $p = $p->pListNext
+       end
+end
+
+document dump_entry
+       dump_entry "pharname"|"pharalias" "filename" [1]
+       display phar_entry_info for a file within a phar.  If the optional third param
+       is passed in, displays the php_stream that is the file's fp
 end
\ No newline at end of file