デバッグモード

http://d.hatena.ne.jp/lurker/20060620
なるほど。これってIDEとかじゃなくてもできるんだよね?
と思って試してみる。


テスト用のソース hello.rb

1 value = "aiueo"
2 puts value


デバッグを開始する

ruby -rdebug hello.rb


ブレークポイントを設定する

(rdb:1) break hello.rb:1
Set breakpoint 1 at hello.rb:1


ブレークポイントまで飛ぶ

(rdb:1) c
Breakpoint 1, toplevel at hello.rb:1
hello.rb:1:value = "aiueo"


1行進める

(rdb:1) n
hello.rb:2:puts value


valueの内容を出力する

(rdb:1) value
aiueo


1行進める

(rdb:1) n
aiueo