Stepping and Running
The debugger operates by stepping through your program line by line. The following commands let you control what you skip over and where you stop.
s [EXPR]The
sdebugger command single-steps through the program. That is, the debugger will execute the next line of your program until another statement is reached, descending into subroutine calls as necessary. If the next line to execute involves a function call, then the debugger stops at the first line inside that function. If anEXPRis supplied that includes function calls, these will be single-stepped, too.n [EXPR]The
ncommand executes subroutine calls, without stepping through them, until the beginning of the next statement at this same level (or higher). If anEXPRis supplied that includes function calls, those functions will be executed with stops before each statement.<ENTER>If you just hit enter at the debugger prompt, the previous
norscommand is repeated.
.The
.command returns the internal debugger pointer to the line last executed and prints out that line.rThis command continues until the currently executing subroutine returns. It displays the return value if the
PrintRetoption is set, which it is by default.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access