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
#1 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:5 (line)
181
181
```
182
182
183
-
You can see that two breakpoints are registered. Let's continue the program by `continue` command.
183
+
You can see that two breakpoints are registered. Let's continue the program by using the `continue` command.
184
184
185
185
```shell
186
186
(rdbg) continue
@@ -200,8 +200,8 @@ Stop by #0 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:3 (line)
200
200
```
201
201
202
202
You can see that we can stop at line 3.
203
-
Let's see the local variables with `info` command, and continue.
204
-
You can also confirm that the program will suspend at line 5 and you can use `info` command again.
203
+
Let's see the local variables with the `info` command, and continue.
204
+
You can also confirm that the program will suspend at line 5 and you can use the `info` command again.
205
205
206
206
```shell
207
207
(rdbg) info
@@ -245,7 +245,7 @@ It will help if you want to know what the program is doing.
245
245
If you want to run a command written in Ruby like `rake`, `rails`, `bundle`, `rspec`, and so on, you can use `rdbg -c` option.
246
246
247
247
* Without `-c` option, `rdbg <name>` means that `<name>` is Ruby script and invoke it like `ruby <name>` with the debugger.
248
-
* With `-c` option, `rdbg -c <name>` means that `<name>` is command in `PATH` and simply invoke it with the debugger.
248
+
* With `-c` option, `rdbg -c <name>` means that `<name>` is a command in `PATH` and simply invokes it with the debugger.
249
249
250
250
Examples:
251
251
*`rdbg -c -- rails server`
@@ -263,12 +263,12 @@ Like other languages, you can use this debugger on the VSCode.
263
263
264
264
1. Install [VSCode rdbg Ruby Debugger - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg)
265
265
2. Open `.rb` file (e.g. `target.rb`)
266
-
3. Register breakpoints with "Toggle breakpoint" in Run menu (or type F9 key)
266
+
3. Register breakpoints with "Toggle breakpoint" in the Run menu (or type F9 key)
267
267
4. Choose "Start debugging" in "Run" menu (or type F5 key)
268
268
5. You will see a dialog "Debug command line" and you can choose your favorite command line you want to run.
269
269
6. Chosen command line is invoked with `rdbg -c`, and VSCode shows the details at breakpoints.
270
270
271
-
Please refer [Debugging in Visual Studio Code](https://code.visualstudio.com/docs/editor/debugging) for operations on VSCode.
271
+
Please refer to [Debugging in Visual Studio Code](https://code.visualstudio.com/docs/editor/debugging) for operations on VSCode.
272
272
273
273
You can configure the extension in `.vscode/launch.json`.
274
274
Please see the extension page for more details.
@@ -283,7 +283,7 @@ You can use this debugger as a remote debugger. For example, it will help in the
283
283
* Your application uses pipe for STDIN or STDOUT.
284
284
* Your application is running as a daemon and you want to query the running status (checking a backtrace and so on).
285
285
286
-
You can run your application as a remote debugged, and the remote debugger console can attach to the debuggee anytime.
286
+
You can run your application as a remote debuggee, and the remote debugger console can attach to the debuggee anytime.
287
287
288
288
### Invoke as a remote debuggee
289
289
@@ -305,7 +305,7 @@ DEBUGGER: Debugger can attach via UNIX domain socket (/home/ko1/.ruby-debug-sock
305
305
DEBUGGER: waitfor debugger connection...
306
306
```
307
307
308
-
By default, `rdbg --open` uses UNIX domain socket and generates path name automatically (`/home/ko1/.ruby-debug-sock/ruby-debug-ko1-7773` in this case).
308
+
By default, `rdbg --open` uses UNIX domain socket and generates the path name automatically (`/home/ko1/.ruby-debug-sock/ruby-debug-ko1-7773` in this case).
309
309
310
310
You can connect to the debuggee with `rdbg --attach` command (`rdbg -A` for short).
311
311
@@ -324,11 +324,11 @@ $ rdbg -A
324
324
(rdbg:remote)
325
325
```
326
326
327
-
If there is no other opening ports on the default directory, `rdbg --attach` command chooses the only one opening UNIX domain socket and connects to it. If there are more files, you need to specify the file.
327
+
If there are no other opening ports on the default directory, `rdbg --attach` command chooses the only one opening UNIX domain socket and connects to it. If there are more files, you need to specify the file.
328
328
329
329
When `rdbg --attach` connects to the debuggee, you can use any debug commands (set breakpoints, continue the program, and so on) like the local debug console. When a debuggee program exits, the remote console will also terminate.
330
330
331
-
NOTE: If you use `quit` command, only the remote console exits and the debuggee program continues to run (and you can connect it again). If you want to exit the debuggee program, use `kill` command.
331
+
NOTE: If you use the `quit` command, only the remote console exits and the debuggee program continues to run (and you can connect it again). If you want to exit the debuggee program, use `kill` command.
332
332
333
333
If you want to use TCP/IP for the remote debugging, you need to specify the port and host with `--port` like `rdbg --open --port 12345` and it binds to `localhost:12345`.
334
334
@@ -343,11 +343,11 @@ Note that all messages communicated between the debugger and the debuggee are *N
343
343
344
344
#### `require 'debug/open'` in a program
345
345
346
-
If you can modify the program, you can open debugging port by adding `require 'debug/open'` line in the program.
346
+
If you can modify the program, you can open the debugging port by adding `require 'debug/open'` line in the program.
347
347
348
348
If you don't want to stop the program at the beginning, you can also use `require 'debug/open_nonstop'`.
349
349
Using `debug/open_nonstop` is useful if you want to open a backdoor to the application.
350
-
However, it is also danger because it can become another vulnerability.
350
+
However, it is also dangerous because it can become another vulnerability.
351
351
Please use it carefully.
352
352
353
353
By default, UNIX domain socket is used for the debugging port. To use TCP/IP, you can set the `RUBY_DEBUG_PORT` environment variable.
@@ -372,7 +372,7 @@ Also `open` command allows opening the debug port.
372
372
373
373
([vscode-rdbg v0.0.9](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) or later is required)
374
374
375
-
If you don't run a debuggee Ruby process on VSCode, you can attach to VSCode later with the following steps.
375
+
If you don't run a debuggee Ruby process on VSCode, you can attach it to VSCode later with the following steps.
376
376
377
377
`rdbg --open=vscode` opens the debug port and tries to invoke the VSCode (`code` command).
378
378
@@ -816,7 +816,7 @@ Emacs support available.
816
816
817
817
#### Start by method
818
818
819
-
After loading `debug/session`, you can start debug session with the following methods. They are convenient if you want to specify debug configurations in your program.
819
+
After loading `debug/session`, you can start a debug session with the following methods. They are convenient if you want to specify debug configurations in your program.
820
820
821
821
*`DEBUGGER__.start(**kw)`: start debug session with local console.
822
822
*`DEBUGGER__.open(**kw)`: open debug port with configuration (without configurations open with UNIX domain socket)
0 commit comments