Logo

dev-resources.site

for different kinds of informations.

debug.gem blog: initial commit

Published at
7/31/2021
Categories
ruby
debugger
Author
ko1
Categories
2 categories in total
ruby
open
debugger
open
Author
3 person written this
ko1
open
debug.gem blog: initial commit

About this series of articles

This series introduce features of ruby/debug: Debugging functionality for Ruby now I'm working on. debug.gem will be introduced into Ruby 3.1 which will be released Dec/2021.

This article introduce about debug.gem, the background and the motivation.

BTW see the recent article A Sneak Peek of Ruby's New Debugger! by @st0012. His great article introduces debug.gem from Ruby on Rails developer perspective.

Background and motivation

debug.gem is a debugger for Ruby. It is new replacement of lib/debug.rb which is installed from ancient Ruby 1.3.1 (!!). However, lib/debug.rb is not maintained well long time and nobody uses it. Surprisingly, most of features works on recent Ruby versions. However, it introduce performance penalties to the application and it lacks important features like flexible breakpoint setting or remote debugging or IDE integration (it can integrate with emacs, though) and so on. Also it doesn't have cosmetic features like coloring.

Maybe byebug (deivid-rodriguez/byebug: Debugging in Ruby 2) is most famous Ruby's debugger in recent years. byebug has enough features, however it doesn't utilize recent added TracePoint features for debuggers, so it is slow when some breakpoint is set.

byebug supports threading. However Ruby 3.0 introduced Ractor (ruby/ractor.md at master ยท ruby/ruby). Ractor enables to make parallel program in Ruby, but the parallel programming is difficult and it needs support for debugging. However, it is hard to support ractors by existing debuggers.

Hidden but the most important motivation is I (Koichi) likes to make a developer support tools. I feel that using debugger is difficult for the programmers. It is challenging topic to provide useful features for many Rubyists.

Making a new gem

We talked about replacement plan of lib/debug.rb. Fortunately we can reserve "debug" gem name in rubygem.org so we decided to make a new gem and replace with lib/debug.rb

Conclusion

This article introduces the background and the motivation of debug.gem.

There is no debugger implementation to utilize MRI's new features for debuggers and no debugger supports Ractors. This is why we decided to make a new debugger.

I really appreciate any feedback about debug.gem. Next I will introduce basic features of debug.gem.

Acknowledgements

  • This work is supported by Cookpad, an employer of me (Koichi). In recent months Cookpad allowed me to focus on the debugger development.
  • Naoto Ono helps us to prepare testing framework on Google summer of code project (Ruby | Google Summer of Code).
  • Stan Lo contributes appealing features like text coloring and tells us the debugger experience on his projects.
  • And all contributors!
debugger Article's
30 articles in total
Favicon
A Comprehensive Guide to Debugging Go Code for Developers
Favicon
Top Java Debugging Tools for Efficient Application Development
Favicon
Mastering Debugging in C++: Techniques, Tools, and Best Practices for Developers
Favicon
Comprehensive Guide to Python Debugging Tools for Efficient Code Troubleshooting
Favicon
How to configure Delve (dlv) in VS Code
Favicon
Hover Console: Real-time JavaScript debugging directly on your webpage
Favicon
Debugging with breakpoints in ExUnit
Favicon
Precisamos falar sobre ipdb: Uma Jornada para um debugger mais Eficiente em Python
Favicon
Introduction to Debugging with React Developer Tools
Favicon
JavaScript Magic Tricks: Debugger Interception
Favicon
Streamlining Nodejs Error Debugging with Errsole Debugger: Node.js
Favicon
debugging in python for beginners
Favicon
Advance Free Debugger
Favicon
Setup ruby/debug with VSCode
Favicon
Integrating requestly mobile debugger in PostBook App
Favicon
HyperDbg: State-of-the-art native debugging tool
Favicon
Show properties of an object during the debug
Favicon
Debugging Swift in VS Code the old way
Favicon
Levelling up - 2: Use the debugger
Favicon
debug.gem blog: initial commit
Favicon
Become a Toolmaker
Favicon
3 steps to setup debugger for React Native app in WebStorm
Favicon
Kinx v0.19.3 Preview Released
Favicon
Debug Go with VIM
Favicon
Debugging As a Developer
Favicon
Ways to create a new Chrome instance without CORS [macOS]
Favicon
Stop Using Print and Die Statements
Favicon
Debugging Python applications (plus free cheat sheet)
Favicon
Dude, get a debugger!
Favicon
Introduction of LLDB

Featured ones: