Skip to content

Instantly share code, notes, and snippets.

@hell0again
Created February 5, 2015 06:00
Show Gist options
  • Save hell0again/bdbef768361411b1d6c0 to your computer and use it in GitHub Desktop.
Save hell0again/bdbef768361411b1d6c0 to your computer and use it in GitHub Desktop.
デバッガあれこれ

perl

perl -d file.pl
  • ブレークポイント文は $DB::single = 1

実行関連

Command Action
n Next.
s Step in.
o step Out.
c Continue.
r Returnまで進める

ビュー関連

Command Action
T show back-Trace.
y 現在のスコープの変数を表示
x eXpr
p Print
l 一画面分表示。押すたびに次へ
- 一画面分前を表示。押すたびに前へ
v 付近を表示。押すたびに次へ
. 現在の行を表示。

ruby

  • ruby 1.9.3

    • gem install debugger

    • require 'debugger'

    • ブレークポイント文は debugger

    • 起動は ruby file.rb のみでOK

    • ブレークポイント文が不要なら ruby -r debug.rb file.rb

  • ruby2.1

    • gem install byebug
    • require 'byebug'
    • ブレークポイント文は debugger
    • 起動は ruby file.rb のみでOK

` ``

実行関連

Command Action
n Next.
s Step in.
o step Out.
c Continue.
fin Returnまで進める

ビュー関連

Command Action
bt or where show back-Trace.
p Print
l ソース表示。l 4,9 で4行目から9行目まで表示
v l ローカル変数を表示
v g グローバル変数を表示
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment