trepanning 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/ChangeLog +237 -0
  2. data/NEWS +8 -0
  3. data/Rakefile +3 -2
  4. data/app/breakpoint.rb +8 -8
  5. data/app/brkptmgr.rb +86 -85
  6. data/app/client.rb +60 -0
  7. data/app/core.rb-consider +198 -0
  8. data/app/default.rb +17 -7
  9. data/app/disassemble.rb +12 -2
  10. data/app/options.rb +51 -20
  11. data/app/yarv.rb +183 -0
  12. data/bin/trepan +15 -9
  13. data/data/custom_require.rb +44 -0
  14. data/data/irbrc +41 -0
  15. data/data/prelude.rb +38 -0
  16. data/interface/base_intf.rb +10 -4
  17. data/interface/client.rb +79 -0
  18. data/interface/comcodes.rb +18 -0
  19. data/interface/server.rb +142 -0
  20. data/io/base_io.rb +57 -3
  21. data/io/tcpclient.rb +122 -0
  22. data/io/tcpfns.rb +31 -0
  23. data/io/tcpserver.rb +137 -0
  24. data/lib/trepanning.rb +57 -28
  25. data/processor/command/base/cmd.rb +10 -6
  26. data/processor/command/base/subcmd.rb +13 -1
  27. data/processor/command/directory.rb +15 -8
  28. data/processor/command/disassemble.rb +3 -2
  29. data/processor/command/help.rb +71 -19
  30. data/processor/command/info_subcmd/args.rb +2 -3
  31. data/processor/command/info_subcmd/breakpoints.rb +2 -3
  32. data/processor/command/info_subcmd/file.rb +2 -3
  33. data/processor/command/info_subcmd/frame.rb +2 -3
  34. data/processor/command/info_subcmd/iseq.rb +4 -5
  35. data/processor/command/info_subcmd/locals.rb +2 -3
  36. data/processor/command/info_subcmd/program.rb +2 -3
  37. data/processor/command/info_subcmd/registers.rb +2 -3
  38. data/processor/command/info_subcmd/return.rb +2 -3
  39. data/processor/command/info_subcmd/thread.rb +2 -3
  40. data/processor/command/list.rb +10 -6
  41. data/processor/command/reload.rb +1 -1
  42. data/processor/command/reload_subcmd/command.rb +29 -16
  43. data/processor/command/server.rb +70 -0
  44. data/processor/command/set_subcmd/auto.rb +2 -3
  45. data/processor/command/set_subcmd/basename.rb +2 -3
  46. data/processor/command/set_subcmd/debug.rb +2 -3
  47. data/processor/command/set_subcmd/different.rb +2 -3
  48. data/processor/command/set_subcmd/events.rb +2 -3
  49. data/processor/command/set_subcmd/hidelevel.rb +6 -7
  50. data/processor/command/set_subcmd/highlight.rb +32 -0
  51. data/processor/command/set_subcmd/max.rb +2 -3
  52. data/processor/command/set_subcmd/return.rb +2 -3
  53. data/processor/command/set_subcmd/sp.rb +2 -3
  54. data/processor/command/set_subcmd/substitute.rb +2 -3
  55. data/processor/command/set_subcmd/timer.rb +2 -3
  56. data/processor/command/set_subcmd/trace.rb +3 -4
  57. data/processor/command/show_subcmd/alias.rb +3 -3
  58. data/processor/command/show_subcmd/args.rb +2 -3
  59. data/processor/command/show_subcmd/auto.rb +1 -2
  60. data/processor/command/show_subcmd/basename.rb +2 -3
  61. data/processor/command/show_subcmd/debug.rb +1 -2
  62. data/processor/command/show_subcmd/different.rb +2 -1
  63. data/processor/command/show_subcmd/events.rb +2 -2
  64. data/processor/command/show_subcmd/hidelevel.rb +2 -3
  65. data/processor/command/show_subcmd/highlight.rb +23 -0
  66. data/processor/command/show_subcmd/macro.rb +2 -1
  67. data/processor/command/show_subcmd/max.rb +2 -3
  68. data/processor/command/show_subcmd/trace.rb +2 -3
  69. data/processor/command/source.rb +78 -28
  70. data/processor/default.rb +3 -2
  71. data/processor/load_cmds.rb +39 -19
  72. data/processor/location.rb +11 -7
  73. data/processor/main.rb +31 -15
  74. data/processor/mock.rb +22 -7
  75. data/processor/msg.rb +24 -8
  76. data/test/data/fname-with-blank.right +3 -0
  77. data/test/data/quit.right +2 -0
  78. data/test/functional/test-break-long.rb +87 -0
  79. data/test/functional/tmp/b3.rb +5 -0
  80. data/test/functional/tmp/immediate-bug1.rb +9 -0
  81. data/test/integration/helper.rb +14 -11
  82. data/test/integration/test-fname-with-blank.rb +5 -1
  83. data/test/integration/test-quit.rb +6 -2
  84. data/test/unit/cmd-helper.rb +9 -4
  85. data/test/unit/mock-helper.rb +9 -0
  86. data/test/unit/test-app-brkpt.rb +4 -4
  87. data/test/unit/test-app-brkptmgr.rb +2 -2
  88. data/test/unit/test-app-file.rb +0 -1
  89. data/test/unit/test-app-options.rb +26 -5
  90. data/test/unit/test-base-subcmd.rb +0 -1
  91. data/test/unit/test-cmd-alias.rb +0 -1
  92. data/test/unit/test-cmd-break.rb +0 -4
  93. data/test/unit/test-cmd-endisable.rb +1 -3
  94. data/test/unit/test-cmd-help.rb +0 -1
  95. data/test/unit/test-cmd-kill.rb +4 -5
  96. data/test/unit/test-cmd-quit.rb +4 -7
  97. data/test/unit/test-cmd-source.rb +33 -0
  98. data/test/unit/test-cmd-step.rb +0 -2
  99. data/test/unit/test-io-tcp.rb +32 -0
  100. data/test/unit/test-io-tcpclient.rb +53 -0
  101. data/test/unit/test-io-tcpserver.rb +49 -0
  102. data/test/unit/test-proc-main.rb +2 -2
  103. metadata +195 -175
  104. data/processor/command/stepi.rb +0 -63
  105. data/test/functional/tmp/b1.rb +0 -5
  106. data/test/functional/tmp/s1.rb +0 -9
  107. data/test/functional/tmp/t2.rb +0 -6
  108. data/test/integration/try-test-enable.rb +0 -11
