ruby-debug 0.10.3 → 0.10.4

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 (108) hide show
  1. data/CHANGES +15 -0
  2. data/ChangeLog +461 -104
  3. data/Rakefile +69 -13
  4. data/VERSION +3 -0
  5. data/bin/rdebug +2 -1
  6. data/cli/ruby-debug.rb +8 -5
  7. data/cli/ruby-debug/command.rb +43 -4
  8. data/cli/ruby-debug/commands/breakpoints.rb +3 -1
  9. data/cli/ruby-debug/commands/catchpoint.rb +5 -3
  10. data/cli/ruby-debug/commands/{continue.RB.save → continue.RB} +0 -0
  11. data/cli/ruby-debug/commands/eval.rb +4 -1
  12. data/cli/ruby-debug/commands/frame.rb +11 -10
  13. data/cli/ruby-debug/commands/help.rb +5 -0
  14. data/cli/ruby-debug/commands/info.rb +6 -3
  15. data/cli/ruby-debug/commands/irb.rb +115 -12
  16. data/cli/ruby-debug/commands/kill.rb +50 -0
  17. data/cli/ruby-debug/commands/list.rb +3 -3
  18. data/cli/ruby-debug/commands/quit.rb +12 -6
  19. data/cli/ruby-debug/commands/raise.RB +41 -0
  20. data/cli/ruby-debug/commands/show.rb +26 -28
  21. data/cli/ruby-debug/helper.rb +5 -0
  22. data/cli/ruby-debug/interface.rb +53 -25
  23. data/cli/ruby-debug/processor.RB +484 -0
  24. data/cli/ruby-debug/processor.rb +140 -56
  25. data/rdbg.rb +0 -0
  26. data/runner.sh +7 -0
  27. data/test/base/base.rb +0 -0
  28. data/test/base/binding.rb +0 -0
  29. data/test/base/catchpoint.rb +0 -0
  30. data/test/base/reload_bug.rb +8 -0
  31. data/test/brkpt-class-bug.rb +8 -0
  32. data/test/cli/commands/unit/regexp.rb +11 -0
  33. data/test/config.yaml +8 -0
  34. data/test/data/annotate.cmd +1 -1
  35. data/test/data/annotate.right +3 -3
  36. data/test/data/break_bad.cmd +1 -1
  37. data/test/data/break_bad.right +1 -1
  38. data/test/data/break_loop_bug.right +1 -1
  39. data/test/data/breakpoints.cmd +1 -1
  40. data/test/data/breakpoints.right +3 -3
  41. data/test/data/brkpt-class-bug.cmd +9 -0
  42. data/test/data/brkpt-class-bug.right +18 -0
  43. data/test/data/catch.right +2 -0
  44. data/test/data/condition.cmd +1 -0
  45. data/test/data/condition.right +5 -3
  46. data/test/data/ctrl.right +2 -2
  47. data/test/data/display.right +1 -1
  48. data/test/data/emacs_basic.right +2 -2
  49. data/test/data/except-bug1.cmd +7 -0
  50. data/test/data/except-bug1.right +13 -0
  51. data/test/data/file-with-space.cmd +7 -0
  52. data/test/data/file-with-space.right +9 -0
  53. data/test/data/finish.right +1 -1
  54. data/test/data/frame.cmd +7 -1
  55. data/test/data/frame.right +12 -1
  56. data/test/data/info-var.right +1 -1
  57. data/test/data/info.cmd +1 -0
  58. data/test/data/info.right +21 -2
  59. data/test/data/list.right +1 -1
  60. data/test/data/method.right +1 -1
  61. data/test/data/post-mortem.right +5 -4
  62. data/test/data/save.right +1 -1
  63. data/test/data/setshow.cmd +0 -10
  64. data/test/data/setshow.right +0 -17
  65. data/test/dollar-0.rb +0 -0
  66. data/test/except-bug1.rb +4 -0
  67. data/test/file with space.rb +1 -0
  68. data/test/gcd-dbg.rb +0 -0
  69. data/test/helper.rb +7 -1
  70. data/test/pm-base.rb +0 -0
  71. data/test/pm.rb +1 -1
  72. data/test/raise.rb +0 -0
  73. data/test/rdebug-save.1 +7 -0
  74. data/test/tdebug.rb +2 -2
  75. data/test/test-annotate.rb +0 -0
  76. data/test/test-break-bad.rb +0 -0
  77. data/test/test-breakpoints.rb +0 -0
  78. data/test/test-brkpt-class-bug.rb +26 -0
  79. data/test/test-catch.rb +1 -1
  80. data/test/test-condition.rb +1 -1
  81. data/test/test-ctrl.rb +1 -0
  82. data/test/test-display.rb +0 -0
  83. data/test/test-dollar-0.rb +0 -0
  84. data/test/test-edit.rb +0 -0
  85. data/test/test-emacs-basic.rb +0 -0
  86. data/test/test-enable.rb +0 -0
  87. data/test/test-except-bug1.rb +31 -0
  88. data/test/test-file-with-space.rb +30 -0
  89. data/test/test-finish.rb +0 -0
  90. data/test/test-frame.rb +0 -0
  91. data/test/test-help.rb +0 -0
  92. data/test/test-hist.rb +0 -0
  93. data/test/test-info-thread.rb +0 -0
  94. data/test/test-info-var.rb +0 -0
  95. data/test/test-info.rb +0 -0
  96. data/test/test-init.rb +7 -1
  97. data/test/test-list.rb +0 -0
  98. data/test/test-method.rb +0 -0
  99. data/test/test-output.rb +0 -0
  100. data/test/test-pm.rb +0 -0
  101. data/test/test-quit.rb +0 -0
  102. data/test/test-raise.rb +1 -1
  103. data/test/test-save.rb +7 -1
  104. data/test/test-setshow.rb +0 -0
  105. data/test/test-source.rb +0 -0
  106. data/test/test-stepping.rb +0 -0
  107. data/test/test-trace.rb +0 -0
  108. metadata +211 -180
