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,45 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::SubSubcommand::SetDebugStack < Trepan::SetBoolSubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = "Set display of complete stack including possibly setup stack from trepanning"
|
|
8
|
+
MIN_ABBREV = 'st'.size
|
|
9
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
10
|
+
PREFIX = %w(set debug stack)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def run(args)
|
|
14
|
+
super
|
|
15
|
+
@proc.hide_level =
|
|
16
|
+
if @proc.settings[:debugstack]
|
|
17
|
+
0
|
|
18
|
+
else
|
|
19
|
+
@proc.hidelevels[Thread.current] || 0
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
if __FILE__ == $0
|
|
25
|
+
# Demo it.
|
|
26
|
+
require_relative '../../../mock'
|
|
27
|
+
require_relative '../../../subcmd'
|
|
28
|
+
name = File.basename(__FILE__, '.rb')
|
|
29
|
+
|
|
30
|
+
# FIXME: DRY the below code
|
|
31
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
32
|
+
debug_cmd = Trepan::SubSubcommand::SetDebug.new(dbgr.core.processor,
|
|
33
|
+
set_cmd)
|
|
34
|
+
# FIXME: remove the 'join' below
|
|
35
|
+
cmd_name = Trepan::SubSubcommand::SetDebugStack::PREFIX.join('')
|
|
36
|
+
debugx_cmd = Trepan::SubSubcommand::SetDebugStack.new(set_cmd.proc,
|
|
37
|
+
debug_cmd,
|
|
38
|
+
cmd_name)
|
|
39
|
+
# require_relative '../../../../lib/trepanning'
|
|
40
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
41
|
+
# dbgr.debugger
|
|
42
|
+
debugx_cmd.run([name])
|
|
43
|
+
debugx_cmd.run([name, 'off'])
|
|
44
|
+
debugx_cmd.run([name, 'on'])
|
|
45
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::Subcommand::SetDifferent < Trepan::SetBoolSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = "
|
|
8
|
+
set different [on|off|nostack]
|
|
9
|
+
|
|
10
|
+
Set to make sure 'next/step' move to a new position.
|
|
11
|
+
|
|
12
|
+
Due to the interpretive, expression-oriented nature of the Ruby
|
|
13
|
+
Language and implementation, each line often may contain many possible
|
|
14
|
+
stopping points with possibly different event type. In a debugger it
|
|
15
|
+
is sometimes desirable to continue but stop only when the position
|
|
16
|
+
next changes.
|
|
17
|
+
|
|
18
|
+
Setting 'different' to on will cause each 'step' or 'next' command to
|
|
19
|
+
stop at a different position.
|
|
20
|
+
|
|
21
|
+
Note though that the notion of different does take into account stack
|
|
22
|
+
nesting. So in ARGV.map {|arg| arg.to_i} you get a stop before ARGV as
|
|
23
|
+
well as one in the block.
|
|
24
|
+
|
|
25
|
+
If you to ignore stopping at added nesting levels, there are two
|
|
26
|
+
possibilities. 'set step nostack' will ignore stack nestings levels on
|
|
27
|
+
a given line. Also you can use 'next', but that also stepping into
|
|
28
|
+
functions on different lines to also be skipped.
|
|
29
|
+
|
|
30
|
+
See also 'step', 'next' which have suffixes '+' and '-' which
|
|
31
|
+
override this setting."
|
|
32
|
+
|
|
33
|
+
IN_LIST = true
|
|
34
|
+
MIN_ABBREV = 'dif'.size
|
|
35
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
36
|
+
PREFIX = %w(set different)
|
|
37
|
+
SHORT_HELP = "Set to make sure 'next/step' move to a new position."
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def run(args)
|
|
41
|
+
if args.size == 3 && 'nostack' == args[2]
|
|
42
|
+
@proc.settings[:different] = 'nostack'
|
|
43
|
+
msg("different is nostack.")
|
|
44
|
+
else
|
|
45
|
+
super
|
|
46
|
+
end
|
|
47
|
+
@proc.different_pos = @proc.settings[:different]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if __FILE__ == $0
|
|
53
|
+
# Demo it.
|
|
54
|
+
require_relative '../../mock'
|
|
55
|
+
name = File.basename(__FILE__, '.rb')
|
|
56
|
+
|
|
57
|
+
# FIXME: DRY the below code
|
|
58
|
+
dbgr, cmd = MockDebugger::setup('set')
|
|
59
|
+
subcommand = Trepan::Subcommand::SetDifferent.new(cmd)
|
|
60
|
+
testcmdMgr = Trepan::Subcmd.new(subcommand)
|
|
61
|
+
|
|
62
|
+
subcommand.run_show_bool
|
|
63
|
+
subcommand.summary_help(name)
|
|
64
|
+
puts
|
|
65
|
+
puts '-' * 20
|
|
66
|
+
puts subcommand.save_command
|
|
67
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require 'trace'
|
|
4
|
+
require 'columnize'
|
|
5
|
+
require_relative '../base/subcmd'
|
|
6
|
+
|
|
7
|
+
class Trepan::Subcommand::SetEvents < Trepan::Subcommand
|
|
8
|
+
unless defined?(HELP)
|
|
9
|
+
HELP = "set events {event-name[,] ...}
|
|
10
|
+
|
|
11
|
+
Set trace events that the debugger will stop on
|
|
12
|
+
|
|
13
|
+
Valid event names come from the Trace module and include:
|
|
14
|
+
#{Columnize::columnize(Trace.const_get('EVENTS'), 80, ' ' * 4, true, true, ' ' * 2)}
|
|
15
|
+
|
|
16
|
+
Separate event names with space and an optional comma is also
|
|
17
|
+
allowable after an event name.
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
set events call return
|
|
21
|
+
set ev call, c_call, return, c_return, c_return, insn
|
|
22
|
+
"
|
|
23
|
+
MIN_ABBREV = 'ev'.size
|
|
24
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
25
|
+
PREFIX = %w(set events)
|
|
26
|
+
SHORT_HELP = 'Set trace events we may stop on.'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def save_command
|
|
30
|
+
step_events_list = @proc.core.step_events_list
|
|
31
|
+
step_events_list = 'brkpt' unless step_events_list
|
|
32
|
+
["#{subcmd_prefix_string} #{step_events_list}"]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def run(args)
|
|
36
|
+
unless args.size <= 2
|
|
37
|
+
events = args[2..-1]
|
|
38
|
+
events.each {|event| event.chomp!(',')}
|
|
39
|
+
bitmask, bad_events = Trace.events2bitmask(events)
|
|
40
|
+
bitmask |= Trace::BRKPT_EVENT_MASK
|
|
41
|
+
unless bad_events.empty?
|
|
42
|
+
errmsg("Event names unrecognized/ignored: %s" % bad_events.join(', '))
|
|
43
|
+
end
|
|
44
|
+
@proc.core.step_events = bitmask
|
|
45
|
+
end
|
|
46
|
+
@proc.commands['show'].subcmds.subcmds[:events].run('events')
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
if __FILE__ == $0
|
|
51
|
+
# Demo it.
|
|
52
|
+
require_relative '../../mock'
|
|
53
|
+
name = File.basename(__FILE__, '.rb')
|
|
54
|
+
|
|
55
|
+
# FIXME: DRY the below code
|
|
56
|
+
dbgr, cmd = MockDebugger::setup('set')
|
|
57
|
+
subcommand = Trepan::Subcommand::SetEvents.new(cmd)
|
|
58
|
+
testcmdMgr = Trepan::Subcmd.new(subcommand)
|
|
59
|
+
|
|
60
|
+
name = File.basename(__FILE__, '.rb')
|
|
61
|
+
subcommand.summary_help(name)
|
|
62
|
+
puts
|
|
63
|
+
subcommand.run([])
|
|
64
|
+
[%w(call line foo), %w(insn, c_call, c_return,)].each do |events|
|
|
65
|
+
subcommand.run(%w(set events) + events)
|
|
66
|
+
puts 'bitmask: %09b, events: %s ' % [dbgr.core.step_events, events.inspect]
|
|
67
|
+
end
|
|
68
|
+
puts '-' * 20
|
|
69
|
+
puts subcommand.save_command()
|
|
70
|
+
|
|
71
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
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::SetMax < Trepan::SubSubcommandMgr
|
|
7
|
+
unless defined?(HELP)
|
|
8
|
+
HELP = 'Set maximum length for things which may have unbounded size'
|
|
9
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
10
|
+
PREFIX = %w(set max)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# def run(args)
|
|
14
|
+
# puts "foo"
|
|
15
|
+
# require 'trepanning'
|
|
16
|
+
# Trepan.debug
|
|
17
|
+
# super
|
|
18
|
+
# end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
if __FILE__ == $0
|
|
22
|
+
require_relative '../../mock'
|
|
23
|
+
dbgr, cmd = MockDebugger::setup('set')
|
|
24
|
+
cmds = dbgr.core.processor.commands
|
|
25
|
+
set_cmd = cmds['set']
|
|
26
|
+
command = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
|
|
27
|
+
set_cmd)
|
|
28
|
+
name = File.basename(__FILE__, '.rb')
|
|
29
|
+
cmd_args = ['set', name]
|
|
30
|
+
set_cmd.instance_variable_set('@last_args', cmd_args)
|
|
31
|
+
command.run(cmd_args)
|
|
32
|
+
require_relative '../../../lib/trepanning'
|
|
33
|
+
# Trepan.debug(:set_restart => true)
|
|
34
|
+
command.run(['set', name, 'string', 30])
|
|
35
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::SubSubcommand::SetMaxList < Trepan::SubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = 'Set max[imum] list NUMBER
|
|
8
|
+
|
|
9
|
+
Set number of source-code lines to list by default.'
|
|
10
|
+
IN_LIST = true
|
|
11
|
+
MIN_ABBREV = 'lis'.size
|
|
12
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
13
|
+
PREFIX = %w(set max list)
|
|
14
|
+
SHORT_HELP = 'Set number of lines to list'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def run(args)
|
|
18
|
+
args.shift
|
|
19
|
+
run_set_int(args.join(' '),
|
|
20
|
+
"The '#{PREFIX.join(' ')}' command requires a list size",
|
|
21
|
+
0, nil)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
alias save_command save_command_from_settings
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
if __FILE__ == $0
|
|
29
|
+
# Demo it.
|
|
30
|
+
require_relative '../../../mock'
|
|
31
|
+
name = File.basename(__FILE__, '.rb')
|
|
32
|
+
|
|
33
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
34
|
+
max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
|
|
35
|
+
set_cmd)
|
|
36
|
+
cmd_ary = Trepan::SubSubcommand::SetMaxWidth::PREFIX
|
|
37
|
+
cmd_name = cmd_ary.join('')
|
|
38
|
+
subcmd = Trepan::SubSubcommand::SetMaxList.new(set_cmd.proc,
|
|
39
|
+
max_cmd,
|
|
40
|
+
cmd_name)
|
|
41
|
+
prefix_run = cmd_ary[1..-1]
|
|
42
|
+
subcmd.run(prefix_run)
|
|
43
|
+
subcmd.run(prefix_run + %w(0))
|
|
44
|
+
subcmd.run(prefix_run + %w(20))
|
|
45
|
+
name = File.basename(__FILE__, '.rb')
|
|
46
|
+
subcmd.summary_help(name)
|
|
47
|
+
puts
|
|
48
|
+
puts '-' * 20
|
|
49
|
+
puts subcmd.save_command
|
|
50
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::Subcommand::SetMaxStack < Trepan::SubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = 'Set number of backtrace lines the debugger will show'
|
|
8
|
+
DEFAULT_MIN = 3
|
|
9
|
+
MIN_ABBREV = 'sta'.size
|
|
10
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
11
|
+
PREFIX = %w(set max stack)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def run(args)
|
|
15
|
+
args.shift
|
|
16
|
+
args = %W(#{DEFAULT_MIN}) if args.empty?
|
|
17
|
+
run_set_int(args.join(' '),
|
|
18
|
+
"The '#{PREFIX.join(' ')}'command requires number at least #{DEFAULT_MIN}",
|
|
19
|
+
DEFAULT_MIN, nil)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
alias save_command save_command_from_settings
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
if __FILE__ == $0
|
|
27
|
+
# Demo it.
|
|
28
|
+
require_relative '../../../mock'
|
|
29
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
30
|
+
max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
|
|
31
|
+
set_cmd)
|
|
32
|
+
# FIXME: remove the 'join' below
|
|
33
|
+
cmd_name = Trepan::SubSubcommand::SetMaxStack::PREFIX.join('')
|
|
34
|
+
subcmd = Trepan::SubSubcommand::SetMaxStack.new(set_cmd.proc,
|
|
35
|
+
max_cmd,
|
|
36
|
+
cmd_name)
|
|
37
|
+
name = File.basename(__FILE__, '.rb')
|
|
38
|
+
|
|
39
|
+
# FIXME: DRY the below code
|
|
40
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
41
|
+
max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
|
|
42
|
+
set_cmd)
|
|
43
|
+
cmd_ary = Trepan::SubSubcommand::SetMaxStack::PREFIX
|
|
44
|
+
cmd_name = cmd_ary.join(' ')
|
|
45
|
+
subcmd = Trepan::SubSubcommand::SetMaxStack.new(set_cmd.proc,
|
|
46
|
+
max_cmd,
|
|
47
|
+
cmd_name)
|
|
48
|
+
|
|
49
|
+
prefix_run = cmd_ary[1..-1]
|
|
50
|
+
subcmd.run(prefix_run)
|
|
51
|
+
subcmd.run(prefix_run + %w(0))
|
|
52
|
+
subcmd.run(prefix_run + %w(10))
|
|
53
|
+
name = File.basename(__FILE__, '.rb')
|
|
54
|
+
subcmd.summary_help(name)
|
|
55
|
+
puts
|
|
56
|
+
puts '-' * 20
|
|
57
|
+
|
|
58
|
+
require_relative '../../../../lib/trepanning'
|
|
59
|
+
puts subcmd.save_command
|
|
60
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::SubSubcommand::SetMaxString < Trepan::SubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = 'Set max st[ring] NUMBER
|
|
8
|
+
|
|
9
|
+
Sometimes the string representation of an object is very long. This
|
|
10
|
+
setting limits how much of the string representation you want to
|
|
11
|
+
see. However if the string has an embedded newline then we will assume
|
|
12
|
+
the output is intended to be formated as is.
|
|
13
|
+
'
|
|
14
|
+
DEFAULT_MIN = 10
|
|
15
|
+
MIN_ABBREV = 'str'.size
|
|
16
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
17
|
+
PREFIX = %w(set max string)
|
|
18
|
+
SHORT_HELP = "Set maximum # chars in a string before truncation"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def run(args)
|
|
22
|
+
args.shift
|
|
23
|
+
args = %W(#{DEFAULT_MIN}) if args.empty?
|
|
24
|
+
run_set_int(args.join(' '),
|
|
25
|
+
"The '#{PREFIX.join(' ')}' command requires number at least #{DEFAULT_MIN}",
|
|
26
|
+
DEFAULT_MIN, nil)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
alias save_command save_command_from_settings
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
if __FILE__ == $0
|
|
34
|
+
# Demo it.
|
|
35
|
+
require_relative '../../../mock'
|
|
36
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
37
|
+
max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
|
|
38
|
+
set_cmd)
|
|
39
|
+
# FIXME: remove the 'join' below
|
|
40
|
+
cmd_name = Trepan::SubSubcommand::SetMaxString::PREFIX.join('')
|
|
41
|
+
subcmd = Trepan::SubSubcommand::SetMaxString.new(set_cmd.proc,
|
|
42
|
+
max_cmd,
|
|
43
|
+
cmd_name)
|
|
44
|
+
subcmd.run([])
|
|
45
|
+
subcmd.run(%w(0))
|
|
46
|
+
subcmd.run(%w(20))
|
|
47
|
+
subcmd.run(%w(100))
|
|
48
|
+
name = File.basename(__FILE__, '.rb')
|
|
49
|
+
subcmd.summary_help(name)
|
|
50
|
+
puts
|
|
51
|
+
puts '-' * 20
|
|
52
|
+
puts subcmd.save_command
|
|
53
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../base/subsubcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::SubSubcommand::SetMaxWidth < Trepan::SubSubcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = 'Set max[imum] width NUMBER
|
|
8
|
+
|
|
9
|
+
Set number of characters the debugger thinks are in a line.'
|
|
10
|
+
IN_LIST = true
|
|
11
|
+
MIN_ABBREV = 'wid'.size
|
|
12
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
13
|
+
PREFIX = %w(set max width)
|
|
14
|
+
SHORT_HELP = 'Set number of characters the debugger thinks are in a line'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def run(args)
|
|
18
|
+
args.shift
|
|
19
|
+
run_set_int(args.join(' '),
|
|
20
|
+
"The '#{PREFIX.join(' ')}' command requires a line width",
|
|
21
|
+
0, nil)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
alias save_command save_command_from_settings
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
if __FILE__ == $0
|
|
29
|
+
# Demo it.
|
|
30
|
+
require_relative '../../../mock'
|
|
31
|
+
name = File.basename(__FILE__, '.rb')
|
|
32
|
+
|
|
33
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
34
|
+
max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
|
|
35
|
+
set_cmd)
|
|
36
|
+
cmd_ary = Trepan::SubSubcommand::SetMaxWidth::PREFIX
|
|
37
|
+
cmd_name = cmd_ary.join(' ')
|
|
38
|
+
subcmd = Trepan::SubSubcommand::SetMaxWidth.new(set_cmd.proc,
|
|
39
|
+
max_cmd,
|
|
40
|
+
cmd_name)
|
|
41
|
+
prefix_run = cmd_ary[1..-1]
|
|
42
|
+
subcmd.run(prefix_run)
|
|
43
|
+
subcmd.run(prefix_run + %w(0))
|
|
44
|
+
subcmd.run(prefix_run + %w(20))
|
|
45
|
+
name = File.basename(__FILE__, '.rb')
|
|
46
|
+
subcmd.summary_help(name)
|
|
47
|
+
puts
|
|
48
|
+
puts '-' * 20
|
|
49
|
+
puts subcmd.save_command
|
|
50
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subcmd'
|
|
4
|
+
require_relative '../../../app/frame'
|
|
5
|
+
|
|
6
|
+
class Trepan::Subcommand::SetReturn < Trepan::Subcommand
|
|
7
|
+
unless defined?(HELP)
|
|
8
|
+
HELP = 'Set the value that will be returned in the current method'
|
|
9
|
+
IN_LIST = true
|
|
10
|
+
MIN_ABBREV = 'ret'.size
|
|
11
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
12
|
+
PREFIX = %w(set return)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
include Trepan::Frame
|
|
16
|
+
|
|
17
|
+
def run(args)
|
|
18
|
+
event = @proc.event
|
|
19
|
+
unless %w(return c-return).member?(event)
|
|
20
|
+
errmsg('You need to be in a return event to do this. Event is %s' %
|
|
21
|
+
event)
|
|
22
|
+
return
|
|
23
|
+
end
|
|
24
|
+
if args.size < 3
|
|
25
|
+
errmsg "Too few arguments - the 'return' command requires a return value"
|
|
26
|
+
return
|
|
27
|
+
end
|
|
28
|
+
new_val_str = args[2..-1].join(' ')
|
|
29
|
+
begin
|
|
30
|
+
new_val = @proc.debug_eval(new_val_str)
|
|
31
|
+
rescue StandardError, ScriptError => e
|
|
32
|
+
p $!
|
|
33
|
+
return
|
|
34
|
+
end
|
|
35
|
+
ret_val = Trepan::Frame.value_returned(@proc.frame, event)
|
|
36
|
+
msg('Return value was: %s' % ret_val.inspect)
|
|
37
|
+
Trepan::Frame.set_return_value(@proc.frame, event, new_val)
|
|
38
|
+
msg('New value is: %s' % new_val.inspect)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
if __FILE__ == $0
|
|
44
|
+
# Demo it.
|
|
45
|
+
require_relative '../../mock'
|
|
46
|
+
require_relative '../../subcmd'
|
|
47
|
+
name = File.basename(__FILE__, '.rb')
|
|
48
|
+
|
|
49
|
+
# FIXME: DRY the below code
|
|
50
|
+
dbgr, cmd = MockTrepan::setup('set')
|
|
51
|
+
subcommand = Trepan::Subcommand::SetReturn.new(cmd)
|
|
52
|
+
testcmdMgr = Trepan::Subcmd.new(subcommand)
|
|
53
|
+
|
|
54
|
+
def subcommand.msg(message)
|
|
55
|
+
puts message
|
|
56
|
+
end
|
|
57
|
+
def subcommand.msg_nocr(message)
|
|
58
|
+
print message
|
|
59
|
+
end
|
|
60
|
+
def subcommand.errmsg(message)
|
|
61
|
+
puts message
|
|
62
|
+
end
|
|
63
|
+
subcommand.run(%w(20))
|
|
64
|
+
name = File.basename(__FILE__, '.rb')
|
|
65
|
+
subcommand.summary_help(name)
|
|
66
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../base/subcmd'
|
|
4
|
+
|
|
5
|
+
class Trepan::Subcommand::SetSp < Trepan::Subcommand
|
|
6
|
+
unless defined?(HELP)
|
|
7
|
+
HELP = 'Set a stack pointer register'
|
|
8
|
+
IN_LIST = true
|
|
9
|
+
MIN_ABBREV = 'sp'.size
|
|
10
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
11
|
+
PREFIX = %w(set sp)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def run(args)
|
|
15
|
+
# FIXME handle c-return
|
|
16
|
+
# unless %w(return c-return).member?(@proc.event)
|
|
17
|
+
if args.size < 4
|
|
18
|
+
errmsg "Too few arguments - the 'sp' command requires number and a value"
|
|
19
|
+
return
|
|
20
|
+
end
|
|
21
|
+
msg_on_error = "set SP requires an integer index"
|
|
22
|
+
index = @proc.get_an_int(args[2],
|
|
23
|
+
:msg_on_error => msg_on_error
|
|
24
|
+
)
|
|
25
|
+
return unless index
|
|
26
|
+
new_val_str = args[3..-1].join(' ')
|
|
27
|
+
begin
|
|
28
|
+
new_val = @proc.debug_eval(new_val_str)
|
|
29
|
+
rescue StandardError, ScriptError => e
|
|
30
|
+
return
|
|
31
|
+
end
|
|
32
|
+
msg("Old value was: %s" % @proc.frame.sp(index).inspect)
|
|
33
|
+
@proc.frame.sp_set(index, new_val).inspect
|
|
34
|
+
msg("New value is: %s" % new_val.inspect)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
if __FILE__ == $0
|
|
40
|
+
# Demo it.
|
|
41
|
+
require_relative '../../mock'
|
|
42
|
+
require_relative '../../subcmd'
|
|
43
|
+
name = File.basename(__FILE__, '.rb')
|
|
44
|
+
|
|
45
|
+
# FIXME: DRY the below code
|
|
46
|
+
dbgr, cmd = MockTrepan::setup('set')
|
|
47
|
+
subcommand = Trepan::Subcommand::SetSp.new(cmd)
|
|
48
|
+
testcmdMgr = Trepan::Subcmd.new(subcommand)
|
|
49
|
+
|
|
50
|
+
def subcommand.msg(message)
|
|
51
|
+
puts message
|
|
52
|
+
end
|
|
53
|
+
def subcommand.msg_nocr(message)
|
|
54
|
+
print message
|
|
55
|
+
end
|
|
56
|
+
def subcommand.errmsg(message)
|
|
57
|
+
puts message
|
|
58
|
+
end
|
|
59
|
+
subcommand.run(%w(20))
|
|
60
|
+
name = File.basename(__FILE__, '.rb')
|
|
61
|
+
subcommand.summary_help(name)
|
|
62
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
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::SetSubstitute < Trepan::SubSubcommandMgr
|
|
7
|
+
unless defined?(HELP)
|
|
8
|
+
HELP = 'Set instruction sequence-to-filename mapping'
|
|
9
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
10
|
+
PREFIX = %w(set substitute)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
if __FILE__ == $0
|
|
15
|
+
require_relative '../../mock'
|
|
16
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
17
|
+
command = Trepan::SubSubcommand::SetSubstitute.new(dbgr.core.processor,
|
|
18
|
+
set_cmd)
|
|
19
|
+
name = File.basename(__FILE__, '.rb')
|
|
20
|
+
cmd_args = ['set', name]
|
|
21
|
+
set_cmd.instance_variable_set('@last_args', cmd_args)
|
|
22
|
+
# require_relative '../../../lib/trepanning'
|
|
23
|
+
# Trepan.debug(:set_restart => true)
|
|
24
|
+
command.run(cmd_args)
|
|
25
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
|
3
|
+
require_relative '../../frame'
|
|
4
|
+
require_relative '../../base/subsubcmd'
|
|
5
|
+
require_relative '../substitute'
|
|
6
|
+
|
|
7
|
+
class Trepan::SubSubcommand::SetSubstituteEval < Trepan::SubSubcommand
|
|
8
|
+
unless defined?(HELP)
|
|
9
|
+
HELP =
|
|
10
|
+
'set substitute eval [FRAME-NUM]
|
|
11
|
+
|
|
12
|
+
Causes lines in an EVAL frame to show up as we stop/step through them.
|
|
13
|
+
The text fror the eval string comes from the current frame.
|
|
14
|
+
|
|
15
|
+
FRAME-NUM is a relative frame number unless prefaced with an "=" which
|
|
16
|
+
indicates how many frames prior to move. The default is "0"
|
|
17
|
+
(alternatively "=0", the current frame.
|
|
18
|
+
|
|
19
|
+
This is largely done automatically anytime the debugger discovers an EVAL frame.
|
|
20
|
+
We have this here for completeness and just in case.
|
|
21
|
+
'
|
|
22
|
+
MIN_ABBREV = 'ev'.size
|
|
23
|
+
MAX_ARGS = 1
|
|
24
|
+
NAME = File.basename(__FILE__, '.rb')
|
|
25
|
+
SHORT_HELP = 'Set eval string text of an filename'
|
|
26
|
+
PREFIX = %w(set substitute string)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def run(args)
|
|
30
|
+
|
|
31
|
+
frame =
|
|
32
|
+
if args.size == 2
|
|
33
|
+
absolute, count_str =
|
|
34
|
+
if '=' == args[1][0]
|
|
35
|
+
[true, args[1][1..-1].dup]
|
|
36
|
+
else
|
|
37
|
+
[false, args[1]]
|
|
38
|
+
end
|
|
39
|
+
stack_size = @proc.top_frame.stack_size - @hide_level
|
|
40
|
+
opts = {
|
|
41
|
+
:msg_on_error =>
|
|
42
|
+
"The 'eval' command argument must eval to an integer. Got: %s" % count_str,
|
|
43
|
+
:min_value => -stack_size,
|
|
44
|
+
:max_value => stack_size-1
|
|
45
|
+
}
|
|
46
|
+
count = @proc.get_an_int(count_str, opts)
|
|
47
|
+
@proc.get_frame(count, absolute)[0]
|
|
48
|
+
else
|
|
49
|
+
@proc.frame
|
|
50
|
+
end
|
|
51
|
+
return unless frame
|
|
52
|
+
if 'EVAL' != frame.type
|
|
53
|
+
errmsg "Current frame has to be of type EVAL, not #{frame.type}"
|
|
54
|
+
return
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
unless frame.iseq
|
|
58
|
+
errmsg "Can't get instruction sequence for frame."
|
|
59
|
+
return
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
prev = frame.prev
|
|
63
|
+
if 'CFUNC' != prev.type
|
|
64
|
+
errmsg "Previous frame has to be of type CFUNC, not #{frame.type}"
|
|
65
|
+
return
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
if 'eval' != prev.method
|
|
69
|
+
errmsg "Previous frame has to be of type CFUNC, not #{frame.method}"
|
|
70
|
+
return
|
|
71
|
+
end
|
|
72
|
+
@proc.frame_eval_remap
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if __FILE__ == $0
|
|
77
|
+
# Demo it.
|
|
78
|
+
require_relative '../../../mock'
|
|
79
|
+
require_relative '../../../subcmd'
|
|
80
|
+
name = File.basename(__FILE__, '.rb')
|
|
81
|
+
|
|
82
|
+
# FIXME: DRY the below code
|
|
83
|
+
dbgr, set_cmd = MockDebugger::setup('set')
|
|
84
|
+
set_cmd.proc.send('frame_initialize')
|
|
85
|
+
testcmdMgr = Trepan::Subcmd.new(set_cmd)
|
|
86
|
+
cmd_name = Trepan::SubSubcommand::SetSubstituteEval::PREFIX.join('')
|
|
87
|
+
setx_cmd = Trepan::SubSubcommand::SetSubstituteEval.new(set_cmd.proc,
|
|
88
|
+
set_cmd,
|
|
89
|
+
cmd_name)
|
|
90
|
+
setx_cmd.run([])
|
|
91
|
+
# require_relative '../../../../lib/trepanning'
|
|
92
|
+
# dbgr = Trepan.new(:set_restart => true)
|
|
93
|
+
# dbgr.debugger
|
|
94
|
+
eval('set_cmd.proc.frame_setup(RubyVM::ThreadFrame::current); setx_cmd.run([])')
|
|
95
|
+
|
|
96
|
+
# name = File.basename(__FILE__, '.rb')
|
|
97
|
+
# subcommand.summary_help(name)
|
|
98
|
+
end
|