NAME
parrot_debugger - The Parrot debugger
SYNOPSIS
parrot_debugger programfile
DESCRIPTION
Commands
disassemble
Disassemble the bytecode.Use this if you have a PBC file but not the PASM.
load
Load a source code file.
list
orl
List the source code file.
run
orr
Run the program.
break
orb
Add a breakpoint.
watch
orw
Add a watchpoint.
delete
ord
Delete a breakpoint.
disable
Disable a breakpoint.
enable
Reenable a disabled breakpoint.
continue
orc
Continue the program execution.
next
orn
Run the next instruction
eval
ore
Run an instruction.
trace
ort
Trace the next instruction.
print
orp
Print the interpreter registers.
stack
ors
Examine the stack.
info
Print interpreter information.
quit
orq
Exit the debugger.
help
orh
Print the help.
Debug Ops
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[])
Reads the PASM or PBC file from argv[1], loads it, and then calls Parrot_debug().
static void PDB_add_exception_handler(Parrot_Interp)
Adds a default exception handler to PDB.
static void PDB_printwelcome(void)
Prints out the welcome string.
SEE ALSO
src/debug.c, include/parrot/debug.h.
HISTORY
- Initial version by Daniel Grunblatt on 2002.5.19.
- Start of rewrite - leo 2005.02.16
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
.
TODO
- Check the user input for bad commands, it's quite easy to make it bang now, try listing the source before loading or disassembling it.
- Print the interpreter info.
- Make the user interface better (add comands history/completion).
- Some other things I don't remember now because it's late.