parrotcode: The Parrot debugger | |
Contents | C |
pdb - The Parrot debugger
pdb programfile
disassemble
load
list
or l
run
or r
break
or b
watch
or w
delete
or d
disable
enable
continue
or c
next
or n
eval
or e
trace
or t
print
or p
stack
or s
info
quit
or q
help
or h
You can also debug Parrot code by using the debug_init
, debug_load
and debug_break
ops in ops/debug.ops.
int main(int argc, char *argv[])
static void PDB_add_exception_handler(Parrot_Interp)
if (setjmp(exp.destination)) {
char *msg = string_to_cstring(interp, interp->exceptions->msg);
fprintf(stderr, "Caught exception: %s\n", msg);
string_cstring_free(msg);
return;
}
push_new_c_exception_handler(interp, &exp);
Parrot_runcode(interp, argc - 1, argv + 1);
}
static void PDB_printwelcome(void)
src/debug.c, include/parrot/debug.h.
The debugger now uses it's own interpreter. User code is run in Interp* debugee. We have:
debug_interp->pdb->debugee->debugger
^ |
| v
+------------- := -----------+
Debug commands are mostly run inside the debugger
. User code runs of course in the debugee
.
|