debug 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 948301b2d85d9acb8758ae20e63a60d0253dc1d1e1bf5c2ddc276abb39d12993
4
- data.tar.gz: 2e6b7c89ee568710d52d3fcaff1ff5eb44db71c4e296e039a6f21f4e5de9b9ee
3
+ metadata.gz: 7316cec0879fc91787183e28cad0bbc4a1f819eb7d3ee4530a28b2ee173877e9
4
+ data.tar.gz: e37f36b72d3aec5fed4559c78474358c487e3c1748a732984a42331c2a96191a
5
5
  SHA512:
6
- metadata.gz: dd5237c7fc194760f33cdd97c007fe1c879ed4140342821972d2385a612bd5fd4c8faffd2a3763adea1378931be13e65d46e2a23f5997412ac96c6e7c802e0d2
7
- data.tar.gz: 396eab432e765065288f49cda52ce8a4449ee6c97465bde2ef70ec8ca39678b80831748b551d6aa6e4417c1c6512b8b0f8caf4371516a9178181582b9bf9542c
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 `test_foo` and the class name is `FooTest`. The file name will be `[Lowercase letters with "Test" removed from the class name]_test.rb`.
210
- ```shell
211
- # run without any options(test method name will be `test_foo`, class name will be `FooTest`, file name will be `foo_test.rb`)
212
- $ bin/gentest target.rb
213
- # specify the class name(test method name will be `test_foo`, class name will be `StepTest`, file name will be `step_test.rb`)
214
- $ bin/gentest target.rb -c StepTest
215
- # specify the method name(test method name will be `test_step`, class name will be `FooTest`, file name will be `foo_test.rb`)
216
- $ bin/gentest target.rb -m test_step
217
- # specify class name and method name(test method name will be `test_step`, class name will be `StepTest`, file name will be `step_test.rb`.)
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
- * Integeration with rich debugger frontend
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 debuger frontend with VSCode and Chrome.
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 fowllowing steps.
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 tris to invoke the new VSCode window and VSCode starts attaching to the debuggee Ruby program automatically.
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
@@ -116,6 +116,8 @@ module DEBUGGER__
116
116
 
117
117
  self.extend(UI_CDP)
118
118
  @repl = false
119
+ CONFIG.set_config no_color: true
120
+
119
121
  @web_sock = UI_CDP::WebSocket.new(@sock)
120
122
  @web_sock.handshake
121
123
  else
@@ -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('\n'),
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('\n'),
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 = nil # {Thread => ThreadClient}
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DEBUGGER__
4
- VERSION = "1.3.1"
4
+ VERSION = "1.3.2"
5
5
  end
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
- * Integeration with rich debugger frontend
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 debuger frontend with VSCode and Chrome.
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 fowllowing steps.
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 tris to invoke the new VSCode window and VSCode starts attaching to the debuggee Ruby program automatically.
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.1
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-22 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb