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.
Files changed (152) hide show
  1. data/CHANGES +94 -2
  2. data/ChangeLog +5225 -0
  3. data/README +30 -1
  4. data/Rakefile +55 -24
  5. data/bin/rdebug +249 -128
  6. data/cli/ruby-debug/command.rb +30 -3
  7. data/cli/ruby-debug/commands/breakpoints.rb +54 -24
  8. data/cli/ruby-debug/commands/catchpoint.rb +13 -12
  9. data/cli/ruby-debug/commands/condition.rb +49 -0
  10. data/cli/ruby-debug/commands/continue.rb +32 -0
  11. data/cli/ruby-debug/commands/control.rb +19 -43
  12. data/cli/ruby-debug/commands/disassemble.RB +38 -0
  13. data/cli/ruby-debug/commands/display.rb +1 -1
  14. data/cli/ruby-debug/commands/edit.rb +48 -0
  15. data/cli/ruby-debug/commands/enable.rb +78 -35
  16. data/cli/ruby-debug/commands/eval.rb +6 -5
  17. data/cli/ruby-debug/commands/finish.rb +42 -0
  18. data/cli/ruby-debug/commands/frame.rb +64 -33
  19. data/cli/ruby-debug/commands/help.rb +19 -15
  20. data/cli/ruby-debug/commands/info.rb +295 -36
  21. data/cli/ruby-debug/commands/irb.rb +3 -1
  22. data/cli/ruby-debug/commands/list.rb +27 -50
  23. data/cli/ruby-debug/commands/quit.rb +38 -0
  24. data/cli/ruby-debug/commands/reload.rb +40 -0
  25. data/cli/ruby-debug/commands/save.rb +80 -0
  26. data/cli/ruby-debug/commands/{settings.rb → set.rb} +50 -12
  27. data/cli/ruby-debug/commands/show.rb +83 -27
  28. data/cli/ruby-debug/commands/source.rb +36 -0
  29. data/cli/ruby-debug/commands/stepping.rb +36 -72
  30. data/cli/ruby-debug/commands/threads.rb +32 -23
  31. data/cli/ruby-debug/commands/variables.rb +34 -4
  32. data/cli/ruby-debug/helper.rb +10 -75
  33. data/cli/ruby-debug/interface.rb +72 -9
  34. data/cli/ruby-debug/processor.rb +203 -100
  35. data/doc/rdebug.1 +7 -2
  36. data/rdbg.rb +33 -0
  37. data/test/{test-ruby-debug-base.rb → base/base.rb} +27 -29
  38. data/test/base/binding.rb +31 -0
  39. data/test/base/catchpoint.rb +26 -0
  40. data/test/base/load.rb +40 -0
  41. data/test/data/annotate.cmd +29 -0
  42. data/test/data/annotate.right +137 -0
  43. data/test/data/break_bad.cmd +18 -0
  44. data/test/data/break_bad.right +28 -0
  45. data/test/data/breakpoints.cmd +38 -0
  46. data/test/data/breakpoints.right +98 -0
  47. data/test/data/condition.cmd +28 -0
  48. data/test/data/condition.right +65 -0
  49. data/test/data/ctrl.cmd +23 -0
  50. data/test/data/ctrl.right +69 -0
  51. data/test/{display.cmd → data/display.cmd} +7 -1
  52. data/test/{display.right → data/display.right} +13 -6
  53. data/test/data/dollar-0.right +2 -0
  54. data/test/data/dollar-0a.right +2 -0
  55. data/test/data/dollar-0b.right +2 -0
  56. data/test/data/edit.cmd +12 -0
  57. data/test/data/edit.right +19 -0
  58. data/test/{breakpoints.cmd → data/emacs_basic.cmd} +0 -0
  59. data/test/{breakpoints.right → data/emacs_basic.right} +24 -12
  60. data/test/data/enable.cmd +20 -0
  61. data/test/data/enable.right +36 -0
  62. data/test/data/finish.cmd +16 -0
  63. data/test/data/finish.right +43 -0
  64. data/test/{frame.cmd → data/frame.cmd} +2 -0
  65. data/test/{frame.right → data/frame.right} +8 -2
  66. data/test/{help.cmd → data/help.cmd} +8 -0
  67. data/test/data/help.right +21 -0
  68. data/test/data/history.right +7 -0
  69. data/test/data/info-thread.cmd +13 -0
  70. data/test/data/info-thread.right +37 -0
  71. data/test/data/info-var-bug2.cmd +5 -0
  72. data/test/data/info-var-bug2.right +10 -0
  73. data/test/{info-var.cmd → data/info-var.cmd} +3 -3
  74. data/test/{info-var.right → data/info-var.right} +20 -15
  75. data/test/{info.cmd → data/info.cmd} +10 -1
  76. data/test/data/info.right +65 -0
  77. data/test/data/linetrace.cmd +6 -0
  78. data/test/data/linetrace.right +32 -0
  79. data/test/data/linetracep.cmd +7 -0
  80. data/test/data/linetracep.right +25 -0
  81. data/test/data/list.cmd +19 -0
  82. data/test/data/list.right +127 -0
  83. data/test/data/noquit.right +1 -0
  84. data/test/data/output.cmd +6 -0
  85. data/test/data/output.right +41 -0
  86. data/test/data/post-mortem-next.cmd +8 -0
  87. data/test/data/post-mortem-next.right +14 -0
  88. data/test/data/post-mortem-osx.right +31 -0
  89. data/test/data/post-mortem.cmd +13 -0
  90. data/test/data/post-mortem.right +31 -0
  91. data/test/{quit.cmd → data/quit.cmd} +2 -5
  92. data/test/data/quit.right +9 -0
  93. data/test/data/raise.cmd +11 -0
  94. data/test/data/raise.right +26 -0
  95. data/test/{setshow.cmd → data/setshow.cmd} +0 -1
  96. data/test/{setshow.right → data/setshow.right} +0 -1
  97. data/test/data/source.cmd +5 -0
  98. data/test/data/source.right +15 -0
  99. data/test/{stepping.cmd → data/stepping.cmd} +6 -2
  100. data/test/{stepping.right → data/stepping.right} +13 -3
  101. data/test/data/test-init-cygwin.right +7 -0
  102. data/test/data/test-init-osx.right +4 -0
  103. data/test/data/test-init.right +5 -0
  104. data/test/data/trace.right +23 -0
  105. data/test/dollar-0.rb +5 -0
  106. data/test/except-bug2.rb +7 -0
  107. data/test/gcd-dbg-nox.rb +31 -0
  108. data/test/gcd-dbg.rb +30 -0
  109. data/test/helper.rb +44 -14
  110. data/test/info-var-bug.rb +2 -0
  111. data/test/info-var-bug2.rb +2 -0
  112. data/test/null.rb +1 -0
  113. data/test/output.rb +2 -0
  114. data/test/pm-base.rb +22 -0
  115. data/test/pm.rb +11 -0
  116. data/test/raise.rb +3 -0
  117. data/test/tdebug.rb +88 -40
  118. data/test/test-annotate.rb +25 -0
  119. data/test/test-break-bad.rb +25 -0
  120. data/test/test-breakpoints.rb +14 -17
  121. data/test/test-condition.rb +25 -0
  122. data/test/test-ctrl.rb +54 -0
  123. data/test/test-display.rb +15 -15
  124. data/test/test-dollar-0.rb +39 -0
  125. data/test/test-edit.rb +26 -0
  126. data/test/test-emacs-basic.rb +26 -0
  127. data/test/test-enable.rb +25 -0
  128. data/test/test-finish.rb +34 -0
  129. data/test/test-frame.rb +15 -16
  130. data/test/test-help.rb +34 -18
  131. data/test/test-hist.rb +68 -0
  132. data/test/test-info-thread.rb +32 -0
  133. data/test/test-info-var.rb +28 -14
  134. data/test/test-info.rb +15 -17
  135. data/test/test-init.rb +41 -0
  136. data/test/test-list.rb +25 -0
  137. data/test/test-output.rb +26 -0
  138. data/test/test-pm.rb +46 -0
  139. data/test/test-quit.rb +19 -17
  140. data/test/test-raise.rb +25 -0
  141. data/test/test-setshow.rb +14 -13
  142. data/test/test-source.rb +25 -0
  143. data/test/test-stepping.rb +14 -14
  144. data/test/test-trace.rb +63 -0
  145. data/test/thread1.rb +26 -0
  146. metadata +125 -31
  147. data/cli/ruby-debug/commands/script.rb +0 -64
  148. data/runner.sh +0 -7
  149. data/test/help.right +0 -4
  150. data/test/info.right +0 -35
  151. data/test/quit.right +0 -22
  152. data/test/test-columnize.rb +0 -46
