Skip to content

Commit 2e6c781

Browse files
authored
Merge pull request #30 from codefori/debuggerUpdate
Debugger documentation update
2 parents 2d09aa7 + e8fce6c commit 2e6c781

File tree

10 files changed

+71
-45
lines changed

10 files changed

+71
-45
lines changed

.astro/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,5 +391,5 @@ declare module 'astro:content' {
391391

392392
type AnyEntryMap = ContentEntryMap & DataEntryMap;
393393

394-
export type ContentConfig = typeof import("../src/content/config.js");
394+
export type ContentConfig = typeof import("./../src/content/config.js");
395395
}
6.49 KB
Loading
11 KB
Loading
3.44 KB
Loading
4.45 KB
Loading
4.18 KB
Loading
7.32 KB
Loading
2.01 KB
Loading
3.35 KB
Loading

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

Lines changed: 70 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ To debug a program from the Object Browser, right-click on the program object an
5555

5656
## General requirements
5757

58-
* PTFs
59-
* Certificates setup on the server
60-
* created in `/QIBM/UserData/IBMiDebugService/certs` by default
61-
* IBM i Debug extension
62-
* installed into Visual Studio Code
63-
* Local client certificate
64-
* can be imported with the 'Import local certificate' command
58+
* PTFs (see below)
59+
* IBM i Debug extension ([marketplace](https://marketplace.visualstudio.com/items?itemName=IBM.ibmidebug))
60+
* installed into Visual Studio Code
61+
* Debug Service Certificates setup
62+
* created in `/QIBM/UserData/IBMiDebugService/certs` by default
63+
* Debug Service certificate `debug_service.pfx`
64+
* Debug Service client certificate `debug_service.crt`
6565

6666
## Required PTFs
6767

@@ -92,69 +92,95 @@ After you have installed the PTFs, the connection inside of Visual Studio Code w
9292
## Configuring & starting the service
9393

9494
<CardGrid>
95-
9695
<Card>
96+
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.
97+
</Card>
98+
<Card>
99+
![](./debug6.png)
100+
</Card>
101+
</CardGrid>
102+
<CardGrid>
103+
<Card>
104+
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.
105+
</Card>
106+
<Card>
107+
![](./debug7.png)
108+
</Card>
109+
</CardGrid>
97110

98-
After connecting to a system in Code for IBM i, if the PTFs are installed but the service is not configured (i.e. the certificates don't exist) you will see a notice asking if you'd like to open the Walkthrough to configure the Debug Service. Clicking the button will open the Walkthrough.
99-
100-
</Card><Card>
101-
102-
![](./setup1.png)
103-
104-
</Card></CardGrid>
111+
### Start/stop the Server and Service
112+
<CardGrid>
113+
<Card>
114+
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.
115+
</Card>
116+
<Card>
117+
![](./debug8.png)
118+
![](./debug9.png)
119+
</Card>
120+
</CardGrid>
105121

106122
<Aside type="tip">
107-
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.
123+
Starting and stopping the Debug Server and Service requires the *ALLOBJ special authority.
108124
</Aside>
109125

110-
---
111-
112-
### Generating certificates
113-
126+
### Managing the Debug Service
114127
<CardGrid>
115-
116128
<Card>
129+
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.
130+
</Card>
131+
<Card>
132+
![](./debug10.png)
133+
![](./debug11.png)
134+
</Card>
135+
</CardGrid>
117136

118-
This Walkthrough can easily configure the Debug Service and start it up. The last steps have buttons to 'Generate certificates' and 'Start debug service'. Running them in order will do all the work to setup the service.
119-
120-
*It will ask you to confirm the initialisation.*
121-
122-
If certificates already exist on the server, you may see a slightly different message as Code for IBM i will not replace existing certificates.
123-
124-
</Card><Card>
137+
<Aside type="tip">
138+
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.
139+
</Aside>
125140

126-
![](./setup2_a.png)
141+
#### Generating certificates
142+
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.
127143

128-
</Card></CardGrid>
144+
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`.
129145

130-
---
146+
The Debug Service certificate can only be generated if it's missing. In this case, the IBM i Debugger view will show this error:
131147

132-
### Starting the server
148+
![](./debug10.png)
133149

134-
<CardGrid>
150+
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`:
151+
* `debug_service.pfx`
152+
* the Debug Service certificate, used by the service to encrypt the communication.
153+
* `debug_service.crt`
154+
* the client certificate that clients must download if the `Secure Debug` option is turned on in Code for IBM i.
135155

136-
<Card>
156+
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.
137157

138-
The 'Start debug service' button will spin up the Debug Service. If the Debug Service is already running, it will ask you if you want to end the existing instance before starting a new one - this is a requirement if you have generated new certificates on the server. It is not recommended to run two instances of the Debug Service at once.
158+
If `Secure Debug` is on and 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.
139159

140-
</Card><Card>
160+
![](./debug11.png)
141161

142-
![](./setup3_a.png)
143162

144-
</Card></CardGrid>
163+
#### Starting the Debug Service from Code for IBM i
164+
Starting the Debug Service can be done from the IBM i Debugger view and requires `*ALLOBJ` special authority.
145165

146-
<CardGrid>
166+
![](./debug12.png)
147167

148-
<Card>
168+
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.
149169

150-
You can also start the Debug Service through the command palette:
170+
![](./debug13.png)
151171

152-
</Card><Card>
172+
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).
153173

154-
![](./setup3_b.png)
174+
#### Starting the Debug Service outside of Code for IBM i
175+
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:
155176

156-
</Card></CardGrid>
177+
```
178+
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)
179+
```
157180

181+
<Aside type="tip">
182+
This will only work if Code for IBM i was used to configure the Service and generate its certificate.
183+
</Aside>
158184
---
159185

160186
## Debug Service ports

0 commit comments

Comments
 (0)