trepanning 0.1.4 → 0.1.6
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 +188 -0
- data/Makefile +7 -0
- data/NEWS +9 -0
- data/README.textile +3 -3
- data/Rakefile +3 -3
- data/app/breakpoint.rb +1 -1
- data/app/brkptmgr.rb +1 -1
- data/app/client.rb +15 -4
- data/app/core.rb +4 -4
- data/app/default.rb +1 -0
- data/app/display.rb +1 -1
- data/app/frame.rb +38 -19
- data/app/options.rb +4 -1
- data/app/run.rb +12 -2
- data/bin/trepan +2 -1
- data/check-filter.rb +18 -0
- data/interface/client.rb +1 -1
- data/interface/comcodes.rb +9 -8
- data/interface/server.rb +38 -2
- data/interface/user.rb +2 -2
- data/io/input.rb +11 -3
- data/io/tcpclient.rb +0 -2
- data/io/tcpserver.rb +3 -2
- data/lib/trepanning.rb +8 -8
- data/processor.rb +4 -4
- data/processor/command/backtrace.rb +1 -1
- data/processor/command/base/subcmd.rb +4 -1
- data/processor/command/break.rb +1 -1
- data/processor/command/condition.rb +1 -1
- data/processor/command/debug.rb +19 -15
- data/processor/command/delete.rb +2 -1
- data/processor/command/disassemble.rb +2 -2
- data/processor/command/display.rb +1 -1
- data/processor/command/down.rb +1 -2
- data/processor/command/finish.rb +8 -4
- data/processor/command/frame.rb +1 -1
- data/processor/command/help.rb +1 -1
- data/processor/command/info_subcmd/breakpoints.rb +1 -1
- data/processor/command/info_subcmd/registers.rb +1 -1
- data/processor/command/info_subcmd/source.rb +1 -1
- data/processor/command/info_subcmd/thread.rb +2 -2
- data/processor/command/list.rb +1 -1
- data/processor/command/set_subcmd/auto_subcmd/eval.rb +10 -6
- data/processor/command/set_subcmd/auto_subcmd/irb.rb +2 -2
- data/processor/command/set_subcmd/auto_subcmd/list.rb +2 -2
- data/processor/command/set_subcmd/substitute_subcmd/eval.rb +1 -1
- data/processor/command/show_subcmd/abbrev.rb +2 -2
- data/processor/command/undisplay.rb +1 -1
- data/processor/command/up.rb +1 -2
- data/processor/eval.rb +9 -5
- data/processor/frame.rb +1 -1
- data/processor/list.rb +1 -1
- data/processor/location.rb +3 -2
- data/processor/mock.rb +3 -3
- data/processor/running.rb +1 -1
- data/processor/validate.rb +1 -1
- data/test/example/factorial.rb +10 -0
- data/test/example/gcd1.rb +1 -1
- data/test/functional/fn_helper.rb +1 -1
- data/test/functional/test-recursive-bt.rb +103 -0
- data/test/functional/test-remap.rb +50 -0
- data/test/integration/test-remote.rb +23 -0
- data/test/unit/test-app-brkpt.rb +1 -1
- data/test/unit/test-app-brkptmgr.rb +2 -2
- data/test/unit/test-app-display.rb +1 -1
- data/test/unit/test-app-frame.rb +3 -3
- data/test/unit/test-app-options.rb +1 -1
- data/test/unit/test-cmd-break.rb +2 -2
- data/test/unit/test-cmd-endisable.rb +1 -1
- data/test/unit/test-cmd-parse_list_cmd.rb +1 -1
- data/test/unit/test-cmd-quit.rb +1 -0
- data/test/unit/test-cmd-set-auto-eval.rb.try +19 -0
- data/test/unit/test-proc-eval.rb +1 -1
- data/test/unit/test-proc-frame.rb +2 -2
- data/test/unit/test-proc-list.rb +1 -1
- data/test/unit/test-proc-location.rb +1 -1
- data/test/unit/test-proc-validate.rb +3 -3
- data/trepanning.gemspec +5 -5
- metadata +101 -104
@@ -53,7 +53,7 @@ if __FILE__ == $0
|
|
53
53
|
require 'thread_frame'
|
54
54
|
require_relative '../mock'
|
55
55
|
dbgr, cmd = MockDebugger::setup
|
56
|
-
cmd.proc.frame_setup(RubyVM::
|
56
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
57
57
|
|
58
58
|
cmd.run([cmd.name, '1'])
|
59
59
|
cmdproc = dbgr.core.processor
|
data/processor/command/debug.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2012 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require 'thread_frame'
|
4
4
|
require_relative '../command'
|
5
5
|
|
@@ -27,38 +27,42 @@ Enter the debugger recursively on RUBY-CODE.
|
|
27
27
|
arg_str = args[1..-1].join(' ')
|
28
28
|
hidelevels = @proc.hidelevels[th]
|
29
29
|
|
30
|
-
stack_diff = RubyVM::
|
30
|
+
stack_diff = RubyVM::Frame.current.stack_size - frame.stack_size
|
31
31
|
|
32
32
|
# Ignore tracing in support routines:
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
# FIXME remvoe 1.9.3 hack
|
34
|
+
if '1.9.3' != RUBY_VERSION
|
35
|
+
tf = @proc.dbgr.trace_filter
|
36
|
+
[self.method(:run), @proc.method(:debug_eval),
|
37
|
+
@proc.method(:debug_eval_with_exception),
|
38
|
+
@proc.method(:get_binding_and_filename),
|
39
|
+
@proc.method(:fake_eval_filename)].each do |m|
|
40
|
+
tf << m unless tf.member?(m)
|
41
|
+
end
|
39
42
|
end
|
40
43
|
|
41
44
|
@proc.hidelevels[th] += stack_diff + EXTRA_DEBUG_SETUP_CALLS
|
42
45
|
|
43
46
|
# Values we need to save before munging them
|
44
47
|
old_tracing = th.tracing
|
45
|
-
old_exec_event_tracing = th.exec_event_tracing
|
48
|
+
old_exec_event_tracing = th.exec_event_tracing?
|
46
49
|
old_mutex = @proc.core.mutex
|
47
50
|
old_next_level = @proc.next_level
|
48
51
|
old_step_count = @proc.core.step_count
|
49
52
|
|
50
|
-
|
53
|
+
section 'ENTERING NESTED DEBUGGER'
|
51
54
|
|
52
55
|
# Things we need to do to allow entering the debugger again
|
53
56
|
@proc.debug_nest += 1
|
54
57
|
@proc.core.mutex = Mutex.new
|
55
58
|
th.tracing = false
|
56
59
|
th.exec_event_tracing = false
|
57
|
-
@proc.core.step_count = 0
|
58
60
|
@proc.next_level = 32000
|
59
61
|
|
60
|
-
RubyVM::
|
61
|
-
|
62
|
+
RubyVM::Frame.current.trace_off = false
|
63
|
+
@proc.core.step_count = 0
|
64
|
+
retval = @proc.debug_eval(arg_str, 15,
|
65
|
+
RUBY_VERSION == '1.9.3') # FIXME
|
62
66
|
|
63
67
|
# Restore munged values
|
64
68
|
th.exec_event_tracing = old_exec_event_tracing
|
@@ -70,7 +74,7 @@ Enter the debugger recursively on RUBY-CODE.
|
|
70
74
|
@proc.next_level = old_next_level
|
71
75
|
@proc.print_location
|
72
76
|
@proc.debug_nest -= 1
|
73
|
-
|
77
|
+
section 'LEAVING NESTED DEBUGGER'
|
74
78
|
msg "R=> #{retval.inspect}"
|
75
79
|
end
|
76
80
|
end
|
@@ -79,6 +83,6 @@ if __FILE__ == $0
|
|
79
83
|
require_relative '../mock'
|
80
84
|
dbgr, cmd = MockDebugger::setup
|
81
85
|
cmd.proc.hidelevels[Thread.current] = 0
|
82
|
-
cmd.proc.frame_setup(RubyVM::
|
86
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
83
87
|
cmd.run([cmd.name, 'x = 1; y = 2'])
|
84
88
|
end
|
data/processor/command/delete.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010
|
2
|
+
# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../command'
|
4
4
|
require_relative '../breakpoint'
|
5
5
|
require_relative '../../app/breakpoint'
|
@@ -22,6 +22,7 @@ number.
|
|
22
22
|
|
23
23
|
CATEGORY = 'breakpoints'
|
24
24
|
SHORT_HELP = 'Delete some breakpoints'
|
25
|
+
ALIASES = %w(d)
|
25
26
|
end
|
26
27
|
|
27
28
|
def run(args)
|
@@ -92,14 +92,14 @@ if __FILE__ == $0
|
|
92
92
|
require_relative '../mock'
|
93
93
|
dbgr, cmd = MockDebugger::setup
|
94
94
|
def small_fn(cmd, name)
|
95
|
-
cmd.proc.frame_setup(RubyVM::
|
95
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
96
96
|
cmd.run [name]
|
97
97
|
end
|
98
98
|
small_fn(cmd, cmd.name)
|
99
99
|
p = Proc.new do
|
100
100
|
|x,y| x + y
|
101
101
|
end
|
102
|
-
cmd.proc.frame_setup(RubyVM::
|
102
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
103
103
|
cmd.run([cmd.name, 'p'])
|
104
104
|
puts cmd.complete('f')
|
105
105
|
require 'irb'
|
data/processor/command/down.rb
CHANGED
@@ -18,7 +18,6 @@ is the most recent frame. If no count is given, move down 1.
|
|
18
18
|
See also 'up' and 'frame'.
|
19
19
|
HELP
|
20
20
|
|
21
|
-
ALIASES = %w(d)
|
22
21
|
NAME = File.basename(__FILE__, '.rb')
|
23
22
|
SHORT_HELP = 'Move frame in the direction of the caller of the last-selected frame'
|
24
23
|
}
|
@@ -44,7 +43,7 @@ if __FILE__ == $0
|
|
44
43
|
sep
|
45
44
|
end
|
46
45
|
def foo(cmd, name)
|
47
|
-
cmd.proc.frame_setup(RubyVM::
|
46
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
48
47
|
puts "#{name}"
|
49
48
|
cmd.run([name])
|
50
49
|
sep
|
data/processor/command/finish.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010
|
2
|
+
# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../command'
|
4
4
|
|
5
5
|
class Trepan::Command::FinishCommand < Trepan::Command
|
@@ -9,9 +9,13 @@ class Trepan::Command::FinishCommand < Trepan::Command
|
|
9
9
|
HELP = <<-HELP
|
10
10
|
#{NAME} [levels]
|
11
11
|
|
12
|
-
Continue execution until the program is about to
|
13
|
-
|
14
|
-
|
12
|
+
Continue execution until the program is about to:
|
13
|
+
|
14
|
+
* leave the current function, or
|
15
|
+
* switch context via yielding back or finishing a block which was
|
16
|
+
yielded to.
|
17
|
+
|
18
|
+
Sometimes this is called 'step out'.
|
15
19
|
|
16
20
|
When `levels' is specified, that many frame levels need to be
|
17
21
|
popped. The default is 1. Note that 'yield' and exceptions raised my
|
data/processor/command/frame.rb
CHANGED
@@ -112,7 +112,7 @@ if __FILE__ == $0
|
|
112
112
|
def sep ; puts '=' * 40 end
|
113
113
|
%w(0 1 -2).each {|count| cmd.run([cmd.name, count]); sep }
|
114
114
|
def foo(cmd, name)
|
115
|
-
cmd.proc.frame_setup(RubyVM::
|
115
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
116
116
|
%w(0 -1).each {|count| cmd.run([name, count]); sep }
|
117
117
|
end
|
118
118
|
foo(cmd, cmd.name)
|
data/processor/command/help.rb
CHANGED
@@ -38,7 +38,7 @@ info line command.
|
|
38
38
|
SHORT_HELP = 'Print commands or give help for command(s)'
|
39
39
|
|
40
40
|
require 'thread_frame'
|
41
|
-
ROOT_DIR = File.dirname(RubyVM::
|
41
|
+
ROOT_DIR = File.dirname(RubyVM::Frame.current.source_container[1])
|
42
42
|
HELP_DIR = File.join(ROOT_DIR, 'help')
|
43
43
|
end
|
44
44
|
|
@@ -72,6 +72,6 @@ if __FILE__ == $0
|
|
72
72
|
name = File.basename(__FILE__, '.rb')
|
73
73
|
cmd_args = ['info', name]
|
74
74
|
info_cmd.instance_variable_set('@last_args', cmd_args)
|
75
|
-
command.proc.frame_setup(RubyVM::
|
75
|
+
command.proc.frame_setup(RubyVM::Frame::current)
|
76
76
|
command.run(cmd_args)
|
77
77
|
end
|
@@ -49,7 +49,7 @@ EOH
|
|
49
49
|
max_line = LineCache::size(canonic_name)
|
50
50
|
msg 'File has %d lines.' % max_line if max_line
|
51
51
|
msg('SHA1 is %s.' % LineCache::sha1(canonic_name))
|
52
|
-
syntax_errors =
|
52
|
+
syntax_errors = Trepanning::ruby_syntax_errors(canonic_name)
|
53
53
|
if syntax_errors
|
54
54
|
msg('Not a syntactically-correct Ruby program.')
|
55
55
|
else
|
@@ -91,11 +91,11 @@ if __FILE__ == $0
|
|
91
91
|
|
92
92
|
cmd.proc.instance_variable_set('@last_args', cmd_args)
|
93
93
|
cmd_args = ['info', name]
|
94
|
-
cmd.proc.frame_setup(RubyVM::
|
94
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
95
95
|
cmd.run(cmd_args)
|
96
96
|
puts '-' * 20
|
97
97
|
Thread.new do
|
98
|
-
cmd.proc.frame_setup(RubyVM::
|
98
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
99
99
|
cmd.run(cmd_args)
|
100
100
|
puts '-' * 10
|
101
101
|
cmd.run(cmd_args + [0])
|
data/processor/command/list.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../../base/subsubcmd'
|
4
4
|
|
5
5
|
class Trepan::SubSubcommand::SetAutoEval < Trepan::SetBoolSubSubcommand
|
6
6
|
unless defined?(HELP)
|
7
|
-
Trepanning::
|
7
|
+
Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
|
8
8
|
HELP = "Evaluate unrecognized debugger commands.
|
9
9
|
|
10
10
|
Often inside the debugger, one would like to be able to run arbitrary
|
@@ -45,9 +45,13 @@ if __FILE__ == $0
|
|
45
45
|
# Demo it.
|
46
46
|
require_relative '../../../mock'
|
47
47
|
require_relative '../auto'
|
48
|
-
cmd = MockDebugger::
|
49
|
-
|
50
|
-
|
48
|
+
dbgr, cmd = MockDebugger::setup('set')
|
49
|
+
cmds = dbgr.core.processor.commands
|
50
|
+
set_cmd = cmds['set']
|
51
|
+
auto_cmd = Trepan::SubSubcommand::SetAuto.new(dbgr.core.processor,
|
52
|
+
set_cmd)
|
53
|
+
eval_cmd = Trepan::SubSubcommand::SetAutoEval.new(cmd, auto_cmd, 'eval');
|
54
|
+
%w(off on 0 1).each { |arg| eval_cmd.run([eval_cmd.name, arg]) }
|
51
55
|
puts '-' * 10
|
52
|
-
puts
|
56
|
+
puts eval_cmd.save_command
|
53
57
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010
|
2
|
+
# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../../base/subsubcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::SetAutoIrb < Trepan::SetBoolSubSubcommand
|
6
6
|
unless defined?(HELP)
|
7
|
-
Trepanning::
|
7
|
+
Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
|
8
8
|
HELP = "Set to automatically go into irb each time we enter the debugger"
|
9
9
|
MIN_ABBREV = 'ir'.size
|
10
10
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010
|
2
|
+
# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../../base/subsubcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::SetAutoList < Trepan::SetBoolSubSubcommand
|
6
6
|
unless defined?(HELP)
|
7
|
-
Trepanning::
|
7
|
+
Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
|
8
8
|
HELP = "Set to run a 'list' command each time we enter the debugger"
|
9
9
|
MIN_ABBREV = 'l'.size
|
10
10
|
SHORT_HELP = "Set running a 'list' command each time we enter the debugger"
|
@@ -91,7 +91,7 @@ if __FILE__ == $0
|
|
91
91
|
# require_relative '../../../../lib/trepanning'
|
92
92
|
# dbgr = Trepan.new
|
93
93
|
# dbgr.debugger
|
94
|
-
eval('set_cmd.proc.frame_setup(RubyVM::
|
94
|
+
eval('set_cmd.proc.frame_setup(RubyVM::Frame::current); setx_cmd.run([])')
|
95
95
|
|
96
96
|
# name = File.basename(__FILE__, '.rb')
|
97
97
|
# subcommand.summary_help(name)
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011, 2012 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::ShowAbbrev < Trepan::ShowBoolSubcommand
|
6
6
|
unless defined?(HELP)
|
7
7
|
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
|
-
HELP = "Show whether we allow
|
8
|
+
HELP = "Show whether we allow abbreviated debugger command names"
|
9
9
|
MIN_ABBREV = 'ab'.size
|
10
10
|
end
|
11
11
|
|
data/processor/command/up.rb
CHANGED
@@ -18,7 +18,6 @@ the most recent frame. If no count is given, move up 1.
|
|
18
18
|
See also 'down' and 'frame'.
|
19
19
|
HELP
|
20
20
|
|
21
|
-
ALIASES = %w(u)
|
22
21
|
CATEGORY = 'stack'
|
23
22
|
MAX_ARGS = 1 # Need at most this many
|
24
23
|
NEED_STACK = true
|
@@ -79,7 +78,7 @@ if __FILE__ == $0
|
|
79
78
|
sep
|
80
79
|
end
|
81
80
|
def foo(cmd, name)
|
82
|
-
cmd.proc.frame_setup(RubyVM::
|
81
|
+
cmd.proc.frame_setup(RubyVM::Frame::current)
|
83
82
|
puts "#{name}"
|
84
83
|
cmd.run([name])
|
85
84
|
sep
|
data/processor/eval.rb
CHANGED
@@ -1,20 +1,24 @@
|
|
1
|
-
# Copyright (C) 2010
|
1
|
+
# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
|
2
2
|
require 'rubygems'
|
3
3
|
require_relative 'virtual'
|
4
4
|
class Trepan
|
5
5
|
class CmdProcessor < VirtualCmdProcessor
|
6
6
|
|
7
|
-
def debug_eval(str, max_fake_filename=15
|
7
|
+
def debug_eval(str, max_fake_filename=15,
|
8
|
+
ruby_193_hack=false) #FIXME: remove ruby_193_hack
|
8
9
|
begin
|
9
|
-
debug_eval_with_exception(str, max_fake_filename)
|
10
|
+
debug_eval_with_exception(str, max_fake_filename, ruby_193_hack)
|
10
11
|
rescue SyntaxError, StandardError, ScriptError => e
|
11
12
|
exception_dump(e, @settings[:stack_trace_on_error], $!.backtrace)
|
12
13
|
nil
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
|
-
def debug_eval_with_exception(str, max_fake_filename=15
|
17
|
+
def debug_eval_with_exception(str, max_fake_filename=15,
|
18
|
+
ruby_193_hack=false) # FIXME: remove ruby_193_hack
|
19
|
+
RubyVM::Frame.current.trace_off = true if ruby_193_hack
|
17
20
|
filename, b = get_binding_and_filename(str, max_fake_filename)
|
21
|
+
RubyVM::Frame.current.trace_off = false if ruby_193_hack
|
18
22
|
eval(str, b, filename)
|
19
23
|
end
|
20
24
|
|
@@ -94,7 +98,7 @@ if __FILE__ == $0
|
|
94
98
|
|
95
99
|
x = 10
|
96
100
|
require 'thread_frame'
|
97
|
-
cmdp.instance_variable_set('@frame', RubyVM::
|
101
|
+
cmdp.instance_variable_set('@frame', RubyVM::Frame.current)
|
98
102
|
cmdp.instance_variable_set('@settings', {:stack_trace_on_error => true})
|
99
103
|
def cmdp.msg(mess) ; puts mess end
|
100
104
|
puts cmdp.debug_eval('x = "#{x}"')
|
data/processor/frame.rb
CHANGED
@@ -229,7 +229,7 @@ if __FILE__ == $0
|
|
229
229
|
end
|
230
230
|
|
231
231
|
proc = Trepan::CmdProcessor.new(Trepan::MockCore.new())
|
232
|
-
proc.frame_setup(RubyVM::
|
232
|
+
proc.frame_setup(RubyVM::Frame.current)
|
233
233
|
proc.frame_initialize
|
234
234
|
puts "stack size: #{proc.top_frame.stack_size}"
|
235
235
|
0.upto(proc.top_frame.stack_size) { |i| proc.adjust_frame(i, true) }
|
data/processor/list.rb
CHANGED
@@ -125,7 +125,7 @@ if __FILE__ == $0
|
|
125
125
|
cmdproc.frame_initialize
|
126
126
|
cmdproc.instance_variable_set('@settings',
|
127
127
|
Trepan::CmdProcessor::DEFAULT_SETTINGS)
|
128
|
-
cmdproc.frame_setup(RubyVM::
|
128
|
+
cmdproc.frame_setup(RubyVM::Frame.current)
|
129
129
|
def foo; 5 end
|
130
130
|
def cmdproc.errmsg(msg)
|
131
131
|
puts msg
|
data/processor/location.rb
CHANGED
@@ -23,6 +23,7 @@ class Trepan::CmdProcessor < Trepan::VirtualCmdProcessor
|
|
23
23
|
'debugger-call' => ':o',
|
24
24
|
'end' => '-|',
|
25
25
|
'line' => '--',
|
26
|
+
'post-mortem' => ':/',
|
26
27
|
'raise' => '!!',
|
27
28
|
'return' => '<-',
|
28
29
|
'switch' => 'sw',
|
@@ -213,7 +214,7 @@ if __FILE__ == $0 && caller.size == 0
|
|
213
214
|
proc = Trepan::CmdProcessor.new(Trepan::MockCore.new())
|
214
215
|
proc.instance_variable_set('@settings', {})
|
215
216
|
proc.frame_initialize
|
216
|
-
proc.frame_setup(RubyVM::
|
217
|
+
proc.frame_setup(RubyVM::Frame.current)
|
217
218
|
proc.frame_initialize
|
218
219
|
|
219
220
|
puts proc.canonic_file(__FILE__)
|
@@ -222,7 +223,7 @@ if __FILE__ == $0 && caller.size == 0
|
|
222
223
|
puts proc.current_source_text
|
223
224
|
xx = eval <<-END
|
224
225
|
proc.frame_initialize
|
225
|
-
proc.frame_setup(RubyVM::
|
226
|
+
proc.frame_setup(RubyVM::Frame.current)
|
226
227
|
puts proc.current_source_text
|
227
228
|
END
|
228
229
|
end
|
data/processor/mock.rb
CHANGED
@@ -51,7 +51,7 @@ module MockDebugger
|
|
51
51
|
# Common Mock debugger setup
|
52
52
|
def setup(name=nil, show_constants=true)
|
53
53
|
unless name
|
54
|
-
tf = RubyVM::
|
54
|
+
tf = RubyVM::Frame.current.prev
|
55
55
|
name = File.basename(tf.source_container[1], '.rb')
|
56
56
|
end
|
57
57
|
if ARGV.size > 0 && ARGV[0] == 'debug'
|
@@ -64,7 +64,7 @@ module MockDebugger
|
|
64
64
|
|
65
65
|
cmds = dbgr.core.processor.commands
|
66
66
|
cmd = cmds[name]
|
67
|
-
cmd.proc.frame_setup(RubyVM::
|
67
|
+
cmd.proc.frame_setup(RubyVM::Frame::current.prev)
|
68
68
|
show_special_class_constants(cmd) if show_constants
|
69
69
|
|
70
70
|
def cmd.confirm(prompt, default)
|
@@ -90,7 +90,7 @@ module MockDebugger
|
|
90
90
|
def sub_setup(sub_class, run=true)
|
91
91
|
sub_name = sub_class.const_get('PREFIX')
|
92
92
|
dbgr, cmd = setup(sub_name[0], false)
|
93
|
-
cmd.proc.frame_setup(RubyVM::
|
93
|
+
cmd.proc.frame_setup(RubyVM::Frame::current.prev)
|
94
94
|
cmd.proc.event = 'debugger-call'
|
95
95
|
sub_cmd = sub_class.new(cmd)
|
96
96
|
sub_cmd.summary_help(sub_cmd)
|