Control debugger from TextMate

Posted on August 27, 2006

Wouldn't it be great if I can set breakpoints right from within TextMate? I've been thinking about this myself for sometime.

And now I'd like to introduce a new Ruby Debug Bundle.

Note that in order to use it you must have the latest version (0.4.1 or higher) of ruby-debug installed.

How to use it?

Let's say you want to debug your Rails application.

  1. Start your application with the remote debugging enabled:

    $ rdebug -sn ./script/server webrick
    
  2. Connect to the debugger (in new terminal):

    $ rdebug -c
    Connected.
    
  3. In TextMate go to the line where you want to set a breakpoint and press ⇧⌘B and select Set Breakpoint at Current Line.

  4. Open your browser and start using your application until you reach the breakpoint.

That's it.

Currently, these commands are available:

  1. Set Breakpoint at Current Line
  2. Delete All Breakpoints.
  3. Show Breakpoints - show all breakpoints as a tooltip.
  4. Interrupt - interrupt the last debugged thread or, if there is no one, the main thread.
  5. Quit - quit application.