rbx-trepanning 0.0.8-universal-rubinius-1.2 → 0.1.0-universal-rubinius-1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. data/ChangeLog +762 -238
  2. data/NEWS +44 -0
  3. data/Rakefile +61 -32
  4. data/app/breakpoint.rb +2 -0
  5. data/app/brkptmgr.rb +9 -11
  6. data/app/client.rb +0 -1
  7. data/app/cmd_parse.kpeg +21 -4
  8. data/app/cmd_parse.rb +10 -10
  9. data/app/cmd_parser.rb +1029 -840
  10. data/app/complete.rb +1 -1
  11. data/app/display.rb +38 -0
  12. data/app/file.rb +24 -0
  13. data/app/frame.rb +11 -4
  14. data/app/irb.rb +41 -39
  15. data/app/iseq.rb +71 -0
  16. data/app/options.rb +55 -30
  17. data/app/rbx-llvm.rb +0 -2
  18. data/app/run.rb +13 -9
  19. data/app/util.rb +55 -5
  20. data/bin/trepanx +3 -3
  21. data/data/irbrc +13 -13
  22. data/{interface/base_intf.rb → interface.rb} +5 -1
  23. data/interface/client.rb +4 -0
  24. data/interface/script.rb +13 -5
  25. data/interface/server.rb +5 -1
  26. data/interface/user.rb +8 -1
  27. data/{io/base_io.rb → io.rb} +0 -0
  28. data/io/input.rb +1 -1
  29. data/io/null_output.rb +28 -24
  30. data/io/string_array.rb +2 -3
  31. data/io/tcpclient.rb +1 -1
  32. data/io/tcpserver.rb +1 -1
  33. data/lib/trepanning.rb +11 -13
  34. data/{processor/main.rb → processor.rb} +50 -54
  35. data/processor/breakpoint.rb +150 -137
  36. data/processor/{command/base/cmd.rb → command.rb} +1 -1
  37. data/processor/command/alias.rb +14 -3
  38. data/processor/command/backtrace.rb +2 -1
  39. data/processor/command/base/subcmd.rb +1 -5
  40. data/processor/command/base/submgr.rb +5 -2
  41. data/processor/command/base/subsubcmd.rb +1 -1
  42. data/processor/command/base/subsubmgr.rb +4 -4
  43. data/processor/command/break.rb +1 -1
  44. data/processor/command/complete.rb +2 -1
  45. data/processor/command/condition.rb +2 -2
  46. data/processor/command/continue.rb +4 -4
  47. data/processor/command/delete.rb +34 -20
  48. data/processor/command/directory.rb +4 -4
  49. data/processor/command/disable.rb +71 -0
  50. data/processor/command/disassemble.rb +55 -22
  51. data/processor/command/display.rb +3 -1
  52. data/processor/command/down.rb +8 -8
  53. data/processor/command/edit.rb +74 -0
  54. data/processor/command/enable.rb +43 -0
  55. data/processor/command/eval.rb +37 -15
  56. data/processor/command/exit.rb +25 -6
  57. data/processor/command/finish.rb +5 -5
  58. data/processor/command/frame.rb +2 -2
  59. data/processor/command/help.rb +7 -9
  60. data/processor/command/help/README +10 -0
  61. data/processor/command/help/command.txt +37 -27
  62. data/processor/command/help/examples.txt +16 -0
  63. data/processor/command/help/filename.txt +1 -1
  64. data/processor/command/help/suffixes.txt +17 -0
  65. data/processor/command/info.rb +3 -1
  66. data/processor/command/info_subcmd/files.rb +3 -2
  67. data/processor/command/info_subcmd/frame.rb +2 -1
  68. data/processor/command/info_subcmd/line.rb +17 -28
  69. data/processor/command/info_subcmd/locals.rb +22 -0
  70. data/processor/command/{show_subcmd → info_subcmd}/macro.rb +4 -4
  71. data/processor/command/info_subcmd/program.rb +2 -0
  72. data/processor/command/info_subcmd/ruby.rb +2 -0
  73. data/processor/command/info_subcmd/source.rb +75 -0
  74. data/processor/command/info_subcmd/stack.rb +25 -0
  75. data/processor/command/info_subcmd/variables.rb +23 -36
  76. data/processor/command/info_subcmd/variables_subcmd/.gitignore +2 -0
  77. data/processor/command/info_subcmd/variables_subcmd/class.rb +42 -0
  78. data/processor/command/info_subcmd/variables_subcmd/constant.rb +42 -0
  79. data/processor/command/info_subcmd/variables_subcmd/globals.rb +69 -0
  80. data/processor/command/info_subcmd/variables_subcmd/instance.rb +42 -0
  81. data/processor/command/info_subcmd/variables_subcmd/locals.rb +80 -0
  82. data/processor/command/kill.rb +8 -9
  83. data/processor/command/list.rb +101 -167
  84. data/processor/command/macro.rb +28 -10
  85. data/processor/command/next.rb +2 -1
  86. data/processor/command/nexti.rb +1 -1
  87. data/processor/command/parsetree.rb +51 -0
  88. data/processor/command/pr.rb +1 -2
  89. data/processor/command/ps.rb +1 -1
  90. data/processor/command/restart.rb +2 -2
  91. data/processor/command/save.rb +1 -1
  92. data/processor/command/server.rb +1 -1
  93. data/processor/command/set_subcmd/abbrev.rb +25 -0
  94. data/processor/command/set_subcmd/auto.rb +7 -1
  95. data/processor/command/set_subcmd/auto_subcmd/eval.rb +1 -2
  96. data/processor/command/set_subcmd/auto_subcmd/irb.rb +2 -3
  97. data/processor/command/set_subcmd/auto_subcmd/list.rb +2 -3
  98. data/processor/command/set_subcmd/different.rb +1 -1
  99. data/processor/command/set_subcmd/highlight.rb +7 -1
  100. data/processor/command/set_subcmd/reload.rb +42 -0
  101. data/processor/command/set_subcmd/timer.rb +58 -0
  102. data/processor/command/set_subcmd/trace.rb +4 -3
  103. data/processor/command/{irb.rb → shell.rb} +22 -19
  104. data/processor/command/show_subcmd/abbrev.rb +20 -0
  105. data/processor/command/show_subcmd/{alias.rb → aliases.rb} +2 -2
  106. data/processor/command/show_subcmd/auto_subcmd/eval.rb +2 -6
  107. data/processor/command/show_subcmd/directories.rb +22 -0
  108. data/processor/command/show_subcmd/hidelevel.rb +1 -1
  109. data/processor/command/show_subcmd/highlight.rb +2 -1
  110. data/processor/command/show_subcmd/reload.rb +18 -0
  111. data/processor/command/show_subcmd/timer.rb +18 -0
  112. data/processor/command/source.rb +9 -9
  113. data/processor/command/step.rb +1 -1
  114. data/processor/command/tbreak.rb +3 -2
  115. data/processor/command/unalias.rb +11 -6
  116. data/processor/command/undisplay.rb +13 -9
  117. data/processor/command/up.rb +13 -14
  118. data/processor/default.rb +47 -44
  119. data/processor/disassemble.rb +48 -35
  120. data/processor/display.rb +38 -3
  121. data/processor/eval.rb +54 -53
  122. data/processor/eventbuf.rb +69 -69
  123. data/processor/frame.rb +186 -187
  124. data/processor/help.rb +6 -4
  125. data/processor/hook.rb +103 -102
  126. data/processor/list.rb +123 -0
  127. data/processor/load_cmds.rb +9 -1
  128. data/processor/location.rb +193 -188
  129. data/processor/mock.rb +1 -7
  130. data/processor/msg.rb +56 -42
  131. data/processor/running.rb +26 -15
  132. data/processor/stepping.rb +2 -1
  133. data/processor/subcmd.rb +18 -43
  134. data/processor/validate.rb +41 -30
  135. data/processor/virtual.rb +33 -0
  136. data/rbx-trepanning.gemspec +7 -8
  137. data/sample/rocky-trepanx-colors.rb +0 -1
  138. data/test/data/fname-with-blank.right +2 -0
  139. data/test/data/inline-call.right +11 -10
  140. data/test/data/quit.right +1 -0
  141. data/test/example/debugger-stop.rb +1 -1
  142. data/test/example/goto2goto.rb +11 -0
  143. data/test/functional/fn_helper.rb +2 -2
  144. data/test/functional/test-list.rb +7 -6
  145. data/test/integration/helper.rb +5 -5
  146. data/test/unit/cmd-helper.rb +2 -6
  147. data/test/unit/test-app-cmd_parser.rb +3 -2
  148. data/test/unit/test-app-display.rb +22 -0
  149. data/test/unit/test-app-options.rb +14 -10
  150. data/test/unit/test-app-run.rb +0 -2
  151. data/test/unit/test-app-util.rb +21 -4
  152. data/test/unit/test-base-cmd.rb +5 -7
  153. data/test/unit/test-base-subcmd.rb +1 -5
  154. data/test/unit/test-base-submgr.rb +1 -1
  155. data/test/unit/test-base-subsubcmd.rb +0 -4
  156. data/test/unit/test-bin-trepanx.rb +2 -2
  157. data/test/unit/test-cmd-break.rb +2 -0
  158. data/test/unit/test-cmd-edit.rb +34 -0
  159. data/test/unit/test-cmd-kill.rb +11 -4
  160. data/test/unit/test-cmd-parse_list_cmd.rb +36 -0
  161. data/test/unit/test-command.rb +45 -0
  162. data/test/unit/test-completion.rb +1 -1
  163. data/test/unit/test-proc-eval.rb +1 -2
  164. data/test/unit/test-proc-frame.rb +5 -3
  165. data/test/unit/test-proc-list.rb +55 -0
  166. data/test/unit/test-proc-load_cmds.rb +4 -3
  167. data/test/unit/test-proc-location.rb +32 -29
  168. data/test/unit/test-proc-main.rb +1 -5
  169. data/test/unit/test-proc-validate.rb +14 -4
  170. data/test/unit/test-subcmd-help.rb +1 -5
  171. metadata +73 -107
