Debugging your Web target
The basic process for debugging involves setting breakpoints
and stepping through your code. This summary procedure shows the
shortcut keys for debugging actions.
For information on configuring your Web target for debugging,
see “Enabling debugging for your
deployment configuration”.
For information on setting breakpoints, see “Setting breakpoints”.
To debug your Web target:
-
Set one or more breakpoints (F9)
in a script you want to debug.Open any page in the target and set breakpoints in the script
editor. -
Select and debug your Web target from the PowerBuilder Run
menu or the target popup menu.You can also start a debugging session with a debug icon in
the toolbar.The start page you specified on the Run/Debug page
of the Target Properties dialog box displays in the browser. -
In the browser, take actions so that you arrive
at a breakpoint. Focus returns to the editor where you can examine
variables, the call stack, and the script.You can navigate to other pages. Do not edit pages while at
a breakpoint. -
Step through code (F8 and F10),
set more breakpoints (F9), and examine variables. -
Continue executing the script (F5).
Focus returns to the browser. -
Repeat from step 3 until you want to end debugging
(Shift+F5).
Stepping through code
When
you arrive at a breakpoint, you can step to subsequent lines of
code, one by one. Use one of the Step commands, either with a function
key or a button on the Debug toolbar:
To | When | Select this command |
---|---|---|
Step to the next line |
The current line is not a function |
Either Step In (F8) or Step Over (F10) |
Step line by line through a function |
The current line is a function |
Step In (F8) |
Execute a function and step directly to the next line in the current script |
The current line is a function | Step Over (F10) |
To stop single-stepping and continue to the next
breakpoint:
-
Select Continue from the Debug menu.
or
Press F5.
Focus returns to the browser, and you can take actions on
the page that lead you to the next breakpoint.
Keystroke reference for debugging
The following table displays the shortcut keys for debugging
actions:
Action | Keystroke |
---|---|
Set or remove a breakpoint for the line of code containing the cursor |
F9 |
Continue debugging after stopping at a breakpoint |
F5 |
Step to the next line of code in the current script, executing and stepping over any functions |
F10 |
Step to the next line of code to be executed, including stepping into a function |
F8 |
End debugging and close debugging windows | Shift+F5 |