Debugging in Ruby 2
Ruby C Other
Permalink
Failed to load latest commit information.
.git-hooks/pre_commit Make CCop independent from extension path Aug 1, 2015
bin Manipulate LOAD_PATH from byebug's script Apr 6, 2016
ext/byebug Don't stop byebug with linetrace enabled May 14, 2016
lib Get ready for 9.0.5 release May 28, 2016
script Bump rubocop development dependency May 11, 2016
tasks Drop official Ruby 2.0.0 support May 4, 2016
test Fixes rc loading when `ENV['HOME']` is unset May 28, 2016
.gitignore Add YARD and fix syntax errors Nov 11, 2015
.indent.pro Fix code style issues Feb 19, 2015
.mdlrc Fix some style issues in markdown files May 11, 2016
.overcommit.yml Enforce style on C header files too Apr 6, 2016
.rubocop.yml Disable `Style/RaiseArgs` cop May 17, 2016
.rubocop_todo.yml Fix a couple of class comments May 19, 2016
.travis.yml Fix build failure on "ruby-head" x "CC=clang" May 14, 2016
CHANGELOG.md Get ready for 9.0.5 release May 28, 2016
CONTRIBUTING.md Fix some style issues in markdown files May 11, 2016
GUIDE.md Remove unnecessary list in the guide May 11, 2016
Gemfile Bump chandler development dependency May 16, 2016
Gemfile.lock Get ready for 9.0.5 release May 28, 2016
LICENSE Fix typo in License Dec 9, 2014
README.md Fix Gratipay urls: we want the one for the team Mar 16, 2016
Rakefile Add chandler dev dependency Apr 7, 2016
Ruby_Grant_2014_Report.md Add Mdl and fix offenses Jan 31, 2016
appveyor.yml Drop official Ruby 2.0.0 support May 4, 2016
byebug.gemspec Use http://spdx.org/licenses identifier in gemspec. Jun 8, 2016
code_of_conduct.md Add Mdl and fix offenses Jan 31, 2016

README.md

Byebug

Version Quality Coverage Gratipay Gitter

Byebug is a simple to use, feature rich debugger for Ruby 2. It uses the new TracePoint API for execution control and the new Debug Inspector API for call stack navigation, so it doesn't depend on internal core sources. It's developed as a C extension, so it's fast. And it has a full test suite so it's reliable.

It allows you to see what is going on inside a Ruby program while it executes and offers many of the traditional debugging features such as:

  • Stepping: Running your program one line at a time.
  • Breaking: Pausing the program at some event or specified instruction, to examine the current state.
  • Evaluating: Basic REPL functionality, although pry does a better job at that.
  • Tracking: Keeping track of the different values of your variables or the different lines executed by your program.

Build Status

Linux Tra

Windows Vey

Requirements

  • Required: MRI 2.0.0 or higher. For debugging ruby 1.9.3 or older, use debugger.
  • Recommended:
    • MRI 2.1.8 or higher.
    • MRI 2.2.4 or higher.
    • MRI 2.3.0 or higher.

Install

gem install byebug

Usage

Simply drop

byebug

wherever you want to start debugging and the execution will stop there. If you were debugging Rails, for example, you would add byebug to your code.

def index
  byebug
  @articles = Article.find_recent

And then start a Rails server.

bin/rails s

Once the execution gets to your byebug command you will get a debugging prompt.

Byebug's commands

Command Aliases Subcommands
backtrace bt where
break
catch
condition
continue
delete
debug
disable breakpoints display
display
down
edit
enable breakpoints display
finish
frame
help
history
info args breakpoints catch display file line program
irb
kill
list
method instance
next
pry
quit
restart
save
set autoirb autolist autopry autosave basename callstyle fullpath histfile histsize linetrace listsize post_mortem savefile stack_on_error width
show autoirb autolist autopry autosave basename callstyle fullpath histfile histsize linetrace listsize post_mortem savefile stack_on_error width
source
step
thread current list resume stop switch
tracevar
undisplay
up
var all constant global instance local

Semantic Versioning

Byebug tries to follow semantic versioning and tries to bump major version only when backwards incompatible changes are released. Backwards compatibility is targeted to pry-byebug and any other plugins relying on byebug.

Getting Started

Read byebug's markdown guide to get started. Proper documentation will be eventually written.

Related projects

Contribute

See Getting Started with Development.

Credits

Everybody who has ever contributed to this forked and reforked piece of software, especially:

  • @ko1, author of the awesome TracePoint API for Ruby.
  • @cldwalker, debugger's maintainer.
  • @denofevil, author of debase, the starting point of this.
  • @kevjames3 for testing, bug reports and the interest in the project.
  • @FooBarWidget for working and helping with remote debugging.