data/test/config.yaml ADDED
@@ -0,0 +1,8 @@
1
+ # Do not commit personal changes here back to the repository. Create
2
+ # config.private.yaml which, if exists, is preferred to this one.
3
+
4
+ # either should be on the $PATH or use full path
5
+ ruby: ruby
6
+
7
+ # possibility to specify interpreter parameters
8
+ #ruby_params: -w
@@ -26,4 +26,4 @@ step
26
26
  up 10
27
27
  frame 100
28
28
  break bogus:5
29
- quit
29
+ quit!
@@ -31,7 +31,7 @@ self = main
31
31
  if a > b
32
32
  # # "break" should trigger break annotation
33
33
  # break 10
34
- Breakpoint 1 file ./gcd.rb, line 10
34
+ Breakpoint 1 file gcd.rb, line 10
35
35
  breakpoints
36
36
  Num Enb What
37
37
  1 y at gcd.rb:10
@@ -56,7 +56,7 @@ self = main
56
56
  
57
57
  # # "b" should trigger like "break"
58
58
  # b 12
59
- Breakpoint 2 file ./gcd.rb, line 12
59
+ Breakpoint 2 file gcd.rb, line 12
60
60
  breakpoints
61
61
  Num Enb What
62
62
  2 y at gcd.rb:12
@@ -136,4 +136,4 @@ Num Enb What
136
136
  
137
137
  display
138
138
  
139
- # quit
139
+ # quit!
@@ -15,4 +15,4 @@ break gcd.rb:1
15
15
  break gcd.rb:4
16
16
  # No class Foo.
17
17
  break Foo.bar
18
- quit
18
+ q
@@ -25,4 +25,4 @@ Breakpoint 1 file gcd.rb, line 4
25
25
  # # No class Foo.
26
26
  # break Foo.bar
27
27
  *** Unknown class Foo.
28
- # quit
28
+ # q
@@ -3,7 +3,7 @@ bp_loop_issue.rb:1
3
3
  # set debuggertesting on
4
4
  Currently testing the debugger is on.
5
5
  # break 2
6
- Breakpoint 1 file ./bp_loop_issue.rb, line 2
6
+ Breakpoint 1 file bp_loop_issue.rb, line 2
7
7
  # cont
8
8
  Breakpoint 1 at bp_loop_issue.rb:2
9
9
  bp_loop_issue.rb:2
@@ -35,4 +35,4 @@ info break
35
35
  # Should get a message about having no breakpoints.
36
36
  disable 1
37
37
  enable 1
38
- quit
38
+ q!
@@ -12,9 +12,9 @@ Frame call-display style is last.
12
12
  # set autoeval off
13
13
  autoeval is off.
14
14
  # break 6
15
- Breakpoint 1 file ./gcd.rb, line 6
15
+ Breakpoint 1 file gcd.rb, line 6
16
16
  # break 10
