# New Ticket Created by Matthew Zimmerman # Please include the string: [perl #18131] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18131 >
..../disassemble.pl prints out information about the *size* of each piece of header information in a bytecode file, but doesn't actually print out the *values* of each parameter. This patch corrects that. Also: are the sizes of the initial header fields (wordsize, byteorder, major, minor, etc...) always going to be 8-bit bytes, or is that system-dependent? In other words, can I get the wordsize for a PBC file on all platforms by reading the first 8 bits or do I have to do something more complicated? (./pdd/parrotbyte.pod doesn't make it clear to me.) Thanks! -- Matt Matthew Zimmerman Interdisciplinary Biophysics, University of Virginia http://www.people.virginia.edu/~mdz4c/ -- attachment 1 ------------------------------------------------------ url: http://rt.perl.org/rt2/attach/40661/32784/f00634/disassemble_pl.patch
Index: disassemble.pl =================================================================== RCS file: /cvs/public/parrot/disassemble.pl,v retrieving revision 1.22 diff -u -B -r1.22 disassemble.pl --- disassemble.pl 19 Aug 2002 23:14:48 -0000 1.22 +++ disassemble.pl 28 Oct 2002 20:09:22 -0000 @@ -268,15 +268,15 @@ printf "#\n"; printf "# Segments:\n"; printf "#\n"; - printf "# * Wordsize: %8d bytes\n", sizeof('byte'); - printf "# * Byteorder: %8d bytes\n", sizeof('byte'); - printf "# * Major: %8d bytes\n", sizeof('byte'); - printf "# * Minor: %8d bytes\n", sizeof('byte'); - printf "# * Flags: %8d bytes\n", sizeof('byte'); - printf "# * FloatType: %8d bytes\n", sizeof('byte'); - printf "# * Unused: %8d bytes\n", length($pf->pad); - printf "# * Magic Number: %8d bytes\n", sizeof('op'); - printf "# * Opcode Type: %8d bytes\n", sizeof('op'); + printf "# * Wordsize: %8d bytes (%d)\n", sizeof('byte'), $pf->wordsize; + printf "# * Byteorder: %8d bytes (%d)\n", sizeof('byte'), $pf->byteorder; + printf "# * Major: %8d bytes (%d)\n", sizeof('byte'), $pf->major; + printf "# * Minor: %8d bytes (%d)\n", sizeof('byte'), $pf->minor; + printf "# * Flags: %8d bytes (%d)\n", sizeof('byte'), $pf->flags; + printf "# * FloatType: %8d bytes (%d)\n", sizeof('byte'), $pf->floattype; + printf "# * Unused: %8d bytes\n", length($pf->pad); + printf "# * Magic Number: %8d bytes (0x%08x)\n", sizeof('op'), $pf->magic; + printf "# * Opcode Type: %8d bytes (0x%08x)\n", sizeof('op'), $pf->opcodetype; printf "# * Fixup Table: %8d bytes\n", $pf->fixup_table->packed_size; printf "# * Const Table: %8d bytes\n", $pf->const_table->packed_size; printf "# * Byte Code: %8d bytes (%d opcode_ts)\n", length($pf->byte_code), length($pf->byte_code) / sizeof('op');