integrating the ruby debugger into yast

Download Integrating the Ruby Debugger into YaST

If you can't read please download the document

Upload: lslezak

Post on 10-Jan-2017

62 views

Category:

Software


0 download

TRANSCRIPT

Ruby Debugger
Integrating Ruby Debugger into YaST

Ing. Ladislav SlezkSUSE (The YaST Team)[email protected]

Ruby Debugger Introduction

Debugger is a tool for testing and inspecting running programs

The Ruby debugger is called byebug

Ruby Debugger Installation

Run

Gemfile:

Run

gem install byebug

group :development, :test do gem 'byebug'end

bundle install

Ruby Debugger Usage

Start:

Or adapt the script:

And start:

require 'byebug'byebug

byebug script.rb

ruby script.rb

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 systemRead-only RAM disk, no storage

No desktop environment

Cannot install new libraries/gems easily

Byebug Solution

Byebug client/server architecture

Input/output goes through a TCP port instead of STDOUT/STDIN

Allows remote debugging

Byebyg Remote Debugging

Start server (in the code):

Start client (from another console):

# initialize the serverrequire 'byebug/core'Byebug.wait_connection = true# use 0.0.0.0 for real remote debuggingByebug.start_server('localhost', 3344)# start the debuggerbyebug

byebug -R localhost:3344

YaST GUI

Open a new terminal window automatically

Run xterm -e byebug -R ...

YaST Text Mode

Connect manually in the text mode

Invoking the Debugger in YaST

Simply boot the installer with

In installed system run with

y2debugger=1

Y2DEBUGGER=1 yast2

Demo

YaST Exceptions

Run the debugger also from the global exception handler

Questions?

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/debugger.rb

Thank You!

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline LevelSeventh Outline Level

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline LevelSeventh Outline Level

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline LevelSeventh Outline Level