debugger 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +10 -0
- data/CHANGES +334 -0
- data/ChangeLog +5655 -0
- data/INSTALL.SVN +154 -0
- data/LICENSE +23 -0
- data/Makefile.am +14 -0
- data/OLD_README +122 -0
- data/README.md +10 -0
- data/Rakefile +266 -0
- data/autogen.sh +4 -0
- data/bin/rdebug +398 -0
- data/cli/ruby-debug.rb +173 -0
- data/cli/ruby-debug/command.rb +228 -0
- data/cli/ruby-debug/commands/breakpoints.rb +153 -0
- data/cli/ruby-debug/commands/catchpoint.rb +55 -0
- data/cli/ruby-debug/commands/condition.rb +49 -0
- data/cli/ruby-debug/commands/continue.rb +38 -0
- data/cli/ruby-debug/commands/control.rb +107 -0
- data/cli/ruby-debug/commands/display.rb +120 -0
- data/cli/ruby-debug/commands/edit.rb +48 -0
- data/cli/ruby-debug/commands/enable.rb +202 -0
- data/cli/ruby-debug/commands/eval.rb +176 -0
- data/cli/ruby-debug/commands/finish.rb +42 -0
- data/cli/ruby-debug/commands/frame.rb +301 -0
- data/cli/ruby-debug/commands/help.rb +56 -0
- data/cli/ruby-debug/commands/info.rb +467 -0
- data/cli/ruby-debug/commands/irb.rb +123 -0
- data/cli/ruby-debug/commands/jump.rb +66 -0
- data/cli/ruby-debug/commands/kill.rb +51 -0
- data/cli/ruby-debug/commands/list.rb +94 -0
- data/cli/ruby-debug/commands/method.rb +84 -0
- data/cli/ruby-debug/commands/quit.rb +39 -0
- data/cli/ruby-debug/commands/reload.rb +40 -0
- data/cli/ruby-debug/commands/save.rb +90 -0
- data/cli/ruby-debug/commands/set.rb +221 -0
- data/cli/ruby-debug/commands/show.rb +247 -0
- data/cli/ruby-debug/commands/skip.rb +35 -0
- data/cli/ruby-debug/commands/source.rb +36 -0
- data/cli/ruby-debug/commands/stepping.rb +81 -0
- data/cli/ruby-debug/commands/threads.rb +189 -0
- data/cli/ruby-debug/commands/tmate.rb +36 -0
- data/cli/ruby-debug/commands/trace.rb +57 -0
- data/cli/ruby-debug/commands/variables.rb +199 -0
- data/cli/ruby-debug/debugger.rb +5 -0
- data/cli/ruby-debug/helper.rb +69 -0
- data/cli/ruby-debug/interface.rb +232 -0
- data/cli/ruby-debug/processor.rb +474 -0
- data/configure.ac +12 -0
- data/debugger.gemspec +24 -0
- data/doc/.cvsignore +42 -0
- data/doc/Makefile.am +63 -0
- data/doc/emacs-notes.txt +38 -0
- data/doc/hanoi.rb +35 -0
- data/doc/primes.rb +28 -0
- data/doc/rdebug-emacs.texi +1030 -0
- data/doc/rdebug.1 +241 -0
- data/doc/ruby-debug.texi +3791 -0
- data/doc/test-tri2.rb +18 -0
- data/doc/tri3.rb +8 -0
- data/doc/triangle.rb +12 -0
- data/emacs/Makefile.am +130 -0
- data/emacs/rdebug-annotate.el +385 -0
- data/emacs/rdebug-breaks.el +407 -0
- data/emacs/rdebug-cmd.el +92 -0
- data/emacs/rdebug-core.el +502 -0
- data/emacs/rdebug-dbg.el +62 -0
- data/emacs/rdebug-error.el +79 -0
- data/emacs/rdebug-fns.el +111 -0
- data/emacs/rdebug-frames.el +230 -0
- data/emacs/rdebug-gud.el +242 -0
- data/emacs/rdebug-help.el +104 -0
- data/emacs/rdebug-info.el +83 -0
- data/emacs/rdebug-layouts.el +180 -0
- data/emacs/rdebug-locring.el +118 -0
- data/emacs/rdebug-output.el +106 -0
- data/emacs/rdebug-regexp.el +118 -0
- data/emacs/rdebug-secondary.el +260 -0
- data/emacs/rdebug-shortkey.el +175 -0
- data/emacs/rdebug-source.el +568 -0
- data/emacs/rdebug-track.el +392 -0
- data/emacs/rdebug-varbuf.el +150 -0
- data/emacs/rdebug-vars.el +125 -0
- data/emacs/rdebug-watch.el +132 -0
- data/emacs/rdebug.el +326 -0
- data/emacs/test/elk-test.el +242 -0
- data/emacs/test/test-annotate.el +103 -0
- data/emacs/test/test-cmd.el +116 -0
- data/emacs/test/test-core.el +104 -0
- data/emacs/test/test-fns.el +65 -0
- data/emacs/test/test-frames.el +62 -0
- data/emacs/test/test-gud.el +35 -0
- data/emacs/test/test-indent.el +58 -0
- data/emacs/test/test-regexp.el +144 -0
- data/emacs/test/test-shortkey.el +61 -0
- data/ext/ruby_debug/breakpoint.c +586 -0
- data/ext/ruby_debug/extconf.rb +49 -0
- data/ext/ruby_debug/ruby_debug.c +2624 -0
- data/ext/ruby_debug/ruby_debug.h +148 -0
- data/lib/ChangeLog +1065 -0
- data/lib/debugger.rb +7 -0
- data/lib/debugger/version.rb +3 -0
- data/lib/ruby-debug-base.rb +304 -0
- data/rdbg.rb +33 -0
- data/runner.sh +7 -0
- data/svn2cl_usermap +3 -0
- data/test/.cvsignore +1 -0
- data/test/base/base.rb +74 -0
- data/test/base/binding.rb +31 -0
- data/test/base/catchpoint.rb +26 -0
- data/test/base/load.rb +40 -0
- data/test/bp_loop_issue.rb +3 -0
- data/test/classes.rb +11 -0
- data/test/cli/commands/catchpoint_test.rb +36 -0
- data/test/cli/commands/unit/regexp.rb +42 -0
- data/test/config.yaml +8 -0
- data/test/data/annotate.cmd +29 -0
- data/test/data/annotate.right +139 -0
- data/test/data/break_bad.cmd +18 -0
- data/test/data/break_bad.right +28 -0
- data/test/data/break_loop_bug.cmd +5 -0
- data/test/data/break_loop_bug.right +15 -0
- data/test/data/breakpoints.cmd +38 -0
- data/test/data/breakpoints.right +98 -0
- data/test/data/catch.cmd +20 -0
- data/test/data/catch.right +49 -0
- data/test/data/catch2.cmd +19 -0
- data/test/data/catch2.right +65 -0
- data/test/data/catch3.cmd +11 -0
- data/test/data/catch3.right +37 -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 +70 -0
- data/test/data/display.cmd +24 -0
- data/test/data/display.right +44 -0
- 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/data/emacs_basic.cmd +43 -0
- data/test/data/emacs_basic.right +106 -0
- 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 +31 -0
- data/test/data/frame.cmd +26 -0
- data/test/data/frame.right +55 -0
- data/test/data/help.cmd +20 -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/data/info-var.cmd +23 -0
- data/test/data/info-var.right +52 -0
- data/test/data/info.cmd +21 -0
- data/test/data/info.right +65 -0
- data/test/data/jump.cmd +16 -0
- data/test/data/jump.right +56 -0
- data/test/data/jump2.cmd +16 -0
- data/test/data/jump2.right +44 -0
- data/test/data/linetrace.cmd +6 -0
- data/test/data/linetrace.right +23 -0
- data/test/data/list.cmd +19 -0
- data/test/data/list.right +127 -0
- data/test/data/method.cmd +10 -0
- data/test/data/method.right +21 -0
- data/test/data/methodsig.cmd +10 -0
- data/test/data/methodsig.right +20 -0
- data/test/data/next.cmd +22 -0
- data/test/data/next.right +61 -0
- data/test/data/noquit.right +1 -0
- data/test/data/output.cmd +6 -0
- data/test/data/output.right +31 -0
- data/test/data/pm-bug.cmd +7 -0
- data/test/data/pm-bug.right +12 -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 +32 -0
- data/test/data/quit.cmd +6 -0
- data/test/data/quit.right +0 -0
- data/test/data/raise.cmd +11 -0
- data/test/data/raise.right +23 -0
- data/test/data/save.cmd +34 -0
- data/test/data/save.right +59 -0
- data/test/data/scope-var.cmd +42 -0
- data/test/data/scope-var.right +587 -0
- data/test/data/setshow.cmd +56 -0
- data/test/data/setshow.right +98 -0
- data/test/data/source.cmd +5 -0
- data/test/data/source.right +15 -0
- data/test/data/stepping.cmd +21 -0
- data/test/data/stepping.right +50 -0
- 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 +14 -0
- data/test/dollar-0.rb +5 -0
- data/test/gcd-dbg-nox.rb +31 -0
- data/test/gcd-dbg.rb +30 -0
- data/test/gcd.rb +18 -0
- data/test/helper.rb +144 -0
- data/test/info-var-bug.rb +47 -0
- data/test/info-var-bug2.rb +2 -0
- data/test/jump.rb +14 -0
- data/test/jump2.rb +27 -0
- data/test/next.rb +18 -0
- data/test/null.rb +1 -0
- data/test/output.rb +2 -0
- data/test/pm-base.rb +22 -0
- data/test/pm-bug.rb +3 -0
- data/test/pm-catch.rb +12 -0
- data/test/pm-catch2.rb +27 -0
- data/test/pm-catch3.rb +47 -0
- data/test/pm.rb +11 -0
- data/test/raise.rb +3 -0
- data/test/rdebug-save.1 +7 -0
- data/test/runall +12 -0
- data/test/scope-var.rb +29 -0
- data/test/tdebug.rb +248 -0
- data/test/test-annotate.rb +25 -0
- data/test/test-break-bad.rb +37 -0
- data/test/test-breakpoints.rb +25 -0
- data/test/test-catch.rb +25 -0
- data/test/test-catch2.rb +25 -0
- data/test/test-catch3.rb +25 -0
- data/test/test-condition.rb +25 -0
- data/test/test-ctrl.rb +55 -0
- data/test/test-display.rb +26 -0
- data/test/test-dollar-0.rb +40 -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 +34 -0
- data/test/test-help.rb +60 -0
- data/test/test-hist.rb +68 -0
- data/test/test-info-thread.rb +32 -0
- data/test/test-info-var.rb +47 -0
- data/test/test-info.rb +26 -0
- data/test/test-init.rb +44 -0
- data/test/test-jump.rb +35 -0
- data/test/test-list.rb +25 -0
- data/test/test-method.rb +34 -0
- data/test/test-next.rb +25 -0
- data/test/test-output.rb +26 -0
- data/test/test-quit.rb +30 -0
- data/test/test-raise.rb +25 -0
- data/test/test-save.rb +31 -0
- data/test/test-scope-var.rb +25 -0
- data/test/test-setshow.rb +25 -0
- data/test/test-source.rb +25 -0
- data/test/test-stepping.rb +26 -0
- data/test/test-trace.rb +47 -0
- data/test/thread1.rb +26 -0
- data/test/trunc-call.rb +31 -0
- metadata +364 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
gcd.rb:4
|
2
|
+
def gcd(a, b)
|
3
|
+
# # ********************************************************
|
4
|
+
# # This tests step, next, continue, disable and
|
5
|
+
# # enable.
|
6
|
+
# # FIXME: break out enable/disable
|
7
|
+
# # ********************************************************
|
8
|
+
# set debuggertesting on
|
9
|
+
Currently testing the debugger is on.
|
10
|
+
# set callstyle last
|
11
|
+
Frame call-display style is last.
|
12
|
+
# set autoeval off
|
13
|
+
autoeval is off.
|
14
|
+
# break 6
|
15
|
+
Breakpoint 1 file ./gcd.rb, line 6
|
16
|
+
# break 10
|
17
|
+
Breakpoint 2 file ./gcd.rb, line 10
|
18
|
+
# break 11
|
19
|
+
*** Line 11 is not a stopping point in file "gcd.rb".
|
20
|
+
# continue
|
21
|
+
Breakpoint 1 at gcd.rb:6
|
22
|
+
gcd.rb:6
|
23
|
+
if a > b
|
24
|
+
# where
|
25
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
26
|
+
#1 at line gcd.rb:18
|
27
|
+
# break Object.gcd
|
28
|
+
Breakpoint 3 at Object::gcd
|
29
|
+
# info break
|
30
|
+
Num Enb What
|
31
|
+
1 y at ./gcd.rb:6
|
32
|
+
breakpoint already hit 1 time
|
33
|
+
2 y at ./gcd.rb:10
|
34
|
+
3 y at Object:gcd
|
35
|
+
# continue
|
36
|
+
Breakpoint 2 at gcd.rb:10
|
37
|
+
gcd.rb:10
|
38
|
+
return nil if a <= 0
|
39
|
+
# where
|
40
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
|
41
|
+
#1 at line gcd.rb:18
|
42
|
+
# info program
|
43
|
+
Program stopped. It stopped at a breakpoint.
|
44
|
+
# c 6
|
45
|
+
Breakpoint 3 at Object:gcd
|
46
|
+
gcd.rb:4
|
47
|
+
def gcd(a, b)
|
48
|
+
# info break
|
49
|
+
Num Enb What
|
50
|
+
1 y at ./gcd.rb:6
|
51
|
+
breakpoint already hit 1 time
|
52
|
+
2 y at ./gcd.rb:10
|
53
|
+
breakpoint already hit 1 time
|
54
|
+
3 y at Object:gcd
|
55
|
+
breakpoint already hit 1 time
|
56
|
+
# break foo
|
57
|
+
*** Invalid breakpoint location: foo.
|
58
|
+
# info break
|
59
|
+
Num Enb What
|
60
|
+
1 y at ./gcd.rb:6
|
61
|
+
breakpoint already hit 1 time
|
62
|
+
2 y at ./gcd.rb:10
|
63
|
+
breakpoint already hit 1 time
|
64
|
+
3 y at Object:gcd
|
65
|
+
breakpoint already hit 1 time
|
66
|
+
# disable 1
|
67
|
+
# info break
|
68
|
+
Num Enb What
|
69
|
+
1 n at ./gcd.rb:6
|
70
|
+
breakpoint already hit 1 time
|
71
|
+
2 y at ./gcd.rb:10
|
72
|
+
breakpoint already hit 1 time
|
73
|
+
3 y at Object:gcd
|
74
|
+
breakpoint already hit 1 time
|
75
|
+
# delete 1
|
76
|
+
# # We should see breakpoint 2 but not 1
|
77
|
+
# info break
|
78
|
+
Num Enb What
|
79
|
+
2 y at ./gcd.rb:10
|
80
|
+
breakpoint already hit 1 time
|
81
|
+
3 y at Object:gcd
|
82
|
+
breakpoint already hit 1 time
|
83
|
+
# # We should still be able to access 2
|
84
|
+
# disable 2
|
85
|
+
# disable bar
|
86
|
+
Disable breakpoints argument 'bar' needs to be a number.
|
87
|
+
# disable
|
88
|
+
*** "disable" must be followed "display", "breakpoints" or breakpoint numbers.
|
89
|
+
# # We should be able to delete 2
|
90
|
+
# delete 2 3
|
91
|
+
# info break
|
92
|
+
No breakpoints.
|
93
|
+
# # Should get a message about having no breakpoints.
|
94
|
+
# disable 1
|
95
|
+
*** No breakpoints have been set.
|
96
|
+
# enable 1
|
97
|
+
*** No breakpoints have been set.
|
98
|
+
# q!
|
data/test/data/catch.cmd
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# ***************************************************
|
2
|
+
# Test catch
|
3
|
+
# ***************************************************
|
4
|
+
set debuggertesting on
|
5
|
+
set autoeval off
|
6
|
+
set basename on
|
7
|
+
info catch
|
8
|
+
catch ZeroDivisionError off
|
9
|
+
catch ZeroDivisionError off afdasdf
|
10
|
+
catch ZeroDivisionError
|
11
|
+
info catch
|
12
|
+
catch ZeroDivisionError off
|
13
|
+
info catch
|
14
|
+
catch ZeroDivisionError
|
15
|
+
c
|
16
|
+
where
|
17
|
+
jump 6
|
18
|
+
cont
|
19
|
+
jump 11
|
20
|
+
cont
|
@@ -0,0 +1,49 @@
|
|
1
|
+
pm-catch.rb:3
|
2
|
+
def zero_div
|
3
|
+
# # ***************************************************
|
4
|
+
# # Test catch
|
5
|
+
# # ***************************************************
|
6
|
+
# set debuggertesting on
|
7
|
+
Currently testing the debugger is on.
|
8
|
+
# set autoeval off
|
9
|
+
autoeval is off.
|
10
|
+
# set basename on
|
11
|
+
basename is on.
|
12
|
+
# info catch
|
13
|
+
No exceptions set to be caught.
|
14
|
+
# catch ZeroDivisionError off
|
15
|
+
*** Catch for exception ZeroDivisionError not found.
|
16
|
+
# catch ZeroDivisionError off afdasdf
|
17
|
+
*** Unknown command: "catch ZeroDivisionError off afdasdf". Try "help".
|
18
|
+
# catch ZeroDivisionError
|
19
|
+
Catch exception ZeroDivisionError.
|
20
|
+
# info catch
|
21
|
+
ZeroDivisionError
|
22
|
+
# catch ZeroDivisionError off
|
23
|
+
Catch for exception ZeroDivisionError removed.
|
24
|
+
# info catch
|
25
|
+
No exceptions set to be caught.
|
26
|
+
# catch ZeroDivisionError
|
27
|
+
Catch exception ZeroDivisionError.
|
28
|
+
# c
|
29
|
+
Catchpoint at pm-catch.rb:5: `divided by 0' (ZeroDivisionError)
|
30
|
+
from ../rdbg.rb:23:in `runner'
|
31
|
+
from ../rdbg.rb:32:in `<main>'
|
32
|
+
pm-catch.rb:5
|
33
|
+
1/0
|
34
|
+
# where
|
35
|
+
--> #0 Object.zero_div at line pm-catch.rb:5
|
36
|
+
#1 at line pm-catch.rb:9
|
37
|
+
# jump 6
|
38
|
+
pm-catch.rb:6
|
39
|
+
x = 6
|
40
|
+
# cont
|
41
|
+
6
|
42
|
+
Catchpoint at pm-catch.rb:10: `RuntimeError' (RuntimeError)
|
43
|
+
from ../rdbg.rb:32:in `<main>'
|
44
|
+
pm-catch.rb:10
|
45
|
+
raise RuntimeError
|
46
|
+
# jump 11
|
47
|
+
pm-catch.rb:11
|
48
|
+
x = 3
|
49
|
+
# cont
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# ***************************************************
|
2
|
+
# Test catch
|
3
|
+
# ***************************************************
|
4
|
+
set debuggertesting on
|
5
|
+
set autoeval off
|
6
|
+
set basename on
|
7
|
+
catch ZeroDivisionError
|
8
|
+
c
|
9
|
+
sk
|
10
|
+
break 27
|
11
|
+
c
|
12
|
+
jump -1
|
13
|
+
break 4
|
14
|
+
c
|
15
|
+
p arg = nil
|
16
|
+
c
|
17
|
+
jump 7
|
18
|
+
del 1
|
19
|
+
c
|
@@ -0,0 +1,65 @@
|
|
1
|
+
pm-catch2.rb:3
|
2
|
+
def bar(arg)
|
3
|
+
# # ***************************************************
|
4
|
+
# # Test catch
|
5
|
+
# # ***************************************************
|
6
|
+
# set debuggertesting on
|
7
|
+
Currently testing the debugger is on.
|
8
|
+
# set autoeval off
|
9
|
+
autoeval is off.
|
10
|
+
# set basename on
|
11
|
+
basename is on.
|
12
|
+
# catch ZeroDivisionError
|
13
|
+
Catch exception ZeroDivisionError.
|
14
|
+
# c
|
15
|
+
foo begin
|
16
|
+
bar begin
|
17
|
+
Catchpoint at pm-catch2.rb:5: `divided by 0' (ZeroDivisionError)
|
18
|
+
from tdebug.rb:61:in `debug_program'
|
19
|
+
from tdebug.rb:247:in `<top (required)>'
|
20
|
+
from ../rdbg.rb:23:in `load'
|
21
|
+
from ../rdbg.rb:23:in `runner'
|
22
|
+
from ../rdbg.rb:32:in `<main>'
|
23
|
+
pm-catch2.rb:5
|
24
|
+
1/0 if arg
|
25
|
+
# sk
|
26
|
+
ok
|
27
|
+
# break 27
|
28
|
+
Breakpoint 1 file ./pm-catch2.rb, line 27
|
29
|
+
# c
|
30
|
+
rescue
|
31
|
+
15
|
32
|
+
Breakpoint 1 at pm-catch2.rb:27
|
33
|
+
pm-catch2.rb:27
|
34
|
+
puts "done"
|
35
|
+
# jump -1
|
36
|
+
pm-catch2.rb:26
|
37
|
+
puts zero_div(10)
|
38
|
+
# break 4
|
39
|
+
Breakpoint 2 file ./pm-catch2.rb, line 4
|
40
|
+
# c
|
41
|
+
foo begin
|
42
|
+
Breakpoint 2 at pm-catch2.rb:4
|
43
|
+
pm-catch2.rb:4
|
44
|
+
puts "bar begin"
|
45
|
+
# p arg = nil
|
46
|
+
nil
|
47
|
+
# c
|
48
|
+
bar begin
|
49
|
+
Catchpoint at pm-catch2.rb:6: `ZeroDivisionError' (ZeroDivisionError)
|
50
|
+
from tdebug.rb:61:in `debug_program'
|
51
|
+
from tdebug.rb:247:in `<top (required)>'
|
52
|
+
from ../rdbg.rb:23:in `load'
|
53
|
+
from ../rdbg.rb:23:in `runner'
|
54
|
+
from ../rdbg.rb:32:in `<main>'
|
55
|
+
pm-catch2.rb:6
|
56
|
+
raise ZeroDivisionError
|
57
|
+
# jump 7
|
58
|
+
pm-catch2.rb:7
|
59
|
+
puts "bar end"
|
60
|
+
# del 1
|
61
|
+
# c
|
62
|
+
bar end
|
63
|
+
foo end
|
64
|
+
15
|
65
|
+
done
|
@@ -0,0 +1,37 @@
|
|
1
|
+
pm-catch3.rb:3
|
2
|
+
def get_exception(arg)
|
3
|
+
# # ***************************************************
|
4
|
+
# # Test catch
|
5
|
+
# # ***************************************************
|
6
|
+
# set debuggertesting on
|
7
|
+
Currently testing the debugger is on.
|
8
|
+
# set autoeval off
|
9
|
+
autoeval is off.
|
10
|
+
# set basename on
|
11
|
+
basename is on.
|
12
|
+
# c
|
13
|
+
divide by zero
|
14
|
+
start1:foo begin:bar begin:foo ensure:zero_div rescue:
|
15
|
+
Catchpoint at pm-catch3.rb:15: `divided by 0' (ZeroDivisionError)
|
16
|
+
from tdebug.rb:61:in `debug_program'
|
17
|
+
from tdebug.rb:247:in `<top (required)>'
|
18
|
+
from ../rdbg.rb:23:in `load'
|
19
|
+
from ../rdbg.rb:23:in `runner'
|
20
|
+
from ../rdbg.rb:32:in `<main>'
|
21
|
+
pm-catch3.rb:15
|
22
|
+
1/0 if arg
|
23
|
+
# w
|
24
|
+
--> #0 Object.bar(arg#Fixnum) at line pm-catch3.rb:15
|
25
|
+
#1 at line pm-catch3.rb:34
|
26
|
+
#2 Object.foo(arg#Fixnum) at line pm-catch3.rb:24
|
27
|
+
#3 Object.zero_div(arg#Fixnum) at line pm-catch3.rb:34
|
28
|
+
#4 at line pm-catch3.rb:45
|
29
|
+
# p $var
|
30
|
+
"start2:foo begin:bar begin:"
|
31
|
+
# jump +4
|
32
|
+
pm-catch3.rb:19
|
33
|
+
$var = $var + "bar end:"
|
34
|
+
# c
|
35
|
+
7
|
36
|
+
start2:foo begin:bar begin:bar end:foo end:foo ensure:
|
37
|
+
done
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# ********************************************************
|
2
|
+
# This tests primarily the condition command.
|
3
|
+
# In order to do this we need to run break, and disable
|
4
|
+
# ********************************************************
|
5
|
+
set debuggertesting on
|
6
|
+
set callstyle last
|
7
|
+
set autoeval off
|
8
|
+
break 6 if a > b
|
9
|
+
info break
|
10
|
+
condition 1
|
11
|
+
info break
|
12
|
+
break 12
|
13
|
+
condition 2 1 == a
|
14
|
+
# FIXME: should be able to catch error on:
|
15
|
+
# condition 2 if 1 == a
|
16
|
+
disable 1
|
17
|
+
continue
|
18
|
+
info break
|
19
|
+
p a
|
20
|
+
# Now test trying to enable an invalid breakpoint
|
21
|
+
break 6 if a >
|
22
|
+
info break
|
23
|
+
enable 3
|
24
|
+
info break
|
25
|
+
condition 3 a > 5
|
26
|
+
enable 3
|
27
|
+
info break
|
28
|
+
quit
|
@@ -0,0 +1,65 @@
|
|
1
|
+
gcd.rb:4
|
2
|
+
def gcd(a, b)
|
3
|
+
# # ********************************************************
|
4
|
+
# # This tests primarily the condition command.
|
5
|
+
# # In order to do this we need to run break, and disable
|
6
|
+
# # ********************************************************
|
7
|
+
# set debuggertesting on
|
8
|
+
Currently testing the debugger is on.
|
9
|
+
# set callstyle last
|
10
|
+
Frame call-display style is last.
|
11
|
+
# set autoeval off
|
12
|
+
autoeval is off.
|
13
|
+
# break 6 if a > b
|
14
|
+
Breakpoint 1 file ./gcd.rb, line 6
|
15
|
+
# info break
|
16
|
+
Num Enb What
|
17
|
+
1 y at ./gcd.rb:6 if a > b
|
18
|
+
# condition 1
|
19
|
+
# info break
|
20
|
+
Num Enb What
|
21
|
+
1 y at ./gcd.rb:6
|
22
|
+
# break 12
|
23
|
+
Breakpoint 2 file ./gcd.rb, line 12
|
24
|
+
# condition 2 1 == a
|
25
|
+
# # FIXME: should be able to catch error on:
|
26
|
+
# # condition 2 if 1 == a
|
27
|
+
# disable 1
|
28
|
+
# continue
|
29
|
+
Breakpoint 2 at gcd.rb:12
|
30
|
+
gcd.rb:12
|
31
|
+
if a == 1 or b-a == 0
|
32
|
+
# info break
|
33
|
+
Num Enb What
|
34
|
+
1 n at ./gcd.rb:6
|
35
|
+
2 y at ./gcd.rb:12 if 1 == a
|
36
|
+
breakpoint already hit 1 time
|
37
|
+
# p a
|
38
|
+
1
|
39
|
+
# # Now test trying to enable an invalid breakpoint
|
40
|
+
# break 6 if a >
|
41
|
+
Breakpoint 3 file ./gcd.rb, line 6
|
42
|
+
*** Expression "a > " syntactically incorrect; breakpoint disabled.
|
43
|
+
# info break
|
44
|
+
Num Enb What
|
45
|
+
1 n at ./gcd.rb:6
|
46
|
+
2 y at ./gcd.rb:12 if 1 == a
|
47
|
+
breakpoint already hit 1 time
|
48
|
+
3 n at ./gcd.rb:6 if a >
|
49
|
+
# enable 3
|
50
|
+
*** Expression "a > " syntactically incorrect; breakpoint remains disabled.
|
51
|
+
# info break
|
52
|
+
Num Enb What
|
53
|
+
1 n at ./gcd.rb:6
|
54
|
+
2 y at ./gcd.rb:12 if 1 == a
|
55
|
+
breakpoint already hit 1 time
|
56
|
+
3 n at ./gcd.rb:6 if a >
|
57
|
+
# condition 3 a > 5
|
58
|
+
# enable 3
|
59
|
+
# info break
|
60
|
+
Num Enb What
|
61
|
+
1 n at ./gcd.rb:6
|
62
|
+
2 y at ./gcd.rb:12 if 1 == a
|
63
|
+
breakpoint already hit 1 time
|
64
|
+
3 y at ./gcd.rb:6 if a > 5
|
65
|
+
# quit
|
data/test/data/ctrl.cmd
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
set debuggertesting on
|
2
|
+
set width 80
|
3
|
+
help
|
4
|
+
help info
|
5
|
+
info args
|
6
|
+
info breakpoints
|
7
|
+
info display
|
8
|
+
info program
|
9
|
+
info global_variables
|
10
|
+
info line
|
11
|
+
info locals
|
12
|
+
info stack
|
13
|
+
info threads
|
14
|
+
info variables
|
15
|
+
eval 1+2
|
16
|
+
help show
|
17
|
+
set trace off
|
18
|
+
show trace
|
19
|
+
set trace on
|
20
|
+
set annotate 0
|
21
|
+
show annotate
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,70 @@
|
|
1
|
+
Currently testing the debugger is on.
|
2
|
+
width is 80.
|
3
|
+
Type 'help <command-name>' for help on a specific command
|
4
|
+
|
5
|
+
Available commands:
|
6
|
+
break edit help jump pp quit save skip
|
7
|
+
catch eval info kill ps reload set source
|
8
|
+
delete exit interrupt p putl restart show thread
|
9
|
+
|
10
|
+
Generic command for showing things about the program being debugged.
|
11
|
+
--
|
12
|
+
List of info subcommands:
|
13
|
+
--
|
14
|
+
info args -- Argument variables of current stack frame
|
15
|
+
info breakpoints -- Status of user-settable breakpoints
|
16
|
+
info catch -- Exceptions that can be caught in the current stack frame
|
17
|
+
info display -- Expressions to display when program stops
|
18
|
+
info file -- Info about a particular file read in
|
19
|
+
info files -- File names and timestamps of files read in
|
20
|
+
info global_variables -- Global variables
|
21
|
+
info instance_variables -- Instance variables of the current stack frame
|
22
|
+
info line -- Line number and file name of current position in source file
|
23
|
+
info locals -- Local variables of the current stack frame
|
24
|
+
info program -- Execution status of the program
|
25
|
+
info stack -- Backtrace of the stack
|
26
|
+
info thread -- List info about thread NUM
|
27
|
+
info threads -- information of currently-known threads
|
28
|
+
info variables -- Local and instance variables of the current stack frame
|
29
|
+
No frame selected.
|
30
|
+
info breakpoints not available here.
|
31
|
+
info display not available here.
|
32
|
+
The program being debugged is not being run.
|
33
|
+
info global_variables not available here.
|
34
|
+
info line not available here.
|
35
|
+
info line not available here.
|
36
|
+
info stack not available here.
|
37
|
+
info threads not available here.
|
38
|
+
info variables not available here.
|
39
|
+
3
|
40
|
+
Generic command for showing things about the debugger.
|
41
|
+
|
42
|
+
--
|
43
|
+
List of show subcommands:
|
44
|
+
--
|
45
|
+
show annotate -- Show annotation level
|
46
|
+
show args -- Show argument list to give program being debugged when it is started
|
47
|
+
show autoeval -- Show if unrecognized command are evaluated
|
48
|
+
show autolist -- Show if 'list' commands is run on breakpoints
|
49
|
+
show autoirb -- Show if IRB is invoked on debugger stops
|
50
|
+
show autoreload -- Show if source code is reloaded when changed
|
51
|
+
show basename -- Show if basename used in reporting files
|
52
|
+
show callstyle -- Show paramater style used showing call frames
|
53
|
+
show commands -- Show the history of commands you typed
|
54
|
+
show forcestep -- Show if sure 'next/step' forces move to a new line
|
55
|
+
show fullpath -- Show if full file names are displayed in frames
|
56
|
+
show history -- Generic command for showing command history parameters
|
57
|
+
show keep-frame-bindings -- Save frame binding on each call
|
58
|
+
show linetrace -- Show line execution tracing
|
59
|
+
show linetrace+ -- Show if consecutive lines should be different are shown in tracing
|
60
|
+
show listsize -- Show number of source lines to list by default
|
61
|
+
show port -- Show server port
|
62
|
+
show post-mortem -- Show whether we go into post-mortem debugging on an uncaught exception
|
63
|
+
show trace -- Show if a stack trace is displayed when 'eval' raises exception
|
64
|
+
show version -- Show what version of the debugger this is
|
65
|
+
show width -- Show the number of characters the debugger thinks are in a line
|
66
|
+
Displaying stack trace is off.
|
67
|
+
Displaying stack trace is off.
|
68
|
+
Displaying stack trace is on.
|
69
|
+
Annotation level is 0
|
70
|
+
Annotation level is 0
|