@@ -6,6 +6,8 @@ require_relative '../app/core' # core event-handling mechanism
6
6
  require_relative '../app/default' # default debugger settings
7
7
  require_relative '../interface/user' # user interface (includes I/O)
8
8
  require_relative '../interface/script' # --command interface (includes I/O)
9
+ require_relative '../interface/client' # client interface (remote debugging)
10
+ require_relative '../interface/server' # server interface (remote debugging)
9
11
 
10
12
  # SCRIPT_ISEQS__ is like SCRIPT_LINES__ in a patched Ruby 1.9. Setting
11
13
  # this variable to a hash causes instruction sequences to be added in
@@ -20,7 +22,6 @@ ISEQS__ = {} unless
20
22
  defined?(ISEQS__) && ISEQS__.is_a?(Hash)
21
23
 
22
24
  class Trepan
23
- VERSION = '0.0.9'
24
25
 
25
26
  attr_accessor :core # access to Trepan::Core instance
26
27
  attr_accessor :intf # Array. The way the outside world
@@ -40,40 +41,56 @@ class Trepan
40
41
  th = Thread.current
41
42
  th.exec_event_tracing = true
42
43
 
43
- @settings = Trepanning::DEFAULT_SETTINGS.merge(settings)
44
- @input ||= @settings[:input]
45
- @output ||= @settings[:output]
44
+ @settings = Trepan::DEFAULT_SETTINGS.merge(settings)
45
+ @input = @settings[:input] || STDIN
46
+ @output = @settings[:output] || STDOUT
46
47
 
