debugger 1.0.0.rc1
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/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,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# Test catchpoint in C ruby_debug extension.
|
5
|
+
|
6
|
+
class TestRubyDebugCatchpoint < Test::Unit::TestCase
|
7
|
+
|
8
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'ext')
|
9
|
+
require 'ruby_debug'
|
10
|
+
$:.shift
|
11
|
+
|
12
|
+
# test current_context
|
13
|
+
def test_catchpoints
|
14
|
+
assert_raise(RuntimeError) {Debugger.catchpoints}
|
15
|
+
Debugger.start_
|
16
|
+
assert_equal({}, Debugger.catchpoints)
|
17
|
+
Debugger.add_catchpoint('ZeroDivisionError')
|
18
|
+
assert_equal({'ZeroDivisionError' => 0}, Debugger.catchpoints)
|
19
|
+
Debugger.add_catchpoint('RuntimeError')
|
20
|
+
assert_equal(['RuntimeError', 'ZeroDivisionError'],
|
21
|
+
Debugger.catchpoints.keys.sort)
|
22
|
+
Debugger.stop
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
data/test/base/load.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# Test of Debugger.debug_load in C extension ruby_debug.so
|
5
|
+
class TestDebugLoad < Test::Unit::TestCase
|
6
|
+
|
7
|
+
@@src_dir = File.dirname(__FILE__)
|
8
|
+
$:.unshift File.join(@@src_dir, '..', '..', 'ext')
|
9
|
+
require 'ruby_debug'
|
10
|
+
$:.shift
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def at_line(file, line)
|
14
|
+
@@at_line = [File.basename(file), line]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
Debugger::PROG_SCRIPT = File.join(@@src_dir, '..', 'gcd.rb')
|
19
|
+
|
20
|
+
class Debugger::Context
|
21
|
+
def at_line(file, line)
|
22
|
+
TestDebugLoad::at_line(file, line)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_debug_load
|
27
|
+
# Without stopping
|
28
|
+
bt = Debugger.debug_load(Debugger::PROG_SCRIPT, false)
|
29
|
+
assert_equal(nil, bt)
|
30
|
+
# With stopping
|
31
|
+
bt = Debugger.debug_load(Debugger::PROG_SCRIPT, true)
|
32
|
+
assert_equal(nil, bt)
|
33
|
+
assert_equal(['gcd.rb', 4], @@at_line)
|
34
|
+
|
35
|
+
# Test that we get a proper backtrace on a script that raises 'abc'
|
36
|
+
prog_script = File.join(@@src_dir, '..', 'raise.rb')
|
37
|
+
bt = Debugger.debug_load(prog_script, false)
|
38
|
+
assert_equal(bt.to_s, 'abc')
|
39
|
+
end
|
40
|
+
end
|
data/test/classes.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
class TestCatchCommand < Test::Unit::TestCase
|
6
|
+
|
7
|
+
base_dir = File.expand_path(File.join(File.dirname(__FILE__),
|
8
|
+
'..', '..', '..'))
|
9
|
+
|
10
|
+
%w(ext lib cli).each do |dir|
|
11
|
+
$: << File.join(base_dir, dir)
|
12
|
+
end
|
13
|
+
|
14
|
+
require File.join(base_dir, 'cli', 'ruby-debug')
|
15
|
+
|
16
|
+
class MockState
|
17
|
+
attr_accessor :message
|
18
|
+
def context; end
|
19
|
+
def confirm(msg); true end
|
20
|
+
def print(*args)
|
21
|
+
@message = *args
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# regression test for bug #20156
|
26
|
+
def test_catch_does_not_blow_up
|
27
|
+
state = MockState.new
|
28
|
+
catch_cmd = Debugger::CatchCommand.new(state)
|
29
|
+
assert(catch_cmd.match('catch off'))
|
30
|
+
catch(:debug_error) do
|
31
|
+
catch_cmd.execute
|
32
|
+
end
|
33
|
+
assert_equal(nil, state.message)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
|
4
|
+
class TestCommandREs < Test::Unit::TestCase
|
5
|
+
base_dir=File.expand_path(File.join(File.dirname(__FILE__),
|
6
|
+
'..', '..', '..', '..',
|
7
|
+
'cli', 'ruby-debug'))
|
8
|
+
require File.join(base_dir, 'command')
|
9
|
+
require File.join(base_dir, 'commands', 'frame')
|
10
|
+
include Debugger
|
11
|
+
|
12
|
+
def test_quit
|
13
|
+
c = QuitCommand.new(nil)
|
14
|
+
assert c.regexp.match('quit')
|
15
|
+
assert c.regexp.match('q')
|
16
|
+
assert c.regexp.match('quit!')
|
17
|
+
assert c.regexp.match('q!')
|
18
|
+
assert c.regexp.match('quit unconditionally')
|
19
|
+
assert c.regexp.match('exit')
|
20
|
+
assert c.regexp.match('exit!')
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_up
|
24
|
+
c = UpCommand.new(nil)
|
25
|
+
assert c.regexp.match('up')
|
26
|
+
assert c.regexp.match('up 2')
|
27
|
+
assert c.regexp.match('up 2+5')
|
28
|
+
assert c.regexp.match('u')
|
29
|
+
assert c.regexp.match('u 2')
|
30
|
+
assert_equal nil, c.regexp.match('ufoo')
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_down
|
34
|
+
c = DownCommand.new(nil)
|
35
|
+
assert c.regexp.match('down')
|
36
|
+
assert c.regexp.match('down 2')
|
37
|
+
assert_equal(nil, c.regexp.match('d 2'))
|
38
|
+
assert_equal(nil, c.regexp.match('d'))
|
39
|
+
assert_equal(nil, c.regexp.match('dow'))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
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
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# ********************************************************
|
2
|
+
# This tests annotations
|
3
|
+
# ********************************************************
|
4
|
+
set debuggertesting on
|
5
|
+
set callstyle last
|
6
|
+
set force off
|
7
|
+
set annotate 3
|
8
|
+
# Get into gcd
|
9
|
+
step 2
|
10
|
+
# "break" should trigger break annotation
|
11
|
+
break 10
|
12
|
+
# "delete" should trigger break annotation
|
13
|
+
delete 1
|
14
|
+
# p should not trigger a breakpoint annotation
|
15
|
+
p a
|
16
|
+
# "up" should trigger annotations
|
17
|
+
up
|
18
|
+
# "b" should trigger like "break"
|
19
|
+
b 12
|
20
|
+
# "display" should trigger display annotation
|
21
|
+
display 1+2
|
22
|
+
# undisplay should trigger display annotation
|
23
|
+
undisplay 1
|
24
|
+
step
|
25
|
+
# Test error annotations
|
26
|
+
up 10
|
27
|
+
frame 100
|
28
|
+
break bogus:5
|
29
|
+
quit!
|
@@ -0,0 +1,139 @@
|
|
1
|
+
gcd.rb:4
|
2
|
+
def gcd(a, b)
|
3
|
+
# # ********************************************************
|
4
|
+
# # This tests annotations
|
5
|
+
# # ********************************************************
|
6
|
+
# set debuggertesting on
|
7
|
+
Currently testing the debugger is on.
|
8
|
+
# set callstyle last
|
9
|
+
Frame call-display style is last.
|
10
|
+
# set force off
|
11
|
+
force-stepping is off.
|
12
|
+
# set annotate 3
|
13
|
+
Annotation level is 3
|
14
|
+
# # Get into gcd
|
15
|
+
# step 2
|
16
|
+
starting
|
17
|
+
stopped
|
18
|
+
breakpoints
|
19
|
+
No breakpoints.
|
20
|
+
|
21
|
+
stack
|
22
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
23
|
+
#1 at line gcd.rb:18
|
24
|
+
|
25
|
+
variables
|
26
|
+
a = 3
|
27
|
+
b = 5
|
28
|
+
self = main
|
29
|
+
|
30
|
+
source gcd.rb:6
|
31
|
+
if a > b
|
32
|
+
# # "break" should trigger break annotation
|
33
|
+
# break 10
|
34
|
+
Breakpoint 1 file ./gcd.rb, line 10
|
35
|
+
breakpoints
|
36
|
+
Num Enb What
|
37
|
+
1 y at ./gcd.rb:10
|
38
|
+
|
39
|
+
# # "delete" should trigger break annotation
|
40
|
+
# delete 1
|
41
|
+
breakpoints
|
42
|
+
No breakpoints.
|
43
|
+
|
44
|
+
# # p should not trigger a breakpoint annotation
|
45
|
+
# p a
|
46
|
+
3
|
47
|
+
# # "up" should trigger annotations
|
48
|
+
# up
|
49
|
+
#1 at line gcd.rb:18
|
50
|
+
stack
|
51
|
+
#0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
52
|
+
--> #1 at line gcd.rb:18
|
53
|
+
|
54
|
+
variables
|
55
|
+
self = main
|
56
|
+
|
57
|
+
# # "b" should trigger like "break"
|
58
|
+
# b 12
|
59
|
+
Breakpoint 2 file ./gcd.rb, line 12
|
60
|
+
breakpoints
|
61
|
+
Num Enb What
|
62
|
+
2 y at ./gcd.rb:12
|
63
|
+
|
64
|
+
# # "display" should trigger display annotation
|
65
|
+
# display 1+2
|
66
|
+
1: 1+2 = 3
|
67
|
+
display
|
68
|
+
1: 1+2 = 3
|
69
|
+
|
70
|
+
# # undisplay should trigger display annotation
|
71
|
+
# undisplay 1
|
72
|
+
display
|
73
|
+
|
74
|
+
# step
|
75
|
+
display
|
76
|
+
|
77
|
+
starting
|
78
|
+
stopped
|
79
|
+
breakpoints
|
80
|
+
Num Enb What
|
81
|
+
2 y at ./gcd.rb:12
|
82
|
+
|
83
|
+
display
|
84
|
+
|
85
|
+
stack
|
86
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
|
87
|
+
#1 at line gcd.rb:18
|
88
|
+
|
89
|
+
variables
|
90
|
+
a = 3
|
91
|
+
b = 5
|
92
|
+
self = main
|
93
|
+
|
94
|
+
source gcd.rb:10
|
95
|
+
return nil if a <= 0
|
96
|
+
# # Test error annotations
|
97
|
+
# up 10
|
98
|
+
error-begin
|
99
|
+
Adjusting would put us beyond the oldest (initial) frame.
|
100
|
+
|
101
|
+
display
|
102
|
+
|
103
|
+
stack
|
104
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
|
105
|
+
#1 at line gcd.rb:18
|
106
|
+
|
107
|
+
variables
|
108
|
+
a = 3
|
109
|
+
b = 5
|
110
|
+
self = main
|
111
|
+
|
112
|
+
# frame 100
|
113
|
+
error-begin
|
114
|
+
Adjusting would put us beyond the oldest (initial) frame.
|
115
|
+
|
116
|
+
display
|
117
|
+
|
118
|
+
stack
|
119
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
|
120
|
+
#1 at line gcd.rb:18
|
121
|
+
|
122
|
+
variables
|
123
|
+
a = 3
|
124
|
+
b = 5
|
125
|
+
self = main
|
126
|
+
|
127
|
+
# break bogus:5
|
128
|
+
error-begin
|
129
|
+
No source file named bogus
|
130
|
+
|
131
|
+
Breakpoint 3 file bogus, line 5
|
132
|
+
breakpoints
|
133
|
+
Num Enb What
|
134
|
+
2 y at ./gcd.rb:12
|
135
|
+
3 y at bogus:5
|
136
|
+
|
137
|
+
display
|
138
|
+
|
139
|
+
# quit!
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# ********************************************************
|
2
|
+
# This tests mostly invalid breakpoints.
|
3
|
+
# We have some valid ones too.
|
4
|
+
# ********************************************************
|
5
|
+
set debuggertesting on
|
6
|
+
set callstyle last
|
7
|
+
set autoeval off
|
8
|
+
# There aren't 100 lines in gcd.rb.
|
9
|
+
break 100
|
10
|
+
break gcd.rb:100
|
11
|
+
# Line one isn't a valid stopping point.
|
12
|
+
# It is a comment.
|
13
|
+
break gcd.rb:1
|
14
|
+
# This line is okay
|
15
|
+
break gcd.rb:4
|
16
|
+
# No class Foo.
|
17
|
+
break Foo.bar
|
18
|
+
q
|
@@ -0,0 +1,28 @@
|
|
1
|
+
gcd.rb:4
|
2
|
+
def gcd(a, b)
|
3
|
+
# # ********************************************************
|
4
|
+
# # This tests mostly invalid breakpoints.
|
5
|
+
# # We have some valid ones too.
|
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
|
+
# # There aren't 100 lines in gcd.rb.
|
14
|
+
# break 100
|
15
|
+
*** There are only 18 lines in file "gcd.rb".
|
16
|
+
# break gcd.rb:100
|
17
|
+
*** There are only 18 lines in file "gcd.rb".
|
18
|
+
# # Line one isn't a valid stopping point.
|
19
|
+
# # It is a comment.
|
20
|
+
# break gcd.rb:1
|
21
|
+
*** Line 1 is not a stopping point in file "gcd.rb".
|
22
|
+
# # This line is okay
|
23
|
+
# break gcd.rb:4
|
24
|
+
Breakpoint 1 file gcd.rb, line 4
|
25
|
+
# # No class Foo.
|
26
|
+
# break Foo.bar
|
27
|
+
*** Unknown class Foo.
|
28
|
+
# q
|
@@ -0,0 +1,15 @@
|
|
1
|
+
bp_loop_issue.rb:1
|
2
|
+
1.upto(2) {
|
3
|
+
# set debuggertesting on
|
4
|
+
Currently testing the debugger is on.
|
5
|
+
# break 2
|
6
|
+
Breakpoint 1 file ./bp_loop_issue.rb, line 2
|
7
|
+
# cont
|
8
|
+
Breakpoint 1 at bp_loop_issue.rb:2
|
9
|
+
bp_loop_issue.rb:2
|
10
|
+
sleep 0.01
|
11
|
+
# cont
|
12
|
+
Breakpoint 1 at bp_loop_issue.rb:2
|
13
|
+
bp_loop_issue.rb:2
|
14
|
+
sleep 0.01
|
15
|
+
# cont
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# ********************************************************
|
2
|
+
# This tests step, next, continue, disable and
|
3
|
+
# enable.
|
4
|
+
# FIXME: break out enable/disable
|
5
|
+
# ********************************************************
|
6
|
+
set debuggertesting on
|
7
|
+
set callstyle last
|
8
|
+
set autoeval off
|
9
|
+
break 6
|
10
|
+
break 10
|
11
|
+
break 11
|
12
|
+
continue
|
13
|
+
where
|
14
|
+
break Object.gcd
|
15
|
+
info break
|
16
|
+
continue
|
17
|
+
where
|
18
|
+
info program
|
19
|
+
c 6
|
20
|
+
info break
|
21
|
+
break foo
|
22
|
+
info break
|
23
|
+
disable 1
|
24
|
+
info break
|
25
|
+
delete 1
|
26
|
+
# We should see breakpoint 2 but not 1
|
27
|
+
info break
|
28
|
+
# We should still be able to access 2
|
29
|
+
disable 2
|
30
|
+
disable bar
|
31
|
+
disable
|
32
|
+
# We should be able to delete 2
|
33
|
+
delete 2 3
|
34
|
+
info break
|
35
|
+
# Should get a message about having no breakpoints.
|
36
|
+
disable 1
|
37
|
+
enable 1
|
38
|
+
q!
|