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.
Files changed (79) hide show
  1. data/ChangeLog +188 -0
  2. data/Makefile +7 -0
  3. data/NEWS +9 -0
  4. data/README.textile +3 -3
  5. data/Rakefile +3 -3
  6. data/app/breakpoint.rb +1 -1
  7. data/app/brkptmgr.rb +1 -1
  8. data/app/client.rb +15 -4
  9. data/app/core.rb +4 -4
  10. data/app/default.rb +1 -0
  11. data/app/display.rb +1 -1
  12. data/app/frame.rb +38 -19
  13. data/app/options.rb +4 -1
  14. data/app/run.rb +12 -2
  15. data/bin/trepan +2 -1
  16. data/check-filter.rb +18 -0
  17. data/interface/client.rb +1 -1
  18. data/interface/comcodes.rb +9 -8
  19. data/interface/server.rb +38 -2
  20. data/interface/user.rb +2 -2
  21. data/io/input.rb +11 -3
  22. data/io/tcpclient.rb +0 -2
  23. data/io/tcpserver.rb +3 -2
  24. data/lib/trepanning.rb +8 -8
  25. data/processor.rb +4 -4
  26. data/processor/command/backtrace.rb +1 -1
  27. data/processor/command/base/subcmd.rb +4 -1
  28. data/processor/command/break.rb +1 -1
  29. data/processor/command/condition.rb +1 -1
  30. data/processor/command/debug.rb +19 -15
  31. data/processor/command/delete.rb +2 -1
  32. data/processor/command/disassemble.rb +2 -2
  33. data/processor/command/display.rb +1 -1
  34. data/processor/command/down.rb +1 -2
  35. data/processor/command/finish.rb +8 -4
  36. data/processor/command/frame.rb +1 -1
  37. data/processor/command/help.rb +1 -1
  38. data/processor/command/info_subcmd/breakpoints.rb +1 -1
  39. data/processor/command/info_subcmd/registers.rb +1 -1
  40. data/processor/command/info_subcmd/source.rb +1 -1
  41. data/processor/command/info_subcmd/thread.rb +2 -2
  42. data/processor/command/list.rb +1 -1
  43. data/processor/command/set_subcmd/auto_subcmd/eval.rb +10 -6
  44. data/processor/command/set_subcmd/auto_subcmd/irb.rb +2 -2
  45. data/processor/command/set_subcmd/auto_subcmd/list.rb +2 -2
  46. data/processor/command/set_subcmd/substitute_subcmd/eval.rb +1 -1
  47. data/processor/command/show_subcmd/abbrev.rb +2 -2
  48. data/processor/command/undisplay.rb +1 -1
  49. data/processor/command/up.rb +1 -2
  50. data/processor/eval.rb +9 -5
  51. data/processor/frame.rb +1 -1
  52. data/processor/list.rb +1 -1
  53. data/processor/location.rb +3 -2
  54. data/processor/mock.rb +3 -3
  55. data/processor/running.rb +1 -1
  56. data/processor/validate.rb +1 -1
  57. data/test/example/factorial.rb +10 -0
  58. data/test/example/gcd1.rb +1 -1
  59. data/test/functional/fn_helper.rb +1 -1
  60. data/test/functional/test-recursive-bt.rb +103 -0
  61. data/test/functional/test-remap.rb +50 -0
  62. data/test/integration/test-remote.rb +23 -0
  63. data/test/unit/test-app-brkpt.rb +1 -1
  64. data/test/unit/test-app-brkptmgr.rb +2 -2
  65. data/test/unit/test-app-display.rb +1 -1
  66. data/test/unit/test-app-frame.rb +3 -3
  67. data/test/unit/test-app-options.rb +1 -1
  68. data/test/unit/test-cmd-break.rb +2 -2
  69. data/test/unit/test-cmd-endisable.rb +1 -1
  70. data/test/unit/test-cmd-parse_list_cmd.rb +1 -1
  71. data/test/unit/test-cmd-quit.rb +1 -0
  72. data/test/unit/test-cmd-set-auto-eval.rb.try +19 -0
  73. data/test/unit/test-proc-eval.rb +1 -1
  74. data/test/unit/test-proc-frame.rb +2 -2
  75. data/test/unit/test-proc-list.rb +1 -1
  76. data/test/unit/test-proc-location.rb +1 -1
  77. data/test/unit/test-proc-validate.rb +3 -3
  78. data/trepanning.gemspec +5 -5
  79. 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::ThreadFrame::current)
56
+ cmd.proc.frame_setup(RubyVM::Frame::current)
57
57
 
58
58
  cmd.run([cmd.name, '1'])
59
59
  cmdproc = dbgr.core.processor
@@ -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::ThreadFrame.current.stack_size - frame.stack_size
30
+ stack_diff = RubyVM::Frame.current.stack_size - frame.stack_size
31
31
 
32
32
  # Ignore tracing in support routines:
33
- tf = @proc.dbgr.trace_filter
34
- [self.method(:run), @proc.method(:debug_eval),
35
- @proc.method(:debug_eval_with_exception),
36
- @proc.method(:get_binding_and_filename),
37
- @proc.method(:fake_eval_filename)].each do |m|
38
- tf << m unless tf.member?(m)
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
- msg 'ENTERING NESTED DEBUGGER'
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::ThreadFrame.current.trace_off = false
61
- retval = @proc.debug_eval(arg_str)
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
- msg 'LEAVING NESTED DEBUGGER'
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::ThreadFrame::current)
86
+ cmd.proc.frame_setup(RubyVM::Frame::current)
83
87
  cmd.run([cmd.name, 'x = 1; y = 2'])
84
88
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
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::ThreadFrame::current)
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::ThreadFrame::current)
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'
@@ -76,7 +76,7 @@ if __FILE__ == $0
76
76
  puts '==' * 10
77
77
  end
78
78
 
79
- cmd.proc.frame_setup(RubyVM::ThreadFrame::current)
79
+ cmd.proc.frame_setup(RubyVM::Frame::current)
80
80
 
81
81
  run_cmd(cmd, [cmd.name])
82
82
  run_cmd(cmd, [cmd.name, '/x', '10'])
@@ -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::ThreadFrame::current)
46
+ cmd.proc.frame_setup(RubyVM::Frame::current)
48
47
  puts "#{name}"
49
48
  cmd.run([name])
50
49
  sep
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
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 leaving the current
13
- function or switch context via yielding or ending a block which was
14
- yield to. Sometimes this is called 'step out'.
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
@@ -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::ThreadFrame::current)
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)
@@ -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::ThreadFrame.current.source_container[1])
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
 
@@ -149,7 +149,7 @@ if __FILE__ == $0
149
149
  puts '-' * 20
150
150
 
151
151
  require 'thread_frame'
152
- tf = RubyVM::ThreadFrame.current
152
+ tf = RubyVM::Frame.current
153
153
  pc_offset = tf.pc_offset
154
154
  def foo
155
155
  5
@@ -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::ThreadFrame::current)
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 = Trepan::ruby_syntax_errors(canonic_name)
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::ThreadFrame::current)
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::ThreadFrame::current)
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])
@@ -208,7 +208,7 @@ if __FILE__ == $0
208
208
  |x,y| x + y
209
209
  end
210
210
  require 'thread_frame'
211
- tf = RubyVM::ThreadFrame.current
211
+ tf = RubyVM::Frame.current
212
212
  cmd.proc.frame_setup(tf)
213
213
  run_cmd2(cmd, %w(list p))
214
214
 
@@ -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::Subcommand.set_name_prefix(__FILE__, self)
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::subsub_setup(Trepan::SubSubcommand::SetAuto,
49
- Trepan::SubSubcommand::SetAutoEval)
50
- %w(off on 0 1).each { |arg| cmd.run([cmd.name, arg]) }
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 cmd.save_command.join("\n")
56
+ puts eval_cmd.save_command
53
57
  end
@@ -1,10 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010, 2011 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::Subcommand::SetAutoIrb < Trepan::SetBoolSubSubcommand
6
6
  unless defined?(HELP)
7
- Trepanning::Subcommand.set_name_prefix(__FILE__, self)
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, 2011 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::Subcommand::SetAutoList < Trepan::SetBoolSubSubcommand
6
6
  unless defined?(HELP)
7
- Trepanning::Subcommand.set_name_prefix(__FILE__, self)
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::ThreadFrame::current); setx_cmd.run([])')
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 abbreviate debugger command names"
8
+ HELP = "Show whether we allow abbreviated debugger command names"
9
9
  MIN_ABBREV = 'ab'.size
10
10
  end
11
11
 
@@ -58,7 +58,7 @@ if __FILE__ == $0
58
58
  puts '==' * 10
59
59
  end
60
60
 
61
- cmd.proc.frame_setup(RubyVM::ThreadFrame::current)
61
+ cmd.proc.frame_setup(RubyVM::Frame::current)
62
62
 
63
63
  run_cmd(cmd, %W(#{cmd.name} z))
64
64
  run_cmd(cmd, %W(#{cmd.name} 1 10))
@@ -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::ThreadFrame::current)
81
+ cmd.proc.frame_setup(RubyVM::Frame::current)
83
82
  puts "#{name}"
84
83
  cmd.run([name])
85
84
  sep
@@ -1,20 +1,24 @@
1
- # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
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::ThreadFrame.current)
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}"')
@@ -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::ThreadFrame.current)
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) }
@@ -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::ThreadFrame.current)
128
+ cmdproc.frame_setup(RubyVM::Frame.current)
129
129
  def foo; 5 end
130
130
  def cmdproc.errmsg(msg)
131
131
  puts msg
@@ -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::ThreadFrame.current)
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::ThreadFrame.current)
226
+ proc.frame_setup(RubyVM::Frame.current)
226
227
  puts proc.current_source_text
227
228
  END
228
229
  end
@@ -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::ThreadFrame.current.prev
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::ThreadFrame::current.prev)
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::ThreadFrame::current.prev)
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)