4 ms·
> debugger Check out the latest IRB on 3.3, it finally gives Pry a run for its money, especially when jumping into the debugger! https://github.com/ruby/irb#d
by lloeki 3y ago
> debugger
Check out the latest IRB on 3.3, it finally gives Pry a run for its money, especially when jumping into the debugger!
https://github.com/ruby/irb#debugging-with-irb https://github.com/ruby/irb#debugging-with-irb
$ ruby test.rb
From: test.rb @ line 7 :
1: def foo
2: 10.times do |i|
3: p i
4: end
5: end
6:
=> 7: binding.irb
8:
9: foo
irb(main):001> break 9
(rdbg:irb) break 9
#0 BP - Line /Users/loic.nageleisen/test.rb:9 (line)
irb:rdbg(main):002> break 3
#1 BP - Line /Users/loic.nageleisen/test.rb:3 (line)
irb:rdbg(main):003> continue
[4, 9] in test.rb
4| end
5| end
6|
7| binding.irb
8|
=> 9| foo
=>#0 <main> at test.rb:9
Stop by #0 BP - Line /Users/loic.nageleisen/test.rb:9 (line)
irb:rdbg(main):004> continue
[1, 9] in test.rb
1| def foo
2| 10.times do |i|
=> 3| p i
4| end
5| end
6|
7| binding.irb
8|
9| foo
=>#0 block {|i=0|} in foo at test.rb:3
#1 Integer#times at <internal:numeric>:237
# and 2 frames (use `bt' command for all frames)
Stop by #1 BP - Line /Users/loic.nageleisen/test.rb:3 (line)
irb:rdbg(main):005> bt
=>#0 block {|i=0|} in foo at test.rb:3
#1 Integer#times at <internal:numeric>:237
#2 Object#foo at test.rb:2
#3 <main> at test.rb:9
irb:rdbg(main):006>
See also the debug gem by itself:
- https://github.com/ruby/debug#debug-command-on-the-debug-console https://github.com/ruby/debug#debug-command-on-the-debug-con...
- https://github.com/ruby/debug#remote-debugging https://github.com/ruby/debug#remote-debugging
- https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg https://marketplace.visualstudio.com/items?itemName=KoichiSa...