47
- @intf = [Trepan::UserInterface.new(@input, @output)]
48
- @settings[:cmdfiles].each do |cmdfile|
49
- add_command_file(cmdfile)
50
- end if @settings.member?(:cmdfiles)
51
- @core = Core.new(self, @settings[:core_opts])
48
+ @intf =
49
+ if @settings[:server]
50
+ opts = Trepan::ServerInterface::DEFAULT_INIT_CONNECTION_OPTS.dup
51
+ opts[:port] = @settings[:port] if @settings[:port]
52
+ opts[:host] = @settings[:host] if @settings[:host]
53
+ puts("starting debugger in out-of-process mode port at " +
54
+ "#{opts[:host]}:#{opts[:port]}")
55
+ [Trepan::ServerInterface.new(nil, nil, opts)]
56
+ elsif @settings[:client]
57
+ opts = Trepan::ClientInterface::DEFAULT_INIT_CONNECTION_OPTS.dup
58
+ opts[:port] = @settings[:port] if @settings[:port]
59
+ opts[:host] = @settings[:host] if @settings[:host]
60
+ [Trepan::ClientInterface.new(nil, nil, nil, nil, opts)]
61
+ else
62
+ [Trepan::UserInterface.new(@input, @output)]
63
+ end
64
+
65
+ process_cmdfile_setting(@settings)
66
+
67
+ # FIXME: The below option settings is a big crock.
68
+ @settings[:core_opts][:cmdproc_opts] ||= {}
69
+ @settings[:core_opts][:cmdproc_opts][:highlight] ||= settings[:highlight]
70
+
71
+ @core = Core.new(self, @settings[:core_opts])
72
+
52
73
  if @settings[:initial_dir]
53
74
  Dir.chdir(@settings[:initial_dir])
54
75
  else
55
76
  @settings[:initial_dir] = Dir.pwd
56
77
  end
57
78
  @initial_dir = @settings[:initial_dir]
58
- @restart_argv =
59
- if @settings[:set_restart]
60
- [File.expand_path($0)] + ARGV
61
- elsif @settings[:restart_argv]
62
- @settings[:restart_argv]
63
- else
64
- nil
79
+ @restart_argv = @settings[:restart_argv]
80
+
81
+ unless @settings[:client]
82
+ @trace_filter = Trace::Filter.new
83
+ %w(debugger start stop).each do |m|
84
+ @trace_filter << self.method(m.to_sym)
65
85
  end
66
- @trace_filter = Trace::Filter.new
67
- %w(debugger start stop).each do |m|
68
- @trace_filter << self.method(m.to_sym)
69
- end
70
- %w(debugger event_processor trace_var_processor).each do
71
- |m|
72
- @trace_filter << @core.method(m)
86
+ %w(debugger event_processor trace_var_processor).each do
87
+ |m|
88
+ @trace_filter << @core.method(m)
89
+ end
90
+ @trace_filter << @trace_filter.method(:add_trace_func)
91
+ @trace_filter << @trace_filter.method(:remove_trace_func)
92
+ @trace_filter << Kernel.method(:add_trace_func)
73
93
  end
74
- @trace_filter << @trace_filter.method(:add_trace_func)
75
- @trace_filter << @trace_filter.method(:remove_trace_func)
76
- @trace_filter << Kernel.method(:add_trace_func)
77
94
 
78
95
  # Run user debugger command startup files.
79
96
  add_startup_files unless @settings[:nx]
@@ -185,8 +202,8 @@ class Trepan
185
202
 
186
203
  def add_startup_files()
187
204
  seen = {}
188
- cwd_initfile = File.join('.', Trepanning::CMD_INITFILE_BASE)
189
- [cwd_initfile, Trepanning::CMD_INITFILE].each do |initfile|
205
+ cwd_initfile = File.join('.', Trepan::CMD_INITFILE_BASE)
206
+ [cwd_initfile, Trepan::CMD_INITFILE].each do |initfile|
190
207
  full_initfile_path = File.expand_path(initfile)
191
208
  next if seen[full_initfile_path]
192
209
  add_command_file(full_initfile_path) if File.readable?(full_initfile_path)
@@ -194,6 +211,18 @@ class Trepan
194
211
  end
195
212
  end
196
213
 
214
+ def process_cmdfile_setting(settings)
215
+ settings[:cmdfiles].each do |item|
216
+ cmdfile, opts =
217
+ if item.kind_of?(Array)
218
+ item
219
+ else
220
+ [item, {}]
221
+ end
222
+ add_command_file(cmdfile, opts)
223
+ end if settings.member?(:cmdfiles)
224
+ end
225
+
197
226
  # As a simplification for creating a debugger object, and then
198
227
  # calling using the object to invoke the debugger, we allow this
199
228
  # two-step process in one step. That is, instead of
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
2
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
3
  # Base class of all commands. Code common to all commands is here.
4
4
  # Note: don't end classname with Command (capital C) since main
5
5
  # will think this a command name like QuitCommand
@@ -46,21 +46,21 @@ class Trepan
46
46
  @proc.confirm(message, default)
47
47
  end
48
48
 
49
- def errmsg(message)
50
- @proc.errmsg(message)
49
+ def errmsg(message, opts={})
50
+ @proc.errmsg(message, opts)
51
51
  end
52
52
 
53
53
  def obj_const(obj, name)
54
54
  obj.class.const_get(name)
55
55
  end
56
56
 
57
- def msg(message)
58
- @proc.msg(message)
57
+ def msg(message, opts={})
58
+ @proc.msg(message, opts)
59
59
  end
60
60
 
61
61
  # Convenience short-hand for @dbgr.intf[-1].msg_nocr
62
62
  def msg_nocr(msg)
63
- @proc.msg_nocr(msg)
63
+ @proc.msg_nocr(msg, opts={})
64
64
  end
65
65
 
66
66
  def my_const(name)
@@ -86,6 +86,10 @@ class Trepan
86
86
  raise RuntimeError, 'You need to define this method elsewhere'
87
87
  end
88
88
 
89
+ def section(message, opts={})
90
+ @proc.section(message, opts)
91
+ end
92
+
89
93
  def settings
90
94
  @proc.settings
91
95
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
2
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
3
  # A base class for debugger subcommands.
4
4
  #
5
5
  # Note: don't end classname with Command (capital C) since main
@@ -193,6 +193,18 @@ class Trepan
193
193
 
194
194
  end
195
195
 
196
+ module Trepanning
197
+ module Subcommand
198
+ module_function
199
+ def set_name_prefix(__file__, klass)
200
+ dirname = File.basename(File.dirname(File.expand_path(__file__)))
201
+ name = File.basename(__file__, '.rb')
202
+ klass.const_set('NAME', name)
203
+ klass.const_set('PREFIX', %W(#{dirname[0...-'_subcmd'.size]} #{name}))
204
+ end
205
+ end
206
+ end
207
+
196
208
  if __FILE__ == $0
197
209
  # Demo it.
198
210
  require_relative '../../mock'
@@ -8,22 +8,30 @@ class Trepan::Command::DirectoryCommand < Trepan::Command
8
8
  MAX_ARGS = 1 # Need at most this many
9
9
  NAME = File.basename(__FILE__, '.rb')
10
10
  HELP = <<-HELP
11
+ #{NAME} [DIR]
12
+
11
13
  Add directory DIR to beginning of search path for source files.
12
14
  DIR can also be $cwd for the current working directory, or $cdir for the
13
15
  directory in which the debugged file start.
14
16
  With no argument, reset the search path to $cdir:$cwd, the default.
15
17
 
16
- This command may be useful for debugging into Rubinius methods such as
17
- kernel/common/module.rb if have the source code somewhere.
18
+ This command may be useful if for some reason the debugger can't find
19
+ source files because directories have been moved.
20
+
21
+ Examples:
22
+ #{NAME} ~/.rvm/src/ruby-head # Adds an rvm-like directory to path
23
+ #{NAME} # reset to $cdir:$cwd
18
24
  HELP
25
+
19
26
  SHORT_HELP =
20
27
  'Add directory DIR to beginning of search path for source files'
21
28
  end
22
29
 
23
30
  # This method runs the command
24
- def run(args)
31
+ def run(args) # :nodoc
25
32
  if args.size > 1
26
- settings[:directory] = "#{args[1]}:#{settings[:directory]}"
33
+ path = File.expand_path(args[1])
34
+ settings[:directory] = "#{path}:#{settings[:directory]}"
27
35
  msg "Source directories searched: #{settings[:directory]}"
28
36
  else
29
37
  if confirm('Reintialize source path to empty?', false)
@@ -36,8 +44,7 @@ end
36
44
 
37
45
  if __FILE__ == $0
38
46
  require_relative '../mock'
39
- name = File.basename(__FILE__, '.rb')
40
- dbgr, cmd = MockDebugger::setup(name)
41
- cmd.run([name])
42
- cmd.run([name, '/tmp'])
47
+ dbgr, cmd = MockDebugger::setup
48
+ cmd.run([cmd.name])
49
+ cmd.run([cmd.name, '/tmp'])
43
50
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
2
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
3
  require_relative 'base/cmd'
4
4
  require_relative '../../app/disassemble'
5
5
  require_relative '../../app/file'
@@ -43,7 +43,8 @@ Examples:
43
43
  ary = mark_disassembly(iseq.disasm_nochildren,
44
44
  @proc.frame.iseq.equal?(iseq),
45
45
  @proc.frame.pc_offset,
46
- iseq.brkpts, settings[:maxwidth])
46
+ iseq.brkpts, settings[:maxwidth],
47
+ settings[:highlight])
47
48
  msg ary
48
49
  end
49
50
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
1
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
2
2
  require_relative 'base/cmd'
3
3
  class Trepan::Command::HelpCommand < Trepan::Command
4
4
 
@@ -41,13 +41,15 @@ See also 'examine' and 'whatis'.
41
41
 
42
42
  # List the command categories and a short description of each.
43
43
  def list_categories
44
- msg("Classes of commands:")
44
+ section 'Classes of commands:'
45
45
  CATEGORIES.keys.sort.each do |cat|
46
46
  msg("%-13s -- %s" % [cat, CATEGORIES[cat]])
47
47
  end
48
48
  final_msg = '
49
49
  Type "help" followed by a class name for a list of commands in that class.
50
+ Type "help syntax" for information on debugger command syntax.
50
51
  Type "help *" for the list of all commands.
52
+ Type "help all" for the list of all commands.
51
53
  Type "help REGEXP" for the list of commands matching /^#{REGEXP}/
52
54
  Type "help CLASS *" for the list of all commands in class CLASS.
53
55
  Type "help" followed by command name for full documentation.
@@ -56,12 +58,18 @@ Type "help" followed by command name for full documentation.
56
58
  end
57
59
 
58
60
  # This method runs the command
59
- def run(args)
61
+ def run(args) # :nodoc
60
62
  if args.size > 1
61
63
  cmd_name = args[1]
62
64
  if cmd_name == '*'
63
- msg("All command names:")
65
+ section 'All command names:'
64
66
  msg columnize_commands(@proc.commands.keys.sort)
67
+ elsif cmd_name =~ /^syntax$/i
68
+ show_command_syntax
69
+ elsif cmd_name =~ /^all$/i
70
+ CATEGORIES.sort.each do |category|
71
+ show_category(category[0], [])
72
+ end
65
73
  elsif CATEGORIES.member?(cmd_name)
66
74
  show_category(args[1], args[2..-1])
67
75
  elsif @proc.commands.member?(cmd_name) or @proc.aliases.member?(cmd_name)
@@ -87,37 +95,82 @@ Type "help" followed by command name for full documentation.
87
95
  if matches.empty?
88
96
  errmsg("No commands found matching /^#{cmd_name}/. Try \"help\".")
89
97
  else
90
- msg("Command names matching /^#{cmd_name}/:")
98
+ section "Command names matching /^#{cmd_name}/:"
91
99
  msg columnize_commands(matches.sort)
92
100
  end
93
101
  end
94
102
  else
95
103
  list_categories
96
104
  end
97
- return false # Don't break out of cmd loop
98
105
  end
99
106
 
100
107
  # Show short help for all commands in `category'.
101
108
  def show_category(category, args)
102
109
 
103
110
  if args.size == 1 && args[0] == '*'
104
- msg("Commands in class %s:" % category)
111
+ section "Commands in class %s:" % category
105
112
 
106
113
  cmds = @proc.commands.keys.select do |cmd_name|
107
114
  category == @proc.commands[cmd_name].category
108
115
  end.sort
109
-
110
116
  width = settings[:maxwidth]
111
117
  return columnize_commands(cmds)
112
118
  end
113
119
 
114
- msg("%s." % CATEGORIES[category])
115
- msg("List of commands:\n")
120
+ msg('')
121
+ section "Command class: %s" % category
122
+ msg('')
116
123
  @proc.commands.keys.sort.each do |name|
117
124
  next if category != @proc.commands[name].category
118
125
  msg("%-13s -- %s" % [name, @proc.commands[name].short_help])
119
126
  end
120
127
  end
128
+
129
+ def show_command_syntax
130
+ section "Debugger command syntax"
131
+ msg <<-EOS
132
+ Command command syntax is very simple-minded.
133
+
134
+ If a line starts with #, the command is ignored.
135
+ If a line starts with !, the line is eval'd.
136
+
137
+ If the command you want eval'd uses the Ruby ! initally, add that
138
+ after the first !.
139
+
140
+ Commands are split at whereever ;; appears. This process disregards
141
+ any quotes or other symbols that have meaning in Ruby. The strings
142
+ after the leading command string are put back on a command queue.
143
+
144
+ Within a single command, tokens are then white-space split. Again,
145
+ this process disregards quotes or symbols that have meaning in Ruby.
146
+
147
+ The first token is then looked up in the debugger command table and
148
+ then the debugger alias table. If a match is found the command name
149
+ and arguments are dispatched to the command object that process the
150
+ command.
151
+
152
+ If the command is not found and "auto eval" is set on, then the
153
+ command is eval'd in the context that the program is currently stopped
154
+ at. If "auto eval" is not set on, then we display an error message
155
+ that the entered string is "undefined".
156
+
157
+ If you want irb-like command-processing, it's possible to go into an
158
+ irb shell with the "irb" command. It is also possible to arrange going
159
+ into an irb shell every time you enter the debugger.
160
+
161
+ Examples:
162
+
163
+ # This line does nothing. It is a comment
164
+ s # by default, this is an alias for the "step" command
165
+ !s # shows the value of variable step.
166
+ !!s # Evaluates !s (or "not s"). The first ! is indicates evaluate.
167
+ info program;; list # Runs two commands "info program" and "list"
168
+ pr "hi ;;-)" # Syntax error since ;; splits the line and " is not closed.
169
+ !puts "hi ;;-)" # One way to do the above.
170
+
171
+ See also "alias", "irb", "set auto eval", and "set auto irb".
172
+ EOS
173
+ end
121
174
  end
122
175
 
123
176
  if __FILE__ == $0
@@ -125,20 +178,19 @@ if __FILE__ == $0
125
178
  require_relative '../mock'
126
179
  dbgr, cmd = MockDebugger::setup
127
180
 
128
- cmd.run %W(cmd.name help)
181
+ cmd.run %W(#{cmd.name} help)
129
182
  puts '=' * 40
130
- cmd.run %W(cmd.name *)
183
+ cmd.run %W(#{cmd.name} *)
131
184
  puts '=' * 40
132
- cmd.run %W(cmd.name fdafsasfda)
185
+ cmd.run %W(#{cmd.name} fdafsasfda)
133
186
  puts '=' * 40
134
- cmd.run %W(cmd.name)
187
+ cmd.run [cmd.name]
135
188
  puts '=' * 40
136
- cmd.run %W(cmd.name support)
189
+ cmd.run %W(#{cmd.name} support)
137
190
  puts '=' * 40
138
- cmd.run %W(cmd.name support *)
139
-
191
+ cmd.run %W(#{cmd.name} support *)
140
192
  puts '=' * 40
141
- cmd.run %W(cmd.name s.*)
193
+ cmd.run %W(#{cmd.name} s.*)
142
194
  puts '=' * 40
143
- cmd.run %W(cmd.name s<>)
195
+ cmd.run %W(#{cmd.name} s<>)
144
196
  end
@@ -1,15 +1,14 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
2
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
3
  require_relative '../base/subcmd'
4
4
  require_relative '../../../app/frame'
5
5
 
6
6
  class Trepan::Subcommand::InfoArgs < Trepan::Subcommand
7
7
  unless defined?(HELP)
8
+ Trepanning::Subcommand.set_name_prefix(__FILE__, self)
8
9
  HELP = 'Show argument variables of the current stack frame'
9
10
  MIN_ABBREV = 'ar'.size
10
- NAME = File.basename(__FILE__, '.rb')
11
11
  NEED_STACK = true
12
- PREFIX = %w(info args)
13
12
  end
14
13
 
15
14
  include Trepan::Frame
@@ -1,9 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
2
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
3
  require_relative '../base/subcmd'
4
4
 
5
5
  class Trepan::Subcommand::InfoBreakpoints < Trepan::Subcommand
6
6
  unless defined?(HELP)
7
+ Trepanning::Subcommand.set_name_prefix(__FILE__, self)
7
8
  HELP = <<EOH
8
9
  info breakpoints [num1 ...] [verbose]
9
10
 
@@ -21,8 +22,6 @@ The "Where" column indicates where the breakpoint is located.
21
22
  EOH
22
23
 
23
24
  MIN_ABBREV = 'br'.size
24
- NAME = File.basename(__FILE__, '.rb')
25
- PREFIX = %w(info breakpoints)
26
25
  SHORT_HELP = "Status of user-settable breakpoints"
27
26
  end
28
27