17
- Breakpoint 2 file ./gcd.rb, line 10
17
+ Breakpoint 2 file gcd.rb, line 10
18
18
  # break 11
19
19
  *** Line 11 is not a stopping point in file "gcd.rb".
20
20
  # continue
@@ -95,4 +95,4 @@ No breakpoints.
95
95
  *** No breakpoints have been set.
96
96
  # enable 1
97
97
  *** No breakpoints have been set.
98
- # quit
98
+ # q!
@@ -0,0 +1,9 @@
1
+ # Rubyforge Patch #26987
2
+ # http://www.ruby-forum.com/topic/193901
3
+ set debuggertesting on
4
+ set autoeval off
5
+ next
6
+ break A.show
7
+ c
8
+ quit
9
+
@@ -0,0 +1,18 @@
1
+ brkpt-class-bug.rb:1
2
+ class A
3
+ # # Rubyforge Patch #26987
4
+ # # http://www.ruby-forum.com/topic/193901
5
+ # set debuggertesting on
6
+ Currently testing the debugger is on.
7
+ # set autoeval off
8
+ autoeval is off.
9
+ # next
10
+ brkpt-class-bug.rb:6
11
+ x = 1
12
+ # break A.show
13
+ Breakpoint 1 at A::show
14
+ # c
15
+ Breakpoint 1 at A:show
16
+ brkpt-class-bug.rb:2
17
+ def A.show
18
+ # quit
@@ -34,4 +34,6 @@ pm.rb:5
34
34
  # where
35
35
  --> #0 Object./ at line pm.rb:5
36
36
  #1 at line pm.rb:8
37
+ Warning: saved frames may be incomplete;
38
+ compare debugger backtrace (bt) with Ruby caller(0).
37
39
  # quit
@@ -3,6 +3,7 @@
3
3
  # In order to do this we need to run break, and disable
4
4
  # ********************************************************
5
5
  set debuggertesting on
6
+ set basename on
6
7
  set callstyle last
7
8
  set autoeval off
8
9
  break 6 if a > b
@@ -6,12 +6,14 @@ def gcd(a, b)
6
6
  # # ********************************************************
7
7
  # set debuggertesting on
8
8
  Currently testing the debugger is on.
9
+ # set basename on
10
+ basename is on.
9
11
  # set callstyle last
10
12
  Frame call-display style is last.
11
13
  # set autoeval off
12
14
  autoeval is off.
13
15
  # break 6 if a > b
14
- Breakpoint 1 file ./gcd.rb, line 6
16
+ Breakpoint 1 file gcd.rb, line 6
15
17
  # info break
16
18
  Num Enb What
17
19
  1 y at gcd.rb:6 if a > b
@@ -20,7 +22,7 @@ Num Enb What
20
22
  Num Enb What
21
23
  1 y at gcd.rb:6
22
24
  # break 12
23
- Breakpoint 2 file ./gcd.rb, line 12
25
+ Breakpoint 2 file gcd.rb, line 12
24
26
  # condition 2 1 == a
25
27
  # # FIXME: should be able to catch error on:
26
28
  # # condition 2 if 1 == a
@@ -38,7 +40,7 @@ Num Enb What
38
40
  1
39
41
  # # Now test trying to enable an invalid breakpoint
40
42
  # break 6 if a >
41
- Breakpoint 3 file ./gcd.rb, line 6
43
+ Breakpoint 3 file gcd.rb, line 6
42
44
  *** Expression "a > " syntactically incorrect; breakpoint disabled.
43
45
  # info break
44
46
  Num Enb What
data/test/data/ctrl.right CHANGED
@@ -3,8 +3,8 @@ width is 80.
3
3
  Type 'help <command-name>' for help on a specific command
4
4
 
5
5
  Available commands:
6
- break delete eval help interrupt pp putl reload save show thread
7
- catch edit exit info p ps quit restart set source
6
+ break delete eval help interrupt p ps quit restart set source
7
+ catch edit exit info kill pp putl reload save show thread
8
8
 
9
9
  Generic command for showing things about the program being debugged.
10
10
  --
@@ -6,7 +6,7 @@ def gcd(a, b)
6
6
  # set debuggertesting on
7
7
  Currently testing the debugger is on.
8
8
  # b 6
9
- Breakpoint 1 file ./gcd.rb, line 6
9
+ Breakpoint 1 file gcd.rb, line 6
10
10
  # c
11
11
  Breakpoint 1 at gcd.rb:6
12
12
  gcd.rb:6
