Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Integrating the Ruby Debugger into YaST

137 views

Published on

The slides describe the Ruby debugger called "byebug" and it's integration into the YaST installer which is used in openSUSE and SUSE Linux Enterprise products.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Integrating the Ruby Debugger into YaST

  1. 1. Ruby Debugger Integrating Ruby Debugger into YaST Ing. Ladislav Slezák SUSE (The YaST Team) lslezak@suse.com
  2. 2. 2 Ruby Debugger – Introduction ● Debugger is a tool for testing and inspecting running programs ● The Ruby debugger is called “byebug”
  3. 3. 3 Ruby Debugger – Installation Run Gemfile: Run gem install byebug group :development, :test do gem 'byebug' end bundle install
  4. 4. 4 Ruby Debugger – Usage Start: Or adapt the script: And start: require 'byebug' byebug byebug script.rb ruby script.rb
  5. 5. 5 And YaST...? Unfortunately this does NOT work in YaST… ● YaST runs embedded Ruby ● YaST is a GUI/TUI desktop application ● The installer runs in a limited minimal system ● Read-only RAM disk, no storage ● No desktop environment ● Cannot install new libraries/gems easily
  6. 6. 6 Byebug – Solution Byebug client/server architecture ● Input/output goes through a TCP port instead of STDOUT/STDIN ● Allows remote debugging
  7. 7. 7 Byebyg – Remote Debugging Start server (in the code): Start client (from another console): # initialize the server require 'byebug/core' Byebug.wait_connection = true # use ‘0.0.0.0’ for real remote debugging Byebug.start_server('localhost', 3344) … # start the debugger byebug byebug -R localhost:3344
  8. 8. 8 YaST – GUI Open a new terminal window automatically ● Run “xterm -e byebug -R ... ”
  9. 9. 9 YaST – Text Mode Connect manually in the text mode
  10. 10. 10 Invoking the Debugger in YaST Simply boot the installer with In installed system run with y2debugger=1 Y2DEBUGGER=1 yast2 <module>
  11. 11. 11 Demo
  12. 12. 12 YaST – Exceptions ● Run the debugger also from the global exception handler
  13. 13. 13 Questions?
  14. 14. 14 Links ● https://github.com/deivid-rodriguez/byebug ● https://github.com/deivid-rodriguez/byebug/blob/master/GUIDE.md ● https://yastgithubio.readthedocs.io/en/latest/debugging/ ● https://github.com/yast/yast-ruby-bindings/blob/master/src/ruby/yast/debug
  15. 15. 15 Thank You!

×