@@ -0,0 +1,20 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
+ require 'rubygems'; require 'require_relative'
4
+ require_relative '../base/subcmd'
5
+
6
+ class Trepan::Subcommand::ShowAbbrev < Trepan::ShowBoolSubcommand
7
+ unless defined?(HELP)
8
+ Trepanning::Subcommand.set_name_prefix(__FILE__, self)
9
+ HELP = "Show whether we allow abbreviate debugger command names"
10
+ MIN_ABBREV = 'ab'.size
11
+ end
12
+
13
+ end
14
+
15
+ if __FILE__ == $0
16
+ # Demo it.
17
+ $0 = __FILE__ + 'notagain' # So we don't run this agin
18
+ require_relative '../../mock'
19
+ cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowAbbrev)
20
+ end
@@ -3,7 +3,7 @@
3
3
  require 'rubygems'; require 'require_relative'
4
4
  require_relative '../base/subcmd'
5
5
 
6
- class Trepan::Subcommand::ShowAlias < Trepan::Subcommand
6
+ class Trepan::Subcommand::ShowAliases < Trepan::Subcommand
7
7
  Trepanning::Subcommand.set_name_prefix(__FILE__, self)
8
8
  unless defined?(HELP)
9
9
  HELP = <<-EOH
@@ -32,7 +32,7 @@ all alias names
32
32
  elsif @proc.aliases.empty?
33
33
  msg "No aliases defined."
34
34
  else
35
- section "List of aliases names currently defined:"
35
+ section "List of alias names currently defined:"
36
36
  msg columnize_commands(@proc.aliases.keys.sort)
37
37
  end
38
38
  end
@@ -5,15 +5,11 @@ require_relative '../../base/subsubcmd'
5
5
 
6
6
  class Trepan::SubSubcommand::ShowAutoEval < Trepan::ShowBoolSubSubcommand
7
7
  unless defined?(HELP)
8
- HELP = "set auto eval [ON|OFF]
9
-
10
- Set this on if you want things that don't look like debugger command to be eval'd
11
- as a string."
12
-
8
+ HELP = "Show evaluation of unrecognized debugger commands"
13
9
  MIN_ABBREV = 'ev'.size
14
10
  NAME = File.basename(__FILE__, '.rb')
15
11
  PREFIX = %W(show auto #{NAME})
16
- SHORT_HELP = "Show evaluation of unrecognized debugger commands"
12
+ SHORT_HELP = HELP
17
13
  end
18
14
 
19
15
  end
@@ -0,0 +1,22 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
+ require 'rubygems'; require 'require_relative'
4
+ require_relative '../base/subcmd'
5
+
6
+ class Trepan::Subcommand::ShowDirectories < Trepan::Subcommand
7
+ unless defined?(HELP)
8
+ Trepanning::Subcommand.set_name_prefix(__FILE__, self)
9
+ HELP = "Show current search path for finding source files"
10
+ MIN_ABBREV = 'dir'.size
11
+ end
12
+
13
+ def run(args)
14
+ msg "Source directories searched: #{settings[:directory]}"
15
+ end
16
+ end
17
+
18
+ if __FILE__ == $0
19
+ # Demo it.
20
+ require_relative '../../mock'
21
+ cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowDirectories)
22
+ end
@@ -6,7 +6,7 @@ require_relative '../base/subsubcmd'
6
6
  class Trepan::Subcommand::ShowHidelevel < Trepan::ShowIntSubcommand