@@ -12,9 +12,9 @@ Frame call-display style is last.
12
12
  # set autoeval off
13
13
  autoeval is off.
14
14
  # break 6
15
- Breakpoint 1 file ./gcd.rb, line 6
15
+ Breakpoint 1 file gcd.rb, line 6
16
16
  # break 10
17
- Breakpoint 2 file ./gcd.rb, line 10
17
+ Breakpoint 2 file gcd.rb, line 10
18
18
  # continue
19
19
  Breakpoint 1 at gcd.rb:6
20
20
  gcd.rb:6
@@ -0,0 +1,7 @@
1
+ # ********************************************************
2
+ # This tests a bug in showing variables in post-mortem.
3
+ # ********************************************************
4
+ set debuggertesting on
5
+ continue
6
+ p n
7
+ quit
@@ -0,0 +1,13 @@
1
+ except-bug1.rb:1
2
+ def foo(n)
3
+ # # ********************************************************
4
+ # # This tests a bug in showing variables in post-mortem.
5
+ # # ********************************************************
6
+ # set debuggertesting on
7
+ Currently testing the debugger is on.
8
+ # continue
9
+ except-bug1.rb:2
10
+ 1/0
11
+ # p n
12
+ 5
13
+ # quit
@@ -0,0 +1,7 @@
1
+ # *********************************************************
2
+ # This is run on a file with an embedded space in the name
3
+ # ********************************************************
4
+ set debuggertesting on
5
+ step
6
+ quit
7
+
@@ -0,0 +1,9 @@
1
+ file with space.rb:1
2
+ puts 'Ha!'
3
+ # # *********************************************************
4
+ # # This is run on a file with an embedded space in the name
5
+ # # ********************************************************
6
+ # set debuggertesting on
7
+ Currently testing the debugger is on.
8
+ # step
9
+ Ha!
@@ -10,7 +10,7 @@ Frame call-display style is last.
10
10
  # set autoeval off
11
11
  autoeval is off.
12
12
  # break 6
13
- Breakpoint 1 file ./gcd.rb, line 6
13
+ Breakpoint 1 file gcd.rb, line 6
14
14
  # continue
15
15
  Breakpoint 1 at gcd.rb:6
16
16
  gcd.rb:6
data/test/data/frame.cmd CHANGED
@@ -12,7 +12,7 @@ up
12
12
  where
13
13
  down
14
14
  where
15
- frame 0
15
+ frame
16
16
  where
17
17
  frame -1
18
18
  where
@@ -23,4 +23,10 @@ where
23
23
  frame 0 thread 3
24
24
  frame 0 thread 1
25
25
  # finish
26
+ # See that we don't match more than 'down' or 'up' when used as a variable.
27
+ set autoeval on
28
+ download = 1
29
+ download
30
+ upload = 'hey'
31
+ upload
26
32
  quit
@@ -27,7 +27,7 @@ if a > b
27
27
  # where
28
28
  --> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
29
29
  #1 at line gcd.rb:18
30
- # frame 0
30
+ # frame
31
31
  #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
32
32
  # where
33
33
  --> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
@@ -52,4 +52,15 @@ if a > b
52
52
  # frame 0 thread 1
53
53
  #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
54
54
  # # finish
55
+ # # See that we don't match more than 'down' or 'up' when used as a variable.
56
+ # set autoeval on
57
+ autoeval is on.
58
+ # download = 1
59
+ 1
60
+ # download
61
+ 1
62
+ # upload = 'hey'
63
+ "hey"
64
+ # upload
65
+ "hey"
55
66
  # quit
@@ -21,7 +21,7 @@ return x
21
21
  self = main
22
22
  x = *Error in evaluation*
23
23
  # break 31
24
- Breakpoint 1 file ./info-var-bug.rb, line 31
24
+ Breakpoint 1 file info-var-bug.rb, line 31
25
25
  # # The first time through, we can do inspect.
26
26
  # continue
27
27
  Breakpoint 1 at info-var-bug.rb:31
data/test/data/info.cmd CHANGED
@@ -18,4 +18,5 @@ info break 1
18
18
  info break 1 2
19
19
  info break
20
20
  info file ./gcd.rb break
21
+ i
21
22
  quit
data/test/data/info.right CHANGED
@@ -42,9 +42,9 @@ integer argument, list info on that breakpoint.
42
42
  # help info display
43
43
  Expressions to display when program stops.
44
44
  # break 10
45
- Breakpoint 1 file ./gcd.rb, line 10
45
+ Breakpoint 1 file gcd.rb, line 10
46
46
  # break 12
