ruby-debug 0.10.4 → 0.10.5.rc1

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 (129) hide show
  1. data/AUTHORS +5 -0
  2. data/CHANGES +17 -0
  3. data/ChangeLog +6086 -3711
  4. data/README +39 -0
  5. data/Rakefile +67 -82
  6. data/cli/ruby-debug/commands/breakpoints.rb +4 -2
  7. data/cli/ruby-debug/commands/edit.rb +3 -2
  8. data/cli/ruby-debug/commands/info.rb +5 -4
  9. data/cli/ruby-debug/commands/irb.rb +7 -8
  10. data/cli/ruby-debug/commands/list.rb +1 -1
  11. data/cli/ruby-debug/commands/set.rb +7 -1
  12. data/cli/ruby-debug/commands/show.rb +8 -3
  13. data/cli/ruby-debug/processor.rb +10 -4
  14. data/doc/rdebug.1 +1 -1
  15. data/rdbg.rb +1 -1
  16. data/test/base/base.rb +7 -4
  17. data/test/base/binding.rb +3 -12
  18. data/test/base/catchpoint.rb +2 -9
  19. data/test/base/load.rb +18 -14
  20. data/test/base/reload_bug.rb +2 -2
  21. data/test/cli/commands/catchpoint_test.rb +1 -13
  22. data/test/cli/commands/unit/regexp.rb +2 -8
  23. data/test/data/annotate.cmd +2 -2
  24. data/test/data/annotate.right +8 -8
  25. data/test/data/at-exit.cmd +4 -0
  26. data/test/data/at-exit.right +12 -0
  27. data/test/data/break_bad.cmd +3 -5
  28. data/test/data/break_bad.right +4 -6
  29. data/test/data/break_tracelines.cmd +9 -0
  30. data/test/data/break_tracelines.right +17 -0
  31. data/test/data/breakpoints-basename.cmd +2 -0
  32. data/test/data/breakpoints-basename.right +10 -0
  33. data/test/data/breakpoints.cmd +0 -1
  34. data/test/data/breakpoints.right +1 -3
  35. data/test/data/catch.cmd +1 -0
  36. data/test/data/catch.right +2 -0
  37. data/test/data/continue_bad.cmd +4 -0
  38. data/test/data/continue_bad.right +9 -0
  39. data/test/data/ctrl.right +2 -1
  40. data/test/data/dollar-0.right +3 -2
  41. data/test/data/dollar-0a.right +1 -0
  42. data/test/data/dollar-0b.right +1 -0
  43. data/test/data/edit.cmd +1 -1
  44. data/test/data/edit.right +4 -4
  45. data/test/data/emacs_basic.cmd +1 -34
  46. data/test/data/emacs_basic.right +10 -92
  47. data/test/data/frame.cmd +0 -3
  48. data/test/data/frame.right +0 -4
  49. data/test/data/info-file-break.cmd +4 -0
  50. data/test/data/info-file-break.right +11 -0
  51. data/test/data/info-thread.right +4 -4
  52. data/test/data/info-var-bug2.right +2 -2
  53. data/test/data/info.cmd +0 -1
  54. data/test/data/info.right +1 -5
  55. data/test/data/linetrace-jruby.right +23 -0
  56. data/test/data/list.right +13 -13
  57. data/test/data/output.right +4 -4
  58. data/test/data/post-mortem-osx.right +5 -4
  59. data/test/data/quit.right +9 -0
  60. data/test/data/raise-jruby.right +26 -0
  61. data/test/data/raise.right +1 -1
  62. data/test/data/save.cmd +1 -0
  63. data/test/data/save.right +4 -2
  64. data/test/data/stepping.cmd +2 -2
  65. data/test/data/stepping.right +4 -4
  66. data/test/data/test-init.right +2 -2
  67. data/test/data/trace-jruby.right +14 -0
  68. data/test/example/a/example.rb +1 -0
  69. data/test/example/at-exit.rb +3 -0
  70. data/test/example/b/example.rb +1 -0
  71. data/test/{bp_loop_issue.rb → example/bp_loop_issue.rb} +0 -0
  72. data/test/example/breakpoints-basename.rb +2 -0
  73. data/test/{brkpt-class-bug.rb → example/brkpt-class-bug.rb} +0 -0
  74. data/test/{classes.rb → example/classes.rb} +0 -0
  75. data/test/{dollar-0.rb → example/dollar-0.rb} +1 -0
  76. data/test/{except-bug1.rb → example/except-bug1.rb} +0 -0
  77. data/test/file with space.rb b/data/test/example/file with → space.rb +0 -0
  78. data/test/{gcd.rb → example/gcd.rb} +0 -0
  79. data/test/{info-var-bug.rb → example/info-var-bug.rb} +0 -0
  80. data/test/{info-var-bug2.rb → example/info-var-bug2.rb} +0 -0
  81. data/test/{null.rb → example/null.rb} +0 -0
  82. data/test/{output.rb → example/output.rb} +0 -0
  83. data/test/{pm-bug.rb → example/pm-bug.rb} +0 -0
  84. data/test/{pm.rb → example/pm.rb} +0 -0
  85. data/test/{raise.rb → example/raise.rb} +0 -0
  86. data/test/helper.rb +52 -34
  87. data/test/rdebug-save.1 +2 -2
  88. data/test/test-annotate.rb +4 -16
  89. data/test/test-at-exit.rb +13 -0
  90. data/test/test-break-bad.rb +14 -25
  91. data/test/test-breakpoints.rb +13 -14
  92. data/test/test-brkpt-class-bug.rb +3 -16
  93. data/test/test-catch.rb +3 -15
  94. data/test/test-condition.rb +3 -15
  95. data/test/test-display.rb +3 -15
  96. data/test/test-dollar-0.rb +23 -35
  97. data/test/test-edit.rb +4 -16
  98. data/test/test-emacs-basic.rb +4 -17
  99. data/test/test-enable.rb +3 -15
  100. data/test/test-except-bug1.rb +6 -21
  101. data/test/test-file-with-space.rb +3 -15
  102. data/test/test-finish.rb +11 -23
  103. data/test/test-frame.rb +14 -20
  104. data/test/test-hist.rb +6 -10
  105. data/test/test-info-thread.rb +13 -21
  106. data/test/test-info-var.rb +20 -37
  107. data/test/test-info.rb +16 -15
  108. data/test/test-list.rb +3 -14
  109. data/test/test-method.rb +9 -23
  110. data/test/test-output.rb +3 -16
  111. data/test/test-pm.rb +16 -38
  112. data/test/test-quit.rb +3 -20
  113. data/test/test-raise.rb +3 -15
  114. data/test/test-save.rb +12 -21
  115. data/test/test-setshow.rb +3 -15
  116. data/test/test-source.rb +3 -15
  117. data/test/test-stepping.rb +3 -15
  118. data/test/test-trace.rb +22 -45
  119. metadata +199 -159
  120. data/VERSION +0 -3
  121. data/cli/ruby-debug/commands/continue.RB +0 -48
  122. data/cli/ruby-debug/commands/disassemble.RB +0 -38
  123. data/cli/ruby-debug/commands/raise.RB +0 -41
  124. data/cli/ruby-debug/commands/source.RB +0 -44
  125. data/cli/ruby-debug/processor.RB +0 -484
  126. data/runner.sh +0 -7
  127. data/test/except-bug2.rb +0 -7
  128. data/test/scope-test.rb +0 -8
  129. data/test/tvar.rb +0 -3
