ruby-debug 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +94 -2
- data/ChangeLog +5225 -0
- data/README +30 -1
- data/Rakefile +55 -24
- data/bin/rdebug +249 -128
- data/cli/ruby-debug/command.rb +30 -3
- data/cli/ruby-debug/commands/breakpoints.rb +54 -24
- data/cli/ruby-debug/commands/catchpoint.rb +13 -12
- data/cli/ruby-debug/commands/condition.rb +49 -0
- data/cli/ruby-debug/commands/continue.rb +32 -0
- data/cli/ruby-debug/commands/control.rb +19 -43
- data/cli/ruby-debug/commands/disassemble.RB +38 -0
- data/cli/ruby-debug/commands/display.rb +1 -1
- data/cli/ruby-debug/commands/edit.rb +48 -0
- data/cli/ruby-debug/commands/enable.rb +78 -35
- data/cli/ruby-debug/commands/eval.rb +6 -5
- data/cli/ruby-debug/commands/finish.rb +42 -0
- data/cli/ruby-debug/commands/frame.rb +64 -33
- data/cli/ruby-debug/commands/help.rb +19 -15
- data/cli/ruby-debug/commands/info.rb +295 -36
- data/cli/ruby-debug/commands/irb.rb +3 -1
- data/cli/ruby-debug/commands/list.rb +27 -50
- data/cli/ruby-debug/commands/quit.rb +38 -0
- data/cli/ruby-debug/commands/reload.rb +40 -0
- data/cli/ruby-debug/commands/save.rb +80 -0
- data/cli/ruby-debug/commands/{settings.rb → set.rb} +50 -12
- data/cli/ruby-debug/commands/show.rb +83 -27
- data/cli/ruby-debug/commands/source.rb +36 -0
- data/cli/ruby-debug/commands/stepping.rb +36 -72
- data/cli/ruby-debug/commands/threads.rb +32 -23
- data/cli/ruby-debug/commands/variables.rb +34 -4
- data/cli/ruby-debug/helper.rb +10 -75
- data/cli/ruby-debug/interface.rb +72 -9
- data/cli/ruby-debug/processor.rb +203 -100
- data/doc/rdebug.1 +7 -2
- data/rdbg.rb +33 -0
- data/test/{test-ruby-debug-base.rb → base/base.rb} +27 -29
- data/test/base/binding.rb +31 -0
- data/test/base/catchpoint.rb +26 -0
- data/test/base/load.rb +40 -0
- data/test/data/annotate.cmd +29 -0
- data/test/data/annotate.right +137 -0
- data/test/data/break_bad.cmd +18 -0
- data/test/data/break_bad.right +28 -0
- data/test/data/breakpoints.cmd +38 -0
- data/test/data/breakpoints.right +98 -0
- data/test/data/condition.cmd +28 -0
- data/test/data/condition.right +65 -0
- data/test/data/ctrl.cmd +23 -0
- data/test/data/ctrl.right +69 -0
- data/test/{display.cmd → data/display.cmd} +7 -1
- data/test/{display.right → data/display.right} +13 -6
- data/test/data/dollar-0.right +2 -0
- data/test/data/dollar-0a.right +2 -0
- data/test/data/dollar-0b.right +2 -0
- data/test/data/edit.cmd +12 -0
- data/test/data/edit.right +19 -0
- data/test/{breakpoints.cmd → data/emacs_basic.cmd} +0 -0
- data/test/{breakpoints.right → data/emacs_basic.right} +24 -12
- data/test/data/enable.cmd +20 -0
- data/test/data/enable.right +36 -0
- data/test/data/finish.cmd +16 -0
- data/test/data/finish.right +43 -0
- data/test/{frame.cmd → data/frame.cmd} +2 -0
- data/test/{frame.right → data/frame.right} +8 -2
- data/test/{help.cmd → data/help.cmd} +8 -0
- data/test/data/help.right +21 -0
- data/test/data/history.right +7 -0
- data/test/data/info-thread.cmd +13 -0
- data/test/data/info-thread.right +37 -0
- data/test/data/info-var-bug2.cmd +5 -0
- data/test/data/info-var-bug2.right +10 -0
- data/test/{info-var.cmd → data/info-var.cmd} +3 -3
- data/test/{info-var.right → data/info-var.right} +20 -15
- data/test/{info.cmd → data/info.cmd} +10 -1
- data/test/data/info.right +65 -0
- data/test/data/linetrace.cmd +6 -0
- data/test/data/linetrace.right +32 -0
- data/test/data/linetracep.cmd +7 -0
- data/test/data/linetracep.right +25 -0
- data/test/data/list.cmd +19 -0
- data/test/data/list.right +127 -0
- data/test/data/noquit.right +1 -0
- data/test/data/output.cmd +6 -0
- data/test/data/output.right +41 -0
- data/test/data/post-mortem-next.cmd +8 -0
- data/test/data/post-mortem-next.right +14 -0
- data/test/data/post-mortem-osx.right +31 -0
- data/test/data/post-mortem.cmd +13 -0
- data/test/data/post-mortem.right +31 -0
- data/test/{quit.cmd → data/quit.cmd} +2 -5
- data/test/data/quit.right +9 -0
- data/test/data/raise.cmd +11 -0
- data/test/data/raise.right +26 -0
- data/test/{setshow.cmd → data/setshow.cmd} +0 -1
- data/test/{setshow.right → data/setshow.right} +0 -1
- data/test/data/source.cmd +5 -0
- data/test/data/source.right +15 -0
- data/test/{stepping.cmd → data/stepping.cmd} +6 -2
- data/test/{stepping.right → data/stepping.right} +13 -3
- data/test/data/test-init-cygwin.right +7 -0
- data/test/data/test-init-osx.right +4 -0
- data/test/data/test-init.right +5 -0
- data/test/data/trace.right +23 -0
- data/test/dollar-0.rb +5 -0
- data/test/except-bug2.rb +7 -0
- data/test/gcd-dbg-nox.rb +31 -0
- data/test/gcd-dbg.rb +30 -0
- data/test/helper.rb +44 -14
- data/test/info-var-bug.rb +2 -0
- data/test/info-var-bug2.rb +2 -0
- data/test/null.rb +1 -0
- data/test/output.rb +2 -0
- data/test/pm-base.rb +22 -0
- data/test/pm.rb +11 -0
- data/test/raise.rb +3 -0
- data/test/tdebug.rb +88 -40
- data/test/test-annotate.rb +25 -0
- data/test/test-break-bad.rb +25 -0
- data/test/test-breakpoints.rb +14 -17
- data/test/test-condition.rb +25 -0
- data/test/test-ctrl.rb +54 -0
- data/test/test-display.rb +15 -15
- data/test/test-dollar-0.rb +39 -0
- data/test/test-edit.rb +26 -0
- data/test/test-emacs-basic.rb +26 -0
- data/test/test-enable.rb +25 -0
- data/test/test-finish.rb +34 -0
- data/test/test-frame.rb +15 -16
- data/test/test-help.rb +34 -18
- data/test/test-hist.rb +68 -0
- data/test/test-info-thread.rb +32 -0
- data/test/test-info-var.rb +28 -14
- data/test/test-info.rb +15 -17
- data/test/test-init.rb +41 -0
- data/test/test-list.rb +25 -0
- data/test/test-output.rb +26 -0
- data/test/test-pm.rb +46 -0
- data/test/test-quit.rb +19 -17
- data/test/test-raise.rb +25 -0
- data/test/test-setshow.rb +14 -13
- data/test/test-source.rb +25 -0
- data/test/test-stepping.rb +14 -14
- data/test/test-trace.rb +63 -0
- data/test/thread1.rb +26 -0
- metadata +125 -31
- data/cli/ruby-debug/commands/script.rb +0 -64
- data/runner.sh +0 -7
- data/test/help.right +0 -4
- data/test/info.right +0 -35
- data/test/quit.right +0 -22
- data/test/test-columnize.rb +0 -46
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
# ***************************************************
|
|
2
|
-
# This tests
|
|
2
|
+
# This tests the quit.
|
|
3
3
|
# ***************************************************
|
|
4
4
|
set debuggertesting on
|
|
5
|
-
|
|
6
|
-
break 18
|
|
7
|
-
c
|
|
8
|
-
next
|
|
5
|
+
# FIXME need to test --no-quit.
|
|
9
6
|
quit
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
tdebug.rb:53
|
|
2
|
+
if bt
|
|
3
|
+
# # ***************************************************
|
|
4
|
+
# # This tests the quit.
|
|
5
|
+
# # ***************************************************
|
|
6
|
+
# set debuggertesting on
|
|
7
|
+
Currently testing the debugger is on.
|
|
8
|
+
# # FIXME need to test --no-quit.
|
|
9
|
+
# quit
|
data/test/data/raise.cmd
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# ********************************************************
|
|
2
|
+
# This tests that the debugger doesn't step into itself
|
|
3
|
+
# when the application doesn't terminate the right way.
|
|
4
|
+
# ********************************************************
|
|
5
|
+
set debuggertesting on
|
|
6
|
+
catch x
|
|
7
|
+
catch ZeroDivisionError
|
|
8
|
+
info catch
|
|
9
|
+
catch 5
|
|
10
|
+
step
|
|
11
|
+
quit
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
raise.rb:3
|
|
2
|
+
raise "abc"
|
|
3
|
+
# # ********************************************************
|
|
4
|
+
# # This tests that the debugger doesn't step into itself
|
|
5
|
+
# # when the application doesn't terminate the right way.
|
|
6
|
+
# # ********************************************************
|
|
7
|
+
# set debuggertesting on
|
|
8
|
+
Currently testing the debugger is on.
|
|
9
|
+
# catch x
|
|
10
|
+
NameError Exception: undefined local variable or method `x' for main:Object
|
|
11
|
+
# catch ZeroDivisionError
|
|
12
|
+
Catch exception ZeroDivisionError.
|
|
13
|
+
# info catch
|
|
14
|
+
ZeroDivisionError
|
|
15
|
+
# catch 5
|
|
16
|
+
Warning 5 is not known to be a Class
|
|
17
|
+
Catch exception 5.
|
|
18
|
+
# step
|
|
19
|
+
./raise.rb:3
|
|
20
|
+
./tdebug.rb:52:in `debug_load'
|
|
21
|
+
./tdebug.rb:52:in `debug_program'
|
|
22
|
+
./tdebug.rb:243
|
|
23
|
+
../rdbg.rb:23:in `load'
|
|
24
|
+
../rdbg.rb:23:in `runner'
|
|
25
|
+
../rdbg.rb:32
|
|
26
|
+
Uncaught exception: abc
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
gcd.rb:4
|
|
2
|
+
def gcd(a, b)
|
|
3
|
+
# # Test the source command
|
|
4
|
+
# # rdebug-save has breakpoint commands
|
|
5
|
+
# set debuggertesting on
|
|
6
|
+
Currently testing the debugger is on.
|
|
7
|
+
# source ./rdebug-save.1
|
|
8
|
+
Breakpoint 1 file gcd.rb, line 10
|
|
9
|
+
Breakpoint 2 file gcd.rb, line 12
|
|
10
|
+
autoeval is on.
|
|
11
|
+
basename is off.
|
|
12
|
+
Currently testing the debugger is on.
|
|
13
|
+
autolist is off.
|
|
14
|
+
autoirb is off.
|
|
15
|
+
# quit
|
|
@@ -14,16 +14,20 @@ gcd(3,5)
|
|
|
14
14
|
--> #0 at line gcd.rb:18
|
|
15
15
|
# step a
|
|
16
16
|
Step argument 'a' needs to be a number.
|
|
17
|
-
#
|
|
17
|
+
# set forcestep on
|
|
18
|
+
force-stepping is on.
|
|
19
|
+
# step- ; step-
|
|
18
20
|
gcd.rb:6
|
|
19
21
|
if a > b
|
|
22
|
+
# set forcestep off
|
|
23
|
+
force-stepping is off.
|
|
20
24
|
# where
|
|
21
25
|
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
|
22
26
|
#1 at line gcd.rb:18
|
|
23
27
|
# n 2
|
|
24
28
|
gcd.rb:10
|
|
25
29
|
return nil if a <= 0
|
|
26
|
-
# step
|
|
30
|
+
# step+
|
|
27
31
|
gcd.rb:12
|
|
28
32
|
if a == 1 or b-a == 0
|
|
29
33
|
# where
|
|
@@ -32,9 +36,15 @@ if a == 1 or b-a == 0
|
|
|
32
36
|
# step 3
|
|
33
37
|
gcd.rb:6
|
|
34
38
|
if a > b
|
|
39
|
+
# step+
|
|
40
|
+
gcd.rb:10
|
|
41
|
+
return nil if a <= 0
|
|
35
42
|
# where
|
|
36
|
-
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:
|
|
43
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
|
|
37
44
|
#1 Object.-(a#Fixnum, b#Fixnum) at line gcd.rb:15
|
|
38
45
|
#2 at line gcd.rb:18
|
|
46
|
+
# next+
|
|
47
|
+
gcd.rb:12
|
|
48
|
+
if a == 1 or b-a == 0
|
|
39
49
|
# # finish
|
|
40
50
|
# quit
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Tracing(1):gcd.rb:4 def gcd(a, b)
|
|
2
|
+
Tracing(1):gcd.rb:18 gcd(3,5)
|
|
3
|
+
Tracing(1):gcd.rb:6 if a > b
|
|
4
|
+
Tracing(1):gcd.rb:6 if a > b
|
|
5
|
+
Tracing(1):gcd.rb:10 return nil if a <= 0
|
|
6
|
+
Tracing(1):gcd.rb:10 return nil if a <= 0
|
|
7
|
+
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
|
8
|
+
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
|
9
|
+
Tracing(1):gcd.rb:15 return gcd(b-a, a)
|
|
10
|
+
Tracing(1):gcd.rb:6 if a > b
|
|
11
|
+
Tracing(1):gcd.rb:6 if a > b
|
|
12
|
+
Tracing(1):gcd.rb:10 return nil if a <= 0
|
|
13
|
+
Tracing(1):gcd.rb:10 return nil if a <= 0
|
|
14
|
+
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
|
15
|
+
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
|
16
|
+
Tracing(1):gcd.rb:15 return gcd(b-a, a)
|
|
17
|
+
Tracing(1):gcd.rb:6 if a > b
|
|
18
|
+
Tracing(1):gcd.rb:6 if a > b
|
|
19
|
+
Tracing(1):gcd.rb:10 return nil if a <= 0
|
|
20
|
+
Tracing(1):gcd.rb:10 return nil if a <= 0
|
|
21
|
+
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
|
22
|
+
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
|
23
|
+
Tracing(1):gcd.rb:13 return a
|
data/test/dollar-0.rb
ADDED
data/test/except-bug2.rb
ADDED
data/test/gcd-dbg-nox.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This program is *NOT* supposed to be executable, but called
|
|
2
|
+
# via ruby (in order to test that restart provides a funky $:).
|
|
3
|
+
# This program is used to test that 'restart' works when we didn't call
|
|
4
|
+
# the debugger initially.
|
|
5
|
+
|
|
6
|
+
TOP_SRC_DIR = File.join(File.expand_path(File.dirname(__FILE__), '..')) unless
|
|
7
|
+
defined?(TOP_SRC_DIR)
|
|
8
|
+
|
|
9
|
+
$:.unshift File.join(TOP_SRC_DIR, 'ext')
|
|
10
|
+
$:.unshift File.join(TOP_SRC_DIR, 'lib')
|
|
11
|
+
$:.unshift File.join(TOP_SRC_DIR, 'cli')
|
|
12
|
+
require 'ruby-debug'
|
|
13
|
+
Debugger.init
|
|
14
|
+
|
|
15
|
+
# GCD. We assume positive numbers
|
|
16
|
+
def gcd(a, b)
|
|
17
|
+
# Make: a <= b
|
|
18
|
+
debugger
|
|
19
|
+
if a > b
|
|
20
|
+
a, b = [b, a]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
return nil if a <= 0
|
|
24
|
+
|
|
25
|
+
if a == 1 or b-a == 0
|
|
26
|
+
return a
|
|
27
|
+
end
|
|
28
|
+
return gcd(b-a, a)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
gcd(3,5)
|
data/test/gcd-dbg.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This program is used to test that 'restart' works when we didn't call
|
|
3
|
+
# the debugger initially.
|
|
4
|
+
|
|
5
|
+
TOP_SRC_DIR = File.join(File.expand_path(File.dirname(__FILE__), "..")) unless
|
|
6
|
+
defined?(TOP_SRC_DIR)
|
|
7
|
+
|
|
8
|
+
$:.unshift File.join(TOP_SRC_DIR, "ext")
|
|
9
|
+
$:.unshift File.join(TOP_SRC_DIR, "lib")
|
|
10
|
+
$:.unshift File.join(TOP_SRC_DIR, "cli")
|
|
11
|
+
require 'ruby-debug'
|
|
12
|
+
Debugger.start
|
|
13
|
+
|
|
14
|
+
# GCD. We assume positive numbers
|
|
15
|
+
def gcd(a, b)
|
|
16
|
+
# Make: a <= b
|
|
17
|
+
debugger
|
|
18
|
+
if a > b
|
|
19
|
+
a, b = [b, a]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
return nil if a <= 0
|
|
23
|
+
|
|
24
|
+
if a == 1 or b-a == 0
|
|
25
|
+
return a
|
|
26
|
+
end
|
|
27
|
+
return gcd(b-a, a)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
gcd(3,5)
|
data/test/helper.rb
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
# Some common routines used in testing.
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
# require
|
|
5
|
-
# require
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
# require 'diff/lcs'
|
|
5
|
+
# require 'diff/lcs/hunk'
|
|
6
|
+
|
|
7
|
+
# begin require 'rubygems' rescue LoadError end
|
|
8
|
+
# require 'ruby-debug'; Debugger.start
|
|
6
9
|
|
|
7
10
|
module TestHelper
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
# FIXME: turn args into a hash.
|
|
13
|
+
def run_debugger(testname, args='', outfile=nil, filter=nil, old_code=false,
|
|
14
|
+
debug_pgm='tdebug.rb')
|
|
15
|
+
rightfile = File.join('data', "#{testname}.right")
|
|
11
16
|
|
|
12
|
-
outfile =
|
|
17
|
+
outfile = "#{testname}.out" unless outfile
|
|
13
18
|
|
|
14
19
|
if File.exists?(outfile)
|
|
15
20
|
FileUtils.rm(outfile)
|
|
16
21
|
end
|
|
17
22
|
|
|
18
|
-
ENV['RDEBUG'] =
|
|
19
|
-
|
|
23
|
+
ENV['RDEBUG'] = debug_pgm
|
|
24
|
+
if old_code
|
|
25
|
+
cmd = "/bin/sh #{File.join('..', 'runner.sh')} #{args} >#{outfile}"
|
|
26
|
+
else
|
|
27
|
+
cmd = "../rdbg.rb #{args} >#{outfile}"
|
|
28
|
+
end
|
|
29
|
+
# puts cmd
|
|
20
30
|
output = `#{cmd}`
|
|
21
31
|
|
|
22
32
|
got_lines = File.read(outfile).split(/\n/)
|
|
@@ -48,16 +58,36 @@ module TestHelper
|
|
|
48
58
|
return true
|
|
49
59
|
end
|
|
50
60
|
|
|
51
|
-
|
|
61
|
+
# FIXME: using this causes the same test to get run several times
|
|
62
|
+
# and some tests fail probably because of a lack of environment isolation.
|
|
63
|
+
# Many tests follow a basic pattern: run the debugger with a given
|
|
64
|
+
# debugger script and compare output produced. The following creates
|
|
65
|
+
# this kind of test.
|
|
66
|
+
def add_test(base_name, src_dir, script_name=nil, cmd=nil, test_name=nil)
|
|
67
|
+
puts "+++ Adding #{base_name} ++++" if $DEBUG
|
|
68
|
+
test_name = base_name unless test_name
|
|
69
|
+
script_name = File.join('data', test_name + '.cmd') unless script_name
|
|
70
|
+
cmd = 'gcd.rb 3 5' unless cmd
|
|
71
|
+
eval <<-EOF
|
|
72
|
+
def test_#{test_name}
|
|
73
|
+
Dir.chdir(\"#{src_dir}\") do
|
|
74
|
+
assert_equal(true,
|
|
75
|
+
run_debugger(\"#{base_name}\",
|
|
76
|
+
\"--script #{script_name} -- #{cmd}\"))
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
EOF
|
|
80
|
+
end
|
|
81
|
+
module_function :add_test
|
|
82
|
+
|
|
52
83
|
# Adapted from the Ruby Cookbook, Section 6.10: Comparing two files.
|
|
53
84
|
# def diff_as_string(rightfile, checkfile, format=:unified, context_lines=3)
|
|
54
85
|
# right_data = File.read(rightfile)
|
|
55
86
|
# check_data = File.read(checkfile)
|
|
56
|
-
# output =
|
|
87
|
+
# output = ''
|
|
57
88
|
# diffs = Diff::LCS.diff(right_data, check_data)
|
|
58
89
|
# return output if diffs.empty?
|
|
59
90
|
# oldhunk = hunk = nil
|
|
60
|
-
# debugger
|
|
61
91
|
# file_length_difference = 0
|
|
62
92
|
# diffs.each do |piece|
|
|
63
93
|
# begin
|
|
@@ -75,12 +105,12 @@ module TestHelper
|
|
|
75
105
|
# end
|
|
76
106
|
# ensure
|
|
77
107
|
# oldhunk = hunk
|
|
78
|
-
# output <<
|
|
108
|
+
# output << '\n'
|
|
79
109
|
# end
|
|
80
110
|
# end
|
|
81
111
|
|
|
82
112
|
# # Handle the last remaining hunk
|
|
83
|
-
# output << oldhunk.diff(format) <<
|
|
113
|
+
# output << oldhunk.diff(format) << '\n'
|
|
84
114
|
# end
|
|
85
115
|
|
|
86
116
|
end
|
data/test/info-var-bug.rb
CHANGED
data/test/null.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Nothing here. Move along.
|
data/test/output.rb
ADDED
data/test/pm-base.rb
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# Test post-mortem handling using only ruby-debug-base.
|
|
3
|
+
src_dir = File.dirname(__FILE__)
|
|
4
|
+
%w(ext lib cli).each do |dir|
|
|
5
|
+
$:.unshift File.join(src_dir, '..', dir)
|
|
6
|
+
end
|
|
7
|
+
require 'ruby-debug-base'
|
|
8
|
+
|
|
9
|
+
class CommandProcessor
|
|
10
|
+
def at_line(context, file, line)
|
|
11
|
+
puts 'file: %s, line: %s' % [ File.basename(file), line ]
|
|
12
|
+
exit!
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
Debugger.start(:post_mortem => true)
|
|
17
|
+
Debugger.handler = CommandProcessor.new
|
|
18
|
+
def zero_div
|
|
19
|
+
1/0
|
|
20
|
+
end
|
|
21
|
+
zero_div
|
|
22
|
+
|