debug 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +9 -11
- data/README.md +4 -4
- data/ext/debug/debug.c +1 -1
- data/lib/debug/server.rb +2 -0
- data/lib/debug/server_cdp.rb +5 -7
- data/lib/debug/session.rb +2 -2
- data/lib/debug/version.rb +1 -1
- data/misc/README.md.erb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7316cec0879fc91787183e28cad0bbc4a1f819eb7d3ee4530a28b2ee173877e9
|
4
|
+
data.tar.gz: e37f36b72d3aec5fed4559c78474358c487e3c1748a732984a42331c2a96191a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51ba70e0a9b9c73170080a0e428edf178aa98aceb409e8d4b69ea16eb36796467852c07ba38c103cbac8f7e0861119d40d1e6272d5d002ac472ec2b92801a5b5
|
7
|
+
data.tar.gz: 8e02dc629e83151c4a1b744ed3dcd9262e57d1c6dad012bfa1f42410636f9f467a189aa3579abad419e443c943c39930729305311456b06c4fc0a562ef49827c
|
data/CONTRIBUTING.md
CHANGED
@@ -206,17 +206,15 @@ end
|
|
206
206
|
#### gentest options
|
207
207
|
You can get more information about `gentest` here.
|
208
208
|
|
209
|
-
The default method name is `
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
$ bin/gentest target.rb -c StepTest -m test_step
|
219
|
-
```
|
209
|
+
The default method name is `test_#{some integer numbers}`, the class name is `FooTest`, and the file name will be `foo_test.rb`.
|
210
|
+
The following table shows examples of the gentest options.
|
211
|
+
|
212
|
+
| Command | Description | File | Class | Method |
|
213
|
+
| --- | --- | --- | --- | --- |
|
214
|
+
| `$ bin/gentest target.rb` | Run without any options | `foo_test.rb` | `FooTest` | `test_#{some integer numbers}` |
|
215
|
+
| `$ bin/gentest target.rb -c step` | Specify the class name | `step_test.rb` | `StepTest` | `test_#{some integer numbers}` |
|
216
|
+
| `$ bin/gentest target.rb -m test_step` | Specify the method name | `foo_test.rb` | `FooTest` | `test_step` |
|
217
|
+
| `$ bin/gentest target.rb -c step -m test_step` | Specify the class name and the method name | `step_test.rb` | `StepTest` | `test_step` |
|
220
218
|
|
221
219
|
## To Update README
|
222
220
|
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ New debug.rb has several advantages:
|
|
11
11
|
* [Remote debugging](#remote-debugging): Support remote debugging natively.
|
12
12
|
* UNIX domain socket
|
13
13
|
* TCP/IP
|
14
|
-
*
|
14
|
+
* Integration with rich debugger frontend
|
15
15
|
* VSCode/DAP ([VSCode rdbg Ruby Debugger - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg))
|
16
16
|
* Chrome DevTools
|
17
17
|
* Extensible: application can introduce debugging support with several ways:
|
@@ -340,7 +340,7 @@ $ RUBY_DEBUG_PORT=12345 ruby target.rb
|
|
340
340
|
|
341
341
|
### Integration with external debugger frontend
|
342
342
|
|
343
|
-
You can attach with external
|
343
|
+
You can attach with external debugger frontend with VSCode and Chrome.
|
344
344
|
|
345
345
|
```
|
346
346
|
$ rdbg --open=[frontend] target.rb
|
@@ -352,7 +352,7 @@ Also `open` command allows opening the debug port.
|
|
352
352
|
|
353
353
|
#### VSCode integration
|
354
354
|
|
355
|
-
If you don't run a debuggee Ruby process on VSCode, you can attach with VSCode later with the
|
355
|
+
If you don't run a debuggee Ruby process on VSCode, you can attach with VSCode later with the following steps.
|
356
356
|
|
357
357
|
`rdbg --open=vscode` opens the debug port and tries to invoke the VSCode (`code` command).
|
358
358
|
|
@@ -364,7 +364,7 @@ Launching: code /tmp/ruby-debug-vscode-20211014-27706-gd7e85/ /tmp/ruby-debug-vs
|
|
364
364
|
DEBUGGER: Connected.
|
365
365
|
```
|
366
366
|
|
367
|
-
And it
|
367
|
+
And it tries to invoke the new VSCode window and VSCode starts attaching to the debuggee Ruby program automatically.
|
368
368
|
|
369
369
|
You can also use `open vscode` command in REPL.
|
370
370
|
|
data/ext/debug/debug.c
CHANGED
@@ -64,7 +64,7 @@ di_body(const rb_debug_inspector_t *dc, void *ptr)
|
|
64
64
|
|
65
65
|
if (!NIL_P(iseq)) {
|
66
66
|
VALUE path = iseq_realpath(iseq);
|
67
|
-
if (!NIL_P(path) && str_start_with(path, skip_path_prefix)) continue;
|
67
|
+
if (!NIL_P(path) && !NIL_P(skip_path_prefix) && str_start_with(path, skip_path_prefix)) continue;
|
68
68
|
}
|
69
69
|
|
70
70
|
loc = RARRAY_AREF(locs, i);
|
data/lib/debug/server.rb
CHANGED
data/lib/debug/server_cdp.rb
CHANGED
@@ -14,9 +14,7 @@ module DEBUGGER__
|
|
14
14
|
@sock = s
|
15
15
|
end
|
16
16
|
|
17
|
-
def handshake
|
18
|
-
CONFIG.set_config no_color: true
|
19
|
-
|
17
|
+
def handshake
|
20
18
|
req = @sock.readpartial 4096
|
21
19
|
$stderr.puts '[>]' + req if SHOW_PROTOCOL
|
22
20
|
|
@@ -97,10 +95,10 @@ module DEBUGGER__
|
|
97
95
|
end
|
98
96
|
|
99
97
|
def process
|
98
|
+
bps = []
|
100
99
|
loop do
|
101
100
|
req = @web_sock.extract_data
|
102
101
|
$stderr.puts '[>]' + req.inspect if SHOW_PROTOCOL
|
103
|
-
bps = []
|
104
102
|
|
105
103
|
case req['method']
|
106
104
|
|
@@ -124,7 +122,7 @@ module DEBUGGER__
|
|
124
122
|
url: "http://debuggee#{abs}",
|
125
123
|
startLine: 0,
|
126
124
|
startColumn: 0,
|
127
|
-
endLine: src.count(
|
125
|
+
endLine: src.count("\n"),
|
128
126
|
endColumn: 0,
|
129
127
|
executionContextId: 1,
|
130
128
|
hash: src.hash
|
@@ -169,7 +167,7 @@ module DEBUGGER__
|
|
169
167
|
# breakpoint
|
170
168
|
when 'Debugger.getPossibleBreakpoints'
|
171
169
|
s_id = req.dig('params', 'start', 'scriptId')
|
172
|
-
line = req.dig('params', 'lineNumber')
|
170
|
+
line = req.dig('params', 'start', 'lineNumber')
|
173
171
|
send_response req,
|
174
172
|
locations: [
|
175
173
|
{ scriptId: s_id,
|
@@ -269,7 +267,7 @@ module DEBUGGER__
|
|
269
267
|
url: frame[:url],
|
270
268
|
startLine: 0,
|
271
269
|
startColumn: 0,
|
272
|
-
endLine: src.count(
|
270
|
+
endLine: src.count("\n"),
|
273
271
|
endColumn: 0,
|
274
272
|
executionContextId: @script_paths.size + 1,
|
275
273
|
hash: src.hash
|
data/lib/debug/session.rb
CHANGED
@@ -91,7 +91,7 @@ module DEBUGGER__
|
|
91
91
|
# [:check, expr] => CheckBreakpoint
|
92
92
|
#
|
93
93
|
@tracers = {}
|
94
|
-
@th_clients =
|
94
|
+
@th_clients = {} # {Thread => ThreadClient}
|
95
95
|
@q_evt = Queue.new
|
96
96
|
@displays = []
|
97
97
|
@tc = nil
|
@@ -1358,7 +1358,7 @@ module DEBUGGER__
|
|
1358
1358
|
end
|
1359
1359
|
|
1360
1360
|
def setup_threads
|
1361
|
-
prev_clients = @th_clients
|
1361
|
+
prev_clients = @th_clients
|
1362
1362
|
@th_clients = {}
|
1363
1363
|
|
1364
1364
|
Thread.list.each{|th|
|
data/lib/debug/version.rb
CHANGED
data/misc/README.md.erb
CHANGED
@@ -11,7 +11,7 @@ New debug.rb has several advantages:
|
|
11
11
|
* [Remote debugging](#remote-debugging): Support remote debugging natively.
|
12
12
|
* UNIX domain socket
|
13
13
|
* TCP/IP
|
14
|
-
*
|
14
|
+
* Integration with rich debugger frontend
|
15
15
|
* VSCode/DAP ([VSCode rdbg Ruby Debugger - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg))
|
16
16
|
* Chrome DevTools
|
17
17
|
* Extensible: application can introduce debugging support with several ways:
|
@@ -340,7 +340,7 @@ $ RUBY_DEBUG_PORT=12345 ruby target.rb
|
|
340
340
|
|
341
341
|
### Integration with external debugger frontend
|
342
342
|
|
343
|
-
You can attach with external
|
343
|
+
You can attach with external debugger frontend with VSCode and Chrome.
|
344
344
|
|
345
345
|
```
|
346
346
|
$ rdbg --open=[frontend] target.rb
|
@@ -352,7 +352,7 @@ Also `open` command allows opening the debug port.
|
|
352
352
|
|
353
353
|
#### VSCode integration
|
354
354
|
|
355
|
-
If you don't run a debuggee Ruby process on VSCode, you can attach with VSCode later with the
|
355
|
+
If you don't run a debuggee Ruby process on VSCode, you can attach with VSCode later with the following steps.
|
356
356
|
|
357
357
|
`rdbg --open=vscode` opens the debug port and tries to invoke the VSCode (`code` command).
|
358
358
|
|
@@ -364,7 +364,7 @@ Launching: code /tmp/ruby-debug-vscode-20211014-27706-gd7e85/ /tmp/ruby-debug-vs
|
|
364
364
|
DEBUGGER: Connected.
|
365
365
|
```
|
366
366
|
|
367
|
-
And it
|
367
|
+
And it tries to invoke the new VSCode window and VSCode starts attaching to the debuggee Ruby program automatically.
|
368
368
|
|
369
369
|
You can also use `open vscode` command in REPL.
|
370
370
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koichi Sasada
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: irb
|