7
7
  unless defined?(HELP)
8
8
  Trepanning::Subcommand.set_name_prefix(__FILE__, self)
9
- HELP = 'Show the number of stack levels to hide'
9
+ HELP = 'Show the number of stack levels to hide'
10
10
  MIN_ABBREV = 'hide'.size
11
11
  end
12
12
  def run(args)
@@ -7,7 +7,8 @@ require_relative '../base/subsubmgr'
7
7
  class Trepan::Subcommand::ShowHighlight < Trepan::ShowBoolSubcommand
8
8
  unless defined?(HELP)
9
9
  Trepanning::Subcommand.set_name_prefix(__FILE__, self)
10
- HELP = 'Show whether we use terminal highlighting'
10
+ HELP = 'Show whether we use terminal highlighting'
11
+ MIN_ABBREV = 'high'.size
11
12
  end
12
13
 
13
14
  def run(args)
@@ -0,0 +1,18 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
+ require 'rubygems'; require 'require_relative'
4
+ require_relative '../base/subcmd'
5
+
6
+ class Trepan::Subcommand::ShowReload < Trepan::ShowBoolSubcommand
7
+ unless defined?(SHORT_HELP)
8
+ Trepanning::Subcommand.set_name_prefix(__FILE__, self)
9
+ HELP = "Show whether to reread source text when it changes"
10
+ MIN_ABBREV = 're'.size
11
+ end
12
+ end
13
+
14
+ if __FILE__ == $0
15
+ # Demo it.
16
+ require_relative '../../mock'
17
+ cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowReload, false)
18
+ end
@@ -0,0 +1,18 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
+ require 'rubygems'; require 'require_relative'
4
+ require_relative '../base/subcmd'
5
+
6
+ class Trepan::Subcommand::ShowTimer < Trepan::ShowBoolSubcommand
7
+ unless defined?(HELP)
8
+ Trepanning::Subcommand.set_name_prefix(__FILE__, self)
9
+ HELP = "Show status of the timing hook"
10
+ MIN_ABBREV = 'ti'.size
11
+ end
12
+ end
13
+
14
+ if __FILE__ == $0
15
+ # Demo it.
16
+ require_relative '../../mock'
17
+ cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowTimer)
18
+ end
@@ -4,7 +4,7 @@ require 'optparse'
4
4
 
5
5
  # Our local modules
6
6
  require 'rubygems'; require 'require_relative'
7
- require_relative 'base/cmd'
7
+ require_relative '../command'
8
8
  require_relative '../../interface/script'
9
9
  require_relative '../../io/null_output'
10
10
  require_relative '../../app/default'
@@ -59,28 +59,28 @@ unless option -c or --continue is given.
59
59
  def parse_options(options, args) # :nodoc
60
60
  seen_yes_no = false
61
61
  parser = OptionParser.new do |opts|
62
- opts.on("-c", "--[no-]continue",
63
- "Continue in the face of errors") do
62
+ opts.on('-c', '--[no-]continue',
63
+ 'Continue in the face of errors') do
64
64
  |v|