data/README CHANGED
@@ -112,3 +112,42 @@ your program can be minimized.
112
112
  == License
113
113
 
114
114
  See LICENSE for license information.
115
+
116
+
117
+
118
+ = ruby-debug-base for JRuby
119
+
120
+ == Overview
121
+
122
+ (j)ruby-debug-base provides the fast debugger extension for JRuby interpreter.
123
+ It is the same as ruby-debug-base native C extension from ruby-debug project
124
+ (http://rubyforge.org/projects/ruby-debug/), but for JRuby.
125
+
126
+ == Install
127
+
128
+ (j)ruby-debug-base is available as a RubyGem:
129
+
130
+ jruby -S gem install ruby-debug-base
131
+
132
+ == Usage
133
+
134
+ The usage is then the same as with native ruby-debugger, but you might need to
135
+ force JRuby which has to run in interpreted mode. Simplest usage is:
136
+
137
+ $ jruby --debug -S rdebug <your-script>
138
+
139
+ Or easier, you might create 'jruby-dm' ('dm' for 'debugger-mode'):
140
+
141
+ $ cat ~/bin/jruby-dm
142
+ #!/bin/bash
143
+ jruby --debug "$@"
144
+
145
+ Then you may run just as you used to:
146
+
147
+ $ jruby-dm -S rdebug <your-script>
148
+
149
+ For more information see: http://bashdb.sourceforge.net/ruby-debug.html
150
+
151
+ == License
152
+
153
+ See MIT-LICENSE for license information.
data/Rakefile CHANGED
@@ -1,34 +1,17 @@
1
1
  #!/usr/bin/env rake
2
2
  # -*- Ruby -*-
3
3
  require 'rubygems'
4
- require 'rake/gempackagetask'
5
- require 'rake/rdoctask'
4
+ require 'rubygems/package_task'
5
+ require 'rdoc/task'
6
6
  require 'rake/testtask'
7
+ require 'rake/extensiontask'
8
+ require 'rake/javaextensiontask'
9
+
10
+ $:.push File.expand_path("../lib", __FILE__)
11
+ require "ruby-debug-base/version"
7
12
 
8
13
  SO_NAME = "ruby_debug.so"
9
14
  ROOT_DIR = File.dirname(__FILE__)
10
- VERSION_FILE = ROOT_DIR + '/VERSION'
11
-
12
- def make_version_file
13
- ruby_debug_version = open("ext/ruby_debug.c").
14
- grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1]
15
- File.open(VERSION_FILE, 'w') do |f|
16
- f.write(
17
- "# This file was created automatically from data in ext/ruby_debug.c via:
18
- # rake :make_version_file.
19
- #{ruby_debug_version}
20
- ")
21
- end
22
- end
23
-
24
- make_version_file unless File.exist?(VERSION_FILE)
25
- ruby_debug_version = nil
26
- open(VERSION_FILE).each do |line|
27
- next if line =~ /^#/
28
- ruby_debug_version = line.chomp
29
- break
30
- end
31
-
32
15
 
33
16
  # ------- Default Package ----------
34
17
  COMMON_FILES = FileList[
@@ -36,7 +19,6 @@ COMMON_FILES = FileList[
36
19
  'CHANGES',
37
20
  'LICENSE',
38
21
  'README',
39
- 'VERSION',
40
22
  'Rakefile',
41
23
  ]
42
24
 
@@ -52,19 +34,14 @@ CLI_FILES = COMMON_FILES + FileList[
52
34
  'test/rdebug-save.1',
53
35
  'test/**/data/*.cmd',
54
36
  'test/**/data/*.right',
37
+ 'test/**/example/*.rb',
55
38
  'test/config.yaml',
56
39
  'test/**/*.rb',
57
40
  'rdbg.rb',
58
- 'runner.sh',
59
41
  CLI_TEST_FILE_LIST
60
42
  ]
61
43
 
62
- BASE_TEST_FILE_LIST = %w(
63
- test/base/base.rb
64
- test/base/binding.rb
65
- test/base/catchpoint.rb
66
- test/base/reload_bug.rb
67
- )
44
+ BASE_TEST_FILE_LIST = FileList['test/base/*.rb']
68
45
 
69
46
  BASE_FILES = COMMON_FILES + FileList[
70
47
  'ext/breakpoint.c',
@@ -72,54 +49,46 @@ BASE_FILES = COMMON_FILES + FileList[
72
49
  'ext/ruby_debug.c',
73
50
  'ext/ruby_debug.h',
74
51
  'ext/win32/*',
75
- 'lib/**/*',
52
+ 'lib/ruby-debug-base.rb',
53
+ 'lib/ruby-debug-base/version.rb',
76
54
  BASE_TEST_FILE_LIST,
77
55
  ]
78
56
 
79
- desc "Test everything."
80
57
  ext = File.join(ROOT_DIR, 'ext')
81
- test_and_args = File.exist?(ext) ? {:test => :test_base} : [:test]
82
- task test_and_args do
83
- Rake::TestTask.new(:test) do |t|
84
- t.libs += %W(#{ROOT_DIR}/lib #{ROOT_DIR}/cli)
85
- t.libs << ext if File.exist?(ext)
86
- t.test_files = CLI_TEST_FILE_LIST
87
- t.verbose = true
88
- end
89
- end
90
58
 
91
- desc "Test ruby-debug-base."
92
- task :test_base => :lib do
93
- Rake::TestTask.new(:test_base) do |t|
94
- t.libs += ['./ext', './lib']
95
- t.test_files = FileList[BASE_TEST_FILE_LIST]
96
- t.verbose = true
97
- end
59
+ desc "Test everything."
60
+ Rake::TestTask.new(:test) do |t|
61
+ t.libs += %W(#{ROOT_DIR}/lib #{ROOT_DIR}/cli)
62
+ t.libs << ext if File.exist?(ext)
63
+ t.test_files = CLI_TEST_FILE_LIST
64
+ t.options = '--verbose' if $VERBOSE
65
+ t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
98
66
  end
99
67
 
100
- desc "Test everything - same as test."
101
- task :check => :test
68
+ task :test => :test_base if File.exist?(ext)
102
69
 
103
- desc "Create the core ruby-debug shared library extension"
104
- task :lib do
105
- Dir.chdir("ext") do
106
- system("#{Gem.ruby} extconf.rb && make")
107
- end
70
+ desc "Test ruby-debug-base."
71
+ Rake::TestTask.new(:test_base) do |t|
72
+ t.libs += ['./ext', './lib']
73
+ t.test_files = FileList[BASE_TEST_FILE_LIST]
74
+ t.options = '--verbose' if $VERBOSE
75
+ t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
108
76
  end
109
77
 
110
- desc "Compile Emacs code"
111
- task :emacs => "emacs/rdebug.elc"
112
- file "emacs/rdebug.elc" => ["emacs/elisp-comp", "emacs/rdebug.el"] do
113
- Dir.chdir("emacs") do
114
- system("./elisp-comp ./rdebug.el")
115
- end
78
+ if defined?(JRUBY_VERSION)
79
+ task :test_base => 'jruby:compile:java'
80
+ else
81
+ task :test_base => :compile
116
82
  end
117
83
 
84
+ desc "Test everything - same as test."
85
+ task :check => :test
86
+
118
87
  desc "Create a GNU-style ChangeLog via svn2cl"
119
88
  task :ChangeLog do
120
- system('svn2cl --authors=svn2cl_usermap http://ruby-debug.rubyforge.org/svn/trunk')
121
- system("svn2cl --authors=svn2cl_usermap http://ruby-debug.rubyforge.org/svn/trunk/ext -o ext/ChangeLog")
122
- system("svn2cl --authors=svn2cl_usermap http://ruby-debug.rubyforge.org/svn/trunk/lib -o lib/ChangeLog")
89
+ system('git log --pretty --numstat --summary | git2cl > ChangeLog')
90
+ system('git log --pretty --numstat --summary ext | git2cl > ext/ChangeLog')
91
+ system('git log --pretty --numstat --summary lib | git2cl > lib/ChangeLog')
123
92
  end
124
93
 
125
94
  # Base GEM Specification
@@ -135,7 +104,7 @@ provides support that front-ends can build on. It provides breakpoint
135
104
  handling, bindings for stack frames among other things.
136
105
  EOF
137
106
 
138
- spec.version = ruby_debug_version
107
+ spec.version = Debugger::VERSION
139
108
 
140
109
  spec.author = "Kent Sibilev"
141
110
  spec.email = "ksibilev@yahoo.com"
@@ -148,7 +117,8 @@ EOF
148
117
  spec.date = Time.now
149
118
  spec.rubyforge_project = 'ruby-debug'
150
119
  spec.add_dependency('linecache', '>= 0.3')
151
-
120
+ spec.add_development_dependency('rake-compiler')
121
+
152
122
  spec.test_files = FileList[BASE_TEST_FILE_LIST]
153
123
 
154
124
  # rdoc
@@ -165,7 +135,7 @@ cli_spec = Gem::Specification.new do |spec|
165
135
  A generic command line interface for ruby-debug.
166
136
  EOF
167
137
 
168
- spec.version = ruby_debug_version
138
+ spec.version = Debugger::VERSION
169
139
 
170
140
  spec.author = "Kent Sibilev"
171
141
  spec.email = "ksibilev@yahoo.com"
@@ -179,7 +149,7 @@ EOF
179
149
  spec.date = Time.now
180
150
  spec.rubyforge_project = 'ruby-debug'
181
151
  spec.add_dependency('columnize', '>= 0.1')
182
- spec.add_dependency('ruby-debug-base', "~> #{ruby_debug_version}.0")
152
+ spec.add_dependency('ruby-debug-base', "~> #{Debugger::VERSION}.0")
183
153
 
184
154
  # FIXME: work out operational logistics for this
185
155
  # spec.test_files = FileList[CLI_TEST_FILE_LIST]
@@ -190,14 +160,18 @@ EOF
190
160
  end
191
161
 
192
162
  # Rake task to build the default package
193
- Rake::GemPackageTask.new(base_spec) do |pkg|
163
+ Gem::PackageTask.new(base_spec) do |pkg|
194
164
  pkg.need_tar = true
195
165
  end
196
- Rake::GemPackageTask.new(cli_spec) do |pkg|
166
+ Gem::PackageTask.new(cli_spec) do |pkg|
197
167
  pkg.need_tar = true
198
168
  end
199
169
 
200
- task :default => [:package]
170
+ Rake::ExtensionTask.new('ruby_debug', base_spec) do |t|
171
+ t.ext_dir = "ext"
172
+ end
173
+
174
+ task :default => :test
201
175
 
202
176
  # Windows specification
203
177
  win_spec = base_spec.clone
@@ -244,11 +218,12 @@ task :clean do
244
218
  derived_files = Dir.glob(".o") + Dir.glob("*.so")
245
219
  rm derived_files unless derived_files.empty?
246
220
  end
221
+ rm 'lib/ruby_debug.jar' if File.exists?("lib/ruby_debug.jar")
247
222
  end
248
223
 
249
224
  # --------- RDoc Documentation ------
250
225
  desc "Generate rdoc documentation"
251
- Rake::RDocTask.new("rdoc") do |rdoc|
226
+ RDoc::Task.new("rdoc") do |rdoc|
252
227
  rdoc.rdoc_dir = 'doc/rdoc'
253
228
  rdoc.title = "ruby-debug"
254
229
  # Show source inline with line numbers
@@ -284,9 +259,9 @@ task :rubyforge_upload do
284
259
  end
285
260
  end
286
261
 
287
- def install(spec, *opts)
262
+ def install_gem(spec, *opts)
288
263
  args = ['gem', 'install', "pkg/#{spec.name}-#{spec.version}.gem"] + opts
289
- args.unshift 'sudo' unless 0 == Process.uid
264
+ args.unshift 'sudo' unless 0 == Process.uid || ENV['rvm_path']
290
265
  system(*args)
291
266
  end
292
267
 
@@ -294,18 +269,28 @@ desc 'Install locally'
294
269
  task :install => :package do
295
270
  Dir.chdir(File::dirname(__FILE__)) do
296
271
  # ri and rdoc take lots of time
297
- install(base_spec, '--no-ri', '--no-rdoc')
298
- install(cli_spec, '--no-ri', '--no-rdoc')
272
+ install_gem(base_spec, '--no-ri', '--no-rdoc')
273
+ install_gem(cli_spec, '--no-ri', '--no-rdoc')
299
274
  end
300
275
  end
301
276
 
302
277
  task :install_full => :package do
303
278
  Dir.chdir(File::dirname(__FILE__)) do
304
- install(base_spec)
305
- install(cli_spec)
279
+ install_gem(base_spec)
280
+ install_gem(cli_spec)
306
281
  end
307
282
  end
308
283
 
309
- task :make_version_file do
310
- make_version_file
284
+ namespace :jruby do
285
+ jruby_spec = base_spec.clone
286
+ jruby_spec.platform = "java"
287
+ jruby_spec.files = jruby_spec.files.reject {|f| f =~ /^ext/ }
288
+ jruby_spec.files += ['lib/ruby_debug.jar']
289
+ jruby_spec.extensions = []
290
+
291
+ Gem::PackageTask.new(jruby_spec) {}
292
+
293
+ Rake::JavaExtensionTask.new('ruby_debug') do |t|
294
+ t.ext_dir = "src"
295
+ end
311
296
  end
@@ -65,11 +65,13 @@ module Debugger
65
65
  if LineCache.cache(brkpt_filename, Command.settings[:reload_source_on_change])
66
66
  last_line = LineCache.size(brkpt_filename)
67
67
  if line > last_line
68
- errmsg("There are only %d lines in file \"%s\".\n", last_line, file)
68
+ errmsg("There are only %d lines in file \"%s\".\n", last_line,
69
+ CommandProcessor.canonic_file(file))
69
70
  return
70
71
  end
71
72
  unless LineCache.trace_line_numbers(brkpt_filename).member?(line)
72
- errmsg("Line %d is not a stopping point in file \"%s\".\n", line, file)
73
+ errmsg("Line %d is not a stopping point in file \"%s\".\n", line,
74
+ CommandProcessor.canonic_file(file))
73
75
  return
74
76
  end
75
77
  else
@@ -19,9 +19,10 @@ module Debugger
19
19
  errmsg "Invalid file/line number specification: #{@match[1]}\n"
20
20
  return
21
21
  end
22
- editor = ENV['EDITOR'] || 'ex'
22
+ editor = ENV['EDITOR'] || '/bin/ex'
23
23
  if File.readable?(file)
24
- system("#{editor} +#{line_number} #{file}")
24
+ system("#{editor} +#{line_number} \"#{file}\"")
25
+ msg "Warning: return code was #{$?.exitstatus}" if $?.exitstatus != 0
25
26
  else
26
27
  errmsg "File \"#{file}\" is not readable.\n"
27
28
  end
@@ -305,15 +305,16 @@ item. If \'verbose\' is given then the entire stack frame is shown.'],
305
305
  end
306
306
 
307
307
  print "Program stopped. "
308
+ event_arg = @state.processor.event_arg
308
309
  case @state.context.stop_reason
309
310
  when :step
310
311
  print "It stopped after stepping, next'ing or initial start.\n"
311
312
  when :breakpoint
312
- print("It stopped at a breakpoint.\n")
313
+ print("It stopped at breakpoint %d.\n",
314
+ Debugger.breakpoints.index(event_arg) + 1)
313
315
  when :catchpoint
314
- print("It stopped at a catchpoint.\n")
315
- when :catchpoint
316
- print("It stopped at a catchpoint.\n")
316
+ print("It stopped at catchpoint `%s' (%s) .\n", event_arg,
317
+ event_arg.class)
317
318
  else
318
319
  print "unknown reason: %s\n" % @state.context.stop_reason.to_s
319
320
  end
@@ -3,9 +3,10 @@ require 'irb'
3
3
  module IRB # :nodoc:
4
4
  module ExtendCommand # :nodoc:
5
5
 
6
- # FIXME: should we read these out of a directory to
7
- # make this more user-customizable?
8
6
  # A base command class that resume execution
7
+ #
8
+ # FIXME: should we read these out of a directory to make this more
9
+ # user-customizable?
9
10
  class DebuggerResumeCommand
10
11
  def self.execute(conf, *opts)
11
12
  name =
@@ -90,15 +91,13 @@ module IRB # :nodoc:
90
91
  end
91
92
  end
92
93
 
93
- # Monkeypatch to save the current IRB statement to be run and make the instruction sequence
94
- # "filename" unique. Possibly not needed.
94
+ # Monkeypatch to save the current IRB statement to be run and make the
95
+ # instruction sequence "filename" unique. Possibly not needed.
95
96
  class IRB::Context
97
+ alias_method :_ruby_debug_original_evaluate, :evaluate
96
98
  def evaluate(line, line_no)
97
99
  $rdebug_irb_statements = line
98
- @line_no = line_no
99
- set_last_value(@workspace.evaluate(self, line, irb_path, line_no))
100
- # @workspace.evaluate("_ = IRB.conf[:MAIN_CONTEXT]._")
101
- # @_ = @workspace.evaluate(line, irb_path, line_no)
100
+ _ruby_debug_original_evaluate(line, line_no)
102
101
  end
103
102
  end
104
103
 
@@ -74,7 +74,7 @@ module Debugger
74
74
  if lines
75
75
  b = lines.size - (e - b) if b >= lines.size
76
76
  e = lines.size if lines.size < e
77
- print "[%d, %d] in %s\n", b, e, file
77
+ print "[%d, %d] in %s\n", b, e, CommandProcessor.canonic_file(file)
78
78
  [b, 1].max.upto(e) do |n|
79
79
  if n > 0 && lines[n-1]
80
80
  if n == current
@@ -28,6 +28,8 @@ ruby-debug."],
28
28
  ['debuggertesting', 8, false,
29
29
  "Used when testing the debugger"],
30
30
  ['forcestep', 2, true,
31
+ "Deprecated - same as 'set different'"],
32
+ ['different', 2, true,
31
33
  "Make sure 'next/step' commands always move to a new line"],
32
34
  ['fullpath', 2, true,
33
35
  "Display full file names in frames"],
@@ -65,7 +67,8 @@ set history size -- Set the size of the command history"],
65
67
  print "\"set\" must be followed by the name of an set command:\n"
66
68
  print "List of set subcommands:\n\n"
67
69
  for subcmd in Subcommands do
68
- print "set #{subcmd.name} -- #{subcmd.short_help}\n"
70
+ print "set #{subcmd.name} -- #{subcmd.short_help}\n" unless
71
+ subcmd.name == 'forcestep'
69
72
  end
70
73
  else
71
74
  args = @match[1].split(/[ \t]+/)
@@ -135,7 +138,10 @@ set history size -- Set the size of the command history"],
135
138
  if set_on
136
139
  Command.settings[:basename] = true
137
140
  end
141
+ when /^different$/
142
+ self.class.settings[:force_stepping] = set_on
138
143
  when /^forcestep$/
144
+ print "This setting deprecated. Please use 'set different'.\n"
139
145
  self.class.settings[:force_stepping] = set_on
140
146
  when /^history$/
141
147
  if 2 == args.size
@@ -71,9 +71,12 @@ module Debugger
71
71
  when /^debuggertesting$/
72
72
  on_off = Command.settings[:debuggertesting]
73
73
  return "Currently testing the debugger is #{show_onoff(on_off)}."
74
+ when /^different$/
75
+ on_off = self.class.settings[:force_stepping]
76
+ return "different-line stepping is #{show_onoff(on_off)}."
74
77
  when /^forcestep$/
75
78
  on_off = self.class.settings[:force_stepping]
76
- return "force-stepping is #{show_onoff(on_off)}."
79
+ return "different-line stepping is #{show_onoff(on_off)}."
77
80
  when /^fullpath$/
78
81
  on_off = Command.settings[:full_path]
79
82
  return "Displaying frame's full file names is #{show_onoff(on_off)}."
@@ -166,7 +169,8 @@ ruby-debug."],
166
169
  ['callstyle', 2, "Show paramater style used showing call frames"],
167
170
  ['commands', 2, "Show the history of commands you typed",
168
171
  "You can supply a command number to start with."],
169
- ['forcestep', 1, "Show if sure 'next/step' forces move to a new line"],
172
+ ['different', 2, "Show if 'next/step' forces move to a new line"],
173
+ ['forcestep', 1, "Deprecated. Please use 'different'"],
170
174
  ['fullpath', 2, "Show if full file names are displayed in frames"],
171
175
  ['history', 2, "Generic command for showing command history parameters",
172
176
  "show history filename -- Show the filename in which to record the command history
@@ -200,7 +204,8 @@ show history size -- Show the size of the command history"],
200
204
  print "\"show\" must be followed by the name of an show command:\n"
201
205
  print "List of show subcommands:\n\n"
202
206
  for subcmd in Subcommands do
203
- print "show #{subcmd.name} -- #{subcmd.short_help}\n"
207
+ print "show #{subcmd.name} -- #{subcmd.short_help}\n" unless
208
+ 'forcestep' == subcmd.name
204
209
  end
205
210
  else
206
211
  args = @match[1].split(/[ \t]+/)