debug 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +24 -0
- data/.github/ISSUE_TEMPLATE/custom.md +10 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
- data/debug.gemspec +1 -1
- data/lib/debug/color.rb +25 -3
- data/lib/debug/server_dap.rb +15 -13
- data/lib/debug/session.rb +3 -3
- data/lib/debug/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 556965976e9db176b06e1997eb167cf5538ccd301ddb497ae629cfda01062fa3
|
4
|
+
data.tar.gz: e709e60ef9b43b44a998362347b2b8d7e3d4cbddb4831cd43156d5ddc67dead8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9169efb00f3f9cebb0f9f21d2773e29d4c67edd7a4bb0b7330664080a15972cfe43199ae3c43e86424b2a6f94b83ce1fb8be1c208149cdd04f28c12f5d9f2842
|
7
|
+
data.tar.gz: a56d82fb5beb82cd821639ae073d8f902aafbdfc762236ea6eb0b2d391cc1e121e541d16083b6b22ae5a8c73b2c2c2e49e54c39f37ac9d4c03d38210499398c8
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Your environment**
|
11
|
+
|
12
|
+
* `ruby -v`:
|
13
|
+
* `rdbg -v`:
|
14
|
+
|
15
|
+
**Describe the bug**
|
16
|
+
A clear and concise description of what the bug is.
|
17
|
+
|
18
|
+
**To Reproduce**
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Additional context**
|
24
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Your proposal**
|
11
|
+
What is your idea?
|
12
|
+
|
13
|
+
**Additional context**
|
14
|
+
Add any other context or screenshots about the feature request here.
|
data/debug.gemspec
CHANGED
@@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
spec.extensions = ['ext/debug/extconf.rb']
|
27
27
|
|
28
|
-
spec.add_dependency "irb" # for its color_printer class, which was added after 1.3
|
28
|
+
spec.add_dependency "irb", ">= 1.3.6" # for its color_printer class, which was added after 1.3
|
29
29
|
spec.add_dependency "reline", ">= 0.2.7"
|
30
30
|
end
|
data/lib/debug/color.rb
CHANGED
@@ -17,9 +17,25 @@ end
|
|
17
17
|
module DEBUGGER__
|
18
18
|
module Color
|
19
19
|
if defined? IRB::Color.colorize
|
20
|
+
begin
|
21
|
+
IRB::Color.colorize('', [:DIM], colorable: true)
|
22
|
+
SUPPORT_COLORABLE_OPTION = true
|
23
|
+
rescue ArgumentError
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined? SUPPORT_COLORABLE_OPTION
|
27
|
+
def irb_colorize str, color
|
28
|
+
IRB::Color.colorize str, color, colorable: true
|
29
|
+
end
|
30
|
+
else
|
31
|
+
def irb_colorize str, color
|
32
|
+
IRB::Color.colorize str, color
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
20
36
|
def colorize str, color
|
21
37
|
if !CONFIG[:no_color]
|
22
|
-
|
38
|
+
irb_colorize str, color
|
23
39
|
else
|
24
40
|
str
|
25
41
|
end
|
@@ -63,8 +79,14 @@ module DEBUGGER__
|
|
63
79
|
end
|
64
80
|
|
65
81
|
if defined? IRB::Color.colorize_code
|
66
|
-
|
67
|
-
|
82
|
+
if SUPPORT_COLORABLE_OPTION
|
83
|
+
def colorize_code code
|
84
|
+
IRB::Color.colorize_code(code, colorable: true)
|
85
|
+
end
|
86
|
+
else
|
87
|
+
def colorize_code code
|
88
|
+
IRB::Color.colorize_code(code)
|
89
|
+
end
|
68
90
|
end
|
69
91
|
else
|
70
92
|
def colorize_code code
|
data/lib/debug/server_dap.rb
CHANGED
@@ -182,7 +182,7 @@ module DEBUGGER__
|
|
182
182
|
@q_msg << 'continue'
|
183
183
|
when 'attach'
|
184
184
|
send_response req
|
185
|
-
Process.kill(:
|
185
|
+
Process.kill(:SIGURG, Process.pid)
|
186
186
|
when 'disconnect'
|
187
187
|
send_response req
|
188
188
|
@q_msg << 'continue'
|
@@ -205,7 +205,7 @@ module DEBUGGER__
|
|
205
205
|
exit
|
206
206
|
when 'pause'
|
207
207
|
send_response req
|
208
|
-
Process.kill(:
|
208
|
+
Process.kill(:SIGURG, Process.pid)
|
209
209
|
when 'reverseContinue'
|
210
210
|
send_response req,
|
211
211
|
success: false, message: 'cancelled',
|
@@ -256,7 +256,7 @@ module DEBUGGER__
|
|
256
256
|
def event type, *args
|
257
257
|
case type
|
258
258
|
when :suspend_bp
|
259
|
-
_i, bp = *args
|
259
|
+
_i, bp, tid = *args
|
260
260
|
if bp.kind_of?(CatchBreakpoint)
|
261
261
|
reason = 'exception'
|
262
262
|
text = bp.description
|
@@ -268,24 +268,26 @@ module DEBUGGER__
|
|
268
268
|
send_event 'stopped', reason: reason,
|
269
269
|
description: text,
|
270
270
|
text: text,
|
271
|
-
threadId:
|
271
|
+
threadId: tid,
|
272
272
|
allThreadsStopped: true
|
273
273
|
when :suspend_trap
|
274
|
+
_sig, tid = *args
|
274
275
|
send_event 'stopped', reason: 'pause',
|
275
|
-
threadId:
|
276
|
+
threadId: tid,
|
276
277
|
allThreadsStopped: true
|
277
278
|
when :suspended
|
279
|
+
tid, = *args
|
278
280
|
send_event 'stopped', reason: 'step',
|
279
|
-
threadId:
|
281
|
+
threadId: tid,
|
280
282
|
allThreadsStopped: true
|
281
283
|
end
|
282
284
|
end
|
283
285
|
end
|
284
286
|
|
285
287
|
class Session
|
286
|
-
def
|
288
|
+
def find_waiting_tc id
|
287
289
|
@th_clients.each{|th, tc|
|
288
|
-
return tc if tc.id == id
|
290
|
+
return tc if tc.id == id && tc.waiting?
|
289
291
|
}
|
290
292
|
return nil
|
291
293
|
end
|
@@ -306,7 +308,7 @@ module DEBUGGER__
|
|
306
308
|
|
307
309
|
when 'stackTrace'
|
308
310
|
tid = req.dig('arguments', 'threadId')
|
309
|
-
if tc =
|
311
|
+
if tc = find_waiting_tc(tid)
|
310
312
|
tc << [:dap, :backtrace, req]
|
311
313
|
else
|
312
314
|
fail_response req
|
@@ -315,7 +317,7 @@ module DEBUGGER__
|
|
315
317
|
frame_id = req.dig('arguments', 'frameId')
|
316
318
|
if @frame_map[frame_id]
|
317
319
|
tid, fid = @frame_map[frame_id]
|
318
|
-
if tc =
|
320
|
+
if tc = find_waiting_tc(tid)
|
319
321
|
tc << [:dap, :scopes, req, fid]
|
320
322
|
else
|
321
323
|
fail_response req
|
@@ -348,7 +350,7 @@ module DEBUGGER__
|
|
348
350
|
frame_id = ref[1]
|
349
351
|
tid, fid = @frame_map[frame_id]
|
350
352
|
|
351
|
-
if tc =
|
353
|
+
if tc = find_waiting_tc(tid)
|
352
354
|
tc << [:dap, :scope, req, fid]
|
353
355
|
else
|
354
356
|
fail_response req
|
@@ -357,7 +359,7 @@ module DEBUGGER__
|
|
357
359
|
when :variable
|
358
360
|
tid, vid = ref[1], ref[2]
|
359
361
|
|
360
|
-
if tc =
|
362
|
+
if tc = find_waiting_tc(tid)
|
361
363
|
tc << [:dap, :variable, req, vid]
|
362
364
|
else
|
363
365
|
fail_response req
|
@@ -373,7 +375,7 @@ module DEBUGGER__
|
|
373
375
|
if @frame_map[frame_id]
|
374
376
|
tid, fid = @frame_map[frame_id]
|
375
377
|
expr = req.dig('arguments', 'expression')
|
376
|
-
if tc =
|
378
|
+
if tc = find_waiting_tc(tid)
|
377
379
|
tc << [:dap, :evaluate, req, fid, expr]
|
378
380
|
else
|
379
381
|
fail_response req
|
data/lib/debug/session.rb
CHANGED
@@ -215,16 +215,16 @@ module DEBUGGER__
|
|
215
215
|
case ev_args.first
|
216
216
|
when :breakpoint
|
217
217
|
bp, i = bp_index ev_args[1]
|
218
|
-
@ui.event :suspend_bp, i, bp
|
218
|
+
@ui.event :suspend_bp, i, bp, tc.id
|
219
219
|
when :trap
|
220
|
-
@ui.event :suspend_trap, sig = ev_args[1]
|
220
|
+
@ui.event :suspend_trap, sig = ev_args[1], tc.id
|
221
221
|
|
222
222
|
if sig == :SIGINT && (@intercepted_sigint_cmd.kind_of?(Proc) || @intercepted_sigint_cmd.kind_of?(String))
|
223
223
|
@ui.puts "#{@intercepted_sigint_cmd.inspect} is registerred as SIGINT handler."
|
224
224
|
@ui.puts "`sigint` command execute it."
|
225
225
|
end
|
226
226
|
else
|
227
|
-
@ui.event :suspended
|
227
|
+
@ui.event :suspended, tc.id
|
228
228
|
end
|
229
229
|
|
230
230
|
if @displays.empty?
|
data/lib/debug/version.rb
CHANGED
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.2.
|
4
|
+
version: 1.2.1
|
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-09-
|
11
|
+
date: 2021-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: irb
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.3.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.3.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: reline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -48,6 +48,9 @@ extensions:
|
|
48
48
|
- ext/debug/extconf.rb
|
49
49
|
extra_rdoc_files: []
|
50
50
|
files:
|
51
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
52
|
+
- ".github/ISSUE_TEMPLATE/custom.md"
|
53
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
51
54
|
- ".github/workflows/ruby.yml"
|
52
55
|
- ".gitignore"
|
53
56
|
- CONTRIBUTING.md
|