2 Copyright (C) 2001-2003, The Perl Foundation.
7 disassemble - Parrot disassembler
15 This uses the C<Parrot_disassemble()> function from F<src/embed.c>,
16 which in turn uses the C<PDB_disassemble()> function from
23 #include <parrot/parrot.h>
24 #include "parrot/embed.h"
29 static void do_dis(Parrot_Interp
);
33 int main(int argc, char *argv[])
35 The run-loop. Starts up an interpreter, loads the bytecode from the
36 command-line and disassembles it.
41 main(int argc
, char *argv
[])
43 Parrot_Interp interpreter
;
47 interpreter
= Parrot_new(NULL
);
53 interpreter
->lo_var_ptr
= &interpreter
;
56 fprintf(stderr
, "Usage: disassemble programfile \n");
57 Parrot_exit(interpreter
, 1);
62 pf
= Parrot_readbc(interpreter
, filename
);
68 Parrot_loadbc(interpreter
, pf
);
72 Parrot_exit(interpreter
, 0);
79 static void do_dis(Parrot_Interp interpreter)
86 do_dis(Parrot_Interp interpreter
)
88 Parrot_disassemble(interpreter
);
95 F<src/embed.c> and F<src/debug.c>.
99 Initial version by Daniel Grunblatt on 2002.5.26.
101 Florian Ragwitz: Moved POD documentation that's not necessary to know how to
102 actually run the disassembler to normal C comments (Wed, 16 Nov 2005).
111 * c-file-style: "parrot"
113 * vim: expandtab shiftwidth=4: