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.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +491 -55
  3. data/LICENSE +1 -1
  4. data/NEWS +18 -14
  5. data/README.md +5 -22
  6. data/Rakefile +22 -1
  7. data/app/breakpoint.rb +5 -3
  8. data/app/core.rb +147 -179
  9. data/app/default.rb +47 -46
  10. data/app/file.rb +6 -7
  11. data/app/frame.rb +183 -176
  12. data/app/markdown.rb +2 -9
  13. data/app/options.rb +1 -1
  14. data/app/run.rb +71 -37
  15. data/interface/script.rb +8 -8
  16. data/io.rb +19 -20
  17. data/lib/trepanning.rb +292 -297
  18. data/processor.rb +332 -344
  19. data/processor/breakpoint.rb +98 -96
  20. data/processor/command/base/submgr.rb +9 -9
  21. data/processor/command/break.rb +40 -38
  22. data/processor/command/continue.rb +15 -10
  23. data/processor/command/debug.rb +6 -25
  24. data/processor/command/delete.rb +21 -12
  25. data/processor/command/directory.rb +15 -13
  26. data/processor/command/disable.rb +12 -9
  27. data/processor/command/disassemble.rb +80 -74
  28. data/processor/command/display.rb +15 -12
  29. data/processor/command/down.rb +8 -3
  30. data/processor/command/edit.rb +37 -23
  31. data/processor/command/enable.rb +11 -8
  32. data/processor/command/eval.rb +24 -22
  33. data/processor/command/finish.rb +50 -48
  34. data/processor/command/help.rb +1 -1
  35. data/processor/command/info_subcmd/breakpoints.rb +7 -7
  36. data/processor/command/info_subcmd/files.rb +195 -196
  37. data/processor/command/info_subcmd/frame.rb +7 -4
  38. data/processor/command/info_subcmd/locals.rb +29 -12
  39. data/processor/command/info_subcmd/program.rb +48 -39
  40. data/processor/command/info_subcmd/registers_subcmd/ep.rb +46 -0
  41. data/processor/command/info_subcmd/registers_subcmd/helper.rb +32 -35
  42. data/processor/command/info_subcmd/registers_subcmd/sp.rb +29 -23
  43. data/processor/command/info_subcmd/return.rb +28 -10
  44. data/processor/command/info_subcmd/variables_subcmd/class.rb +3 -3
  45. data/processor/command/info_subcmd/variables_subcmd/constants.rb +77 -0
  46. data/processor/command/info_subcmd/variables_subcmd/globals.rb +7 -7
  47. data/processor/command/info_subcmd/variables_subcmd/instance.rb +68 -22
  48. data/processor/command/info_subcmd/variables_subcmd/locals.rb +148 -67
  49. data/processor/command/list.rb +14 -8
  50. data/processor/command/macro.rb +1 -1
  51. data/processor/command/next.rb +1 -0
  52. data/processor/command/set_subcmd/auto.rb +3 -3
  53. data/processor/command/set_subcmd/different.rb +30 -29
  54. data/processor/command/set_subcmd/events.rb +74 -48
  55. data/processor/command/set_subcmd/max_subcmd/list.rb +12 -5
  56. data/processor/command/set_subcmd/max_subcmd/width.rb +28 -19
  57. data/processor/command/set_subcmd/register.rb +37 -0
  58. data/processor/command/set_subcmd/register_subcmd/pc.rb +67 -0
  59. data/processor/command/set_subcmd/register_subcmd/sp.rb +75 -0
  60. data/processor/command/set_subcmd/reload.rb +12 -10
  61. data/processor/command/set_subcmd/return.rb +68 -44
  62. data/processor/command/shell.rb +3 -2
  63. data/processor/command/show_subcmd/different.rb +17 -14
  64. data/processor/command/show_subcmd/events.rb +25 -25
  65. data/processor/default.rb +1 -1
  66. data/processor/eval.rb +14 -15
  67. data/processor/frame.rb +43 -36
  68. data/processor/help.rb +5 -5
  69. data/processor/hook.rb +26 -29
  70. data/processor/location.rb +54 -51
  71. data/processor/mock.rb +4 -3
  72. data/processor/running.rb +113 -103
  73. data/processor/validate.rb +401 -373
  74. data/test/data/debug.cmd +8 -0
  75. data/test/data/debug.right +13 -0
  76. data/test/data/debugger-stop.right +6 -4
  77. data/test/data/fname-with-blank.cmd +1 -1
  78. data/test/data/fname-with-blank.right +5 -0
  79. data/test/data/pc.cmd +8 -0
  80. data/test/data/pc.right +10 -0
  81. data/test/data/quit.right +3 -1
  82. data/test/data/trace.cmd +2 -2
  83. data/test/data/trace.right +41 -20
  84. data/test/example/assign.rb +6 -0
  85. data/test/functional/fn_helper.rb +11 -17
  86. data/test/functional/test-break-long.rb +15 -16
  87. data/test/functional/test-break.rb +6 -8
  88. data/test/functional/test-condition.rb +8 -10
  89. data/test/functional/test-debugger-call-bug.rb +21 -22
  90. data/test/functional/test-delete.rb +57 -59
  91. data/test/functional/test-eval.rb +101 -103
  92. data/test/functional/test-finish.rb +24 -33
  93. data/test/functional/test-immediate-step-bug.rb +6 -10
  94. data/test/functional/test-next.rb +64 -65
  95. data/test/functional/test-raise.rb +63 -64
  96. data/test/functional/test-recursive-bt.rb +81 -76
  97. data/test/functional/test-remap.rb +6 -7
  98. data/test/functional/test-return.rb +44 -38
  99. data/test/functional/test-step.rb +55 -53
  100. data/test/functional/test-stepbug.rb +6 -9
  101. data/test/functional/test-watchg.rb +40 -39
  102. data/test/integration/test-debug.rb +12 -0
  103. data/test/integration/test-debugger-stop.rb +7 -7
  104. data/test/integration/test-pc.rb +24 -0
  105. data/test/integration/test-trace.rb +1 -1
  106. data/test/unit/cmd-helper.rb +0 -1
  107. data/test/unit/test-app-brkpt.rb +21 -21
  108. data/test/unit/test-app-brkptmgr.rb +7 -8
  109. data/test/unit/test-app-display.rb +3 -4
  110. data/test/unit/test-app-frame.rb +4 -5
  111. data/test/unit/test-base-subsubcmd.rb +2 -2
  112. data/test/unit/test-cmd-break.rb +6 -6
  113. data/test/unit/test-cmd-endisable.rb +7 -6
  114. data/test/unit/test-cmd-parse_list_cmd.rb +24 -24
  115. data/test/unit/test-io-tcpserver.rb +39 -35
  116. data/test/unit/test-proc-default.rb +23 -22
  117. data/test/unit/test-proc-eval.rb +1 -2
  118. data/test/unit/test-proc-frame.rb +8 -9
  119. data/test/unit/test-proc-list.rb +1 -1
  120. data/test/unit/test-proc-location.rb +2 -2
  121. data/test/unit/test-proc-main.rb +10 -10
  122. data/test/unit/test-proc-validate.rb +11 -13
  123. data/test/unit/test-subcmd-help.rb +1 -2
  124. data/trepanning.gemspec +8 -13
  125. metadata +44 -95
  126. data/COPYING +0 -57
  127. data/data/custom_require.rb +0 -44
  128. data/data/perldb.bindings +0 -17
  129. data/data/prelude.rb +0 -38
  130. data/processor/command/info_subcmd/variables_subcmd/constant.rb +0 -41
  131. data/processor/command/raise.rb +0 -48
  132. data/processor/command/set_subcmd/pc.rb +0 -62
  133. data/processor/command/set_subcmd/sp.rb +0 -67
  134. 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
- unless defined?(HELP)
7
- Trepanning::Subcommand.set_name_prefix(__FILE__, self)
8
- HELP = <<-EOH
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: #{frame.method}" % @proc.frame_index
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
- unless defined?(HELP)
7
- Trepanning::Subcommand.set_name_prefix(__FILE__, self)
8
- HELP = 'Same thing as "info locals"'
9
- NEED_LOCALS = true
10
- end
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
- def run(args)
13
- @proc.commands['info'].run(%w(info variables locals))
14
- end
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
- # Demo it.
19
- require_relative '../../mock'
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, 2011 Rocky Bernstein <rockyb@rubyforge.net>
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
- unless defined?(HELP)
7
- Trepanning::Subcommand.set_name_prefix(__FILE__, self)
8
- 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
- end
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
- def run(args)
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
- if @proc.brkpt
36
- msg('It is stopped at %sbreakpoint %d.' %
37
- [@proc.brkpt.temp? ? 'temporary ' : '',
38
- @proc.brkpt.id])
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
- # Demo it.
46
- require_relative '../../mock'
47
- name = File.basename(__FILE__, '.rb')
54
+ # Demo it.
55
+ require_relative '../../mock'
56
+ name = File.basename(__FILE__, '.rb')
48
57
 
49
- # FIXME: DRY the below code
50
- cmd = MockDebugger::sub_setup(Trepan::Subcommand::InfoProgram, false)
51
- cmd.run(cmd.prefix)
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, 2011 Rocky Bernstein <rockyb@rubyforge.net>
1
+ # Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
2
2
  module Registers
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
- lookup_pos =
18
- if 'lfp' == name
19
- max_value + 1 - position
20
- elsif 'sp' == name && 'CFUNC' == @proc.frame.type
21
- # && @proc.frame.next.type == 'IFUNC" # ?
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
- # FIXME: In C frames there seems to be some vm_push_frame's
24
- # via perhaps vm_yield_with_cfunc along with sp adjustments.
25
- # I am not sure if this is under what conditions this
26
- # *doesn't* happen so until I can figure out the better thing
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, 2011 Rocky Bernstein <rockyb@rubyforge.net>
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
- #{CMD} [NUMBER NUMBER ...|size]
10
+ **#{CMD}** [*number* *number*...| **size**]
11
11
 
12
- With no arguments, all SP values for the current frame of the debugged
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 "size" is given, then we show the number items
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 temporary values in computations. For
18
- example to compute "a + b", the values of "a" and "b" are pushed onto
19
- a stack pointed to by SP. Just before the addition is perofrmed, sp(1)
20
- will have the value "a" contians and sp(2) will contain the value of
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
- See also "info register LFP"
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
- include Registers
32
- def run(args)
33
- if args.size == 0
34
- 1.upto(@proc.frame.sp_size-1) do |i|
35
- msg "%s%d: %s" % [' ' * 2, i, @proc.frame.sp(i).inspect]
36
- end if @proc.frame.sp_size
37
- elsif args.size == 1 and 'size' == args[0]
38
- msg "Number of stack items in frame is #{@proc.frame.sp_size}."
39
- else
40
- args.each do |arg|
41
- register_array_index(PREFIX[-1], arg, @proc.frame.sp_size)
42
- end
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, 2011 Rocky Bernstein <rockyb@rubyforge.net>
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 = 'Show the value about to be returned'
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
- event = @proc.event
15
- if %w(return c-return).member?(event)
16
- ret_val = Trepan::Frame.value_returned(@proc.frame, event)
17
- msg('Return value: %s' % ret_val.inspect)
18
- else
19
- errmsg('You need to be in a return event to do this. Event is %s' %
20
- event)
21
- end
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