47
- Breakpoint 2 file ./gcd.rb, line 12
47
+ Breakpoint 2 file gcd.rb, line 12
48
48
  # info break 10
49
49
  *** No breakpoints found among list given.
50
50
  # info break 1
@@ -62,4 +62,23 @@ Num Enb What
62
62
  File ./gcd.rb
63
63
  breakpoint line numbers:
64
64
  4 6 6 7 10 10 12 12 13 15 18
65
+ # i
66
+ *** "info" must be followed by the name of an info command:
67
+ List of info subcommands:
68
+
69
+ info args -- Argument variables of current stack frame
70
+ info breakpoints -- Status of user-settable breakpoints
71
+ info catch -- Exceptions that can be caught in the current stack frame
72
+ info display -- Expressions to display when program stops
73
+ info file -- Info about a particular file read in
74
+ info files -- File names and timestamps of files read in
75
+ info global_variables -- Global variables
76
+ info instance_variables -- Instance variables of the current stack frame
77
+ info line -- Line number and file name of current position in source file
78
+ info locals -- Local variables of the current stack frame
79
+ info program -- Execution status of the program
80
+ info stack -- Backtrace of the stack
81
+ info thread -- List info about thread NUM
82
+ info threads -- information of currently-known threads
83
+ info variables -- Local and instance variables of the current stack frame
65
84
  # quit
data/test/data/list.right CHANGED
@@ -99,7 +99,7 @@ basename is on.
99
99
  => 4 def gcd(a, b)
100
100
  5 # Make: a <= b
101
101
  # list 20
102
- [15, 24] in ./gcd.rb
102
+ [15, 18] in ./gcd.rb
103
103
  15 return gcd(b-a, a)
104
104
  16 end
105
105
  17
@@ -8,7 +8,7 @@ Currently testing the debugger is on.
8
8
  # set autoeval off
9
9
  autoeval is off.
10
10
  # b 11
11
- Breakpoint 1 file ./classes.rb, line 11
11
+ Breakpoint 1 file classes.rb, line 11
12
12
  # c
13
13
  Breakpoint 1 at classes.rb:11
14
14
  classes.rb:11
@@ -23,9 +23,10 @@ Exception: #<ZeroDivisionError: divided by 0>
23
23
  Type 'help <command-name>' for help on a specific command
24
24
 
25
25
  Available commands:
26
- backtrace continue down exit irb pp reload show undisplay
27
- break delete edit frame list ps restart source up
28
- catch disable enable help method putl save thread var
29
- condition display eval info p quit set trace where
26
+ backtrace delete enable info p reload source var
27
+ break disable eval irb pp restart thread where
28
+ catch display exit kill ps save trace
29
+ condition down frame list putl set undisplay
30
+ continue edit help method quit show up
30
31
 
31
32
  # quit
data/test/data/save.right CHANGED
@@ -34,7 +34,7 @@ autoirb is off.
34
34
  No breakpoints.
35
35
  # # Now try saving something interesting
36
36
  # break 10
37
- Breakpoint 1 file ./gcd.rb, line 10
37
+ Breakpoint 1 file gcd.rb, line 10
38
38
  # catch RuntimeError
39
39
  Catch exception RuntimeError.
40
40
  # save temp
@@ -31,16 +31,6 @@ set linetrace on
31
31
  show linetrace
32
32
  set linetrace off
33
33
  show linetrace
34
- ########################################
35
- ### show history
36
- ########################################
37
- set history
38
- set history size 10
39
- show history size
40
- set history save off
41
- show history save
42
- set history save 1
43
- show history save
44
34
  #### Test 'autoeval'...
45
35
  set autoeval on
46
36
  puts 'printed via autoeval'
@@ -53,23 +53,6 @@ line tracing is on.
53
53
  line tracing is off.
54
54
  # show linetrace
55
55
  line tracing is off.
56
- # ########################################
57
- # ### show history
58
- # ########################################
59
- # set history
60
- Need two parameters for 'set history'; got 0.
61
- # set history size 10
62
- Debugger history size is 10
63
- # show history size
64
- Debugger history size is 10
65
- # set history save off
66
- Saving of history save is off.
67
- # show history save
68
- Saving of history save is off.
69
- # set history save 1
70
- Saving of history save is on.
71
- # show history save
72
- Saving of history save is on.
73
56
  # #### Test 'autoeval'...
74
57
  # set autoeval on
75
58
  autoeval is on.