65
65
  options[:abort_on_error] = !v
66
66
  end
67
- opts.on("-v",
68
- "--[no-]verbose", "echo each command as it is executed") do
67
+ opts.on('-v',
68
+ '--[no-]verbose', 'echo each command as it is executed') do
69
69
  |v|
70
70
  options[:verbose] = v
71
71
  end
72
- opts.on("-N", "--no", "Use 'no' in any confirmation prompts") do
72
+ opts.on('-N', '--no', "Use 'no' in any confirmation prompts") do
73
73
  |v|
74
74
  if seen_yes_no
75
- msg("Yes/No option already seen. This option (no) ignored.")
75
+ msg('Yes/No option already seen. This option (no) ignored.')
76
76
  end
77
77
  options[:confirm_val] = false
78
78
  end
79
- opts.on("-q", "--[no-]quiet", "Silence debugger output") do
79
+ opts.on('-q', '--[no-]quiet', 'Silence debugger output') do
80
80
  |v|
81
81
  options[:quiet] = v
82
82
  end
83
- opts.on("-Y", "--yes", "Use 'yes' in any confirmation prompts") do
83
+ opts.on('-Y', '--yes', "Use 'yes' in any confirmation prompts") do
84
84
  |v|
85
85
  if seen_yes_no
86
86
  msg("Yes/No option already seen. This option, --yes, ignored.")
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'; require 'require_relative'
2
- require_relative 'base/cmd'
2
+ require_relative '../command'
3
3
  require_relative '../../app/condition'
4
4
  require_relative '../stepping'
5
5
 
@@ -1,14 +1,15 @@
1
1
  require 'rubygems'; require 'require_relative'
2
- require_relative './base/cmd'
2
+ require_relative '../command'
3
3
  require_relative 'break'
4
4
 
5
5
  class Trepan::Command::SetTempBreakpointCommand <
6
6
  Trepan::Command::BreakCommand
7
- ALIASES = %w(tb tbrk)
7
+ ALIASES = []
8
8
  CATEGORY = 'breakpoints'
9
9
  NAME = File.basename(__FILE__, '.rb')
10
10
  HELP = <<-HELP
11
11
  Same as break, but the breakpoint is deleted when it is hit.
12
+ See also "break".
12
13
  HELP
13
14
  SHORT_HELP = 'Set a temporary breakpoint'
14
15
 
@@ -1,17 +1,18 @@
1
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
1
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
2
2
  require 'rubygems'; require 'require_relative'
3
- require_relative 'base/cmd'
3
+ require_relative '../command'
4
+ require_relative '../../app/complete'
4
5
 
5
6
  class Trepan::Command::UnaliasCommand < Trepan::Command
6
7
 
7
8
  unless defined?(HELP)
8
- HELP =
9
- "unalias COMMAND
9
+ HELP = <<-HELP
10
+ unalias ALIAS
10
11
 
11
- Remove alias for COMMAND
12
+ Remove alias ALIAS
12
13
 
13
14
  See also 'alias'.
14
- "
15
+ HELP
15
16
 
16
17
  CATEGORY = 'support'
17
18
  MIN_ARGS = 1
@@ -21,6 +22,10 @@ See also 'alias'.
21
22
  SHORT_HELP = 'Remove an alias'
22
23
  end
23
24
 
25
+ def complete(prefix)
26
+ Trepan::Complete.complete_token(@proc.aliases.keys, prefix)
27
+ end
28
+
24
29
  # Run command.
25
30
  def run(args)
26
31
  args[1..-1].each do |arg|
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
3
  require 'rubygems'; require 'require_relative'
4
- require_relative 'base/cmd'
4
+ require_relative '../command'
5
5
 
6
6
  # undisplay display-number...
7
7
  class Trepan::Command::UndisplayCommand < Trepan::Command
@@ -9,37 +9,41 @@ class Trepan::Command::UndisplayCommand < Trepan::Command
9
9
  unless defined?(HELP)
10
10
  NAME = File.basename(__FILE__, '.rb')
11
11
  HELP = <<EOH
12
- undisplay DISPLAY_NUMBER ...
12
+ #{NAME} DISPLAY_NUMBER ...
13
13
  Cancel some expressions to be displayed when program stops.
