Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (77 sloc) 1.79 KB
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
=head1 NAME
disassemble - Parrot disassembler
disassemble file.pbc
This uses the C<Parrot_disassemble()> function from F<src/embed.c>,
which in turn uses the C<PDB_disassemble()> function from
#include <parrot/parrot.h>
#include "parrot/embed.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
static void do_dis(Parrot_Interp);
int main(int argc, char *argv[])
The run-loop. Starts up an interpreter, loads the bytecode from the
command-line and disassembles it.
main(int argc, char *argv[])
Parrot_Interp interpreter;
char *filename, *disassemble;
Parrot_PackFile pf;
interpreter = Parrot_new(NULL);
if (!interpreter) {
return 1;
interpreter->lo_var_ptr = &interpreter;
if (argc != 2) {
fprintf(stderr, "Usage: disassemble programfile \n");
filename = argv[1];
pf = Parrot_readbc(interpreter, filename);
if (!pf) {
return 1;
Parrot_loadbc(interpreter, pf);
return 0;
static void do_dis(Parrot_Interp interpreter)
Do the disassembling.
static void
do_dis(Parrot_Interp interpreter)
=head1 SEE ALSO
F<src/embed.c> and F<src/debug.c>.
=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).
* Local variables:
* c-indentation-style: bsd
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
* vim: expandtab shiftwidth=4:
Jump to Line
Something went wrong with that request. Please try again.