GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
B::Disassembler(3) User Contributed Perl Documentation B::Disassembler(3)

B::Disassembler - Disassemble Perl bytecode

        use Disassembler qw(print_insn);
        my $fh = new FileHandle "<$ARGV[0]";
        disassemble_fh($fh, \&print_insn);

disassemble_fh takes an filehandle with bytecode and a printer function. The printer function gets three arguments: insn, arg (optional) and the comment.

See lib/B/Disassembler.pm and scripts/disassemble.

disassemble_fh takes an filehandle with bytecode and a printer coderef.

Two default printer functions are provided:

  print_insn print_insn_bare

Callback function for disassemble_fh, which gets three arguments from the disassembler. insn (a string), arg (a string or number or undef) and the comment (an optional string).

This supports the new behaviour in scripts/disassemble. It prints each insn and optional argument with some additional comments, which looks similar to B::Assembler with option -S (commented source).

This is the same as the old behaviour of scripts/disassemble. It prints each insn and optional argument without any comments. Line per line.

Returns the .plc header as array of

  ( magic, archname, blversion, ivsize, ptrsize,
    byteorder, longsize, archflag, perlversion )

in ARRAY context, or in SCALAR context the array from above as named hash.

magic is always "PLBC". "PLJC" is reserved for JIT'ted code also loaded via ByteLoader.

archname is the archname string and is in the ByteLoader up to 0.06 checked strictly. Starting with ByteLoader 0.06_05 platform compatibility is implemented by checking the $archflag, and doing byteorder swapping for same length longsize, and adjusting the ivsize and ptrsize.

blversion is the ByteLoader version from the header as string. Up to ByteLoader 0.06 this version must have matched exactly, since 0.07 earlier ByteLoader versions are also accepted in the ByteLoader.

ivsize matches $Config{ivsize} of the assembling perl. A number, 4 or 8 only supported.

ptrsize matches $Config{ptrsize} of the assembling perl. A number, 4 or 8 only supported.

longsize is $Config{longsize} of the assembling perl. A number, 4 or 8. Only since blversion 0.06_03.

byteorder is a string of "0x12345678" on big-endian or "0x78563412" (?) on little-endian machines. The beginning "0x" is stripped for compatibility with intermediate ByteLoader versions, i.e. 5.6.1 to 5.8.0, Added with blversion 0.06_03, and also with blversion 0.04. See BcVersions

archflag is a bitmask of opcode platform-dependencies. Currently used: bit 1 for USE_ITHREADS bit 2 for MULTIPLICITY Added with blversion 0.06_05.

perlversion $] of the perl which produced this bytecode as string. Added with blversion 0.06_06.

Malcolm Beattie "MICB at cpan.org" (retired), Reini Urban "perl-compiler@googlegroups.com" since 2008.
2018-11-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.