14
14
  Arguments are the code numbers of the expressions to stop displaying.
15
15
  No argument means cancel all automatic-display expressions.
16
16
  "delete display" has the same effect as this command.
17
- Do "info display" to see current list of code numbers.
17
+ Use "info display" to see current list of display numbers.
18
18
  EOH
19
19
 
20
- ALIASES = %w(und)
21
20
  CATEGORY = 'data'
22
21
  NEED_STACK = false
23
22
  SHORT_HELP = 'Cancel some expressions to be displayed when program stops'
24
23
  end
25
24
 
25
+ def complete(prefix)
26
+ @proc.displays.nums.map{|disp| disp.to_s}
27
+ end
28
+
26
29
  def run(args)
27
30
 
28
31
  if args.size == 1
29
- @proc.displays.clear
30
- return
32
+ if confirm('Delete all displays?', false)
33
+ @proc.displays.clear
34
+ return
35
+ end
31
36
  end
32
37
  opts = {}
33
38
  args[1..-1].each do |arg|
34
- opts[:msg_on_error] = '%s must be a display number' % arg
39
+ opts = {:msg_on_error => '%s must be a display number' % arg}
35
40
  i = @proc.get_an_int(arg, opts)
36
41
  if i
37
42
  unless @proc.displays.delete_index(i)
38
- errmsg("no display number %d." % i)
43
+ errmsg("No display number %d." % i)
39
44
  return
40
45
  end
41
46
  end
42
- return false
43
47
  end
44
48
  end
45
49
  end
@@ -1,17 +1,16 @@
1
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
1
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
2
2
  require 'rubygems'; require 'require_relative'
3
- require_relative 'base/cmd'
3
+ require_relative '../command'
4
+ require_relative '../../app/util'
4
5
 
5
- # up command. Like 'down' butthe direction (set by DIRECTION) is different.
6
+ # up command. Like 'down' but the direction (set by DIRECTION) is different.
6
7
  #
7
8
  # NOTE: The down command subclasses this, so beware when changing!
8
9
  class Trepan::Command::UpCommand < Trepan::Command
9
10
 
10
- # Silence already initialized constant .. warnings
11
- old_verbose = $VERBOSE
12
- $VERBOSE = nil
13
- NAME = File.basename(__FILE__, '.rb')
14
- HELP = <<-HELP
11
+ Trepan::Util.suppress_warnings {
12
+ NAME = File.basename(__FILE__, '.rb')
13
+ HELP = <<-HELP
15
14
  #{NAME} [count]
16
15
 
17
16
  Move the current frame up in the stack trace (to an older frame). 0 is
@@ -20,12 +19,12 @@ the most recent frame. If no count is given, move up 1.
20
19
  See also 'down' and 'frame'.
21
20
  HELP
22
21
 
23
- ALIASES = %w(u)
24
- CATEGORY = 'stack'
25
- MAX_ARGS = 1 # Need at most this many
26
- NEED_STACK = true
27
- SHORT_HELP = 'Move frame in the direction of the caller of the last-selected frame'
28
- $VERBOSE = old_verbose
22
+ ALIASES = %w(u)
23
+ CATEGORY = 'stack'
24
+ MAX_ARGS = 1 # Need at most this many
25
+ NEED_STACK = true
26
+ SHORT_HELP = 'Move frame in the direction of the caller of the last-selected frame'
27
+ }
29
28
 
30
29
  def complete(prefix)
31
30
  @proc.frame_complete(prefix, @direction)
data/processor/default.rb CHANGED
@@ -1,54 +1,57 @@
1
1
  # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
2
2
  require 'rubygems'; require 'require_relative'
3
3
  require_relative '../app/default'
4
- class Trepan
5
- class CmdProcessor
4
+ require_relative 'virtual'
5
+ class Trepan::CmdProcessor < Trepan::VirtualCmdProcessor
6
6
 
