Commit 9d2292e
committed
Use
The debug gem can abort when stepping into a rescue clause:
```
$ ruby -Ilib exe/rdbg rescue-test.rb
[1, 7] in rescue-test.rb
=> 1| 1.times do
2| begin
3| raise
4| rescue
5| p 1
6| end
7| end
=>#0 <main> at rescue-test.rb:1
(rdbg) s # step command
[1, 7] in rescue-test.rb
1| 1.times do
2| begin
=> 3| raise
4| rescue
5| p 1
6| end
7| end
=>#0 block in <main> at rescue-test.rb:3
#1 Integer#times at <internal:numeric>:257
# and 1 frames (use `bt' command for all frames)
(rdbg) s # step command
/home/mame/work/debug/lib/debug/thread_client.rb:85:in 'DEBUGGER__::ThreadClient#default_frame_formatter': undefined method '+' for nil (NoMethodError)
"#{colorize_blue("block")}#{args_str} in #{colorize_blue(block_loc + level)}"
^
from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'Method#call'
from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'DEBUGGER__::ThreadClient#frame_str'
from /home/mame/work/debug/lib/debug/thread_client.rb:742:in 'block in DEBUGGER__::ThreadClient#show_frames'
from <internal:numeric>:257:in 'Integer#times'
from /home/mame/work/debug/lib/debug/thread_client.rb:739:in 'DEBUGGER__::ThreadClient#show_frames'
from /home/mame/work/debug/lib/debug/thread_client.rb:304:in 'DEBUGGER__::ThreadClient#suspend'
from /home/mame/work/debug/lib/debug/thread_client.rb:358:in 'block in DEBUGGER__::ThreadClient#step_tp'
from rescue-test.rb:5:in 'block in <main>'
from <internal:numeric>:257:in 'Integer#times'
from rescue-test.rb:1:in '<main>'
rescue-test.rb:3:in 'block in <main>': unhandled exception
from <internal:numeric>:257:in 'Integer#times'
from rescue-test.rb:1:in '<main>'
```
This is caused by the design issue of the debug inspector API.
See ruby/ruby#13508
This changeset fixes the issue by using a newly-introduced debug
inspector API, namely `rb_debug_inspector_frame_loc_get`.rb_debug_inspector_frame_loc_get if any1 parent bead098 commit 9d2292e
File tree
4 files changed
+17
-3
lines changed- ext/debug
- test/console
4 files changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | | - | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
0 commit comments