rb8-trepanning 0.1.3
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/.gitignore +3 -0
- data/CHANGES +34 -0
- data/ChangeLog +875 -0
- data/README.textile +59 -0
- data/Rakefile +215 -0
- data/app/.gitignore +1 -0
- data/app/cmd_parse.kpeg +241 -0
- data/app/cmd_parse.rb +212 -0
- data/app/cmd_parser.rb +1948 -0
- data/app/complete.rb +79 -0
- data/app/default.rb +90 -0
- data/app/display.rb +148 -0
- data/app/eventbuffer.rb +147 -0
- data/app/frame.rb +166 -0
- data/app/irb.rb +114 -0
- data/app/options.rb +200 -0
- data/app/run.rb +74 -0
- data/app/util.rb +65 -0
- data/bin/.gitignore +1 -0
- data/bin/trepan8 +115 -0
- data/data/.gitignore +1 -0
- data/data/irbrc +41 -0
- data/interface/.gitignore +1 -0
- data/interface/base_intf.rb +109 -0
- data/interface/client.rb +82 -0
- data/interface/comcodes.rb +20 -0
- data/interface/script.rb +110 -0
- data/interface/server.rb +147 -0
- data/interface/user.rb +165 -0
- data/io/base_io.rb +148 -0
- data/io/input.rb +158 -0
- data/io/null_output.rb +46 -0
- data/io/string_array.rb +156 -0
- data/io/tcpclient.rb +129 -0
- data/io/tcpfns.rb +33 -0
- data/io/tcpserver.rb +141 -0
- data/lib/debugger.rb +8 -0
- data/lib/trepanning.rb +283 -0
- data/processor/.gitignore +1 -0
- data/processor/command-ruby-debug/breakpoints.rb +155 -0
- data/processor/command-ruby-debug/catchpoint.rb +55 -0
- data/processor/command-ruby-debug/condition.rb +49 -0
- data/processor/command-ruby-debug/control.rb +31 -0
- data/processor/command-ruby-debug/display.rb +120 -0
- data/processor/command-ruby-debug/enable.rb +202 -0
- data/processor/command-ruby-debug/frame.rb +199 -0
- data/processor/command-ruby-debug/help.rb +63 -0
- data/processor/command-ruby-debug/info.rb +359 -0
- data/processor/command-ruby-debug/method.rb +84 -0
- data/processor/command-ruby-debug/reload.rb +40 -0
- data/processor/command-ruby-debug/save.rb +90 -0
- data/processor/command-ruby-debug/set.rb +237 -0
- data/processor/command-ruby-debug/show.rb +251 -0
- data/processor/command-ruby-debug/source.rb +36 -0
- data/processor/command-ruby-debug/threads.rb +189 -0
- data/processor/command-ruby-debug/trace.rb +57 -0
- data/processor/command-ruby-debug/variables.rb +199 -0
- data/processor/command.rb +270 -0
- data/processor/command/.gitignore +1 -0
- data/processor/command/alias.rb +54 -0
- data/processor/command/backtrace.rb +123 -0
- data/processor/command/base/cmd.rb +177 -0
- data/processor/command/base/subcmd.rb +230 -0
- data/processor/command/base/submgr.rb +188 -0
- data/processor/command/base/subsubcmd.rb +128 -0
- data/processor/command/base/subsubmgr.rb +199 -0
- data/processor/command/break.rb +114 -0
- data/processor/command/catch.rb +71 -0
- data/processor/command/complete.rb +39 -0
- data/processor/command/continue.rb +57 -0
- data/processor/command/directory.rb +50 -0
- data/processor/command/disable.rb +85 -0
- data/processor/command/display.rb +78 -0
- data/processor/command/down.rb +54 -0
- data/processor/command/edit.rb +79 -0
- data/processor/command/enable.rb +48 -0
- data/processor/command/eval.rb +90 -0
- data/processor/command/exit.rb +66 -0
- data/processor/command/finish.rb +59 -0
- data/processor/command/frame.rb +97 -0
- data/processor/command/help.rb +230 -0
- data/processor/command/help/.gitignore +1 -0
- data/processor/command/help/README +10 -0
- data/processor/command/help/command.txt +58 -0
- data/processor/command/help/examples.txt +16 -0
- data/processor/command/help/filename.txt +40 -0
- data/processor/command/help/location.txt +37 -0
- data/processor/command/help/suffixes.txt +17 -0
- data/processor/command/info.rb +28 -0
- data/processor/command/info_subcmd/.gitignore +1 -0
- data/processor/command/info_subcmd/args.rb +39 -0
- data/processor/command/info_subcmd/breakpoints.rb +80 -0
- data/processor/command/info_subcmd/catch.rb +36 -0
- data/processor/command/info_subcmd/files.rb +39 -0
- data/processor/command/info_subcmd/globals.rb +64 -0
- data/processor/command/info_subcmd/line.rb +30 -0
- data/processor/command/info_subcmd/locals.rb +69 -0
- data/processor/command/info_subcmd/macro.rb +62 -0
- data/processor/command/info_subcmd/program.rb +51 -0
- data/processor/command/info_subcmd/ruby.rb +57 -0
- data/processor/command/info_subcmd/source.rb +74 -0
- data/processor/command/info_subcmd/stack.rb +25 -0
- data/processor/command/info_subcmd/threads.rb +75 -0
- data/processor/command/kill.rb +78 -0
- data/processor/command/list.rb +117 -0
- data/processor/command/macro.rb +68 -0
- data/processor/command/next.rb +79 -0
- data/processor/command/parsetree.rb +56 -0
- data/processor/command/pp.rb +40 -0
- data/processor/command/pr.rb +37 -0
- data/processor/command/ps.rb +40 -0
- data/processor/command/restart.rb +86 -0
- data/processor/command/save.rb +58 -0
- data/processor/command/set.rb +47 -0
- data/processor/command/set_subcmd/.gitignore +1 -0
- data/processor/command/set_subcmd/abbrev.rb +25 -0
- data/processor/command/set_subcmd/auto.rb +27 -0
- data/processor/command/set_subcmd/auto_subcmd/.gitignore +1 -0
- data/processor/command/set_subcmd/auto_subcmd/eval.rb +53 -0
- data/processor/command/set_subcmd/auto_subcmd/irb.rb +33 -0
- data/processor/command/set_subcmd/auto_subcmd/list.rb +33 -0
- data/processor/command/set_subcmd/basename.rb +25 -0
- data/processor/command/set_subcmd/callstyle.rb +46 -0
- data/processor/command/set_subcmd/confirm.rb +24 -0
- data/processor/command/set_subcmd/debug.rb +47 -0
- data/processor/command/set_subcmd/different.rb +61 -0
- data/processor/command/set_subcmd/highlight.rb +43 -0
- data/processor/command/set_subcmd/max.rb +26 -0
- data/processor/command/set_subcmd/max_subcmd/list.rb +49 -0
- data/processor/command/set_subcmd/max_subcmd/stack.rb +50 -0
- data/processor/command/set_subcmd/max_subcmd/string.rb +76 -0
- data/processor/command/set_subcmd/max_subcmd/width.rb +49 -0
- data/processor/command/set_subcmd/reload.rb +42 -0
- data/processor/command/set_subcmd/timer.rb +58 -0
- data/processor/command/set_subcmd/trace.rb +37 -0
- data/processor/command/set_subcmd/trace_subcmd/buffer.rb +42 -0
- data/processor/command/set_subcmd/trace_subcmd/print.rb +41 -0
- data/processor/command/shell.rb +139 -0
- data/processor/command/show.rb +39 -0
- data/processor/command/show_subcmd/.gitignore +1 -0
- data/processor/command/show_subcmd/abbrev.rb +20 -0
- data/processor/command/show_subcmd/alias.rb +46 -0
- data/processor/command/show_subcmd/args.rb +34 -0
- data/processor/command/show_subcmd/auto.rb +28 -0
- data/processor/command/show_subcmd/auto_subcmd/eval.rb +27 -0
- data/processor/command/show_subcmd/auto_subcmd/irb.rb +23 -0
- data/processor/command/show_subcmd/auto_subcmd/list.rb +22 -0
- data/processor/command/show_subcmd/basename.rb +20 -0
- data/processor/command/show_subcmd/callstyle.rb +22 -0
- data/processor/command/show_subcmd/confirm.rb +18 -0
- data/processor/command/show_subcmd/debug.rb +26 -0
- data/processor/command/show_subcmd/debug_subcmd/dbgr.rb +21 -0
- data/processor/command/show_subcmd/debug_subcmd/skip.rb +22 -0
- data/processor/command/show_subcmd/debug_subcmd/step.rb +22 -0
- data/processor/command/show_subcmd/different.rb +26 -0
- data/processor/command/show_subcmd/directories.rb +22 -0
- data/processor/command/show_subcmd/highlight.rb +24 -0
- data/processor/command/show_subcmd/max.rb +27 -0
- data/processor/command/show_subcmd/max_subcmd/list.rb +38 -0
- data/processor/command/show_subcmd/max_subcmd/stack.rb +36 -0
- data/processor/command/show_subcmd/max_subcmd/string.rb +42 -0
- data/processor/command/show_subcmd/max_subcmd/width.rb +37 -0
- data/processor/command/show_subcmd/reload.rb +18 -0
- data/processor/command/show_subcmd/timer.rb +18 -0
- data/processor/command/show_subcmd/trace.rb +29 -0
- data/processor/command/show_subcmd/trace_subcmd/buffer.rb +65 -0
- data/processor/command/show_subcmd/trace_subcmd/print.rb +23 -0
- data/processor/command/show_subcmd/version.rb +23 -0
- data/processor/command/source.rb +134 -0
- data/processor/command/step.rb +81 -0
- data/processor/command/tbreak.rb +19 -0
- data/processor/command/unalias.rb +44 -0
- data/processor/command/undisplay.rb +59 -0
- data/processor/command/up.rb +72 -0
- data/processor/default.rb +56 -0
- data/processor/display.rb +17 -0
- data/processor/eval.rb +113 -0
- data/processor/eventbuf.rb +105 -0
- data/processor/frame.rb +172 -0
- data/processor/help.rb +92 -0
- data/processor/helper.rb +76 -0
- data/processor/hook.rb +134 -0
- data/processor/load_cmds.rb +258 -0
- data/processor/location.rb +174 -0
- data/processor/main.rb +455 -0
- data/processor/mock.rb +136 -0
- data/processor/msg.rb +61 -0
- data/processor/processor.rb +674 -0
- data/processor/running.rb +168 -0
- data/processor/stepping.rb +18 -0
- data/processor/subcmd.rb +161 -0
- data/processor/validate.rb +355 -0
- data/processor/virtual.rb +34 -0
- data/test/data/.gitignore +1 -0
- data/test/data/break_bad.cmd +19 -0
- data/test/data/break_bad.right +29 -0
- data/test/data/break_loop_bug.cmd +5 -0
- data/test/data/break_loop_bug.right +15 -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 +14 -0
- data/test/data/edit.right +24 -0
- data/test/data/file-with-space.cmd +6 -0
- data/test/data/file-with-space.right +4 -0
- data/test/data/printvar.cmd +17 -0
- data/test/data/printvar.right +31 -0
- data/test/data/raise.cmd +11 -0
- data/test/data/raise.right +19 -0
- data/test/data/source.cmd +5 -0
- data/test/data/source.right +18 -0
- data/test/data/stepping-1.9.right +50 -0
- data/test/data/stepping.cmd +21 -0
- data/test/data/stepping.right +48 -0
- data/test/data/trepan8-save.1 +6 -0
- data/test/example/bp_loop_issue.rb +3 -0
- data/test/example/break-bug.rb +7 -0
- data/test/example/brkpt-class-bug.rb +8 -0
- data/test/example/classes.rb +11 -0
- data/test/example/dollar-0.rb +5 -0
- data/test/example/except-bug1.rb +4 -0
- data/test/example/except-bug2.rb +7 -0
- data/test/example/file with space.rb +1 -0
- data/test/example/gcd.rb +18 -0
- data/test/example/info-var-bug.rb +47 -0
- data/test/example/info-var-bug2.rb +2 -0
- data/test/example/null.rb +1 -0
- data/test/example/pm-bug.rb +3 -0
- data/test/example/pm.rb +11 -0
- data/test/example/raise.rb +3 -0
- data/test/integration/.gitignore +4 -0
- data/test/integration/config.yaml +8 -0
- data/test/integration/helper.rb +154 -0
- data/test/integration/test-break_bad.rb +26 -0
- data/test/integration/test-dollar-0.rb +31 -0
- data/test/integration/test-edit.rb +17 -0
- data/test/integration/test-file-with-space.rb +26 -0
- data/test/integration/test-printvar.rb +17 -0
- data/test/integration/test-raise.rb +21 -0
- data/test/integration/test-source.rb +16 -0
- data/test/integration/test-stepping.rb +24 -0
- data/test/unit/.gitignore +1 -0
- data/test/unit/cmd-helper.rb +52 -0
- data/test/unit/mock-helper.rb +12 -0
- data/test/unit/test-app-cmd_parse.rb +97 -0
- data/test/unit/test-app-cmd_parser.rb +23 -0
- data/test/unit/test-app-complete.rb +39 -0
- data/test/unit/test-app-frame.rb +32 -0
- data/test/unit/test-app-options.rb +92 -0
- data/test/unit/test-app-run.rb +14 -0
- data/test/unit/test-app-util.rb +44 -0
- data/test/unit/test-base-cmd.rb +45 -0
- data/test/unit/test-base-subcmd.rb +57 -0
- data/test/unit/test-base-submgr.rb +23 -0
- data/test/unit/test-base-subsubcmd.rb +17 -0
- data/test/unit/test-cmd-alias.rb +48 -0
- data/test/unit/test-cmd-exit.rb +27 -0
- data/test/unit/test-cmd-help.rb +104 -0
- data/test/unit/test-cmd-kill.rb +46 -0
- data/test/unit/test-cmd-source.rb +34 -0
- data/test/unit/test-completion.rb +42 -0
- data/test/unit/test-intf-user.rb +46 -0
- data/test/unit/test-io-input.rb +27 -0
- data/test/unit/test-io-tcp.rb +33 -0
- data/test/unit/test-io-tcpclient.rb +54 -0
- data/test/unit/test-io-tcpfns.rb +17 -0
- data/test/unit/test-io-tcpserver.rb +50 -0
- data/test/unit/test-proc-eval.rb +36 -0
- data/test/unit/test-proc-hook.rb +30 -0
- data/test/unit/test-proc-load_cmds.rb +50 -0
- data/test/unit/test-proc-location.rb +79 -0
- data/test/unit/test-subcmd-help.rb +44 -0
- data/trepan8.gemspec +52 -0
- metadata +391 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# The class serves as the parent for Trepan::CmdProcessor which is
|
|
2
|
+
# quite large and spans over several files. By declaring initialize
|
|
3
|
+
# below, we have a consistent initialize routine and many of the
|
|
4
|
+
# others don't need to define initialize.
|
|
5
|
+
|
|
6
|
+
# Also, simple versions of the I/O routines make it possible
|
|
7
|
+
# to do testing without having to bring in the whole "Interface"
|
|
8
|
+
# and I/O routines that trepanning (and "main.rb") use.
|
|
9
|
+
|
|
10
|
+
# Note that via this file we can change 'module Trepan' to 'class
|
|
11
|
+
# Trepan' and this takes effect on all of the places which
|
|
12
|
+
# subclass this. They use class
|
|
13
|
+
# Trepan::CmdProcessor < Trepan::VirtualCmdProcessor
|
|
14
|
+
# rather than breaking this down into to parts as below.
|
|
15
|
+
module Trepan
|
|
16
|
+
class VirtualCmdProcessor
|
|
17
|
+
attr_accessor :interfaces
|
|
18
|
+
attr_accessor :state, :context, :settings
|
|
19
|
+
def initialize(interfaces, settings={})
|
|
20
|
+
@interfaces = interfaces
|
|
21
|
+
@intf = interfaces[-1]
|
|
22
|
+
@settings = settings
|
|
23
|
+
end
|
|
24
|
+
def errmsg(message)
|
|
25
|
+
puts "Error: #{message}"
|
|
26
|
+
end
|
|
27
|
+
def msg(message)
|
|
28
|
+
puts message
|
|
29
|
+
end
|
|
30
|
+
def section(message, opts={})
|
|
31
|
+
puts "Section: #{message}"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*~
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# ********************************************************
|
|
2
|
+
# This tests mostly invalid breakpoints.
|
|
3
|
+
# We have some valid ones too.
|
|
4
|
+
# ********************************************************
|
|
5
|
+
set debug testing
|
|
6
|
+
set callstyle last
|
|
7
|
+
set autoeval off
|
|
8
|
+
set basename on
|
|
9
|
+
# There aren't 100 lines in gcd.rb.
|
|
10
|
+
break 100
|
|
11
|
+
break ../example/gcd.rb:100
|
|
12
|
+
# Line one isn't a valid stopping point.
|
|
13
|
+
# It is a comment.
|
|
14
|
+
break example/gcd.rb:1
|
|
15
|
+
# This line is okay
|
|
16
|
+
break ../example/gcd.rb:4
|
|
17
|
+
# No class Foo.
|
|
18
|
+
break Foo.bar
|
|
19
|
+
q!
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
-- (gcd.rb:4)
|
|
2
|
+
def gcd(a, b)
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ break_bad.cmd line 6: set callstyle last
|
|
5
|
+
Frame call-display style is last.
|
|
6
|
+
+ break_bad.cmd line 7: set autoeval off
|
|
7
|
+
Evaluation of unrecognized debugger commands is off.
|
|
8
|
+
+ break_bad.cmd line 8: set basename on
|
|
9
|
+
basename is on.
|
|
10
|
+
+ break_bad.cmd line 9: # There aren't 100 lines in gcd.rb.
|
|
11
|
+
+ break_bad.cmd line 10: break 100
|
|
12
|
+
*** There are only 18 lines in file "gcd.rb".
|
|
13
|
+
+ break_bad.cmd line 11: break ../example/gcd.rb:100
|
|
14
|
+
*** There are only 18 lines in file "gcd.rb".
|
|
15
|
+
+ break_bad.cmd line 12: # Line one isn't a valid stopping point.
|
|
16
|
+
+ break_bad.cmd line 13: # It is a comment.
|
|
17
|
+
+ break_bad.cmd line 14: break example/gcd.rb:1
|
|
18
|
+
*** Can't evaluate example to get a method
|
|
19
|
+
*** Unable to get breakpoint position for example/gcd.rb:1
|
|
20
|
+
Breakpoint 1 file gcd.rb, line 4
|
|
21
|
+
+ break_bad.cmd line 15: # This line is okay
|
|
22
|
+
+ break_bad.cmd line 16: break ../example/gcd.rb:4
|
|
23
|
+
Breakpoint 2 file gcd.rb, line 4
|
|
24
|
+
+ break_bad.cmd line 17: # No class Foo.
|
|
25
|
+
+ break_bad.cmd line 18: break Foo.bar
|
|
26
|
+
*** Can't evaluate Foo.bar to get a method
|
|
27
|
+
*** Unable to get breakpoint position for Foo.bar
|
|
28
|
+
Breakpoint 3 file gcd.rb, line 4
|
|
29
|
+
+ break_bad.cmd line 19: q!
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- (bp_loop_issue.rb:1)
|
|
2
|
+
1.upto(2) {
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ break_loop_bug.cmd line 2: break 2
|
|
5
|
+
Breakpoint 1 file bp_loop_issue.rb, line 2
|
|
6
|
+
+ break_loop_bug.cmd line 3: cont
|
|
7
|
+
Breakpoint 1 at bp_loop_issue.rb:2
|
|
8
|
+
-- (bp_loop_issue.rb:2)
|
|
9
|
+
sleep 0.01
|
|
10
|
+
+ break_loop_bug.cmd line 4: cont
|
|
11
|
+
Breakpoint 1 at bp_loop_issue.rb:2
|
|
12
|
+
-- (bp_loop_issue.rb:2)
|
|
13
|
+
sleep 0.01
|
|
14
|
+
+ break_loop_bug.cmd line 5: cont
|
|
15
|
+
trepan8: That's all, folks...
|
data/test/data/edit.cmd
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# ********************************************************
|
|
2
|
+
# This tests the edit command
|
|
3
|
+
# ********************************************************
|
|
4
|
+
set debug testing
|
|
5
|
+
# Edit using current line position.
|
|
6
|
+
edit
|
|
7
|
+
edit 7
|
|
8
|
+
edit ../example/gcd.rb 5
|
|
9
|
+
# File should not exist
|
|
10
|
+
edit foo
|
|
11
|
+
# Add space to the end of 'edit'
|
|
12
|
+
edit
|
|
13
|
+
edit ../example/gcd.rb
|
|
14
|
+
quit!
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- (gcd.rb:4)
|
|
2
|
+
def gcd(a, b)
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ edit.cmd line 5: # Edit using current line position.
|
|
5
|
+
+ edit.cmd line 6: edit
|
|
6
|
+
Running echo FAKE-EDITOR +4 "gcd.rb"...
|
|
7
|
+
FAKE-EDITOR +4 gcd.rb
|
|
8
|
+
+ edit.cmd line 7: edit 7
|
|
9
|
+
Running echo FAKE-EDITOR +7 "gcd.rb"...
|
|
10
|
+
FAKE-EDITOR +7 gcd.rb
|
|
11
|
+
+ edit.cmd line 8: edit ../example/gcd.rb 5
|
|
12
|
+
Running echo FAKE-EDITOR +5 "gcd.rb"...
|
|
13
|
+
FAKE-EDITOR +5 gcd.rb
|
|
14
|
+
+ edit.cmd line 9: # File should not exist
|
|
15
|
+
+ edit.cmd line 10: edit foo
|
|
16
|
+
*** File "foo" is not readable.
|
|
17
|
+
+ edit.cmd line 11: # Add space to the end of 'edit'
|
|
18
|
+
+ edit.cmd line 12: edit
|
|
19
|
+
Running echo FAKE-EDITOR +4 "gcd.rb"...
|
|
20
|
+
FAKE-EDITOR +4 gcd.rb
|
|
21
|
+
+ edit.cmd line 13: edit ../example/gcd.rb
|
|
22
|
+
Running echo FAKE-EDITOR +1 "gcd.rb"...
|
|
23
|
+
FAKE-EDITOR +1 gcd.rb
|
|
24
|
+
+ edit.cmd line 14: quit!
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ********************************************************
|
|
2
|
+
# This tests mostly invalid breakpoints.
|
|
3
|
+
# We have some valid ones too.
|
|
4
|
+
# ********************************************************
|
|
5
|
+
set debug testing
|
|
6
|
+
set callstyle last
|
|
7
|
+
set autoeval off
|
|
8
|
+
set basename on
|
|
9
|
+
break ../example/gcd.rb:6
|
|
10
|
+
continue
|
|
11
|
+
pr a
|
|
12
|
+
eval [a,b]
|
|
13
|
+
continue
|
|
14
|
+
eval [a,b]
|
|
15
|
+
up
|
|
16
|
+
eval [a,b]
|
|
17
|
+
q!
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
-- (gcd.rb:4)
|
|
2
|
+
def gcd(a, b)
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ printvar.cmd line 6: set callstyle last
|
|
5
|
+
Frame call-display style is last.
|
|
6
|
+
+ printvar.cmd line 7: set autoeval off
|
|
7
|
+
Evaluation of unrecognized debugger commands is off.
|
|
8
|
+
+ printvar.cmd line 8: set basename on
|
|
9
|
+
basename is on.
|
|
10
|
+
+ printvar.cmd line 9: break ../example/gcd.rb:6
|
|
11
|
+
Breakpoint 1 file gcd.rb, line 6
|
|
12
|
+
+ printvar.cmd line 10: continue
|
|
13
|
+
Breakpoint 1 at gcd.rb:6
|
|
14
|
+
-- (gcd.rb:6)
|
|
15
|
+
if a > b
|
|
16
|
+
+ printvar.cmd line 11: pr a
|
|
17
|
+
3
|
|
18
|
+
+ printvar.cmd line 12: eval [a,b]
|
|
19
|
+
[3, 5]
|
|
20
|
+
+ printvar.cmd line 13: continue
|
|
21
|
+
Breakpoint 1 at gcd.rb:6
|
|
22
|
+
-- (gcd.rb:6)
|
|
23
|
+
if a > b
|
|
24
|
+
+ printvar.cmd line 14: eval [a,b]
|
|
25
|
+
[2, 3]
|
|
26
|
+
+ printvar.cmd line 15: up
|
|
27
|
+
--> #1 at line gcd.rb:15
|
|
28
|
+
|
|
29
|
+
+ printvar.cmd line 16: eval [a,b]
|
|
30
|
+
[3, 5]
|
|
31
|
+
+ printvar.cmd line 17: q!
|
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 debug testing
|
|
6
|
+
catch x
|
|
7
|
+
catch ZeroDivisionError
|
|
8
|
+
info catch
|
|
9
|
+
catch 5
|
|
10
|
+
step
|
|
11
|
+
quit!
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
-- (raise.rb:3)
|
|
2
|
+
raise ZeroDivisionError
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ raise.cmd line 6: catch x
|
|
5
|
+
Warning x is not known to be a Class
|
|
6
|
+
Catch exception x.
|
|
7
|
+
+ raise.cmd line 7: catch ZeroDivisionError
|
|
8
|
+
Catch exception ZeroDivisionError.
|
|
9
|
+
+ raise.cmd line 8: info catch
|
|
10
|
+
x
|
|
11
|
+
ZeroDivisionError
|
|
12
|
+
+ raise.cmd line 9: catch 5
|
|
13
|
+
Warning 5 is not known to be a Class
|
|
14
|
+
Catch exception 5.
|
|
15
|
+
+ raise.cmd line 10: step
|
|
16
|
+
Catchpoint at raise.rb:3: `ZeroDivisionError' (ZeroDivisionError)
|
|
17
|
+
!! (raise.rb:3)
|
|
18
|
+
raise ZeroDivisionError
|
|
19
|
+
+ raise.cmd line 11: quit!
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- (gcd.rb:4)
|
|
2
|
+
def gcd(a, b)
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ source.cmd line 4: source ../data/trepan8-save.1
|
|
5
|
+
debugger testing is on.
|
|
6
|
+
+ trepan8-save.1 line 2: break ../example/gcd.rb:10
|
|
7
|
+
Breakpoint 1 file gcd.rb, line 10
|
|
8
|
+
+ trepan8-save.1 line 3: break ../example/gcd.rb:12 if a > b
|
|
9
|
+
Breakpoint 2 file gcd.rb, line 12
|
|
10
|
+
+ trepan8-save.1 line 4: set autoeval on
|
|
11
|
+
Evaluation of unrecognized debugger commands is on.
|
|
12
|
+
+ trepan8-save.1 line 5: set autolist off
|
|
13
|
+
Running a 'list' command each time we enter the debugger is off.
|
|
14
|
+
+ trepan8-save.1 line 6: set autoirb off
|
|
15
|
+
To automatically go into irb each time we enter the debugger is off.
|
|
16
|
+
-- (gcd.rb:4)
|
|
17
|
+
def gcd(a, b)
|
|
18
|
+
+ source.cmd line 5: quit!
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
-- (gcd.rb:4)
|
|
2
|
+
def gcd(a, b)
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ stepping.cmd line 5: set callstyle last
|
|
5
|
+
Frame call-display style is last.
|
|
6
|
+
+ stepping.cmd line 6: next
|
|
7
|
+
-- (gcd.rb:18)
|
|
8
|
+
gcd(3,5)
|
|
9
|
+
+ stepping.cmd line 7: where
|
|
10
|
+
--> #0 at line gcd.rb:18
|
|
11
|
+
+ stepping.cmd line 8: step a
|
|
12
|
+
*** The step command argument must eval to an integer. Got: a
|
|
13
|
+
+ stepping.cmd line 9: set different on
|
|
14
|
+
different is on.
|
|
15
|
+
+ stepping.cmd line 10: step- ;; step-
|
|
16
|
+
-- (gcd.rb:6)
|
|
17
|
+
if a > b
|
|
18
|
+
-- (gcd.rb:10)
|
|
19
|
+
return nil if a <= 0
|
|
20
|
+
+ stepping.cmd line 11: set diff off
|
|
21
|
+
different is off.
|
|
22
|
+
+ stepping.cmd line 12: where
|
|
23
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
|
|
24
|
+
#1 at line gcd.rb:18
|
|
25
|
+
+ stepping.cmd line 13: n 2
|
|
26
|
+
-- (gcd.rb:15)
|
|
27
|
+
return gcd(b-a, a)
|
|
28
|
+
+ stepping.cmd line 14: step+
|
|
29
|
+
-- (gcd.rb:6)
|
|
30
|
+
if a > b
|
|
31
|
+
+ stepping.cmd line 15: where
|
|
32
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
|
33
|
+
#1 at line gcd.rb:15
|
|
34
|
+
#2 at line gcd.rb:18
|
|
35
|
+
+ stepping.cmd line 16: step 3
|
|
36
|
+
-- (gcd.rb:15)
|
|
37
|
+
return gcd(b-a, a)
|
|
38
|
+
+ stepping.cmd line 17: step+
|
|
39
|
+
-- (gcd.rb:6)
|
|
40
|
+
if a > b
|
|
41
|
+
+ stepping.cmd line 18: where
|
|
42
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
|
43
|
+
#1 at line gcd.rb:15
|
|
44
|
+
#2 at line gcd.rb:15
|
|
45
|
+
#3 at line gcd.rb:18
|
|
46
|
+
+ stepping.cmd line 19: next+
|
|
47
|
+
-- (gcd.rb:10)
|
|
48
|
+
return nil if a <= 0
|
|
49
|
+
+ stepping.cmd line 20: # finish
|
|
50
|
+
+ stepping.cmd line 21: quit!
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ***************************************************
|
|
2
|
+
# This tests step, next, finish and continue
|
|
3
|
+
# ***************************************************
|
|
4
|
+
set debug testing
|
|
5
|
+
set callstyle last
|
|
6
|
+
next
|
|
7
|
+
where
|
|
8
|
+
step a
|
|
9
|
+
set different on
|
|
10
|
+
step- ;; step-
|
|
11
|
+
set diff off
|
|
12
|
+
where
|
|
13
|
+
n 2
|
|
14
|
+
step+
|
|
15
|
+
where
|
|
16
|
+
step 3
|
|
17
|
+
step+
|
|
18
|
+
where
|
|
19
|
+
next+
|
|
20
|
+
# finish
|
|
21
|
+
quit!
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
-- (gcd.rb:4)
|
|
2
|
+
def gcd(a, b)
|
|
3
|
+
debugger testing is on.
|
|
4
|
+
+ stepping.cmd line 5: set callstyle last
|
|
5
|
+
Frame call-display style is last.
|
|
6
|
+
+ stepping.cmd line 6: next
|
|
7
|
+
-- (gcd.rb:18)
|
|
8
|
+
gcd(3,5)
|
|
9
|
+
+ stepping.cmd line 7: where
|
|
10
|
+
--> #0 at line gcd.rb:18
|
|
11
|
+
+ stepping.cmd line 8: step a
|
|
12
|
+
*** The step command argument must eval to an integer. Got: a
|
|
13
|
+
+ stepping.cmd line 9: set different on
|
|
14
|
+
different is on.
|
|
15
|
+
+ stepping.cmd line 10: step- ;; step-
|
|
16
|
+
-- (gcd.rb:6)
|
|
17
|
+
if a > b
|
|
18
|
+
-- (gcd.rb:6)
|
|
19
|
+
if a > b
|
|
20
|
+
+ stepping.cmd line 11: set diff off
|
|
21
|
+
different is off.
|
|
22
|
+
+ stepping.cmd line 12: where
|
|
23
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
|
24
|
+
#1 at line gcd.rb:18
|
|
25
|
+
+ stepping.cmd line 13: n 2
|
|
26
|
+
-- (gcd.rb:10)
|
|
27
|
+
return nil if a <= 0
|
|
28
|
+
+ stepping.cmd line 14: step+
|
|
29
|
+
-- (gcd.rb:12)
|
|
30
|
+
if a == 1 or b-a == 0
|
|
31
|
+
+ stepping.cmd line 15: where
|
|
32
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:12
|
|
33
|
+
#1 at line gcd.rb:18
|
|
34
|
+
+ stepping.cmd line 16: step 3
|
|
35
|
+
-- (gcd.rb:6)
|
|
36
|
+
if a > b
|
|
37
|
+
+ stepping.cmd line 17: step+
|
|
38
|
+
-- (gcd.rb:6)
|
|
39
|
+
if a > b
|
|
40
|
+
+ stepping.cmd line 18: where
|
|
41
|
+
--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
|
|
42
|
+
#1 at line gcd.rb:15
|
|
43
|
+
#2 at line gcd.rb:18
|
|
44
|
+
+ stepping.cmd line 19: next+
|
|
45
|
+
-- (gcd.rb:10)
|
|
46
|
+
return nil if a <= 0
|
|
47
|
+
+ stepping.cmd line 20: # finish
|
|
48
|
+
+ stepping.cmd line 21: quit!
|