You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -61,15 +61,40 @@ To debug a program from the Object Browser, right-click on the program object an
61
61
* IBM i Debug extension ([marketplace](https://marketplace.visualstudio.com/items?itemName=IBM.ibmidebug))
62
62
* installed into Visual Studio Code
63
63
* Debug Service Certificates setup
64
-
* created in `/QIBM/UserData/IBMiDebugService/certs` by default
65
-
* Debug Service certificate `debug_service.pfx`
66
-
* Debug Service client certificate `debug_service.crt`
64
+
* As of Code for IBM i 2.16.0, the Debug Service is configured inside of Navigator for IBM i. **If you're using Code for IBM i 2.16.0**, then you are required to use this method to configure and start the Debug Service. Code for IBM i 2.16.0+ supports only Debug Service 3+.
67
65
68
66
## Required PTFs
69
67
70
68
To make use of the Debug Service, you need the following PTFs:
*[IBM documentation for PTFs](https://www.ibm.com/support/pages/download-installation-and-usage-java-11-ibm-i-os)
95
+
96
+
</TabItem>
97
+
73
98
<TabItemlabel="Version 2.0.2" >
74
99
75
100
* IBM i debug client v2.0.2 requires the following host PTFs:
@@ -112,158 +137,25 @@ After you have installed the PTFs, the connection inside of Visual Studio Code w
112
137
113
138
## Configuring & starting the service
114
139
115
-
<CardGrid>
116
-
<Card>
117
-
After connecting to a system in Code for IBM i, you can hover over the connection in the bottom status bar to check the Debugger version and status. The status will be `on` if both the Debug Server and Debug Service are running.
118
-
</Card>
119
-
<Card>
120
-

121
-
</Card>
122
-
</CardGrid>
123
-
<CardGrid>
124
-
<Card>
125
-
Clicking on the Debugger status will take you to the IBM i Debugger view. This view shows the status of the Debug Server and the Debug Service. It also allows to start/stop the Debug Server and manage the Debug Service.
126
-
</Card>
127
-
<Card>
128
-

129
-
</Card>
130
-
</CardGrid>
131
-
132
-
### Start/stop the Server and Service
133
-
<CardGrid>
134
-
<Card>
135
-
The start/stop/restart actions are located on the right of each status. Running one of these actions will refresh the statuses once it's done.
136
-
</Card>
137
-
<Card>
138
-

139
-

140
-
</Card>
141
-
</CardGrid>
142
-
143
-
<Asidetype="tip">
144
-
Starting and stopping the Debug Server and Service requires the *ALLOBJ special authority.
145
-
</Aside>
146
-
147
-
### Managing the Debug Service
148
-
<CardGrid>
149
-
<Card>
150
-
If the Debug Service is not correctly configured, a warning sign will appear next to it. Expanding the Debug Service node will show the cause of the issue.
151
-
</Card>
152
-
<Card>
153
-

154
-

155
-
</Card>
156
-
</CardGrid>
157
-
158
-
<Asidetype="tip">
159
-
There only needs to be one instance of the Debug Service running and therefore the certificates should only be generated once. All developers share the Debug Service.
160
-
</Aside>
161
-
162
-
#### Generating certificates
163
-
The Debug Service needs a certificate to be able to be started. This is required because the Debug Service is basically a web server exposing web services through HTTPS, and encrypting the traffic on HTTPS requires a certificate. Supported formats for the certificate are `PKCS12` and `JKS`. If Code for IBM i is used to generate the certificate, it will use the PKCS12 format.
164
-
165
-
By default, certificates are generated in `/QIBM/UserData/IBMiDebugService/certs` (which is the recommended location). The path to the Debug Service certificate is set in `/QIBM/ProdData/IBMiDebugService/bin/DebugService.env` with `DEBUG_SERVICE_KEYSTORE_FILE`.
166
-
167
-
If the certificate is missing, the IBM i Debugger view will show this error:
168
-
169
-

170
-
171
-
Clicking on the Setup Service Certificate button will start a process that offers to either generate a certificate or import an existing one (`PKCS12` format only). Once the certificate is successfully generated or imported, two files will be found under `/QIBM/UserData/IBMiDebugService/certs`:
172
-
*`debug_service.pfx`
173
-
* the Debug Service certificate, used by the service to encrypt the communication.
174
-
*`debug_service.crt`
175
-
* the client certificate that clients must download to be able to connect to the Debug Service.
176
-
177
-
Generating the certificates will also update the Debug Service configuration file `/QIBM/ProdData/IBMiDebugService/bin/DebugService.env` to set the correct path to the required JDK and save the encrypted certificate password.
178
-
179
-
If these certificates are deleted for some reason, they can be simply regenerated from the IBM i Debugger view as described above. They are used only to encrypt the traffic between the clients and Debug Service.
180
-
181
-
It also possible to regenerate the certificates by right-clicking on the Debug Service and choosing `Regenerate service certificate`
182
-
183
-

184
-
185
-
If the client certificate cannot be found locally or does not match the remote certificate, Code for IBM i will show a warning in the IBM i Debugger view and offer an action to import the client certificate.
186
-
187
-

188
-
189
-
190
-
#### Starting the Debug Service from Code for IBM i
191
-
Starting the Debug Service can be done from the IBM i Debugger view and requires `*ALLOBJ` special authority.
192
-
193
-

194
-
195
-
Clicking on the action to start the Service will first show a prompt showing `SBMJOB` parameters. Since the shell script that starts the service will be submitted, this lets you modify the submission parameters if needed. Only the `CMD` and `JOB` parameters are imposed.
196
-
197
-

198
-
199
-
Once the prompt is validated, the SBMJOB command will be executed and Code for IBM i will monitor its execution until the Debug Service is actually started (or fails to start).
200
-
201
-
#### Starting the Debug Service outside of Code for IBM i
202
-
If the Debug Service was configured from Code for IBM i (i.e the certificate was generated from Code for IBM i), then it is possible to start the Debug Service by running the same `SBMJOB` command that Code for IBM i uses:
This will only work if Code for IBM i was used to configure the Service and generate its certificate.
210
-
</Aside>
211
-
---
212
-
213
-
## Debug Service ports
214
-
215
-
The Debug Service depends on three ports by default:
216
-
217
-
* Port 8001 (unsecure port)
218
-
* this port is not used for anything in regards to debugging, though it is required to start and stop the Debug Service
219
-
* Port 8005 (secure port)
220
-
* this port is used by all debugging clients and is required to start the Debug Service.
221
-
* Port 8008
222
-
* this port is used for Service Entry Breakpoint (*only applies to version 2 of the Debug Service*)
223
-
224
-
While you can configure the ports in the Connection Settings, it is recommended the defaults are used for consistency.
225
-
226
-
{/* These ports can be changed in `/QIBM/ProdData/IBMiDebugService/bin/DebugService.env`, both `DBGSRV_PORT` and `DBGSRV_SECURED_PORT` respectively.
227
-
228
-
If `DBGSRV_SECURED_PORT` is changed, make sure to:
229
-
230
-
* restart the Debug Service
231
-
* reconnect every Code for IBM i instances. **Every user will need to do this step.** */}
232
-
233
-
# FAQ
234
-
235
-
### What's the difference between the Debug Service and Debug Server?
236
-
237
-
<CardGrid>
238
-
239
-
<Card>
240
-
241
-
As depicted in this diagram, the client (VS Code, IBM i Debug) connects to the Debug Service, which talks to the Debug Server.
242
-
243
-
* The Debug Service is started up inside of Visual Studio Code as documented above. In the future it will also be possible to start it from Navigator for i.
244
-
* The Debug Server is started up with `STRDBGSVR`. You may get an error message in VS Code if you attempt to debug when the Debug Server is not running.
245
-
246
-
</Card><Card>
247
-
248
-

249
-
250
-
</Card></CardGrid>
251
-
252
-
### I can't see the variables when debugging CL
253
-
254
-
<CardGrid>
255
-
256
-
<Card>
257
-
258
-
This is a limitation for CL. The local variables will not show up in the Variables view for CL. You can add a local variable to the Watch view to inspect its value. The CL limitation also exists in RDi.
0 commit comments