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.
2. 2
Ruby Debugger – Introduction
● Debugger is a tool for testing and inspecting running programs
● The Ruby debugger is called “byebug”
3. 3
Ruby Debugger – Installation
Run
Gemfile:
Run
gem install byebug
group :development, :test do
gem 'byebug'
end
bundle install
4. 4
Ruby Debugger – Usage
Start:
Or adapt the script:
And start:
require 'byebug'
byebug
byebug script.rb
ruby script.rb
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
Byebug – Solution
Byebug client/server architecture
● Input/output goes through a TCP port instead of STDOUT/STDIN
● Allows remote debugging
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
YaST – GUI
Open a new terminal window automatically
● Run “xterm -e byebug -R ... ”