
Setting Breakpoints and Watchpoints
Use
You use this procedure to set breakpoints and watchpoints in HTMLBusiness code.
You can:
Procedure
Setting and Managing Breakpoints
You set breakpoints in HTMLBusiness code directly. To do this:
A red disk (
) indicating the breakpoint appears at the beginning of the line.
When you have set breakpoints, there are two methods you can use to manage them:
Managing Breakpoints Directly in the Code
The following table lists and describes the functions for managing breakpoints directly:
|
Function |
Procedure |
|
Disable a breakpoint temporarily |
The red disk (enabled breakpoint) becomes a red circle (disabled breakpoint). |
|
Enable a disabled breakpoint: |
The red circle (disabled breakpoint) becomes a red disk (enabled breakpoint). |
|
Delete a breakpoint |
The red disk indicating the breakpoint disappears from the beginning of the line. |
Managing Breakpoints in the Breakpoints Dialog
You can also manage breakpoints in the SAP@Web Studio Breakpoints dialog.
The following table lists and describes the functions for managing breakpoints with the SAP@Web Studio Breakpoints dialog:
|
Function |
Procedure |
|
Disable a breakpoint temporarily |
|
|
Enable a disabled breakpoint |
|
|
Delete a single breakpoint |
|
|
Delete all breakpoints |
|
|
Specify the number of times you want the debugger to skip a breakpoint before stopping |
|
Setting and Managing Watchpoints
To monitor the values of variables and array elements, you can set and manage watchpoints in the SAP@Web Studio Breakpoints dialog.
To set watchpoints:
When the value of this variable or array element is modified during program execution, an implicit breakpoint is set. This interrupts the program and passes control to the debugger.
If you enter
If you set a watchpoint for
xyz, attempts to change the values of xyz[1], xyz[2], xyz[3] or any other element in the array all cause the watchpoint to be hit.If you set a watchpoint for
a.b.c, this detects any changes made to a[1].b.c, a[2].b.c and so on. If you only want to monitor the element a[1].b.c (and no other a[*].b.c element), you must specify a[1].b.c explicitly as the watchpoint name.The context acts as an additional filter, which specifies that a watchpoint is active only within the specified function or file. This means that any changes made to the variable in any other function or file are ignored.
To edit watchpoints you have set:
Setting Implicit Breakpoints
You can set implicit breakpoints to be hit when the HTMLBusiness interpreter starts or finishes executing an HTML template. To do this:
Hardcoding Breakpoints
Sometimes, it is useful to set breakpoints by embedding them in the code. To hardcode breakpoints in HTML templates, insert the HTMLBusiness function
debugger().When executing this call, the HTMLBusiness interpreter stops at the breakpoint. You can then connect to the server and
start a debugging session.