/* Copyright (C) 2001-2003, The Perl Foundation. $Id: disassemble.c 22712 2007-11-05 04:11:46Z paultcochrane $ =head1 NAME disassemble - Parrot disassembler =head1 SYNOPSIS disassemble file.pbc =head1 DESCRIPTION This uses the C function from F, which in turn uses the C function from F. =head2 Functions =over 4 =cut */ #include #include "parrot/embed.h" #include #include #include static void do_dis(Parrot_Interp); /* =item C The run-loop. Starts up an interpreter, loads the bytecode from the command-line and disassembles it. =cut */ int main(int argc, char *argv[]) { Parrot_Interp interp; char *filename; Parrot_PackFile pf; interp = Parrot_new(NULL); if (!interp) { return 1; } interp->lo_var_ptr = &interp; if (argc != 2) { fprintf(stderr, "Usage: disassemble programfile \n"); Parrot_exit(interp, 1); } filename = argv[1]; pf = Parrot_readbc(interp, filename); if (!pf) { return 1; } Parrot_loadbc(interp, pf); do_dis(interp); Parrot_exit(interp, 0); } /* =item C Do the disassembling. =cut */ static void do_dis(Parrot_Interp interp) { Parrot_disassemble(interp); } /* =back =head1 SEE ALSO F and F. =head1 HISTORY Initial version by Daniel Grunblatt on 2002.5.26. Florian Ragwitz: Moved POD documentation that's not necessary to know how to actually run the disassembler to normal C comments (Wed, 16 Nov 2005). =cut */ /* * Local variables: * c-file-style: "parrot" * End: * vim: expandtab shiftwidth=4: */