@@ -1,9 +1,6 @@
1
1
  # ***************************************************
2
- # This tests display expressions.
2
+ # This tests the quit.
3
3
  # ***************************************************
4
4
  set debuggertesting on
5
- c
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
@@ -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
@@ -1,4 +1,3 @@
1
- # $Id: setshow.cmd 346 2007-11-14 01:39:05Z rockyb $
2
1
  # This tests the functioning of some set/show debugger commands
3
2
  set debuggertesting on
4
3
  ### *******************************
@@ -1,6 +1,5 @@
1
1
  gcd.rb:4
2
2
  def gcd(a, b)
3
- # # $Id: setshow.cmd 346 2007-11-14 01:39:05Z rockyb $
4
3
  # # This tests the functioning of some set/show debugger commands
5
4
  # set debuggertesting on
6
5
  Currently testing the debugger is on.
@@ -0,0 +1,5 @@
1
+ # Test the source command
2
+ # rdebug-save has breakpoint commands
3
+ set debuggertesting on
4
+ source ./rdebug-save.1
5
+ quit
@@ -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
@@ -6,12 +6,16 @@ set callstyle last
6
6
  next
7
7
  where
8
8
  step a
9
- step 2
9
+ set forcestep on
10
+ step- ; step-
11
+ set forcestep off
10
12
  where
