Debugging LN sessions
Debugging LN sessions through LN UI
LN Studio can attach to a running LN UI and can debug sessions started in LN UI. Unlike when you debug sessions through BW or Web UI, the sessions are started from LN UI and not from LN Studio.
- To debug sessions, a debug Connection Point is required.
- In a multi-tenant environment you cannot debug with LN Studio. You can use the Debug Workbench, see the Debug and Profile 4GL (ttadv1123m000) session.
- In a multi-tenant environment you cannot debug BFlows with LN Studio. You can run BFlows in the LN UI to see the result.
To debug a session:
- Connect to
LN Studio from LN UI.
- Start LN UI and select . The Debug and Profile 4GL (ttadv1123m000) session starts.
- Select your activity and select the Debug Mode check box.
- If LN runs in an
on-premises environment, select the debug UI: In the Debug UI field, select
LN Studio or Debug
Workbench.
In a multi-tenant environment, the debug workbench is selected automatically.
- Click to save the settings.
- Set breakpoints.
See Using breakpoints.
- Debug a session.
Start a session in LN UI. The session is started in debug mode.
Step 1 is only required at the beginning, before you start the first session. Subsequent sessions automatically start in debug mode using the established connection.
Debugging LN sessions through BW or Web UI
From the Eclipse workbench you can run LN sessions in debug mode. In debug mode, you can suspend and resume the execution, inspect variables, and evaluate expressions.
For each session that you want to run in debug mode, you must generate, or manually create, a run configuration. In this configuration you can specify execution parameters.
To run a session in debug mode for the first time, use one of these procedures:
- Manually create a run configuration and then run the session in debug mode
- Automatically generate a run configuration and then run the session in debug mode
- To debug sessions, a debug Connection Point is required.
- In a multi-tenant environment you cannot debug with LN Studio. You can use the Debug Workbench, see the Debug and Profile 4GL (ttadv1123m000) session.
- In a multi-tenant environment you cannot debug BFlows with LN Studio. You can run BFlows in the LN UI to see the result.
Manually create a run configuration and then run the session in debug mode
- Set breakpoints
Edit the involved script or library, and set breakpoints before you start the debug process. For example, set breakpoints in the session's UI script, or in a library called by the session.
You can set these types of breakpoints:
- Line breakpoints
- Method breakpoints
- Watchpoints
For details, see Using breakpoints.
Note:- Before you can set breakpoints in a UI script, you must add the corresponding session to your activity.
- Before you can set breakpoints in a library, you must add the library to your activity.
- Add a new configuration
- On the Debug - Create, manage, and run configurations dialog is displayed. menu, select , or click the command on the button pull-down menu. The
- In the left pane, right-click and select . A new configuration is added in the left pane.
- In the Sessions tab, select an activity from the list.
- Select the session
that calls the script or library you want to debug. The name of the
configuration is automatically filled with the name of the selected session.
To select a session, perform one of these actions:
- Select a session linked to your activity from the list.
- Click Browse session dialog starts. In this dialog you can select a session on the LN server. to select a session that is not linked to your activity. The
- Specify a session code.
Note: You can only select sessions that belong to the packages displayed in the Component Explorer - Specify the launch
mode for the session.
See Configurations.
- Select the company in which you want to start the session.
-
Optionally: Specify additional execution parameters, such as profiling parameters and environment variables, in the other tabs. See the dialog help.
- Click to save the settings.
Note: Debug configurations can also be used to start sessions in run mode.See Running LN sessions.
- Debug the session
Click Debug dialog. The session is started in debug mode.
in the
Automatically generate a run configuration and then run the session in debug mode
Complete these steps:
- Set breakpoints.
See "Manually create a run configuration and then run the session in debug mode".
- In the nullActivity
Explorer, right-click the session and select . A run configuration is generated automatically. The session
starts in debug mode.
See "Manually create a run configuration and then run the session in debug mode".
You can modify a generated run configuration in various ways. For example:
- In the Activity Explorer, right-click the session and select . Then select .
- On the menu, select .
- Click the command on the button pull-down menu.
The Run - Create, manage, and run configurations dialog is displayed.
See Configurations.
Restarting a session in debug mode
The workbench keeps a history of all configurations launched.
To restart the most recent launch, click the
button in the toolbar.You can restart any previous launch in various ways. For example:
- Select a previous launch on the button pull-down menu.
- On the menu, select and select a previous launch from the sub-menu.
- On the Debug - Create, manage, and run configurations dialog is displayed. Select the desired configuration and click . menu, select , or click the command on the button pull-down menu. The
- In the Activity Explorer, right-click the session and select .
Debugging a session in the Debug perspective
Use the views and commands in the Debug perspective to examine the execution and debug the session:
- Use the Debug view and the menu to control the execution of the session. For example, you can terminate or suspend executing sessions, resume the execution, and step through the execution. For details, see this documentation:
- Use the
Variables view to inspect the values of the
variables of a
stack frame.
See Inspecting values.
- Use the Expressions view to evaluate expressions in the context of a stack frame.
- Use the Script Editor and the Outline view to toggle breakpoints.
- Use the
Breakpoints view to enable, disable, or remove
breakpoints.
See Using breakpoints.
- The Variables view displays all variables that are in scope. If a session contains a lot of variables, the performance can be affected. To boost the performance, display local variables only, or close the Variables view and use the Expressions view.
- Try to keep the list of expressions in the Expressions view limited. This is, because all expressions are evaluated each time a session suspends, which can affect the performance adversely.
- The session in the previous example is started through Web UI. To start sessions through Web UI you must start Web UI first.