debug 1.3.4 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +9 -0
- data/CONTRIBUTING.md +39 -6
- data/README.md +34 -7
- data/bin/gentest +12 -4
- data/ext/debug/debug.c +4 -1
- data/lib/debug/breakpoint.rb +61 -11
- data/lib/debug/client.rb +57 -16
- data/lib/debug/color.rb +29 -19
- data/lib/debug/config.rb +6 -3
- data/lib/debug/console.rb +17 -3
- data/lib/debug/frame_info.rb +11 -16
- data/lib/debug/prelude.rb +2 -2
- data/lib/debug/server.rb +45 -77
- data/lib/debug/server_cdp.rb +590 -93
- data/lib/debug/server_dap.rb +231 -53
- data/lib/debug/session.rb +114 -52
- data/lib/debug/source_repository.rb +4 -6
- data/lib/debug/thread_client.rb +67 -48
- data/lib/debug/tracer.rb +1 -1
- data/lib/debug/version.rb +1 -1
- data/misc/README.md.erb +12 -4
- metadata +3 -2
data/lib/debug/tracer.rb
CHANGED
@@ -142,7 +142,7 @@ module DEBUGGER__
|
|
142
142
|
out tp, ">#{sp}#{call_identifier_str}", depth
|
143
143
|
when :return, :c_return, :b_return
|
144
144
|
depth += 1 if tp.event == :c_return
|
145
|
-
return_str = colorize_magenta(DEBUGGER__.
|
145
|
+
return_str = colorize_magenta(DEBUGGER__.safe_inspect(tp.return_value, short: true))
|
146
146
|
out tp, "<#{sp}#{call_identifier_str} #=> #{return_str}", depth
|
147
147
|
end
|
148
148
|
}
|
data/lib/debug/version.rb
CHANGED
data/misc/README.md.erb
CHANGED
@@ -60,8 +60,14 @@ There are several options for (1) and (2). Please choose your favorite way.
|
|
60
60
|
|
61
61
|
### Modify source code with [`binding.break`](#bindingbreak-method) (similar to `binding.pry` or `binding.irb`)
|
62
62
|
|
63
|
-
If you can modify the source code, you can use the debugger by adding `require 'debug'`
|
64
|
-
|
63
|
+
If you can modify the source code, you can use the debugger by adding `require 'debug'` at the top of your program and putting [`binding.break`](#bindingbreak-method) method into lines where you want to stop as breakpoints like `binding.pry` and `binding.irb`.
|
64
|
+
|
65
|
+
You can also use its 2 aliases in the same way:
|
66
|
+
|
67
|
+
- `binding.b`
|
68
|
+
- `debugger`
|
69
|
+
|
70
|
+
After that, run the program as usual and you will enter the debug console at breakpoints you inserted.
|
65
71
|
|
66
72
|
The following example shows the demonstration of [`binding.break`](#bindingbreak-method).
|
67
73
|
|
@@ -346,7 +352,7 @@ You can attach with external debugger frontend with VSCode and Chrome.
|
|
346
352
|
$ rdbg --open=[frontend] target.rb
|
347
353
|
```
|
348
354
|
|
349
|
-
will open a debug port and `[
|
355
|
+
will open a debug port and `[frontend]` can attach to the port.
|
350
356
|
|
351
357
|
Also `open` command allows opening the debug port.
|
352
358
|
|
@@ -427,7 +433,9 @@ Type `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:43633` in the addr
|
|
427
433
|
|
428
434
|
Also `open chrome` command works like `open vscode`.
|
429
435
|
|
430
|
-
For more information about how to use Chrome debugging, you might want to read [here](https://developer.chrome.com/docs/devtools/)
|
436
|
+
For more information about how to use Chrome debugging, you might want to read [here](https://developer.chrome.com/docs/devtools/).
|
437
|
+
|
438
|
+
Note: If you want to maximize Chrome DevTools, click [Toggle Device Toolbar](https://developer.chrome.com/docs/devtools/device-mode/#viewport).
|
431
439
|
|
432
440
|
## Configuration
|
433
441
|
|
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.
|
4
|
+
version: 1.4.0
|
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-
|
11
|
+
date: 2021-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: irb
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
52
52
|
- ".github/ISSUE_TEMPLATE/custom.md"
|
53
53
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
54
|
+
- ".github/pull_request_template.md"
|
54
55
|
- ".github/workflows/ruby.yml"
|
55
56
|
- ".gitignore"
|
56
57
|
- CONTRIBUTING.md
|