src/pdb.c - The Parrot debugger
% make pdb
% ./pdb programfile
disassemble
- Disassemble the bytecode.
- Use this if you have a PBC file but not the PASM.
load
- Load a source code file.
list
or l
- List the source code file.
run
or r
- Run the program.
break
or b
- Add a breakpoint.
watch
or w
- Add a watchpoint.
delete
or d
- Delete a breakpoint.
disable
- Disable a breakpoint.
enable
- Reenable a disabled breakpoint.
continue
or c
- Continue the program execution.
next
or n
- Run the next instruction
eval
or e
- Run an instruction.
trace
or t
- Trace the next instruction.
print
or p
- Print the interpreter registers.
stack
or s
- Examine the stack.
info
- Print interpreter information.
quit
or q
- Exit the debugger.
help
or h
- Print the help.
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()
.
void PDB_printwelcome()
- Prints out the welcome string.
src/debug.c, include/parrot/debug.h.
Initial version by Daniel Grunblatt on 2002.5.19.
- 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.