trepanning 1.93.35 → 2.15.33
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.
- checksums.yaml +7 -0
- data/ChangeLog +491 -55
- data/LICENSE +1 -1
- data/NEWS +18 -14
- data/README.md +5 -22
- data/Rakefile +22 -1
- data/app/breakpoint.rb +5 -3
- data/app/core.rb +147 -179
- data/app/default.rb +47 -46
- data/app/file.rb +6 -7
- data/app/frame.rb +183 -176
- data/app/markdown.rb +2 -9
- data/app/options.rb +1 -1
- data/app/run.rb +71 -37
- data/interface/script.rb +8 -8
- data/io.rb +19 -20
- data/lib/trepanning.rb +292 -297
- data/processor.rb +332 -344
- data/processor/breakpoint.rb +98 -96
- data/processor/command/base/submgr.rb +9 -9
- data/processor/command/break.rb +40 -38
- data/processor/command/continue.rb +15 -10
- data/processor/command/debug.rb +6 -25
- data/processor/command/delete.rb +21 -12
- data/processor/command/directory.rb +15 -13
- data/processor/command/disable.rb +12 -9
- data/processor/command/disassemble.rb +80 -74
- data/processor/command/display.rb +15 -12
- data/processor/command/down.rb +8 -3
- data/processor/command/edit.rb +37 -23
- data/processor/command/enable.rb +11 -8
- data/processor/command/eval.rb +24 -22
- data/processor/command/finish.rb +50 -48
- data/processor/command/help.rb +1 -1
- data/processor/command/info_subcmd/breakpoints.rb +7 -7
- data/processor/command/info_subcmd/files.rb +195 -196
- data/processor/command/info_subcmd/frame.rb +7 -4
- data/processor/command/info_subcmd/locals.rb +29 -12
- data/processor/command/info_subcmd/program.rb +48 -39
- data/processor/command/info_subcmd/registers_subcmd/ep.rb +46 -0
- data/processor/command/info_subcmd/registers_subcmd/helper.rb +32 -35
- data/processor/command/info_subcmd/registers_subcmd/sp.rb +29 -23
- data/processor/command/info_subcmd/return.rb +28 -10
- data/processor/command/info_subcmd/variables_subcmd/class.rb +3 -3
- data/processor/command/info_subcmd/variables_subcmd/constants.rb +77 -0
- data/processor/command/info_subcmd/variables_subcmd/globals.rb +7 -7
- data/processor/command/info_subcmd/variables_subcmd/instance.rb +68 -22
- data/processor/command/info_subcmd/variables_subcmd/locals.rb +148 -67
- data/processor/command/list.rb +14 -8
- data/processor/command/macro.rb +1 -1
- data/processor/command/next.rb +1 -0
- data/processor/command/set_subcmd/auto.rb +3 -3
- data/processor/command/set_subcmd/different.rb +30 -29
- data/processor/command/set_subcmd/events.rb +74 -48
- data/processor/command/set_subcmd/max_subcmd/list.rb +12 -5
- data/processor/command/set_subcmd/max_subcmd/width.rb +28 -19
- data/processor/command/set_subcmd/register.rb +37 -0
- data/processor/command/set_subcmd/register_subcmd/pc.rb +67 -0
- data/processor/command/set_subcmd/register_subcmd/sp.rb +75 -0
- data/processor/command/set_subcmd/reload.rb +12 -10
- data/processor/command/set_subcmd/return.rb +68 -44
- data/processor/command/shell.rb +3 -2
- data/processor/command/show_subcmd/different.rb +17 -14
- data/processor/command/show_subcmd/events.rb +25 -25
- data/processor/default.rb +1 -1
- data/processor/eval.rb +14 -15
- data/processor/frame.rb +43 -36
- data/processor/help.rb +5 -5
- data/processor/hook.rb +26 -29
- data/processor/location.rb +54 -51
- data/processor/mock.rb +4 -3
- data/processor/running.rb +113 -103
- data/processor/validate.rb +401 -373
- data/test/data/debug.cmd +8 -0
- data/test/data/debug.right +13 -0
- data/test/data/debugger-stop.right +6 -4
- data/test/data/fname-with-blank.cmd +1 -1
- data/test/data/fname-with-blank.right +5 -0
- data/test/data/pc.cmd +8 -0
- data/test/data/pc.right +10 -0
- data/test/data/quit.right +3 -1
- data/test/data/trace.cmd +2 -2
- data/test/data/trace.right +41 -20
- data/test/example/assign.rb +6 -0
- data/test/functional/fn_helper.rb +11 -17
- data/test/functional/test-break-long.rb +15 -16
- data/test/functional/test-break.rb +6 -8
- data/test/functional/test-condition.rb +8 -10
- data/test/functional/test-debugger-call-bug.rb +21 -22
- data/test/functional/test-delete.rb +57 -59
- data/test/functional/test-eval.rb +101 -103
- data/test/functional/test-finish.rb +24 -33
- data/test/functional/test-immediate-step-bug.rb +6 -10
- data/test/functional/test-next.rb +64 -65
- data/test/functional/test-raise.rb +63 -64
- data/test/functional/test-recursive-bt.rb +81 -76
- data/test/functional/test-remap.rb +6 -7
- data/test/functional/test-return.rb +44 -38
- data/test/functional/test-step.rb +55 -53
- data/test/functional/test-stepbug.rb +6 -9
- data/test/functional/test-watchg.rb +40 -39
- data/test/integration/test-debug.rb +12 -0
- data/test/integration/test-debugger-stop.rb +7 -7
- data/test/integration/test-pc.rb +24 -0
- data/test/integration/test-trace.rb +1 -1
- data/test/unit/cmd-helper.rb +0 -1
- data/test/unit/test-app-brkpt.rb +21 -21
- data/test/unit/test-app-brkptmgr.rb +7 -8
- data/test/unit/test-app-display.rb +3 -4
- data/test/unit/test-app-frame.rb +4 -5
- data/test/unit/test-base-subsubcmd.rb +2 -2
- data/test/unit/test-cmd-break.rb +6 -6
- data/test/unit/test-cmd-endisable.rb +7 -6
- data/test/unit/test-cmd-parse_list_cmd.rb +24 -24
- data/test/unit/test-io-tcpserver.rb +39 -35
- data/test/unit/test-proc-default.rb +23 -22
- data/test/unit/test-proc-eval.rb +1 -2
- data/test/unit/test-proc-frame.rb +8 -9
- data/test/unit/test-proc-list.rb +1 -1
- data/test/unit/test-proc-location.rb +2 -2
- data/test/unit/test-proc-main.rb +10 -10
- data/test/unit/test-proc-validate.rb +11 -13
- data/test/unit/test-subcmd-help.rb +1 -2
- data/trepanning.gemspec +8 -13
- metadata +44 -95
- data/COPYING +0 -57
- data/data/custom_require.rb +0 -44
- data/data/perldb.bindings +0 -17
- data/data/prelude.rb +0 -38
- data/processor/command/info_subcmd/variables_subcmd/constant.rb +0 -41
- data/processor/command/raise.rb +0 -48
- data/processor/command/set_subcmd/pc.rb +0 -62
- data/processor/command/set_subcmd/sp.rb +0 -67
- data/processor/eventbuf.rb +0 -133
@@ -1,11 +1,13 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
# Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
|
+
require_relative '../../../app/frame'
|
4
5
|
|
5
6
|
class Trepan::Subcommand::InfoFrame < Trepan::Subcommand
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
include Trepan::Frame
|
8
|
+
unless defined?(HELP)
|
9
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
10
|
+
HELP = <<-EOH
|
9
11
|
**#{CMD}**
|
10
12
|
|
11
13
|
Show information about the selected frame. The fields we list are:
|
@@ -77,8 +79,9 @@ See also:
|
|
77
79
|
frame, frame_num = @proc.get_frame(frame_num, true)
|
78
80
|
end
|
79
81
|
meth = frame.method rescue nil
|
82
|
+
call_info = meth ? format_stack_call(frame, {}) : ''
|
80
83
|
|
81
|
-
section "Frame %2d:
|
84
|
+
section "Frame %2d: %s" % [frame_num, call_info]
|
82
85
|
msg " %-6s: %s" % frame.source_container if frame.source_container
|
83
86
|
msg " line : %s" % @proc.frame_line
|
84
87
|
msg " argc : %d" % frame.argc if frame.argc
|
@@ -1,21 +1,38 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
|
+
require_relative './variables_subcmd/locals'
|
4
5
|
|
5
6
|
class Trepan::Subcommand::InfoLocals < Trepan::Subcommand
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
|
+
HELP = 'Same thing as "info variables locals"'
|
10
|
+
NEED_LOCALS = true
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def complete(prefix)
|
14
|
+
if @proc && @proc.frame
|
15
|
+
argc =
|
16
|
+
if 'CFUNC' == @proc.frame.type
|
17
|
+
@proc.frame.argc
|
18
|
+
else
|
19
|
+
iseq = @proc.frame.iseq
|
20
|
+
iseq.local_size - 2
|
21
|
+
end
|
22
|
+
ary = (0..argc).map{|i| i.to_s}
|
23
|
+
['names'] + ary
|
24
|
+
else
|
25
|
+
[]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def run(args)
|
30
|
+
@proc.commands['info'].run(%w(info variables) + args[1..-1])
|
31
|
+
end
|
15
32
|
end
|
16
33
|
|
17
34
|
if __FILE__ == $0
|
18
|
-
|
19
|
-
|
20
|
-
|
35
|
+
# Demo it.
|
36
|
+
require_relative '../../mock'
|
37
|
+
# ???
|
21
38
|
end
|
@@ -1,52 +1,61 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010,
|
2
|
+
# Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::InfoProgram < Trepan::Subcommand
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
unless defined?(HELP)
|
7
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
|
+
SHORT_HELP = 'Information about debugged program and its environment'
|
9
|
+
MIN_ARGS = 0
|
10
|
+
MAX_ARGS = 0
|
11
|
+
MIN_ABBREV = 'pr'.size
|
12
|
+
NEED_STACK = true
|
13
|
+
HELP = <<-EOH
|
14
|
+
**#{CMD}**
|
14
15
|
|
15
|
-
|
16
|
-
frame = @proc.frame
|
17
|
-
m = 'Program stop event: %s' % @proc.event
|
18
|
-
m +=
|
19
|
-
if frame.iseq
|
20
|
-
'; PC offset %d of instruction sequence: %s' %
|
21
|
-
[frame.pc_offset, frame.iseq.name]
|
22
|
-
else
|
23
|
-
'.'
|
24
|
-
end
|
25
|
-
msg m
|
26
|
-
if 'return' == @proc.event
|
27
|
-
msg 'R=> %s' % @proc.frame.sp(1).inspect
|
28
|
-
elsif 'raise' == @proc.event
|
29
|
-
msg @proc.core.hook_arg.inspect if @proc.core.hook_arg
|
30
|
-
if @proc.frame.iseq.catch_table_size == 0
|
31
|
-
msg "Warning: exception raised is non-local!"
|
32
|
-
end
|
33
|
-
end
|
16
|
+
Show information about the debugged program and its environment.
|
34
17
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
18
|
+
See also:
|
19
|
+
---------
|
20
|
+
`info frame`, `info file`
|
21
|
+
EOH
|
39
22
|
end
|
40
|
-
end
|
41
23
|
|
24
|
+
def run(args)
|
25
|
+
frame = @proc.top_frame
|
26
|
+
m = 'Program stop event: %s' % @proc.event
|
27
|
+
m +=
|
28
|
+
if frame.iseq
|
29
|
+
'; PC offset %d of instruction sequence: %s' %
|
30
|
+
[frame.pc_offset, frame.iseq.label]
|
31
|
+
else
|
32
|
+
'.'
|
33
|
+
end
|
34
|
+
msg m
|
35
|
+
if :return == @proc.event
|
36
|
+
msg 'R=> %s' % frame.sp(1).inspect
|
37
|
+
elsif :raise == @proc.event
|
38
|
+
exc = @proc.core.trace_point.raised_exception
|
39
|
+
msg "#{exc.class}: #{exc}"
|
40
|
+
if frame.iseq.catch_table_size == 0
|
41
|
+
msg "Warning: exception raised is non-local!"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
if @proc.brkpt
|
46
|
+
msg('It is stopped at %sbreakpoint %d.' %
|
47
|
+
[@proc.brkpt.temp? ? 'temporary ' : '',
|
48
|
+
@proc.brkpt.id])
|
49
|
+
end
|
50
|
+
end
|
42
51
|
end
|
43
52
|
|
44
53
|
if __FILE__ == $0
|
45
|
-
|
46
|
-
|
47
|
-
|
54
|
+
# Demo it.
|
55
|
+
require_relative '../../mock'
|
56
|
+
name = File.basename(__FILE__, '.rb')
|
48
57
|
|
49
|
-
|
50
|
-
|
51
|
-
|
58
|
+
# FIXME: DRY the below code
|
59
|
+
cmd = MockDebugger::sub_setup(Trepan::Subcommand::InfoProgram, false)
|
60
|
+
cmd.run(cmd.prefix)
|
52
61
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
|
3
|
+
require_relative '../../base/subsubcmd'
|
4
|
+
require_relative 'helper'
|
5
|
+
|
6
|
+
class Trepan::Subcommand::InfoRegistersEp < Trepan::SubSubcommand
|
7
|
+
unless defined?(HELP)
|
8
|
+
Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
|
9
|
+
HELP = <<EOH
|
10
|
+
**#{CMD}**
|
11
|
+
|
12
|
+
Show the value of the VM local EP pointer. The EP (environment
|
13
|
+
pointer?) is used find the next enclosing scope.
|
14
|
+
|
15
|
+
See also:
|
16
|
+
---------
|
17
|
+
|
18
|
+
`info register sp".`
|
19
|
+
EOH
|
20
|
+
|
21
|
+
MIN_ABBREV = 'ep'.size
|
22
|
+
MIN_ARGS = 0
|
23
|
+
MAX_ARGS = 0
|
24
|
+
NEED_STACK = true
|
25
|
+
SHORT_HELP = "Show the value of the VM EP."
|
26
|
+
end
|
27
|
+
|
28
|
+
def run(args)
|
29
|
+
frame = @proc.frame
|
30
|
+
if 'CFUNC' == frame.type
|
31
|
+
msg "ep not available for C functions"
|
32
|
+
else
|
33
|
+
msg "ep=%s" % frame.ep
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
if __FILE__ == $0
|
39
|
+
# Demo it.
|
40
|
+
require_relative '../../../mock'
|
41
|
+
require_relative '../registers'
|
42
|
+
cmd = MockDebugger::subsub_setup(Trepan::SubSubcommand::InfoRegisters,
|
43
|
+
Trepan::SubSubcommand::InfoRegistersLfp,
|
44
|
+
false)
|
45
|
+
cmd.run([])
|
46
|
+
end
|
@@ -1,39 +1,36 @@
|
|
1
|
-
# Copyright (C) 2010,
|
1
|
+
# Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
|
2
2
|
module Registers
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
3
|
+
def register_array_index(name, arg, max_value=nil)
|
4
|
+
if !arg or arg.empty?
|
5
|
+
# Form is: "info xx" which means "info xx 0"
|
6
|
+
lookup_pos = position = 0
|
7
|
+
else
|
8
|
+
opts = {
|
9
|
+
:msg_on_error =>
|
10
|
+
"The 'info registers %s' command argument must eval to an integer. Got: %s" % [name, arg],
|
11
|
+
:min_value => -10,
|
12
|
+
:max_value => max_value + 10
|
13
|
+
}
|
14
|
+
position = @proc.get_an_int(arg, opts)
|
15
|
+
return nil unless position
|
16
|
+
end
|
17
|
+
### FIXME: not sure if this is correct
|
18
|
+
lookup_pos =
|
19
|
+
if 'ep' == name
|
20
|
+
max_value + 1 - position
|
21
|
+
elsif 'sp' == name && 'CFUNC' == @proc.frame.type
|
22
|
+
# In C frames, the "local_size" parameter is always 1.
|
23
|
+
# I guess this is for the return parameter.
|
24
|
+
# There is a magic number 2 that we also always have
|
25
|
+
# to add.
|
26
|
+
position + 3
|
27
|
+
else
|
28
|
+
position
|
29
|
+
end
|
22
30
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
# to do, possibly in the Ruby 1.9 interpeter, we'll handle
|
28
|
-
# this here. It is also conceivable to handle this in
|
29
|
-
# thread_frame's sp handling.
|
30
|
-
position + 3
|
31
|
-
else
|
32
|
-
position
|
33
|
-
end
|
34
|
-
msg("VM %s(%d) = %s" % [name, position,
|
35
|
-
@proc.frame.send(name, lookup_pos).inspect])
|
36
|
-
return position
|
37
|
-
end
|
31
|
+
val = @proc.frame.send(name, lookup_pos)
|
32
|
+
msg("VM %s(%d) = %s (%s)" % [name, position, val.inspect, val.class])
|
33
|
+
return position
|
34
|
+
end
|
38
35
|
|
39
36
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010,
|
2
|
+
# Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../../base/subsubcmd'
|
4
4
|
require_relative 'helper'
|
5
5
|
|
@@ -7,20 +7,25 @@ class Trepan::Subcommand::InfoRegistersSp < Trepan::SubSubcommand
|
|
7
7
|
unless defined?(HELP)
|
8
8
|
Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
|
9
9
|
HELP = <<EOH
|
10
|
-
|
10
|
+
**#{CMD}** [*number* *number*...| **size**]
|
11
11
|
|
12
|
-
With no arguments, all
|
12
|
+
With no arguments, all *sp* values for the current frame of the debugged
|
13
13
|
program are shown. If a number is given, then the entry at that
|
14
|
-
location is shown. If
|
14
|
+
location is shown. If `size` is given, then we show the number items
|
15
15
|
in the stack of the current frame.
|
16
16
|
|
17
|
-
The VM uses a stack to store
|
18
|
-
|
19
|
-
a
|
20
|
-
|
21
|
-
"b"
|
17
|
+
The VM uses a stack to store both local variables and temporary values
|
18
|
+
in computations. The stack grows downward (toward lower numbers).
|
19
|
+
As a result, local values and parameters in the stack in the reverse
|
20
|
+
order as they appear in a call and are as they are defined.
|
22
21
|
|
23
|
-
|
22
|
+
The entry before the end of the stack contains the return value and
|
23
|
+
the top entry is a fake RubyVM::Env value.
|
24
|
+
|
25
|
+
See also:
|
26
|
+
---------
|
27
|
+
|
28
|
+
`info register ep`, `info register pc`
|
24
29
|
EOH
|
25
30
|
|
26
31
|
MIN_ABBREV = 'sp'.size
|
@@ -28,20 +33,21 @@ EOH
|
|
28
33
|
SHORT_HELP = "Show value(s) of the VM stack pointer (SP)."
|
29
34
|
end
|
30
35
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
include Registers
|
37
|
+
def run(args)
|
38
|
+
if args.size == 0
|
39
|
+
1.upto(@proc.frame.sp_size) do |i|
|
40
|
+
val = @proc.frame.sp(i)
|
41
|
+
msg "%s%d: %s (%s)" % [' ' * 2, i, val.inspect, val.class]
|
42
|
+
end if @proc.frame.sp_size
|
43
|
+
elsif args.size == 1 and 'size' == args[0]
|
44
|
+
msg "Number of stack items in frame is #{@proc.frame.sp_size}."
|
45
|
+
else
|
46
|
+
args.each do |arg|
|
47
|
+
register_array_index(PREFIX[-1], arg, @proc.frame.sp_size)
|
48
|
+
end
|
49
|
+
end
|
43
50
|
end
|
44
|
-
end
|
45
51
|
end
|
46
52
|
|
47
53
|
if __FILE__ == $0
|
@@ -1,24 +1,42 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010,
|
2
|
+
# Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::InfoReturn < Trepan::Subcommand
|
6
6
|
unless defined?(HELP)
|
7
7
|
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
|
-
HELP =
|
8
|
+
HELP = <<-EOH
|
9
|
+
**#{CMD}**
|
10
|
+
|
11
|
+
Show the value about to be returned.
|
12
|
+
|
13
|
+
You have to be at some sort of return event for this command to work.
|
14
|
+
|
15
|
+
See also:
|
16
|
+
---------
|
17
|
+
|
18
|
+
`set return`, `info frame`, `info program`
|
19
|
+
|
20
|
+
EOH
|
9
21
|
MIN_ABBREV = 'ret'.size # Note we have "info registers"
|
10
22
|
NEED_STACK = true
|
11
23
|
end
|
12
24
|
|
13
25
|
def run(args)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
26
|
+
event = @proc.event
|
27
|
+
frame = @proc.frame
|
28
|
+
if %w(return b_return).member?(event.to_s)
|
29
|
+
ret_val = frame.sp(1)
|
30
|
+
msg('Return class: %s' % ret_val.class)
|
31
|
+
msg('Return value: %s' % ret_val.inspect)
|
32
|
+
elsif %w(c_return).member?(event.to_s)
|
33
|
+
ret_val = frame.sp(frame.argc + 3)
|
34
|
+
msg('Return class: %s' % ret_val.class)
|
35
|
+
msg('Return value: %s' % ret_val.inspect)
|
36
|
+
else
|
37
|
+
errmsg('You need to be in a return event to do this. Event is %s' %
|
38
|
+
event)
|
39
|
+
end
|
22
40
|
end
|
23
41
|
|
24
42
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative 'locals'
|
4
4
|
|
5
|
-
class Trepan::Subcommand::InfoVariablesClass <
|
5
|
+
class Trepan::Subcommand::InfoVariablesClass <
|
6
6
|
Trepan::Subcommand::InfoVariablesLocals
|
7
7
|
Trepan::Util.suppress_warnings {
|
8
8
|
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
@@ -32,9 +32,9 @@ end
|
|
32
32
|
if __FILE__ == $0
|
33
33
|
# Demo it.
|
34
34
|
require_relative '../../mock'
|
35
|
-
cmd =
|
35
|
+
cmd =
|
36
36
|
MockDebugger::subsub_setup(Trepan::Subcommand::InfoVariables,
|
37
37
|
Trepan::Subcommand::InfoVariablesClass)
|
38
38
|
cmd.run(cmd.prefix)
|
39
|
-
cmd.run(cmd.prefix + ['name'])
|
39
|
+
cmd.run(cmd.prefix + ['--name'])
|
40
40
|
end
|