Skip to content

Commit 865e778

Browse files
committed
Merge branch 'main' of github.com:halcyon-tech/docs
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
2 parents 1d9fd7a + ddacf3c commit 865e778

File tree

7 files changed

+50
-155
lines changed

7 files changed

+50
-155
lines changed
60.3 KB
Loading
118 KB
Loading
51.7 KB
Loading
77.9 KB
Loading
77 KB
Loading

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

Lines changed: 47 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,40 @@ To debug a program from the Object Browser, right-click on the program object an
6161
* IBM i Debug extension ([marketplace](https://marketplace.visualstudio.com/items?itemName=IBM.ibmidebug))
6262
* installed into Visual Studio Code
6363
* 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+.
6765

6866
## Required PTFs
6967

7068
To make use of the Debug Service, you need the following PTFs:
7169

7270
<Tabs>
71+
<TabItem label="Version 3" >
72+
73+
* IBM i 7.6
74+
* Debug Service PTF SJ04601
75+
* Navigator for i PTF SJ04647
76+
* Java 17 LPP 5770JV1 Option 20 (not Java from Yum)
77+
* IBM i 7.5
78+
* Debug Service PTF SJ05012
79+
* Navigator for i PTF SJ03406
80+
* Java 11 is required via LPP 5770JV1 Option 19 (not Java from Yum)
81+
* IBM i 7.4
82+
* Debug Service PTF SJ05013
83+
* Navigator for i PTF SJ03404
84+
* Java 11 is required via LPP 5770JV1 Option 19 (not Java from Yum)
85+
* IBM i 7.3
86+
* Debug Service PTF SJ05014
87+
* Navigator for i PTF SJ03402
88+
* Java 11 is required via LPP 5770JV1 Option 19 (not Java from Yum)
89+
90+
**All OS versions require** 5770WDS option 60 (Workstation Tools - Base).
91+
92+
* Java 11 information:
93+
* `/QOpenSys/QIBM/ProdData/JavaVM/jdk11/64bit`
94+
* [IBM documentation for PTFs](https://www.ibm.com/support/pages/download-installation-and-usage-java-11-ibm-i-os)
95+
96+
</TabItem>
97+
7398
<TabItem label="Version 2.0.2" >
7499

75100
* 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
112137

113138
## Configuring & starting the service
114139

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-
![](./debug6.png)
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-
![](./debug7.png)
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-
![](./debug8.png)
139-
![](./debug9.png)
140-
</Card>
141-
</CardGrid>
142-
143-
<Aside type="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-
![](./debug10.png)
154-
![](./debug11.png)
155-
</Card>
156-
</CardGrid>
157-
158-
<Aside type="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-
![](./debug10.png)
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-
![](./debug14.png)
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-
![](./debug11.png)
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-
![](./debug12.png)
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-
![](./debug13.png)
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:
203-
204-
```
205-
SBMJOB CMD(STRQSH CMD('/QOpenSys/pkgs/bin/bash -c /QIBM/ProdData/IBMiDebugService/bin/startDebugService.sh')) JOB(DBGSVCE) JOBQ(QSYS/QUSRNOMAX) JOBD(QSYS/QSYSJOBD) USER(*CURRENT)
206-
```
207-
208-
<Aside type="tip">
209-
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-
![](./debug4.png)
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.
259-
260-
[See GitHub issue here](https://github.com/codefori/vscode-ibmi/issues/1069)<Icon name="github" class="icon-inline" />.
261-
262-
</Card><Card>
263-
264-
![](./debug5.png)
265-
266-
</Card></CardGrid>
140+
This must be done with user that has *ALLOBJ and *SYSADM privlages.
141+
Below are the base requirements to configure the certificate:
142+
- Master key 1 is set (this can be done in Navigator for IBM i under Security > Cryptographic Services Key Management > Manage Master Keys)
143+
- *SYSTEM store is populated with a valid certificate (this can be done in Digital Certificate Manager)
144+
145+
1. On Navigator for IBM i, go to Network > Servers > TCP/IP Servers
146+
2. Scroll down to System Debugger and right click
147+
3. Hover over Stop Instance, select Debug Service
148+
![](image-4.png)
149+
4. Right click System Debugger again, select Regenerate Debug Service Trust Store
150+
![](image-3.png)
151+
5. Enter in the password for the *SYSTEM store, click OK
152+
![](image-1.png)
153+
6. Select the certificate you want to use, click OK
154+
![](image-2.png)
155+
7. Right click System Debugger again, hover over Start Instance, select Debug Service
156+
![](image-5.png)
157+
158+
**NOTE:** This needs to be done each time you renew or replace that certificate, it does not automatically update when you update the *SYSTEM store
267159

268160
# Common issues
269161

src/content/docs/extensions/db2i/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ csv: select * from sample.employee;
5656
-- result set as SQL insert statement
5757
sql: select * from sample.employee;
5858

59+
-- RPG data structure based on result set columns
60+
rpg: select * from sample.employee;
61+
5962
-- run CL commands. output is directed to IBM i output channel
6063
cl: dspffd sample/employee
6164
```

0 commit comments

Comments
 (0)