Skip to content

Instantly share code, notes, and snippets.

@duncan-bayne
Created January 23, 2013 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duncan-bayne/4600539 to your computer and use it in GitHub Desktop.
Save duncan-bayne/4600539 to your computer and use it in GitHub Desktop.
Setting a breakpoint from within the Ruby debugger
$ cat test.rb
class Foo
def bar
'baz'
end
end
debugger
Foo.new.bar
$ be rdebug test.rb
[-4, 5] in /Users/dev/Dropbox/repos/atlas/test.rb
=> 1 class Foo
2 def bar
3 'baz'
4 end
5 end
/Users/dev/Dropbox/repos/atlas/test.rb:1
class Foo
(rdb:1) c
[3, 12] in /Users/dev/Dropbox/repos/atlas/test.rb
3 'baz'
4 end
5 end
6
7 debugger
=> 8 Foo.new.bar
/Users/dev/Dropbox/repos/atlas/test.rb:8
Foo.new.bar
(rdb:1) break Foo.bar
Breakpoint 1 at Foo::bar
(rdb:1) c
Breakpoint 1 at Foo:bar
[-3, 6] in /Users/dev/Dropbox/repos/atlas/test.rb
1 class Foo
=> 2 def bar
3 'baz'
4 end
5 end
6
/Users/dev/Dropbox/repos/atlas/test.rb:2
def bar
(rdb:1) c
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment