Next: , Previous: Working With Libraries, Up: Command Line Use


5.5 Using The Step Debugger

This part of the manual describes the command line debugger. To use the Integrated Step Debugger in the Roadsend Studio IDE, see Debugging Your Project.

To begin a debugging session, call pcc with the -g argument, along with the file you wish to debug (the main file of your project).

     $ pcc -g main.php

You will be given the debugger prompt. At this point, your program is in Pause mode and has not yet been executed. Use the h command to get a list of debugging commands available:

     (pdb) h
     Most commands can be abbreviated.  When single-stepping,
     hitting enter is the same as the command 's', or 'step'.
     Commands available:
     help, quit, step, next, continue, reset, backtrace, list,
     $<var>, break <function>, clear <function>, clearall, locals.

Debugging Command Overview

help
Display the command list
quit
Quit the debugging session
run
Run the program
step
Step a single line of source code (tracing into functions)
next
Step a single line of source code (stepping over functions)
continue
Continue running the program until it finishes, a breakpoint is reached, or an error occurs
reset
Reset the program to it's initial state
backtrace
View the current function call stack
list
Show the current position in the source code
$<var>
View the current value of variable <var>
break <function>
Set a breakpoint on function <function>
clear <function>
Clear breakpoint on function <function>
clearall
Clear all breakpoints
locals
Show the current list of local variables

Pressing enter at the prompt will execute the last command issued. You can press Ctrl-Break while the program is running to pause the program at its current execution point.