11
13
  n 2
12
- step
14
+ step+
13
15
  where
14
16
  step 3
17
+ step+
15
18
  where
19
+ next+
16
20
  # finish
17
21
  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
- # step 2
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:6
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,7 @@
1
+ gcd-dbg.rb:18
2
+ if a > b
3
+ (rdb:1) p Debugger::PROG_SCRIPT
4
+ "./gcd-dbg.rb"
5
+ (rdb:1) show args
6
+ Argument list to give program being debugged when it is started is "5".
7
+ (rdb:1) quit unconditionally
@@ -0,0 +1,4 @@
1
+ gcd-dbg.rb:18
2
+ if a > b
3
+ "./gcd-dbg.rb"
4
+ Argument list to give program being debugged when it is started is "5".
@@ -0,0 +1,5 @@
1
+ gcd-dbg.rb:18
2
+ if a > b
3
+ (rdb:1) "./gcd-dbg.rb"
4
+ (rdb:1) Argument list to give program being debugged when it is started is "5".
5
+ (rdb:1)
@@ -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
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # A test to see that rdebug set's $0 properly.
3
+ puts $0
4
+ puts __FILE__
5
+
@@ -0,0 +1,7 @@
1
+ begin
2
+ exit
3
+ sleep 20
4
+ rescue SystemExit
5
+ printf("Exception caught\n")
6
+ end
7
+ puts "You can't debug here"
@@ -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 "fileutils"
4
- # require "diff/lcs"
5
- # require "diff/lcs/hunk"
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
- def run_debugger(testname, args='', outfile=nil, filter=nil)
10
- rightfile = File.join(SRC_DIR, "#{testname}.right")
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 = File.join(SRC_DIR, "#{testname}.out") unless 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'] = "#{SRC_DIR}tdebug.rb"
19
- cmd = "/bin/sh #{File.join(SRC_DIR, '../runner.sh')} #{args} >#{outfile}"
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 << "\n"
108
+ # output << '\n'
79
109
  # end
80
110
  # end
81
111
 
82
112
  # # Handle the last remaining hunk
83
- # output << oldhunk.diff(format) << "\n"
113
+ # output << oldhunk.diff(format) << '\n'
84
114
  # end
85
115
 
86
116
  end
data/test/info-var-bug.rb CHANGED
@@ -23,6 +23,8 @@ end
23
23
  # Something that will be passed objects with
24
24
  # bad inspect or to_s methods
25
25
  class UnsuspectingClass
26
+ @@Const = 'A constant'
27
+ @@var = 'a class variable'
26
28
  def initialize(a)
27
29
  @a = a # "info locals" will try to use
28
30
  # inspect or to_s here
@@ -0,0 +1,2 @@
1
+ s = '<%= PRODUCT[:name] %>'
2
+ y = 0
data/test/null.rb ADDED
@@ -0,0 +1 @@
1
+ # Nothing here. Move along.
data/test/output.rb ADDED
@@ -0,0 +1,2 @@
1
+ puts "one"
2
+ puts "two"
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
+
data/test/pm.rb ADDED
@@ -0,0 +1,11 @@
1
+ #!/ursr/bin/env ruby
2
+ # Test Debugger.catchpoint and post-mortem handling
3
+ def zero_div
4
+ x = 5
5
+ 1/0
6
+ end
7
+ x = 2
8
+ zero_div
9
+ raise RuntimeError
10
+ x = 3
11
+