Info
顯示相關(guān)信息
-
info args # Argument variables of current stack frame
[7, 16] in /Users/wanghao/Work/common_divisor.rb 7 if(x < y) 8 return gcd2(y , x) 9 elsif(y == 0) 10 return x 11 else => 12 return gcd2(x - y , y) 13 end 14 end 15 16 def gcd3(x ,y) (rdb:1) info args x = 1071 y = 462 (rdb:1) show line line tracing is off (rdb:1) info line Line 12 of "/Users/wanghao/Work/common_divisor.rb" (rdb:1) info stack --> #0 CommonDivisor.gcd2(x#Fixnum,...) at line /Users/wanghao/Work/common_divisor.rb:12 #1 at line /Users/wanghao/Work/common_divisor.rb:52
-
info breakpoints # 顯示當(dāng)前所有斷點的狀態(tài)
(rdb:1) info breakpoints Num Enb What 1 y at /Users/wanghao/Work/common_divisor.rb:51 2 y at /Users/wanghao/Work/common_divisor.rb:51 3 y at /Users/wanghao/Work/common_divisor.rb:3
info catch # 可以被捕獲的Exceptions,通過catch命令設(shè)定
info display # 程序結(jié)束時的輸出
info file # 關(guān)于讀取文件的內(nèi)容
info files # 關(guān)于讀取文件的時間和名字等信息
info global_variables # 所有全局變量
info instance_variables # 當(dāng)前frame的示例變量
-
info line # 當(dāng)前文件的當(dāng)前行有關(guān)信息
[4, 13] in /Users/wanghao/Work/common_divisor.rb 4 end 5 6 def gcd2(x , y) 7 if(x < y) 8 return gcd2(y , x) => 9 elsif(y == 0) 10 return x 11 else 12 return gcd2(x - y , y) 13 end (rdb:1) info line Line 9 of "/Users/wanghao/Work/common_divisor.rb" (rdb:1) info stack --> #0 CommonDivisor.gcd2(x#Fixnum,...) at line /Users/wanghao/Work/common_divisor.rb:9 #1 at line /Users/wanghao/Work/common_divisor.rb:52
-
info locals # 局部變量信息
(rdb:1) info locals x = 1071 y = 462
info program # 程序執(zhí)行狀態(tài)信息
-
info stack # 相關(guān)stack信息
(rdb:1) info stack --> #0 CommonDivisor.gcd(x#Fixnum,...) at line /Users/wanghao/Work/common_divisor.rb:3 #1 CommonDivisor.gcd(x#Fixnum,...) at line /Users/wanghao/Work/common_divisor.rb:3 #2 at line /Users/wanghao/Work/common_divisor.rb:51
info thread # Thread相關(guān)信息
info threads # Thread相關(guān)信息
(rdb:1) info threads
+ 1 #<Thread:0x007fc7ab0677a8 run> /Users/wanghao/Work/common_divisor.rb:3
!2 #<Debugger::DebugThread:0x007fc7ab364b40 sleep>-
info variables # 局部變量示例變量信息
self = ... x = 462 y = 147
Set
設(shè)定ruby-debug的環(huán)境晰奖,Boolean變量可以設(shè)定為on off或者1 0 設(shè)定變量可以用show顯示
set annotate # 設(shè)定注釋等級
set args # 設(shè)定變量列表,用來傳遞給運行環(huán)境
-
set autoeval # 在不能直接輸出的表達(dá)式,進(jìn)行eval計算
(rdb:1) set autoeval 0 autoeval is off (rdb:1) fib2 *** Unknown command: "fib2". Try "help". (rdb:1) fib1 *** Unknown command: "fib1". Try "help". (rdb:1) (rdb:1) fib1=0\; fib2=1\; 5.times {|temp| temp=fib1\; fib1=fib2\; fib2 += temp } *** Unknown command: "fib1=0; fib2=1; 5.times {|temp| temp=fib1; fib1=fib2; fib2 += temp }". Try "help". (rdb:1) set autoeval 1 autoeval is on (rdb:1) fib1=0\; fib2=1\; 5.times {|temp| temp=fib1\; fib1=fib2\; fib2 += temp } 5 (rdb:1) fib1 5 (rdb:1) fib2 8
set autolist # 在每個breakpoint時執(zhí)行l(wèi)ist
set autoirb # 任何時候只要stop則執(zhí)行irb
set autoreload # 當(dāng)代碼有修改的時候,從新load
set basename # 設(shè)定basename只顯示文件名
set callstyle # 設(shè)定顯示變量格式
set debuggertesting # 用于測試debugger自身
set forcestep # 保證'next/step'命令總是能向新行移動
set fullpath # 在frames中顯示文件的完整路徑名
set history # Generic command for setting command history parameters
set keep-frame-bindings # Save frame binding on each call
set linetrace+ # Set line execution tracing to show different lines
set linetrace # Set line execution tracing
set listsize # Set number of source lines to list by default
set trace # Display stack trace when 'eval' raises exception
set width # Number of characters the debugger thinks are in a line
Thread
用于線程操作
th[read] l[ist] # 列出所有的線程
th[read] stop <nnn> # 停止指定線程
th[read] resume <nnn> # 恢復(fù)指定線程
th[read] [sw[itch]] <nnn> # 切換執(zhí)行環(huán)境到指定線程
th[read] [cur[rent]] # 顯示當(dāng)前線程
Trace
tr[ace] (on|off) set trace mode of current thread
tr[ace] (on|off) all set trace mode of all threads