7
- DEFAULT_SETTINGS = {
8
- :autoeval => true, # Ruby eval non-debugger commands
9
- :autoirb => false, # Go into IRB in debugger command loop
10
- :autolist => false, # Run 'list'
7
+ DEFAULT_SETTINGS = {
8
+ :abbrev => true, # Allow abbreviations of debugger commands?
9
+ :autoeval => true, # Ruby eval non-debugger commands
10
+ :autoirb => false, # Go into IRB in debugger command loop
11
+ :autolist => false, # Run 'list'
12
+
13
+ :basename => false, # Show basename of filenames only
14
+ :confirm => true, # Confirm potentially dangerous operations?
15
+ :different => 'nostack', # stop *only* when different position?
16
+
17
+ :debugdbgr => false, # Debugging the debugger
18
+ :debugexcept => true, # Internal debugging of command exceptions
19
+ :debugmacro => false, # debugging macros
20
+ :debugskip => false, # Internal debugging of step/next skipping
21
+ :directory => # last-resort path-search for files
22
+ '$rbx:$cdir:$cwd', # that are not fully qualified.
11
23
 
12
- :basename => false, # Show basename of filenames only
13
- :confirm => true, # Confirm potentially dangerous operations?
14
- :different => 'nostack', # stop *only* when different position?
15
-
16
- :debugdbgr => false, # Debugging the debugger
17
- :debugexcept => true, # Internal debugging of command exceptions
18
- :debugmacro => false, # debugging macros
19
- :debugskip => false, # Internal debugging of step/next skipping
20
- :directory => # last-resort path-search for files
21
- '$cdir:$cwd', # that are not fully qualified.
22
-
23
- :hidestack => nil, # Fixnum. How many hidden outer
24
- # debugger stack frames to hide?
25
- # nil or -1 means compute value. 0
26
- # means hide none. Less than 0 means show
27
- # all stack entries.
28
- :hightlight => false, # Use terminal highlight?
29
-
30
- :maxlist => 10, # Number of source lines to list
31
- :maxstack => 10, # backtrace limit
32
- :maxstring => 150, # Strings which are larger than this
33
- # will be truncated to this length when
34
- # printed
35
- :maxwidth => (ENV['COLUMNS'] || '80').to_i,
36
- :prompt => 'trepanx', # core part of prompt. Additional info like
37
- # debug nesting and
38
- :save_cmdfile => nil, # If set, debugger command file to be
39
- # used on restart
40
- :timer => false, # show elapsed time between events
41
- :traceprint => false, # event tracing printing
42
- :tracebuffer => false, # save events to a trace buffer.
43
- :user_cmd_dir => File.join(Trepan::HOME_DIR, 'tepanx', 'command'),
44
- # User command directory
45
-
46
- # Rubinius-specific user variables
47
- :show_ip => false,
48
- :show_bytecode => false,
24
+ :hidestack => nil, # Fixnum. How many hidden outer
25
+ # debugger stack frames to hide?
26
+ # nil or -1 means compute value. 0
27
+ # means hide none. Less than 0 means show
28
+ # all stack entries.
29
+ :hightlight => false, # Use terminal highlight?
30
+
31
+ :maxlist => 10, # Number of source lines to list
32
+ :maxstack => 10, # backtrace limit
33
+ :maxstring => 150, # Strings which are larger than this
34
+ # will be truncated to this length when
35
+ # printed
36
+ :maxwidth => (ENV['COLUMNS'] || '80').to_i,
37
+ :prompt => 'trepanx', # core part of prompt. Additional info like
38
+ # debug nesting and thread name is fixed
39
+ # and added on.
40
+ :reload => false, # Reread source file if we determine
41
+ # it has changed?
42
+ :save_cmdfile => nil, # If set, debugger command file to be
43
+ # used on restart
44
+ :timer => false, # show elapsed time between events
45
+ :traceprint => false, # event tracing printing
46
+ :tracebuffer => false, # save events to a trace buffer.
47
+ :user_cmd_dir => File.join(%W(#{Trepan::HOME_DIR} trepanx command)),
48
+ # User command directory
49
49
 
50
+ # Rubinius-specific user variables
51
+ :show_ip => false,
52
+ :show_bytecode => false,
53
+
50
54
  } unless defined?(CmdProcessor::DEFAULT_SETTINGS)
51
- end
52
55
  end
53
56
 
54
57
  if __FILE__ == $0