Skip to content

Commit f3187a4

Browse files
mkwan01chrjorgensen
authored andcommitted
Update debug overview docs
1. Added TOC 2. Added common issue for self-signed cert 3. Updated debug docs
1 parent 969748a commit f3187a4

File tree

1 file changed

+72
-27
lines changed

1 file changed

+72
-27
lines changed

src/content/docs/developing/debug/overview.mdx

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ Debugging IBM i programs is now available inside of Visual Studio Code.
99

1010
<Aside type="note">You must have `bash` set as your default shell. [See Bash Shell Required](/docs/tips/bash/) for more info. </Aside>
1111

12+
### Table of Contents
13+
14+
- [Supported Features](#supported-features)
15+
- [Limitations](#limitations)
16+
- [Starting to debug](#starting-to-debug)
17+
- [Managing Service Entry Points](#managing-service-entry-points)
18+
- [Settings](#settings)
19+
- [Common issues](#common-issues)
20+
21+
* [STRDBGSVR requirement](#strdbgsvr-requirement)
22+
23+
* [Self-signed certificate issue](#self-signed-certificate-issue)
24+
25+
* [IP not in cert list](#ip-not-in-cert-list)
26+
27+
- [Frequently Asked Questions](#frequently-asked-questions)
28+
1229
### Supported Features
1330

1431
Supported language types:
@@ -32,20 +49,21 @@ Supported batch debug features:
3249
- Debugging with the **Update Production Files** option
3350

3451

35-
Supported service entry point debug features:
52+
Supported Service Entry Point (SEP) debug features:
3653

3754
- Setting a service entry point on a program, service program, module or procedure
3855
- Enabling, disabling and removing a service entry point
3956
- Setting a condition on a service entry point
4057
- Modifying the user profile of a service entry point
4158
- Logging service entry point activities in an output channel
42-
- Saving service entry points across multiple IDE sessions
59+
- Saving service entry points across multiple client sessions
4360
- Refreshing service entry points after programs are recompiled
4461

4562
### Limitations
4663

4764
The following features are not supported in the current release:
4865
- Code coverage
66+
- Additional source lookup path. If the debug source is moved to a different location after the program is compiled, there is no way to instruct the debugger to lookup the source in a different location.
4967

5068

5169

@@ -55,11 +73,11 @@ The following features are not supported in the current release:
5573

5674
<Card>
5775

58-
After [configuring](../configure/) the Debug Service, launching a debug session is a click of a button away. When you have active source open, a new Debug button will appear in the navigation bar. Breakpoints can be set prior to debugging, or during the debugging session.
76+
After [configuring](../configure/) the Debug Service, launching a debug session is a click of a button away. To start a batch debug session, right-click on a program object from the Object Browser and select the **Start Debugging > Debug as Batch** action.
5977

6078
</Card><Card>
6179

62-
![](./debug1.png)
80+
![](./debug3.png)
6381

6482
</Card></CardGrid>
6583

@@ -69,44 +87,47 @@ After [configuring](../configure/) the Debug Service, launching a debug session
6987

7088
<Card>
7189

72-
Clicking the Debug button will display an input box which will allow the user to customise the command which starts the debug job. This allows the developer to pass in parameters, or call another program to launch the debug session.
90+
Selecting the Debug action will display an input box which allows the user to customise the command that starts the debug job. This allows the developer to pass in parameters, or call another program to launch the debug session.
7391

7492
After the debug session has started, every session will break on entry. You can read more about the debugging UI on the [Debug actions section on the Visual Studio Code documentation](https://code.visualstudio.com/docs/editor/debugging#_debug-actions)<Icon name="external" color="cyan" class="icon-inline" />.
7593

7694
</Card><Card>
7795

78-
![](./debug2.png)
79-
80-
</Card></CardGrid>
81-
96+
![](./debug1.png)
8297
---
8398

8499
<CardGrid>
85100

86101
<Card>
87102

88-
To debug a program from the Object Browser, right-click on the program object and select the **Debug Program** option. Like before this will also display an input box to modify the command which starts the debug job.
103+
The debug source will be opened in the editor area. A floating Debug panel which contains the common debug actions (e.g. continue, step over, stop, etc) will appear at the top. Breakpoints can be set prior to debugging, or during the debugging session. You can see the value of a local variable in the **Variables** view. You can also hover over a variable in the debug editor to show its value. A monitored expression can be added to the **Watch** view.
89104

90105
</Card><Card>
91106

92-
![](./debug3.png)
107+
![](./debug2.png)
93108

94109
</Card></CardGrid>
95110

111+
96112
### Managing Service Entry Points
97113
<CardGrid>
98114

99115
<Card>
100-
Service Entry Point (SEP) can be set using the **Set Service Entry Point** popup menu action from the **Project Explorer** and **Object Browser**. SEP can also be set using the **Create Service Entry Point** toolbar action from the **Service Entry Points** view in the **Run and Debug** side bar. The action will prompt for the Service Entry Point location. The Service Entry Point location can be in a short format which includes the library name and program name (e.g. `MY_LIB/MY_PGM`), or in a long format which also includes the program type, module name and procedure name (e.g. `MY_LIB/MY_PGM *PGM/MY_MOD/MY_PROC`). The supported program types are `*PGM` and `*SRVPGM`.
116+
117+
Service Entry Point (SEP) can be set using the **Set Service Entry Point** popup menu action from the **Object Browser**. SEP can also be set using the **Create Service Entry Point** toolbar action from the **Service Entry Points** view in the **Run and Debug** side bar. The action will prompt for the service entry point location. The service entry point location can be in a short format which includes the library name and program name (e.g. `MY_LIB/MY_PGM`), or in a long format which also includes the program type, module name and procedure name (e.g. `MY_LIB/MY_PGM *PGM/MY_MOD/MY_PROC`). The supported program types are `*PGM` and `*SRVPGM`.
118+
101119
</Card><Card>
120+
102121
![Debug Service Entry Point](debugSEPView.png)
122+
103123
</Card></CardGrid>
124+
104125
- A checkbox at a SEP indicates that the SEP is enabled. You can clear the checkbox to disable the SEP.
105126
- You can use the **Edit Condition…** inline action to set a condition on a SEP. The condition is an expression that is evaluated to a boolean value at the given context.
106127
- You can use the **Remove Service Entry Point** inline action to remove the selected SEP, or the **Remove All Service Entry Points** toolbar action to remove all SEPs from the view.
107128
- You can use the **Modify User Profile...** context menu action to modify the owner of the job where the service entry point is hit. The default owner user profile is the currently logged on user.
108-
- Service Entry Point related messages appear in the **IBM i Service Entry Points** output channel.
109-
- Service Entry Points are saved in the debug service job on the host. When a new debug client connects to a running debug service, it will restore the saved service entry points for the current user.
129+
- Service entry point related messages appear in the **IBM i Service Entry Points** output channel.
130+
- Service entry points are saved in the debug service job on the host. When a new debug client connects to a running debug service, it will restore the saved service entry points for the current user.
110131
- If a program or service program is recompiled, you can use the **Refresh** action from the context menu to refresh the selected SEP, or use the **Refresh All Service Entry Points** toolbar action to refresh all SEPs in the **Service Entry Points** view.
111132

112133
### Settings
@@ -121,26 +142,43 @@ The following settings are available from the **Debugger** tab of the **IBM i: C
121142

122143
- **Debug trace**: Enable tracing for **Debug Adapter Protocol**.
123144

124-
The debug port and SEP debug port are specified in the DebugService.env file on the host.
145+
The debug port and SEP debug port are specified in the DebugService.env file on the host.
125146

126147

127148
## Common issues
128149

129-
### Debug hangs
150+
### `STRDBGSVR` requirement
130151

131-
There is a [known issue](https://github.com/codefori/vscode-ibmi/issues/1059)<Icon name="github" class="icon-inline" /> that when you start debugging from VS Code, the debugger hangs and doesn't launch.
152+
The Debug Service that is started depends on the traditional Debug Server.
132153

133-
The fix is to check if you've got a prior debug job stuck in `MSGW`. You can do this with `WRKACTJOB`, or a similar command like `WRKSBSJOB QBATCH`.
154+
![](./error_2.png)
134155

135-
**Users should no longer face this issue** as we now submit debug jobs to `QSYSWRK` with `QSYSNOMAX`.
156+
If you receive this message, do as it says. Simply start the Debug Server with `STRDBGSVR` from a green screen.
136157

137-
### `STRDBGSVR` requirement
158+
### Self-signed certificate issue
138159

139-
The Debug Service that is started depends on the traditional Debug Server.
160+
If you are getting a self-signed certificate error or a certificate signature failure when starting a batch debug session or setting a SEP, please use the following steps for diagnostics:
140161

141-
![](./error_2.png)
162+
- Find out the certificate location on the client machine
163+
164+
* Turn on **Debug trace** (see details in FAQ entry "Can I get trace information for the debug service?" )
165+
166+
* Inspect the "Connection settings" line in the Debug Console when starting a batch debug session or setting a SEP.
167+
168+
* The "capath" field under "Connection Settings" contains the fully qualified path of the client certificate.
169+
170+
* If the "capath" field is undefined, update your Code for IBM i extension to a newer level; otherwise continue with the next step.
171+
172+
- Inspect the TrustStore and debug_service.crt files on the host
173+
174+
* When you use Navigator to generate the debug service trust store, you will get the following two files on the host:
175+
176+
/QIBM/UserData/IBMIDEBUGSERVICE/TrustStore
177+
178+
/QIBM/UserData/IBMIDEBUGSERVICE/certs/debug_service.crt
179+
180+
* Verify that the debug_service.crt file has the same contents as the certificate on the client machine, which is indicated by the "capath" value in the previous step. Both .crt files are text files. You can open a .crt file in a text editor to inspect its contents. If the certificate on the client machine is different from the debug_service.crt file on the host, you can remove the certificate on the client machine. Code for IBM i will download the client certificate again upon the next connection to the host.
142181

143-
If you receive this message, do as it says. Simply start the Debug Server with `STRDBGSVR` from a greenscreen.
144182

145183
### IP not in cert list
146184

@@ -232,9 +270,6 @@ You need to restart the debug service after changing a port number.
232270
**Question**: I am getting a message “EQAVS1007E myHost on port 8005 could not be connected” when I start a debug session.
233271
**Answer**: IBM i Debug Service is not started yet. You need to start debug service before starting a debug session.
234272

235-
**Question**: I am seeing a message “IBM i Debug Server has not been started yet. Please run the STRDBGSVR command from a user profile with enough authority.”.
236-
**Answer**: You need to run STRDBGSVR from a terminal session to start Debug Server (QB5ROUTER) first. IBM i Debug Service requires a running Debug Server.
237-
238273
**Question**: I am seeing a message “Your debug server version is not up to date. IBM i Debug Service requires a host PTF update.”.
239274
**Answer**: IBM i Debug Service depends on the following debug server PTFs for strong password encryption. You need to load one of the PTFs below or a superseded PTF.
240275
- V7R3 PTF SI82198
@@ -244,6 +279,15 @@ You need to restart the debug service after changing a port number.
244279
**Question**: I do not have the QDBGSRV user profile after installing the debug service on IBM i 7.5.
245280
**Answer**: The debug service PTFs on 7.3/7.4/7.5 are update installs. An update install depends on a previous installation of the debug service PTF. The update install does not create the QDBGSRV user profile. If you have not installed debug service before, please install the v1 debug service PTF first, and then update the debug service PTF to the next levels.
246281

282+
**Question**: I am getting the error that the startDebugServiceNavigator.log file cannot be created when starting debug service.
283+
**Answer**: You can use the "DSPAUT OBJ('ifs_path')" command to verify the authority of the following IFS folders:
284+
285+
/QIBM
286+
/QIBM/UserData
287+
/QIBM/UserData/IBMiDebugService
288+
289+
You should have *PUBLIC *RX authority on /QIBM and /QIBM/UserData, and *PUBLIC *RWX authority on /QIBM/UserData/IBMiDebugService.
290+
247291
**Question**: How can I set a Service Entry Point on a procedure?
248292
**Answer**: Select the **Set Service Entry Point** action on the target program or service program. In the service entry point location prompt, change the last part of the entry field value “/*ALL/*ALL” to specify the module name and procedure name.
249293

@@ -267,6 +311,7 @@ You need to restart the debug service and the debug router (QB5ROUTER) after the
267311
**Question**: What diagnostic information should I collect to report a debug problem?
268312
**Answer**: Please collect the following diagnostic information:
269313
- The content of the DebugService_log.txt file under /QIBM/UserData/IBMIDEBUGSERVICE.
270-
- The content of the debug service workspace log in /QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/USER/.metadata/.log, where USER is the user profile that starts the debug service.
314+
- The content of the startDebugServiceNavigator.log file under /QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace.
315+
- The content of the debug service workspace log in /QIBM/UserData/IBMIDEBUGSERVICE/startDebugService_workspace/QDBGSRV/.metadata/.log. Please note that some IFS browsing tools hide this file, as the name starts with a dot.
271316
- Check the **Debug trace** option from the Debugger tab of the Connection Settings page. Save the trace text in the **Debug Console** to a file. Edit the file to remove the user password that appears under the trace statement for the launch request.
272317

0 commit comments

Comments
 (0)