trepanning 0.0.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.
- data/ChangeLog +4422 -0
- data/LICENSE +23 -0
- data/NEWS +12 -0
- data/README.textile +56 -0
- data/Rakefile +171 -0
- data/app/Makefile +7 -0
- data/app/breakpoint.rb +157 -0
- data/app/brkptmgr.rb +149 -0
- data/app/condition.rb +22 -0
- data/app/core.rb +203 -0
- data/app/default.rb +54 -0
- data/app/disassemble.rb +61 -0
- data/app/display.rb +148 -0
- data/app/file.rb +135 -0
- data/app/frame.rb +275 -0
- data/app/irb.rb +112 -0
- data/app/mock.rb +22 -0
- data/app/options.rb +122 -0
- data/app/run.rb +95 -0
- data/app/thread.rb +24 -0
- data/app/util.rb +32 -0
- data/bin/trepan +63 -0
- data/data/custom_require.rb +44 -0
- data/data/irbrc +55 -0
- data/data/prelude.rb +38 -0
- data/interface/base_intf.rb +95 -0
- data/interface/script.rb +103 -0
- data/interface/user.rb +90 -0
- data/io/base_io.rb +92 -0
- data/io/input.rb +111 -0
- data/io/string_array.rb +155 -0
- data/lib/Makefile +7 -0
- data/lib/trepanning.rb +277 -0
- data/processor/breakpoint.rb +108 -0
- data/processor/command/alias.rb +55 -0
- data/processor/command/backtrace.rb +95 -0
- data/processor/command/base/cmd.rb +97 -0
- data/processor/command/base/subcmd.rb +207 -0
- data/processor/command/base/submgr.rb +178 -0
- data/processor/command/base/subsubcmd.rb +102 -0
- data/processor/command/base/subsubmgr.rb +182 -0
- data/processor/command/break.rb +85 -0
- data/processor/command/condition.rb +64 -0
- data/processor/command/continue.rb +61 -0
- data/processor/command/debug.rb +85 -0
- data/processor/command/delete.rb +54 -0
- data/processor/command/directory.rb +43 -0
- data/processor/command/disable.rb +65 -0
- data/processor/command/disassemble.rb +103 -0
- data/processor/command/display.rb +81 -0
- data/processor/command/down.rb +56 -0
- data/processor/command/enable.rb +43 -0
- data/processor/command/exit.rb +54 -0
- data/processor/command/finish.rb +81 -0
- data/processor/command/frame.rb +117 -0
- data/processor/command/help.rb +146 -0
- data/processor/command/info.rb +28 -0
- data/processor/command/info_subcmd/args.rb +56 -0
- data/processor/command/info_subcmd/breakpoints.rb +162 -0
- data/processor/command/info_subcmd/file.rb +162 -0
- data/processor/command/info_subcmd/frame.rb +39 -0
- data/processor/command/info_subcmd/iseq.rb +83 -0
- data/processor/command/info_subcmd/locals.rb +88 -0
- data/processor/command/info_subcmd/program.rb +54 -0
- data/processor/command/info_subcmd/registers.rb +72 -0
- data/processor/command/info_subcmd/registers_subcmd/dfp.rb +38 -0
- data/processor/command/info_subcmd/registers_subcmd/helper.rb +40 -0
- data/processor/command/info_subcmd/registers_subcmd/lfp.rb +54 -0
- data/processor/command/info_subcmd/registers_subcmd/pc.rb +44 -0
- data/processor/command/info_subcmd/registers_subcmd/sp.rb +75 -0
- data/processor/command/info_subcmd/return.rb +40 -0
- data/processor/command/info_subcmd/thread.rb +106 -0
- data/processor/command/irb.rb +106 -0
- data/processor/command/kill.rb +58 -0
- data/processor/command/list.rb +327 -0
- data/processor/command/macro.rb +65 -0
- data/processor/command/next.rb +89 -0
- data/processor/command/nocache.rb +33 -0
- data/processor/command/print.rb +37 -0
- data/processor/command/ps.rb +40 -0
- data/processor/command/quit.rb +62 -0
- data/processor/command/raise.rb +47 -0
- data/processor/command/reload.rb +28 -0
- data/processor/command/reload_subcmd/command.rb +34 -0
- data/processor/command/restart.rb +57 -0
- data/processor/command/save.rb +60 -0
- data/processor/command/set.rb +47 -0
- data/processor/command/set_subcmd/auto.rb +27 -0
- data/processor/command/set_subcmd/auto_subcmd/eval.rb +67 -0
- data/processor/command/set_subcmd/auto_subcmd/irb.rb +49 -0
- data/processor/command/set_subcmd/auto_subcmd/list.rb +51 -0
- data/processor/command/set_subcmd/basename.rb +39 -0
- data/processor/command/set_subcmd/debug.rb +27 -0
- data/processor/command/set_subcmd/debug_subcmd/dbgr.rb +49 -0
- data/processor/command/set_subcmd/debug_subcmd/except.rb +35 -0
- data/processor/command/set_subcmd/debug_subcmd/macro.rb +35 -0
- data/processor/command/set_subcmd/debug_subcmd/skip.rb +35 -0
- data/processor/command/set_subcmd/debug_subcmd/stack.rb +45 -0
- data/processor/command/set_subcmd/different.rb +67 -0
- data/processor/command/set_subcmd/events.rb +71 -0
- data/processor/command/set_subcmd/max.rb +35 -0
- data/processor/command/set_subcmd/max_subcmd/list.rb +50 -0
- data/processor/command/set_subcmd/max_subcmd/stack.rb +60 -0
- data/processor/command/set_subcmd/max_subcmd/string.rb +53 -0
- data/processor/command/set_subcmd/max_subcmd/width.rb +50 -0
- data/processor/command/set_subcmd/return.rb +66 -0
- data/processor/command/set_subcmd/sp.rb +62 -0
- data/processor/command/set_subcmd/substitute.rb +25 -0
- data/processor/command/set_subcmd/substitute_subcmd/eval.rb +98 -0
- data/processor/command/set_subcmd/substitute_subcmd/path.rb +55 -0
- data/processor/command/set_subcmd/substitute_subcmd/string.rb +72 -0
- data/processor/command/set_subcmd/timer.rb +68 -0
- data/processor/command/set_subcmd/trace.rb +43 -0
- data/processor/command/set_subcmd/trace_subcmd/buffer.rb +56 -0
- data/processor/command/set_subcmd/trace_subcmd/print.rb +54 -0
- data/processor/command/set_subcmd/trace_subcmd/var.rb +61 -0
- data/processor/command/show.rb +27 -0
- data/processor/command/show_subcmd/alias.rb +50 -0
- data/processor/command/show_subcmd/args.rb +50 -0
- data/processor/command/show_subcmd/auto.rb +27 -0
- data/processor/command/show_subcmd/auto_subcmd/eval.rb +38 -0
- data/processor/command/show_subcmd/auto_subcmd/irb.rb +34 -0
- data/processor/command/show_subcmd/auto_subcmd/list.rb +36 -0
- data/processor/command/show_subcmd/basename.rb +28 -0
- data/processor/command/show_subcmd/debug.rb +27 -0
- data/processor/command/show_subcmd/debug_subcmd/dbgr.rb +31 -0
- data/processor/command/show_subcmd/debug_subcmd/except.rb +33 -0
- data/processor/command/show_subcmd/debug_subcmd/macro.rb +32 -0
- data/processor/command/show_subcmd/debug_subcmd/skip.rb +33 -0
- data/processor/command/show_subcmd/debug_subcmd/stack.rb +32 -0
- data/processor/command/show_subcmd/different.rb +37 -0
- data/processor/command/show_subcmd/events.rb +40 -0
- data/processor/command/show_subcmd/macro.rb +45 -0
- data/processor/command/show_subcmd/max.rb +31 -0
- data/processor/command/show_subcmd/max_subcmd/list.rb +39 -0
- data/processor/command/show_subcmd/max_subcmd/stack.rb +35 -0
- data/processor/command/show_subcmd/max_subcmd/string.rb +41 -0
- data/processor/command/show_subcmd/max_subcmd/width.rb +36 -0
- data/processor/command/show_subcmd/trace.rb +29 -0
- data/processor/command/show_subcmd/trace_subcmd/buffer.rb +84 -0
- data/processor/command/show_subcmd/trace_subcmd/print.rb +38 -0
- data/processor/command/source.rb +74 -0
- data/processor/command/step.rb +139 -0
- data/processor/command/stepi.rb +63 -0
- data/processor/command/unalias.rb +44 -0
- data/processor/command/undisplay.rb +63 -0
- data/processor/command/up.rb +92 -0
- data/processor/default.rb +45 -0
- data/processor/display.rb +17 -0
- data/processor/eval.rb +88 -0
- data/processor/eventbuf.rb +131 -0
- data/processor/frame.rb +230 -0
- data/processor/help.rb +72 -0
- data/processor/hook.rb +128 -0
- data/processor/load_cmds.rb +102 -0
- data/processor/location.rb +126 -0
- data/processor/main.rb +364 -0
- data/processor/mock.rb +100 -0
- data/processor/msg.rb +26 -0
- data/processor/running.rb +170 -0
- data/processor/subcmd.rb +159 -0
- data/processor/validate.rb +395 -0
- data/test/example/fname with blank.rb +1 -0
- data/test/example/gcd-xx.rb +18 -0
- data/test/example/gcd.rb +19 -0
- data/test/example/gcd1.rb +24 -0
- data/test/example/null.rb +1 -0
- data/test/example/thread1.rb +3 -0
- data/test/functional/fn_helper.rb +119 -0
- data/test/functional/test-break.rb +87 -0
- data/test/functional/test-condition.rb +59 -0
- data/test/functional/test-debugger-call-bug.rb +31 -0
- data/test/functional/test-delete.rb +71 -0
- data/test/functional/test-finish.rb +44 -0
- data/test/functional/test-immediate-step-bug.rb +35 -0
- data/test/functional/test-next.rb +77 -0
- data/test/functional/test-raise.rb +73 -0
- data/test/functional/test-return.rb +100 -0
- data/test/functional/test-step.rb +274 -0
- data/test/functional/test-stepbug.rb +40 -0
- data/test/functional/test-trace-var.rb +40 -0
- data/test/functional/tmp/b1.rb +5 -0
- data/test/functional/tmp/s1.rb +9 -0
- data/test/functional/tmp/t2.rb +6 -0
- data/test/integration/file-diff.rb +88 -0
- data/test/integration/helper.rb +52 -0
- data/test/integration/test-fname-with-blank.rb +11 -0
- data/test/integration/test-quit.rb +11 -0
- data/test/integration/try-test-enable.rb +11 -0
- data/test/unit/cmd-helper.rb +44 -0
- data/test/unit/test-app-brkpt.rb +30 -0
- data/test/unit/test-app-brkptmgr.rb +56 -0
- data/test/unit/test-app-disassemble.rb +60 -0
- data/test/unit/test-app-file.rb +46 -0
- data/test/unit/test-app-frame.rb +49 -0
- data/test/unit/test-app-options.rb +60 -0
- data/test/unit/test-app-run.rb +19 -0
- data/test/unit/test-app-thread.rb +25 -0
- data/test/unit/test-app-util.rb +17 -0
- data/test/unit/test-base-subcmd.rb +59 -0
- data/test/unit/test-bin-trepan.rb +48 -0
- data/test/unit/test-cmd-alias.rb +50 -0
- data/test/unit/test-cmd-break.rb +80 -0
- data/test/unit/test-cmd-endisable.rb +59 -0
- data/test/unit/test-cmd-help.rb +100 -0
- data/test/unit/test-cmd-kill.rb +47 -0
- data/test/unit/test-cmd-quit.rb +26 -0
- data/test/unit/test-cmd-step.rb +45 -0
- data/test/unit/test-intf-user.rb +45 -0
- data/test/unit/test-io-input.rb +26 -0
- data/test/unit/test-proc-eval.rb +26 -0
- data/test/unit/test-proc-frame.rb +77 -0
- data/test/unit/test-proc-help.rb +15 -0
- data/test/unit/test-proc-hook.rb +29 -0
- data/test/unit/test-proc-load_cmds.rb +40 -0
- data/test/unit/test-proc-main.rb +99 -0
- data/test/unit/test-proc-validate.rb +90 -0
- data/test/unit/test-subcmd-help.rb +48 -0
- metadata +358 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
require_relative '../substitute'
|
|
5
|
+
|
|
6
|
+
class Trepan::SubSubcommand::SetSubstitutePath < Trepan::SubSubcommand
|
|
7
|
+
unless defined?(HELP)
|
|
8
|
+
HELP =
|
|
9
|
+
'Add a substitution rule replacing FROM into TO in source file names.
|
|
10
|
+
If a substitution rule was previously set for FROM, the old rule
|
|
11
|
+
is replaced by the new one.'
|
|
12
|
+
MIN_ABBREV = 'fi'.size
|
|
13
|
+
MAX_ARGS = 2
|
|
14
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
15
|
+
SHORT_HELP = 'Use PATH in place of an filename'
|
|
16
|
+
PREFIX = %w(set substitute path)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def run(args)
|
|
20
|
+
if args.size != 3
|
|
21
|
+
errmsg "This command needs 2 arguments, got #{args.size-1}."
|
|
22
|
+
return
|
|
23
|
+
end
|
|
24
|
+
from_path = args[1]
|
|
25
|
+
to_path = args[2]
|
|
26
|
+
# FIXME Check from_path name to see if it is loaded
|
|
27
|
+
if File.exist?(to_path)
|
|
28
|
+
LineCache::remap_file(from_path, to_path)
|
|
29
|
+
else
|
|
30
|
+
errmsg "File #{to_path} doesn't exist"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
if __FILE__ == $0
|
|
36
|
+
# Demo it.
|
|
37
|
+
require_relative '../../../mock'
|
|
38
|
+
require_relative '../../../subcmd'
|
|
39
|
+
name = File.basename(__FILE__, '.rb')
|
|
40
|
+
|
|
41
|
+
# FIXME: DRY the below code
|
|
42
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
43
|
+
testcmdMgr = Trepan::Subcmd.new(set_cmd)
|
|
44
|
+
cmd_name = Trepan::SubSubcommand::SetSubstitutePath::PREFIX.join('')
|
|
45
|
+
setx_cmd = Trepan::SubSubcommand::SetSubstitutePath.new(set_cmd.proc,
|
|
46
|
+
set_cmd,
|
|
47
|
+
cmd_name)
|
|
48
|
+
# require_relative '../../../../lib/trepanning'
|
|
49
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
50
|
+
# dbgr.debugger
|
|
51
|
+
setx_cmd.run([])
|
|
52
|
+
|
|
53
|
+
# name = File.basename(__FILE__, '.rb')
|
|
54
|
+
# subcommand.summary_help(name)
|
|
55
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require 'tempfile'
|
|
4
|
+
require 'linecache'
|
|
5
|
+
require_relative '../../base/subsubcmd'
|
|
6
|
+
require_relative '../substitute'
|
|
7
|
+
|
|
8
|
+
class Trepan::SubSubcommand::SetSubstituteString < Trepan::SubSubcommand
|
|
9
|
+
unless defined?(HELP)
|
|
10
|
+
HELP =
|
|
11
|
+
'set substitute string FROM-FILE STRING-VAR
|
|
12
|
+
|
|
13
|
+
Use the contents of string variable STRING-VAR as the source text for
|
|
14
|
+
FROM-FILE. If a substitution rule was previously set for FROM-FILE,
|
|
15
|
+
the old rule is replaced by the new one.
|
|
16
|
+
|
|
17
|
+
If "." is given for FROM_FILE, the current instruction sequence name is used.'
|
|
18
|
+
MIN_ABBREV = 'st'.size
|
|
19
|
+
MAX_ARGS = 2
|
|
20
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
21
|
+
SHORT_HELP = 'Use STRING in place of an filename'
|
|
22
|
+
PREFIX = %w(set substitute string)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def run(args)
|
|
26
|
+
if args.size != 3
|
|
27
|
+
errmsg "This command needs 2 arguments, got #{args.size-1}."
|
|
28
|
+
return
|
|
29
|
+
end
|
|
30
|
+
from_path =
|
|
31
|
+
if '.' == args[1]
|
|
32
|
+
@proc.frame.iseq.source_container[1]
|
|
33
|
+
else
|
|
34
|
+
from_path = args[1]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
to_str = args[2]
|
|
38
|
+
val = @proc.debug_eval_no_errmsg(to_str)
|
|
39
|
+
|
|
40
|
+
if val
|
|
41
|
+
tempfile = Tempfile.new(["#{from_path}-#{to_str}-", '.rb'])
|
|
42
|
+
tempfile.open.puts(val)
|
|
43
|
+
@proc.remap_container[['string', from_path]] = ['file', tempfile.path]
|
|
44
|
+
tempfile.close
|
|
45
|
+
LineCache::cache(tempfile.path)
|
|
46
|
+
else
|
|
47
|
+
errmsg "Can't get value for #{to_str}"
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if __FILE__ == $0
|
|
53
|
+
# Demo it.
|
|
54
|
+
require_relative '/../../../mock'
|
|
55
|
+
require_relative '../../../subcmd'
|
|
56
|
+
name = File.basename(__FILE__, '.rb')
|
|
57
|
+
|
|
58
|
+
# FIXME: DRY the below code
|
|
59
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
60
|
+
testcmdMgr = Trepan::Subcmd.new(set_cmd)
|
|
61
|
+
cmd_name = Trepan::SubSubcommand::SetSubstituteString::PREFIX.join('')
|
|
62
|
+
setx_cmd = Trepan::SubSubcommand::SetSubstituteString.new(set_cmd.proc,
|
|
63
|
+
set_cmd,
|
|
64
|
+
cmd_name)
|
|
65
|
+
# require_relative '../../../../lib/trepanning'
|
|
66
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
67
|
+
# dbgr.debugger
|
|
68
|
+
setx_cmd.run([])
|
|
69
|
+
|
|
70
|
+
# name = File.basename(__FILE__, '.rb')
|
|
71
|
+
# subcommand.summary_help(name)
|
|
72
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::Subcommand::SetTimer < Trepan::SetBoolSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = "set timer [on|off|0|1]
|
|
8
|
+
|
|
9
|
+
Tracks and shows elapsed time between debugger events.
|
|
10
|
+
|
|
11
|
+
Since debugger overhead can be large depending on what you are doing,
|
|
12
|
+
there are many ways to customize the debugger to take less time (and
|
|
13
|
+
do less).
|
|
14
|
+
|
|
15
|
+
Stepping is slow, running to a breakpoint without stepping is
|
|
16
|
+
relatively fast compared to previous versions of the debugger and
|
|
17
|
+
compared to stepping.
|
|
18
|
+
|
|
19
|
+
Stopping at fewer events can also speed things up. Trace event
|
|
20
|
+
buffering slows things down.
|
|
21
|
+
|
|
22
|
+
Buy turning this setting on, you may be able to get a feel for what
|
|
23
|
+
how expensive the various settings.
|
|
24
|
+
|
|
25
|
+
See also: 'set events', 'set trace buffer', 'step', and 'break'.
|
|
26
|
+
"
|
|
27
|
+
|
|
28
|
+
MIN_ABBREV = 'ti'.size
|
|
29
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
30
|
+
PREFIX = %w(set timer)
|
|
31
|
+
SHORT_HELP = "Set to show elapsed time between debugger events"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def run(args)
|
|
35
|
+
super
|
|
36
|
+
if @proc.settings[:timer]
|
|
37
|
+
@proc.cmdloop_posthooks.insert_if_new(-1, 'timer', @proc.timer_hook[1])
|
|
38
|
+
@proc.cmdloop_prehooks.insert_if_new(-1, 'timer', @proc.timer_hook[1])
|
|
39
|
+
else
|
|
40
|
+
@proc.cmdloop_posthooks.delete_by_name('timer')
|
|
41
|
+
@proc.cmdloop_prehooks.delete_by_name('timer')
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
if __FILE__ == $0
|
|
48
|
+
# Demo it.
|
|
49
|
+
require_relative '../../mock'
|
|
50
|
+
require_relative '../../subcmd'
|
|
51
|
+
require_relative '../../hook'
|
|
52
|
+
name = File.basename(__FILE__, '.rb')
|
|
53
|
+
|
|
54
|
+
# FIXME: DRY the below code
|
|
55
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
56
|
+
subcommand = Trepan::Subcommand::SetTimer.new(set_cmd)
|
|
57
|
+
testcmdMgr = Trepan::Subcmd.new(subcommand)
|
|
58
|
+
|
|
59
|
+
subcommand.run_show_bool
|
|
60
|
+
subcommand.summary_help(name)
|
|
61
|
+
|
|
62
|
+
# require 'trepanning'
|
|
63
|
+
# Trepan.debug(:set_restart => true)
|
|
64
|
+
subcommand.run(['set', name])
|
|
65
|
+
subcommand.run(['set', name, 'off'])
|
|
66
|
+
subcommand.run(['set', name, 'on'])
|
|
67
|
+
|
|
68
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subsubcmd'
|
|
4
|
+
require_relative '../base/subsubmgr'
|
|
5
|
+
|
|
6
|
+
class Trepan::SubSubcommand::SetTrace < Trepan::SubSubcommandMgr
|
|
7
|
+
unless defined?(HELP)
|
|
8
|
+
HELP = "Set tracing of various sorts.
|
|
9
|
+
|
|
10
|
+
The types of tracing include global variables, events from the trace
|
|
11
|
+
buffer, or printing those events.
|
|
12
|
+
|
|
13
|
+
See 'help set trace *' or a list of subcommands or 'help set trace
|
|
14
|
+
<name>' for help on a particular trace subcommand."
|
|
15
|
+
|
|
16
|
+
IN_LIST = true
|
|
17
|
+
MIN_ABBREV = 'tr'.size
|
|
18
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
19
|
+
PREFIX = %w(set trace)
|
|
20
|
+
SHORT_HELP = 'Set tracing of various sorts.'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
if __FILE__ == $0
|
|
26
|
+
# Demo it.
|
|
27
|
+
require_relative '../../mock'
|
|
28
|
+
require_relative '../../subcmd'
|
|
29
|
+
require_relative '../../hook'
|
|
30
|
+
name = File.basename(__FILE__, '.rb')
|
|
31
|
+
|
|
32
|
+
# FIXME: DRY the below code
|
|
33
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
34
|
+
command = Trepan::SubSubcommand::SetTrace.new(dbgr.core.processor,
|
|
35
|
+
set_cmd)
|
|
36
|
+
name = File.basename(__FILE__, '.rb')
|
|
37
|
+
cmd_args = ['set', name]
|
|
38
|
+
set_cmd.instance_variable_set('@last_args', cmd_args)
|
|
39
|
+
# require_relative '../../../lib/trepanning'
|
|
40
|
+
# Trepan.debug(:set_restart => true)
|
|
41
|
+
command.run(cmd_args)
|
|
42
|
+
command.run(['set', name, '*'])
|
|
43
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
require_relative '../trace'
|
|
5
|
+
class Trepan::SubSubcommand::SetTraceBuffer < Trepan::SetBoolSubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP =
|
|
8
|
+
"set trace buffer [on|off|1|0]
|
|
9
|
+
|
|
10
|
+
Set saving trace events in a buffer
|
|
11
|
+
"
|
|
12
|
+
MIN_ABBREV = 'b'.size
|
|
13
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
14
|
+
PREFIX = %w(set trace buffer)
|
|
15
|
+
SHORT_HELP = 'Set saving trace events in a buffer'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def run(args)
|
|
19
|
+
super
|
|
20
|
+
if settings[:tracebuffer]
|
|
21
|
+
# @proc.start_capture
|
|
22
|
+
@proc.unconditional_prehooks.insert_if_new(-1, *@proc.tracebuf_hook)
|
|
23
|
+
else
|
|
24
|
+
@proc.unconditional_prehooks.delete_by_name('tracebuffer')
|
|
25
|
+
# @proc.stop_capture
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
if __FILE__ == $0
|
|
32
|
+
# Demo it.
|
|
33
|
+
require_relative '../../../mock'
|
|
34
|
+
require_relative '../../../subcmd'
|
|
35
|
+
name = File.basename(__FILE__, '.rb')
|
|
36
|
+
|
|
37
|
+
# FIXME: DRY the below code
|
|
38
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
39
|
+
trace_cmd = Trepan::SubSubcommand::SetTrace.new(dbgr.core.processor,
|
|
40
|
+
set_cmd)
|
|
41
|
+
|
|
42
|
+
# FIXME: remove the 'join' below
|
|
43
|
+
cmd_name = Trepan::SubSubcommand::SetTraceBuffer::PREFIX.join('')
|
|
44
|
+
subcmd = Trepan::SubSubcommand::SetTraceBuffer.new(set_cmd.proc,
|
|
45
|
+
trace_cmd,
|
|
46
|
+
cmd_name)
|
|
47
|
+
# require_relative '../../../../lib/trepanning'
|
|
48
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
49
|
+
# dbgr.debugger
|
|
50
|
+
|
|
51
|
+
subcmd.run([cmd_name])
|
|
52
|
+
%w(off on 1 0).each { |arg| subcmd.run([cmd_name, arg]) }
|
|
53
|
+
puts subcmd.save_command()
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
require_relative '../trace'
|
|
5
|
+
class Trepan::SubSubcommand::SetTracePrint < Trepan::SetBoolSubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP =
|
|
8
|
+
"set trace print [on|off|1|0]
|
|
9
|
+
|
|
10
|
+
Set printing trace events."
|
|
11
|
+
|
|
12
|
+
MIN_ABBREV = 'p'.size
|
|
13
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
14
|
+
PREFIX = %w(set trace print)
|
|
15
|
+
SHORT_HELP = 'Set print trace events'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def run(args)
|
|
19
|
+
super
|
|
20
|
+
if settings[:traceprint]
|
|
21
|
+
@proc.unconditional_prehooks.insert_if_new(-1, *@proc.trace_hook)
|
|
22
|
+
else
|
|
23
|
+
@proc.unconditional_prehooks.delete_by_name('trace')
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
if __FILE__ == $0
|
|
30
|
+
# Demo it.
|
|
31
|
+
require_relative '../../../mock'
|
|
32
|
+
require_relative '../../../subcmd'
|
|
33
|
+
name = File.basename(__FILE__, '.rb')
|
|
34
|
+
|
|
35
|
+
# FIXME: DRY the below code
|
|
36
|
+
dbgr, set_cmd = MockTrepan::setup('set')
|
|
37
|
+
trace_cmd = Trepan::SubSubcommand::SetTrace.new(dbgr.core.processor,
|
|
38
|
+
set_cmd)
|
|
39
|
+
|
|
40
|
+
# FIXME: remove the 'join' below
|
|
41
|
+
cmd_name = Trepan::SubSubcommand::SetTracePrint::PREFIX.join('')
|
|
42
|
+
subcmd = Trepan::SubSubcommand::SetTracePrint.new(set_cmd.proc,
|
|
43
|
+
trace_cmd,
|
|
44
|
+
cmd_name)
|
|
45
|
+
# require_relative '../../../../lib/trepanning'
|
|
46
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
47
|
+
# dbgr.debugger
|
|
48
|
+
|
|
49
|
+
subcmd.run([cmd_name])
|
|
50
|
+
%w(off on 1 0).each { |arg| subcmd.run([cmd_name, arg]) }
|
|
51
|
+
puts subcmd.save_command()
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
require_relative '../trace'
|
|
5
|
+
class Trepan::SubSubcommand::SetTraceVar < Trepan::SubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP =
|
|
8
|
+
"set trace var GLOBAL_VARIABLE
|
|
9
|
+
|
|
10
|
+
The debugger calls 'trace_var' to trace changes to the value of
|
|
11
|
+
GLOBAL_VARIABLE. Note in contrast to other events, stopping for
|
|
12
|
+
variable tracing occurs *after* the event, not before.
|
|
13
|
+
|
|
14
|
+
See also 'set events'."
|
|
15
|
+
|
|
16
|
+
MIN_ABBREV = 'v'.size
|
|
17
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
18
|
+
SHORT_HELP = "Set to display trace a global variable."
|
|
19
|
+
PREFIX = %w(set trace var)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def run(args)
|
|
23
|
+
if args.size == 2
|
|
24
|
+
traced_var = args[1]
|
|
25
|
+
unless traced_var[0] == '$'
|
|
26
|
+
errmsg "Expecting a global variable to trace, got: #{traced_var}"
|
|
27
|
+
return
|
|
28
|
+
end
|
|
29
|
+
trace_var(traced_var, @proc.core.method(:trace_var_processor))
|
|
30
|
+
msg("Tracing variable #{traced_var}.")
|
|
31
|
+
return
|
|
32
|
+
else
|
|
33
|
+
errmsg "Expecting two arguments, got #{args.size}"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
if __FILE__ == $0
|
|
39
|
+
# Demo it.
|
|
40
|
+
require_relative '../../../mock'
|
|
41
|
+
require_relative '../../../subcmd'
|
|
42
|
+
name = File.basename(__FILE__, '.rb')
|
|
43
|
+
|
|
44
|
+
# FIXME: DRY the below code
|
|
45
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
46
|
+
set_cmd.proc.send('frame_initialize')
|
|
47
|
+
testcmdMgr = Trepan::Subcmd.new(set_cmd)
|
|
48
|
+
cmd_name = Trepan::SubSubcommand::SetTraceVar::PREFIX.join('')
|
|
49
|
+
setx_cmd = Trepan::SubSubcommand::SetTraceVar.new(set_cmd.proc,
|
|
50
|
+
set_cmd,
|
|
51
|
+
cmd_name)
|
|
52
|
+
setx_cmd.run([])
|
|
53
|
+
# require_relative '../../../../lib/bdbgr'
|
|
54
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
55
|
+
# dbgr.debugger
|
|
56
|
+
eval('set_cmd.proc.frame_setup(RubyVM::ThreadFrame::current); setx_cmd.run([])')
|
|
57
|
+
|
|
58
|
+
# name = File.basename(__FILE__, '.rb')
|
|
59
|
+
# subcommand.summary_help(name)
|
|
60
|
+
end
|
|
61
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative 'base/submgr'
|
|
4
|
+
|
|
5
|
+
class Trepan::Command::ShowCommand < Trepan::SubcommandMgr
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP =
|
|
8
|
+
'Generic command for showing things about the debugger. You can
|
|
9
|
+
give unique prefix of the name of a subcommand to get information
|
|
10
|
+
about just that subcommand.
|
|
11
|
+
|
|
12
|
+
Type "show" for a list of "show" subcommands and what they do.
|
|
13
|
+
Type "help show *" for just a list of "show" subcommands.'
|
|
14
|
+
|
|
15
|
+
CATEGORY = 'status'
|
|
16
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
17
|
+
NEED_STACK = false
|
|
18
|
+
SHORT_HELP = 'Show parts of the debugger environment'
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
if __FILE__ == $0
|
|
23
|
+
require_relative '../mock'
|
|
24
|
+
name = File.basename(__FILE__, '.rb')
|
|
25
|
+
dbgr, cmd = MockDebugger::setup(name)
|
|
26
|
+
cmd.run([name])
|
|
27
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::Subcommand::ShowAlias < Trepan::Subcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = "show alias [NAME1 NAME2 ...]
|
|
8
|
+
|
|
9
|
+
If aliases names are given, show their definition. If left blank, show
|
|
10
|
+
all alias names"
|
|
11
|
+
|
|
12
|
+
MIN_ABBREV = 'al'.size
|
|
13
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
14
|
+
PREFIX = %w(show alias)
|
|
15
|
+
SHORT_HELP = "Show defined aliases"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def run(args)
|
|
19
|
+
if args.size > 2
|
|
20
|
+
args[2..-1].each do |alias_name|
|
|
21
|
+
if @proc.aliases.member?(alias_name)
|
|
22
|
+
msg "%s: %s" % [alias_name, @proc.aliases[alias_name]]
|
|
23
|
+
else
|
|
24
|
+
msg "%s is not a defined alias" % alias_name
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
elsif @proc.aliases.empty?
|
|
28
|
+
msg "No aliases defined."
|
|
29
|
+
else
|
|
30
|
+
msg "List of aliases names currently defined:"
|
|
31
|
+
msg columnize_commands(@proc.aliases.keys.sort)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
if __FILE__ == $0
|
|
37
|
+
# Demo it.
|
|
38
|
+
require_relative '../../mock'
|
|
39
|
+
name = File.basename(__FILE__, '.rb')
|
|
40
|
+
|
|
41
|
+
# FIXME: DRY the below code
|
|
42
|
+
dbgr, cmd = MockDebugger::setup('show')
|
|
43
|
+
subcommand = Trepan::Subcommand::ShowAlias.new(cmd)
|
|
44
|
+
|
|
45
|
+
name = File.basename(__FILE__, '.rb')
|
|
46
|
+
subcommand.summary_help(name)
|
|
47
|
+
puts
|
|
48
|
+
subcommand.run(%w(show alias))
|
|
49
|
+
subcommand.run(%w(show alias u foo))
|
|
50
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::Subcommand::ShowArgs < Trepan::Subcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = 'Show argument list to give program when it is restarted'
|
|
8
|
+
MIN_ABBREV = 'ar'.size
|
|
9
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
10
|
+
PREFIX = %w(show args)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def run(args)
|
|
14
|
+
dbgr = @proc.dbgr
|
|
15
|
+
argv = dbgr.restart_argv
|
|
16
|
+
msg("Restart directory: #{dbgr.initial_dir}") if dbgr.initial_dir
|
|
17
|
+
msg("Restart args:\n\t#{argv.inspect}")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
if __FILE__ == $0
|
|
23
|
+
# Demo it.
|
|
24
|
+
require_relative '../../mock'
|
|
25
|
+
require_relative '../../subcmd'
|
|
26
|
+
name = File.basename(__FILE__, '.rb')
|
|
27
|
+
|
|
28
|
+
# FIXME: DRY the below code
|
|
29
|
+
dbgr, cmd = MockDebugger::setup('show')
|
|
30
|
+
subcommand = Trepan::Subcommand::ShowArgs.new(cmd)
|
|
31
|
+
testcmdMgr = Trepan::Subcmd.new(subcommand)
|
|
32
|
+
|
|
33
|
+
def subcommand.msg(message)
|
|
34
|
+
puts message
|
|
35
|
+
end
|
|
36
|
+
def subcommand.msg_nocr(message)
|
|
37
|
+
print message
|
|
38
|
+
end
|
|
39
|
+
def subcommand.errmsg(message)
|
|
40
|
+
puts message
|
|
41
|
+
end
|
|
42
|
+
subcommand.run([])
|
|
43
|
+
name = File.basename(__FILE__, '.rb')
|
|
44
|
+
subcommand.summary_help(name)
|
|
45
|
+
puts
|
|
46
|
+
dbgr.instance_variable_set('@initial_dir', Dir.pwd)
|
|
47
|
+
dbgr.restart_argv = ARGV
|
|
48
|
+
subcommand.run([])
|
|
49
|
+
|
|
50
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subsubcmd'
|
|
4
|
+
require_relative '../base/subsubmgr'
|
|
5
|
+
|
|
6
|
+
class Trepan::SubSubcommand::ShowAuto < Trepan::SubSubcommandMgr
|
|
7
|
+
unless defined?(HELP)
|
|
8
|
+
HELP = 'Show settings which some sort of "automatic" default behavior'
|
|
9
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
10
|
+
PREFIX = %w(show auto)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
if __FILE__ == $0
|
|
15
|
+
require_relative '../../mock'
|
|
16
|
+
dbgr = MockDebugger::MockDebugger.new
|
|
17
|
+
cmds = dbgr.core.processor.commands
|
|
18
|
+
show_cmd = cmds['show']
|
|
19
|
+
command = Trepan::SubSubcommand::ShowAuto.new(dbgr.core.processor,
|
|
20
|
+
show_cmd)
|
|
21
|
+
name = File.basename(__FILE__, '.rb')
|
|
22
|
+
cmd_args = ['show', name]
|
|
23
|
+
show_cmd.instance_variable_set('@last_args', cmd_args)
|
|
24
|
+
# require_relative '../../../lib/trepanning'
|
|
25
|
+
# Trepan.debug(:set_restart => true)
|
|
26
|
+
command.run(cmd_args)
|
|
27
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::SubSubcommand::ShowAutoEval < Trepan::ShowBoolSubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = "set auto eval [ON|OFF]
|
|
8
|
+
|
|
9
|
+
Set this on if you want things that don't look like debugger command to be eval'd
|
|
10
|
+
as a string."
|
|
11
|
+
|
|
12
|
+
MIN_ABBREV = 'ev'.size
|
|
13
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
14
|
+
PREFIX = %w(show auto eval)
|
|
15
|
+
SHORT_HELP = "Show evaluation of unrecognized debugger commands"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
if __FILE__ == $0
|
|
21
|
+
# Demo it.
|
|
22
|
+
require_relative '../../../mock'
|
|
23
|
+
|
|
24
|
+
# FIXME: DRY the below code
|
|
25
|
+
dbgr, show_cmd = MockDebugger::setup('show')
|
|
26
|
+
testcmdMgr = Trepan::Subcmd.new(show_cmd)
|
|
27
|
+
auto_cmd = Trepan::SubSubcommand::ShowAuto.new(dbgr.core.processor,
|
|
28
|
+
show_cmd)
|
|
29
|
+
# FIXME: remove the 'join' below
|
|
30
|
+
cmd_name = Trepan::SubSubcommand::ShowAutoEval::PREFIX.join('')
|
|
31
|
+
autox_cmd = Trepan::SubSubcommand::ShowAutoEval.new(show_cmd.proc, auto_cmd,
|
|
32
|
+
cmd_name)
|
|
33
|
+
# require_relative '../../../../lib/trepanning'
|
|
34
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
35
|
+
# dbgr.debugger
|
|
36
|
+
autox_cmd.run([])
|
|
37
|
+
|
|
38
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
require_relative '../auto'
|
|
5
|
+
|
|
6
|
+
class Trepan::SubSubcommand::ShowAutoIrb < Trepan::ShowBoolSubSubcommand
|
|
7
|
+
unless defined?(HELP)
|
|
8
|
+
HELP = "Show if IRB is invoked on debugger stops"
|
|
9
|
+
MIN_ABBREV = 'ir'.size
|
|
10
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
11
|
+
PREFIX = %w(show auto irb)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
if __FILE__ == $0
|
|
17
|
+
# Demo it.
|
|
18
|
+
require_relative '../../../mock'
|
|
19
|
+
require_relative '../../../subcmd'
|
|
20
|
+
name = File.basename(__FILE__, '.rb')
|
|
21
|
+
|
|
22
|
+
# FIXME: DRY the below code
|
|
23
|
+
dbgr, show_cmd = MockDebugger::setup('show')
|
|
24
|
+
testcmdMgr = Trepan::Subcmd.new(show_cmd)
|
|
25
|
+
auto_cmd = Trepan::SubSubcommand::ShowAuto.new(dbgr.core.processor,
|
|
26
|
+
show_cmd)
|
|
27
|
+
|
|
28
|
+
cmd_name = Trepan::SubSubcommand::ShowAutoIrb::PREFIX.join('')
|
|
29
|
+
autox_cmd = Trepan::SubSubcommand::ShowAutoIrb.new(show_cmd.proc, auto_cmd,
|
|
30
|
+
cmd_name)
|
|
31
|
+
autox_cmd.run([])
|
|
32
|
+
# name = File.basename(__FILE__, '.rb')
|
|
33
|
+
# autox_cmd.summary_help(name)
|
|
34
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::SubSubcommand::ShowAutoList < Trepan::ShowBoolSubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = "Show running a 'list' command each time we enter the debugger"
|
|
8
|
+
MIN_ABBREV = 'l'.size
|
|
9
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
10
|
+
PREFIX = %w(show auto list)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
if __FILE__ == $0
|
|
16
|
+
# Demo it.
|
|
17
|
+
require_relative '../../../mock'
|
|
18
|
+
require_relative '../../../subcmd'
|
|
19
|
+
name = File.basename(__FILE__, '.rb')
|
|
20
|
+
|
|
21
|
+
# FIXME: DRY the below code
|
|
22
|
+
dbgr, show_cmd = MockDebugger::setup('show')
|
|
23
|
+
testcmdMgr = Trepan::Subcmd.new(show_cmd)
|
|
24
|
+
auto_cmd = Trepan::SubSubcommand::ShowAuto.new(dbgr.core.processor,
|
|
25
|
+
show_cmd)
|
|
26
|
+
|
|
27
|
+
# FIXME: remove the 'join' below
|
|
28
|
+
cmd_name = Trepan::SubSubcommand::ShowAutoList::PREFIX.join('')
|
|
29
|
+
autox_cmd = Trepan::SubSubcommand::ShowAutoList.new(show_cmd.proc, auto_cmd,
|
|
30
|
+
cmd_name)
|
|
31
|
+
# require_relative '../../../../lib/trepanning'
|
|
32
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
33
|
+
# dbgr.debugger
|
|
34
|
+
autox_cmd.run([])
|
|
35
|
+
|
|
36
|
+
end
|