October 2006
Intermediate to advanced
888 pages
16h 55m
English
Truthfully, the Ruby debugger does not seem to get much use. I do not use it, and I have talked to very few who do. But it’s nice to know that it’s there. Here’s a brief description of how it works.
Invoke the debugger simply by requiring the debug library. This can be done on the command line:
ruby -rdebug myfile.rb
At the prompt (which looks like (rdb:1) ), you can type such commands as list to list any or all of the program, step to step into a method call, and so on. A few of these commands are listed in Table 16.1 (with the abbreviation in boldface).
| Command | Description |
|---|---|
| break | List or set a breakpoint. |
| delete | Delete some or all breakpoints. |
| catch | List or set a catchpoint. |
| step | Step ... |
Read now
Unlock full access