From nobody at rubyforge.org Thu May 1 19:16:58 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 1 May 2008 19:16:58 -0400 (EDT) Subject: [Ruby-debug-commits] [830] trunk/doc/ruby-debug.texi: Remove a Texism. Message-ID: <20080501231658.DABFF18585E7@rubyforge.org> Revision: 830 Author: rockyb Date: 2008-05-01 19:16:58 -0400 (Thu, 01 May 2008) Log Message: ----------- Remove a Texism. texinfo does not do or need italic correction. Modified Paths: -------------- trunk/doc/ruby-debug.texi Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-30 20:14:00 UTC (rev 829) +++ trunk/doc/ruby-debug.texi 2008-05-01 23:16:58 UTC (rev 830) @@ -2674,7 +2674,7 @@ If you want instead to terminate the program and debugger entirely, use @code{quit} (@pxref{Quitting the debugger, ,Quitting the debugger}). - at emph{Note:\/} Releases before Ruby version 1.8.7 show the return line + at emph{Note:} Releases before Ruby version 1.8.7 show the return line as the first line of the method. Starting with version 1.8.7, the last line executed will be shown as the return line. @url{http://rubyforge.org/tracker/?func=detail&atid=22040&aid=18749&group_id=426} From nobody at rubyforge.org Mon May 5 14:05:14 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 5 May 2008 14:05:14 -0400 (EDT) Subject: [Ruby-debug-commits] [831] trunk: make test-frame installation independent. Message-ID: <20080505180514.EB6D4185863A@rubyforge.org> Revision: 831 Author: rockyb Date: 2008-05-05 14:05:14 -0400 (Mon, 05 May 2008) Log Message: ----------- make test-frame installation independent. Bug #19931 Modified Paths: -------------- trunk/ChangeLog trunk/lib/ChangeLog trunk/test/data/frame.right trunk/test/test-frame.rb Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-05-01 23:16:58 UTC (rev 830) +++ trunk/ChangeLog 2008-05-05 18:05:14 UTC (rev 831) @@ -1,3 +1,16 @@ +2008-04-29 14:00 Rocky Bernstein + + * cli/ruby-debug/commands/method.rb, doc/ruby-debug.texi, + test/classes.rb, test/data/methodsig.right: Small doc and test + improvements on 'method signature' + +2008-04-29 13:37 Rocky Bernstein + + * ChangeLog, cli/ruby-debug/commands/breakpoints.rb, + cli/ruby-debug/commands/continue.rb, lib/ChangeLog, + test/data/frame.cmd, test/data/frame.right: Test line number in + "continue" command for validity. + 2008-04-29 09:11 Rocky Bernstein * cli/ruby-debug/commands/method.rb, Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-05-01 23:16:58 UTC (rev 830) +++ trunk/lib/ChangeLog 2008-05-05 18:05:14 UTC (rev 831) @@ -1,3 +1,10 @@ +2008-04-29 13:37 Rocky Bernstein + + * trunk/ChangeLog, trunk/cli/ruby-debug/commands/breakpoints.rb, + trunk/cli/ruby-debug/commands/continue.rb, ChangeLog, + trunk/test/data/frame.cmd, trunk/test/data/frame.right: Test line + number in "continue" command for validity. + 2008-04-28 16:16 Rocky Bernstein * trunk/ChangeLog, ChangeLog, trunk/test/helper.rb: From Martin Modified: trunk/test/data/frame.right =================================================================== --- trunk/test/data/frame.right 2008-05-01 23:16:58 UTC (rev 830) +++ trunk/test/data/frame.right 2008-05-05 18:05:14 UTC (rev 831) @@ -9,7 +9,7 @@ Frame call-display style is last. # # Invalid line number in continue command # continue 3 -*** Line 3 is not a stopping point in file "/src/external-cvs/ruby-debug/trunk/test/gcd.rb". +*** Line 3 is not a stopping point in file "gcd.rb". # # This time, for sure! # continue 6 gcd.rb:6 Modified: trunk/test/test-frame.rb =================================================================== --- trunk/test/test-frame.rb 2008-05-01 23:16:58 UTC (rev 830) +++ trunk/test/test-frame.rb 2008-05-05 18:05:14 UTC (rev 831) @@ -1,8 +1,8 @@ #!/usr/bin/env ruby require 'test/unit' -# begin require 'rubygems' rescue LoadError end -# require 'ruby-debug'; Debugger.start +# require 'rubygems' +# require 'ruby-debug'; Debugger.start(:post_mortem => true) # Test frame commands class TestFrame < Test::Unit::TestCase @@ -16,11 +16,19 @@ # Test commands in frame.rb def test_basic testname='frame' + # Ruby 1.8.6 and earlier have a trace-line number bug for return + # statements. + filter = Proc.new{|got_lines, correct_lines| + [got_lines[11], got_lines[11]].flatten.each do |s| + s.sub!(/in file ".*gcd.rb/, 'in file "gcd.rb') + end + } Dir.chdir(@@SRC_DIR) do script = File.join('data', testname + '.cmd') assert_equal(true, run_debugger(testname, - "--script #{script} -- gcd.rb 3 5")) + "--script #{script} -- gcd.rb 3 5", + nil, filter)) end end end From nobody at rubyforge.org Sun May 11 04:38:24 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 11 May 2008 04:38:24 -0400 (EDT) Subject: [Ruby-debug-commits] [832] trunk: Remove stop in debug_load due to Debugger. start getting called twice. Message-ID: <20080511083825.0F9C91858670@rubyforge.org> Revision: 832 Author: rockyb Date: 2008-05-11 04:38:24 -0400 (Sun, 11 May 2008) Log Message: ----------- Remove stop in debug_load due to Debugger.start getting called twice. The fix -- for now -- is to add another parameter to debug_load to indicate not to increment debug_count. We could also make that the default in debug_load as well, but debug_load might be useful in other situations and where control_threads are not relevant (which is why we need to call Debugger.start rather than let debug_load do it). Bug #19930 Modified Paths: -------------- trunk/bin/rdebug trunk/ext/ruby_debug.c trunk/test/data/output.right trunk/test/data/quit.right trunk/test/tdebug.rb Modified: trunk/bin/rdebug =================================================================== --- trunk/bin/rdebug 2008-05-05 18:05:14 UTC (rev 831) +++ trunk/bin/rdebug 2008-05-11 08:38:24 UTC (rev 832) @@ -40,7 +40,7 @@ end $0[0..-1] = d0 end - bt = Debugger.debug_load(Debugger::PROG_SCRIPT, options.stop) + bt = Debugger.debug_load(Debugger::PROG_SCRIPT, options.stop, false) if bt if options.post_mortem Debugger.handle_post_mortem(bt) @@ -281,7 +281,7 @@ end debug_program(options) else - # activate debugger + # Set up trace hook for debugger Debugger.start # start control thread Debugger.start_control(options.host, options.cport) if options.control Modified: trunk/ext/ruby_debug.c =================================================================== --- trunk/ext/ruby_debug.c 2008-05-05 18:05:14 UTC (rev 831) +++ trunk/ext/ruby_debug.c 2008-05-11 08:38:24 UTC (rev 832) @@ -1374,23 +1374,31 @@ /* * call-seq: - * Debugger.debug_load(file, stop = false) -> nil + * Debugger.debug_load(file, stop = false, increment_start = false) -> nil * * Same as Kernel#load but resets current context's frames. - * +stop+ parameter force the debugger to stop at the first line of code in the +file+ + * +stop+ parameter forces the debugger to stop at the first line of code in the +file+ + * +increment_start+ determines if start_count should be incremented. When + * control threads are used, they have to be set up before loading the + * debugger; so here +increment_start+ will be false. * FOR INTERNAL USE ONLY. */ static VALUE debug_debug_load(int argc, VALUE *argv, VALUE self) { - VALUE file, stop, context; + VALUE file, stop, context, increment_start; debug_context_t *debug_context; int state = 0; - if(rb_scan_args(argc, argv, "11", &file, &stop) == 1) - stop = Qfalse; + if(rb_scan_args(argc, argv, "12", &file, &stop, &increment_start) == 1) + { + stop = Qfalse; + increment_start = Qtrue; + } debug_start(self); + if (Qfalse == increment_start) start_count--; + context = debug_current_context(self); Data_Get_Struct(context, debug_context_t, debug_context); debug_context->stack_size = 0; Modified: trunk/test/data/output.right =================================================================== --- trunk/test/data/output.right 2008-05-05 18:05:14 UTC (rev 831) +++ trunk/test/data/output.right 2008-05-11 08:38:24 UTC (rev 832) @@ -29,13 +29,3 @@ # step starting two -stopped -stack ---> #0 debug_program at line tdebug.rb:53 - -variables -self = main - -source tdebug.rb:53 -if bt -# quit Modified: trunk/test/data/quit.right =================================================================== --- trunk/test/data/quit.right 2008-05-05 18:05:14 UTC (rev 831) +++ trunk/test/data/quit.right 2008-05-11 08:38:24 UTC (rev 832) @@ -1,9 +0,0 @@ -tdebug.rb:53 -if bt -# # *************************************************** -# # This tests the quit. -# # *************************************************** -# set debuggertesting on -Currently testing the debugger is on. -# # FIXME need to test --no-quit. -# quit Modified: trunk/test/tdebug.rb =================================================================== --- trunk/test/tdebug.rb 2008-05-05 18:05:14 UTC (rev 831) +++ trunk/test/tdebug.rb 2008-05-11 08:38:24 UTC (rev 832) @@ -49,7 +49,7 @@ end $0[0..-1] = d0 end - bt = Debugger.debug_load(Debugger::PROG_SCRIPT, !options.nostop) + bt = Debugger.debug_load(Debugger::PROG_SCRIPT, !options.nostop, false) if bt if options.post_mortem Debugger.handle_post_mortem(bt) @@ -188,9 +188,12 @@ Debugger.wait_connection = false Debugger.keep_frame_binding = options.frame_bind -# activate debugger +# Add Debugger trace hook. Debugger.start +# start control thread +Debugger.start_control(options.host, options.cport) if options.control + # activate post-mortem Debugger.post_mortem if options.post_mortem @@ -210,10 +213,6 @@ puts output exit $?.exitstatus end -# activate debugger -Debugger.start -# start control thread -Debugger.start_control(options.host, options.cport) if options.control # load initrc script (e.g. .rdebugrc) Debugger.run_init_script(StringIO.new) unless options.nx From nobody at rubyforge.org Sun May 11 05:03:41 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 11 May 2008 05:03:41 -0400 (EDT) Subject: [Ruby-debug-commits] [833] trunk/test: Patch #19934 multi-interpreter patch from Martin Krauskopf Message-ID: <20080511090341.C84EB18585E1@rubyforge.org> Revision: 833 Author: rockyb Date: 2008-05-11 05:03:40 -0400 (Sun, 11 May 2008) Log Message: ----------- Patch #19934 multi-interpreter patch from Martin Krauskopf Modified Paths: -------------- trunk/test/helper.rb trunk/test/test-init.rb Modified: trunk/test/helper.rb =================================================================== --- trunk/test/helper.rb 2008-05-11 08:38:24 UTC (rev 832) +++ trunk/test/helper.rb 2008-05-11 09:03:40 UTC (rev 833) @@ -26,9 +26,7 @@ if old_code cmd = "/bin/sh #{File.join('..', 'runner.sh')} #{args} >#{outfile}" else - ruby = config_load('ruby', true) - params = config_load('ruby_params', true) - cmd = "#{"#{ruby} #{params} "}../rdbg.rb #{args} > #{outfile}" + cmd = "#{"#{load_ruby} #{load_params} "}../rdbg.rb #{args} > #{outfile}" end # puts "'#{cmd}'" output = `#{cmd}` @@ -125,6 +123,17 @@ assert_not_nil(value, "#{key} is set in config.yaml") unless may_be_nil value || default_value end + module_function :config_load + + def load_ruby + config_load('ruby', true) + end + module_function :load_ruby + + def load_params + config_load('ruby_params', true) + end + module_function :load_params end Modified: trunk/test/test-init.rb =================================================================== --- trunk/test/test-init.rb 2008-05-11 08:38:24 UTC (rev 832) +++ trunk/test/test-init.rb 2008-05-11 09:03:40 UTC (rev 833) @@ -1,6 +1,7 @@ #!/usr/bin/env ruby require 'test/unit' require 'rbconfig' +require File.join(File.dirname(__FILE__), 'helper.rb') # begin require 'rubygems' rescue LoadError end # require 'ruby-debug'; Debugger.start @@ -16,7 +17,8 @@ old_columns = ENV['COLUMNS'] ENV['EMACS'] = nil ENV['COLUMNS'] = '120' - IO.popen("./gcd-dbg.rb 5 >#{debugger_output}", 'w') do |pipe| + ruby = "#{TestHelper.load_ruby} #{TestHelper.load_params}" + IO.popen("#{ruby} ./gcd-dbg.rb 5 >#{debugger_output}", 'w') do |pipe| pipe.puts 'p Debugger::PROG_SCRIPT' pipe.puts 'show args' pipe.puts 'quit unconditionally' From nobody at rubyforge.org Sun May 11 11:25:29 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 11 May 2008 11:25:29 -0400 (EDT) Subject: [Ruby-debug-commits] [834] trunk/test/data/raise.right: tdebug.rb got a line shorter. Message-ID: <20080511152530.0B1E21858663@rubyforge.org> Revision: 834 Author: rockyb Date: 2008-05-11 11:25:29 -0400 (Sun, 11 May 2008) Log Message: ----------- tdebug.rb got a line shorter. Modified Paths: -------------- trunk/test/data/raise.right Modified: trunk/test/data/raise.right =================================================================== --- trunk/test/data/raise.right 2008-05-11 09:03:40 UTC (rev 833) +++ trunk/test/data/raise.right 2008-05-11 15:25:29 UTC (rev 834) @@ -19,7 +19,7 @@ ./raise.rb:3 ./tdebug.rb:52:in `debug_load' ./tdebug.rb:52:in `debug_program' - ./tdebug.rb:243 + ./tdebug.rb:242 ../rdbg.rb:23:in `load' ../rdbg.rb:23:in `runner' ../rdbg.rb:32 From nobody at rubyforge.org Sun May 11 23:21:49 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 11 May 2008 23:21:49 -0400 (EDT) Subject: [Ruby-debug-commits] [835] trunk/cli/ruby-debug/commands/irb.rb: Small doc fix. Message-ID: <20080512032150.07298185867E@rubyforge.org> Revision: 835 Author: rockyb Date: 2008-05-11 23:21:49 -0400 (Sun, 11 May 2008) Log Message: ----------- Small doc fix. Modified Paths: -------------- trunk/cli/ruby-debug/commands/irb.rb Modified: trunk/cli/ruby-debug/commands/irb.rb =================================================================== --- trunk/cli/ruby-debug/commands/irb.rb 2008-05-11 15:25:29 UTC (rev 834) +++ trunk/cli/ruby-debug/commands/irb.rb 2008-05-12 03:21:49 UTC (rev 835) @@ -34,8 +34,8 @@ module Debugger - # Implements debugger "help" command. - class IRBCommand < Command # :nodoc: + # Implements debugger "irb" command. + class IRBCommand < Command register_setting_get(:autoirb) do IRBCommand.always_run From nobody at rubyforge.org Thu May 15 12:05:07 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 15 May 2008 12:05:07 -0400 (EDT) Subject: [Ruby-debug-commits] [836] trunk: Handle "catch nnn off" Forgotten there during r656. Message-ID: <20080515160507.5D74118585D7@rubyforge.org> Revision: 836 Author: rockyb Date: 2008-05-15 12:05:06 -0400 (Thu, 15 May 2008) Log Message: ----------- Handle "catch nnn off" Forgotten there during r656. >From mkrauskopf [#20156]. Modified Paths: -------------- trunk/ChangeLog trunk/cli/ruby-debug/commands/catchpoint.rb trunk/lib/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-05-12 03:21:49 UTC (rev 835) +++ trunk/ChangeLog 2008-05-15 16:05:06 UTC (rev 836) @@ -1,3 +1,48 @@ +2008-05-12 03:21 Rocky Bernstein + + * cli/ruby-debug/commands/irb.rb: Small doc fix. + +2008-05-11 15:25 Rocky Bernstein + + * test/data/raise.right: tdebug.rb got a line shorter. + +2008-05-11 09:03 Rocky Bernstein + + * test/helper.rb, test/test-init.rb: Patch #19934 multi-interpreter + patch from Martin Krauskopf + +2008-05-11 08:38 Rocky Bernstein + + * bin/rdebug, ext/ruby_debug.c, test/data/output.right, + test/data/quit.right, test/tdebug.rb: Remove stop in debug_load + due to Debugger.start getting called twice. + The fix -- for now -- is to add another parameter to debug_load + to + indicate not to increment debug_count. We could also make that + the + default in debug_load as well, but debug_load might be useful in + other + situations and where control_threads are not relevant (which is + why we + need to call Debugger.start rather than let debug_load do it). + + Bug #19930 + +2008-05-05 18:05 Rocky Bernstein + + * ChangeLog, lib/ChangeLog, test/data/frame.right, + test/test-frame.rb: make test-frame installation independent. Bug + #19931 + +2008-05-01 23:16 Rocky Bernstein + + * doc/ruby-debug.texi: Remove a Texism. texinfo does not do or need + italic correction. + +2008-04-30 20:14 Rocky Bernstein + + * doc/ruby-debug.texi: Fix doc for binding_n(). + 2008-04-29 14:00 Rocky Bernstein * cli/ruby-debug/commands/method.rb, doc/ruby-debug.texi, Modified: trunk/cli/ruby-debug/commands/catchpoint.rb =================================================================== --- trunk/cli/ruby-debug/commands/catchpoint.rb 2008-05-12 03:21:49 UTC (rev 835) +++ trunk/cli/ruby-debug/commands/catchpoint.rb 2008-05-15 16:05:06 UTC (rev 836) @@ -8,17 +8,12 @@ def execute if excn = @match[1] - if excn == 'off' - Debugger.catchpoint = nil - print "Clear catchpoint.\n" - else binding = @state.context ? get_binding : TOPLEVEL_BINDING unless debug_eval("#{excn}.is_a?(Class)", binding) print "Warning #{excn} is not known to be a Class\n" end Debugger.add_catchpoint(excn) print "Catch exception %s.\n", excn - end else info_catch end Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-05-12 03:21:49 UTC (rev 835) +++ trunk/lib/ChangeLog 2008-05-15 16:05:06 UTC (rev 836) @@ -1,3 +1,9 @@ +2008-05-05 18:05 Rocky Bernstein + + * trunk/ChangeLog, ChangeLog, trunk/test/data/frame.right, + trunk/test/test-frame.rb: make test-frame installation + independent. Bug #19931 + 2008-04-29 13:37 Rocky Bernstein * trunk/ChangeLog, trunk/cli/ruby-debug/commands/breakpoints.rb, From nobody at rubyforge.org Thu May 15 13:52:34 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 15 May 2008 13:52:34 -0400 (EDT) Subject: [Ruby-debug-commits] [837] trunk: Regression test for recent "catch nn off" error. Message-ID: <20080515175235.0DF6E18585C0@rubyforge.org> Revision: 837 Author: rockyb Date: 2008-05-15 13:52:34 -0400 (Thu, 15 May 2008) Log Message: ----------- Regression test for recent "catch nn off" error. Again from Martin Krauskopf Modified Paths: -------------- trunk/Rakefile Added Paths: ----------- trunk/test/cli/ trunk/test/cli/commands/ trunk/test/cli/commands/catchpoint_test.rb Modified: trunk/Rakefile =================================================================== --- trunk/Rakefile 2008-05-15 16:05:06 UTC (rev 836) +++ trunk/Rakefile 2008-05-15 17:52:34 UTC (rev 837) @@ -20,7 +20,7 @@ 'Rakefile', ] -CLI_TEST_FILE_LIST = 'test/test-*.rb' +CLI_TEST_FILE_LIST = FileList['test/test-*.rb', 'test/cli/**/*_test.rb'] CLI_FILES = COMMON_FILES + FileList[ "cli/**/*", 'ChangeLog', @@ -30,7 +30,7 @@ 'test/**/data/*.right', 'test/**/*.rb', 'rdbg.rb', - CLI_TEST_FILE_LIST, + CLI_TEST_FILE_LIST ] BASE_TEST_FILE_LIST = %w( @@ -48,16 +48,16 @@ ] desc "Test everything." -test_task = task :test => [:lib, :test_base] do +task :test => :test_base do Rake::TestTask.new(:test) do |t| t.libs << ['./ext', './lib', './cli'] - t.pattern = CLI_TEST_FILE_LIST + t.test_files = CLI_TEST_FILE_LIST t.verbose = true end end desc "Test ruby-debug-base." -test_task = task :test_base => :lib do +task :test_base => :lib do Rake::TestTask.new(:test_base) do |t| t.libs << ['./ext', './lib'] t.test_files = FileList[BASE_TEST_FILE_LIST] @@ -198,7 +198,7 @@ # Get ruby-debug path. ruby_debug_path = File.expand_path(File.dirname(__FILE__)) - publisher = Rake::SshDirPublisher.new("kent at rubyforge.org", + Rake::SshDirPublisher.new("kent at rubyforge.org", "/var/www/gforge-projects/ruby-debug", ruby_debug_path) end Added: trunk/test/cli/commands/catchpoint_test.rb =================================================================== --- trunk/test/cli/commands/catchpoint_test.rb (rev 0) +++ trunk/test/cli/commands/catchpoint_test.rb 2008-05-15 17:52:34 UTC (rev 837) @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby + +require 'test/unit' + +BASE_DIR = File.join(File.dirname(__FILE__), '..', '..', '..') + +%w(ext lib cli).each do |dir| + $: << File.join(BASE_DIR, dir) +end + +require File.join(BASE_DIR, 'cli', 'ruby-debug') + +class TestCatchCommand < Test::Unit::TestCase + + class MockState + attr_accessor :message + def context; end + def print(*args) + @message = *args + end + end + + # regression test for bug #20156 + def test_catch_does_not_blow_up + state = MockState.new + catch_cmd = Debugger::CatchCommand.new(state) + assert(catch_cmd.match('catch off')) + catch(:debug_error) do + catch_cmd.execute + end + assert_equal("NameError Exception: undefined local variable or method `off' for main:Object\n", state.message) + end + +end From nobody at rubyforge.org Thu May 15 14:06:22 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 15 May 2008 14:06:22 -0400 (EDT) Subject: [Ruby-debug-commits] [838] trunk/test: Ignore config.private.yaml which folks may use/ customize to omit tests Message-ID: <20080515180622.B5CFB18585D7@rubyforge.org> Revision: 838 Author: rockyb Date: 2008-05-15 14:06:22 -0400 (Thu, 15 May 2008) Log Message: ----------- Ignore config.private.yaml which folks may use/customize to omit tests Added Paths: ----------- trunk/test/.cvsignore Property Changed: ---------------- trunk/test/ Property changes on: trunk/test ___________________________________________________________________ Name: svn:ignore + config.private.yaml Added: trunk/test/.cvsignore =================================================================== --- trunk/test/.cvsignore (rev 0) +++ trunk/test/.cvsignore 2008-05-15 18:06:22 UTC (rev 838) @@ -0,0 +1 @@ +config.private.yaml From nobody at rubyforge.org Sat May 17 07:35:55 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sat, 17 May 2008 07:35:55 -0400 (EDT) Subject: [Ruby-debug-commits] [839] trunk/doc: e.g. Message-ID: <20080517113555.E82431858647@rubyforge.org> Revision: 839 Author: rockyb Date: 2008-05-17 07:35:55 -0400 (Sat, 17 May 2008) Log Message: ----------- e.g. -> e.g.@: Modified Paths: -------------- trunk/doc/rdebug-emacs.texi trunk/doc/ruby-debug.texi Modified: trunk/doc/rdebug-emacs.texi =================================================================== --- trunk/doc/rdebug-emacs.texi 2008-05-15 18:06:22 UTC (rev 838) +++ trunk/doc/rdebug-emacs.texi 2008-05-17 11:35:55 UTC (rev 839) @@ -641,7 +641,7 @@ C-l} is an alternate binding which also can be used in the source script. @item C-c a -Shows argument variables (e.g. @code{$1}, @code{$2}) of the current +Shows argument variables (e.g.@: @code{$1}, @code{$2}) of the current stack frame. Same as @value{DBG} @code{info args} command. The @value{Emacs} command name is @code{gud-args} and @code{C-x C-a a} is an alternate binding which also can be used in the source script. @@ -777,7 +777,7 @@ @item C-x C-a a @code{gud-args} -Shows argument variables (e.g. @code{$1}, @code{$2}) of the current +Shows argument variables (e.g.@: @code{$1}, @code{$2}) of the current stack frame. Same as @value{DBG} @code{info args} command. The @value{Emacs} command name is @code{gud-args}. In the corresponding I/O buffer, @code{C-c a} is an alternate binding which also can be Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-05-15 18:06:22 UTC (rev 838) +++ trunk/doc/ruby-debug.texi 2008-05-17 11:35:55 UTC (rev 839) @@ -200,7 +200,7 @@ @ref{rdebug command-line options} for a full list of command options. Position information consists of a filename and line number, -e.g. @code{triangle.rb:4}. We are currently stopped before the first +e.g.@: @code{triangle.rb:4}. We are currently stopped before the first executable line of the program; this is line 4 of @code{triangle.rb}. If you are used to less dynamic languages and have used debuggers for more statically compiled languages like C, C++, or @@ -954,7 +954,7 @@ class name. @node Bouncing Around in Blocks (e.g. Iterators) - at subsection Bouncing Around in Blocks (e.g. Iterators) + at subsection Bouncing Around in Blocks (e.g.@: Iterators) When debugging languages with coroutines like Python and Ruby, a method call may not necessarily go to the first statement after the @@ -1041,7 +1041,7 @@ @node Lines You Can Stop At @subsection Lines You Can Stop At -As with the duplicate stops per control (e.g. @code{if} statement), +As with the duplicate stops per control (e.g.@: @code{if} statement), until tools like debuggers get more traction among core ruby developers there are going to be weirdness. Here we describe the stopping locations which effects the breakpoint line numbers you can @@ -2667,7 +2667,7 @@ Execute until selected stack frame returns. If no frame number is given, we run until the currently selected frame returns. The currently selected frame starts out the most-recent frame or 0 if no -frame positioning (e.g @code{up}, @code{down} or @code{frame}) has +frame positioning (e.g@: @code{up}, @code{down} or @code{frame}) has been performed. If a frame number is given we run until @var{frame} frames returns. From nobody at rubyforge.org Sat May 17 18:11:18 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sat, 17 May 2008 18:11:18 -0400 (EDT) Subject: [Ruby-debug-commits] [840] trunk/cli/ruby-debug/commands/save.rb: Wording a little closer to gdb 's ; -) Message-ID: <20080517221118.6054018585F3@rubyforge.org> Revision: 840 Author: rockyb Date: 2008-05-17 18:11:18 -0400 (Sat, 17 May 2008) Log Message: ----------- Wording a little closer to gdb's ;-) Modified Paths: -------------- trunk/cli/ruby-debug/commands/save.rb Modified: trunk/cli/ruby-debug/commands/save.rb =================================================================== --- trunk/cli/ruby-debug/commands/save.rb 2008-05-17 11:35:55 UTC (rev 839) +++ trunk/cli/ruby-debug/commands/save.rb 2008-05-17 22:11:18 UTC (rev 840) @@ -72,7 +72,8 @@ %{ save FILE\tsaves current debugger state to FILE as a script file. This includes breakpoints, catchpoint, display expressions and some - settings. + settings. + Use the 'source' command in another debug session to restore them. } end end From nobody at rubyforge.org Tue May 20 03:20:59 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 20 May 2008 03:20:59 -0400 (EDT) Subject: [Ruby-debug-commits] [841] trunk/doc: Use a straight quote in the typewriter font. Message-ID: <20080520072059.EC8151858679@rubyforge.org> Revision: 841 Author: rockyb Date: 2008-05-20 03:20:59 -0400 (Tue, 20 May 2008) Log Message: ----------- Use a straight quote in the typewriter font. Modified Paths: -------------- trunk/doc/rdebug-emacs.texi trunk/doc/ruby-debug.texi Modified: trunk/doc/rdebug-emacs.texi =================================================================== --- trunk/doc/rdebug-emacs.texi 2008-05-17 22:11:18 UTC (rev 840) +++ trunk/doc/rdebug-emacs.texi 2008-05-20 07:20:59 UTC (rev 841) @@ -10,6 +10,12 @@ @include version-rdebug-emacs.texi @finalout + at c Karl Berry informs me that this will add straight quotes in + at c typewriter text. + at c See the "Inserting Quote Characters" node in the Texinfo manual + at set txicodequoteundirected + at set txicodequotebacktick + @c THIS MANUAL REQUIRES TEXINFO 4.0 OR LATER. @c This is a dir.info fragment to support semi-automated addition of Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-05-17 22:11:18 UTC (rev 840) +++ trunk/doc/ruby-debug.texi 2008-05-20 07:20:59 UTC (rev 841) @@ -6,8 +6,19 @@ @set ttDBG @code{@value{DBG}} @set Emacs @sc{gnu} Emacs + at c Karl Berry informs me that this will add straight quotes in + at c typewriter text. + at c See the "Inserting Quote Characters" node in the Texinfo manual + at set txicodequoteundirected + at set txicodequotebacktick @set RDEBUG_VERSION 0.10.2 + at c Karl Berry informs me that this will add straight quotes in + at c typewriter text. + at c See the "Inserting Quote Characters" node in the Texinfo manual + at set txicodequoteundirected + at set txicodequotebacktick + @macro Example {} @iftex @cartouche From nobody at rubyforge.org Thu May 22 21:04:12 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 22 May 2008 21:04:12 -0400 (EDT) Subject: [Ruby-debug-commits] [842] trunk: Lots of bogosity fixed in catchpoint handling. Message-ID: <20080523010412.5042618585CB@rubyforge.org> Revision: 842 Author: rockyb Date: 2008-05-22 21:04:11 -0400 (Thu, 22 May 2008) Log Message: ----------- Lots of bogosity fixed in catchpoint handling. Added "catch xxx off". Confirm when deleting all catchpoints. Correct C rdoc. #20237 Modified Paths: -------------- trunk/cli/ruby-debug/commands/catchpoint.rb trunk/cli/ruby-debug/commands/info.rb trunk/ext/breakpoint.c trunk/test/cli/commands/catchpoint_test.rb Added Paths: ----------- trunk/test/data/catch.cmd trunk/test/data/catch.right trunk/test/test-catch.rb Modified: trunk/cli/ruby-debug/commands/catchpoint.rb =================================================================== --- trunk/cli/ruby-debug/commands/catchpoint.rb 2008-05-20 07:20:59 UTC (rev 841) +++ trunk/cli/ruby-debug/commands/catchpoint.rb 2008-05-23 01:04:11 UTC (rev 842) @@ -3,19 +3,36 @@ self.allow_in_control = true def regexp - /^\s* cat(?:ch)? (?:\s+(.+))? $/x + /^\s* cat(?:ch)? + (?:\s+ (\S+))? + (?:\s+ (off))? \s* $/ix end def execute - if excn = @match[1] + excn = @match[1] + if not excn + # No args given. + info_catch + elsif not @match[2] + # One arg given. + if 'off' == excn + Debugger.catchpoints.clear if + confirm("Delete all catchpoints? (y or n) ") + else binding = @state.context ? get_binding : TOPLEVEL_BINDING unless debug_eval("#{excn}.is_a?(Class)", binding) print "Warning #{excn} is not known to be a Class\n" end Debugger.add_catchpoint(excn) print "Catch exception %s.\n", excn + end + elsif @match[2] != 'off' + errmsg "Off expected. Got %s\n", @match[2] + elsif Debugger.catchpoints.member?(excn) + Debugger.catchpoints.delete(excn) + print "Catch for exception %s removed.\n", excn else - info_catch + errmsg "Catch for exception %s not found.\n", excn end end Modified: trunk/cli/ruby-debug/commands/info.rb =================================================================== --- trunk/cli/ruby-debug/commands/info.rb 2008-05-20 07:20:59 UTC (rev 841) +++ trunk/cli/ruby-debug/commands/info.rb 2008-05-23 01:04:11 UTC (rev 842) @@ -5,15 +5,15 @@ print "No frame selected.\n" return end - if Debugger.catchpoints.empty? - print "No exceptions set to be caught.\n" - else + if Debugger.catchpoints and not Debugger.catchpoints.empty? # FIXME: show whether Exception is valid or not # print "Exception: is_a?(Class)\n" Debugger.catchpoints.each do |exception, hits| # print "#{exception}: #{exception.is_a?(Class)}\n" print "#{exception}\n" end + else + print "No exceptions set to be caught.\n" end end end Modified: trunk/ext/breakpoint.c =================================================================== --- trunk/ext/breakpoint.c 2008-05-20 07:20:59 UTC (rev 841) +++ trunk/ext/breakpoint.c 2008-05-23 01:04:11 UTC (rev 842) @@ -1,7 +1,7 @@ #include "ruby_debug.h" VALUE rdebug_breakpoints = Qnil; -VALUE rdebug_catchpoints = Qnil; +VALUE rdebug_catchpoints; static VALUE cBreakpoint; static ID idEval; @@ -219,7 +219,7 @@ /* * call-seq: - * Debugger.catchpoints -> string + * Debugger.catchpoints -> hash * * Returns a current catchpoints, which is a hash exception names that will * trigger a debugger when raised. The values are the number of times taht @@ -235,23 +235,19 @@ /* * call-seq: - * Debugger.checkpoint = string -> string + * Debugger.catchpoint(string) -> string * - * Sets catchpoint. + * Sets catchpoint. Returns the string passed. */ VALUE rdebug_add_catchpoint(VALUE self, VALUE value) { debug_check_started(); - if (!NIL_P(value) && TYPE(value) != T_STRING) { - rb_raise(rb_eTypeError, "value of chatchpoint must be String"); + if (TYPE(value) != T_STRING) { + rb_raise(rb_eTypeError, "value of a catchpoint must be String"); } - if(NIL_P(value)) - rdebug_catchpoints = Qnil; - else - rb_hash_aset(rdebug_catchpoints, rb_str_dup(value), - INT2FIX(0)); + rb_hash_aset(rdebug_catchpoints, rb_str_dup(value), INT2FIX(0)); return value; } @@ -575,7 +571,9 @@ rb_define_method(cBreakpoint, "pos=", breakpoint_set_pos, 1); rb_define_method(cBreakpoint, "source", breakpoint_source, 0); rb_define_method(cBreakpoint, "source=", breakpoint_set_source, 1); - idEval = rb_intern("eval"); + idEval = rb_intern("eval"); + rdebug_catchpoints = rb_hash_new(); + } Modified: trunk/test/cli/commands/catchpoint_test.rb =================================================================== --- trunk/test/cli/commands/catchpoint_test.rb 2008-05-20 07:20:59 UTC (rev 841) +++ trunk/test/cli/commands/catchpoint_test.rb 2008-05-23 01:04:11 UTC (rev 842) @@ -15,6 +15,7 @@ class MockState attr_accessor :message def context; end + def confirm(msg); true end def print(*args) @message = *args end @@ -28,7 +29,7 @@ catch(:debug_error) do catch_cmd.execute end - assert_equal("NameError Exception: undefined local variable or method `off' for main:Object\n", state.message) + assert_equal(nil, state.message) end end Added: trunk/test/data/catch.cmd =================================================================== --- trunk/test/data/catch.cmd (rev 0) +++ trunk/test/data/catch.cmd 2008-05-23 01:04:11 UTC (rev 842) @@ -0,0 +1,17 @@ +# *************************************************** +# Test catch +# *************************************************** +set debuggertesting on +set autoeval off +set basename on +info catch +catch ZeroDivisionError off +catch ZeroDivisionError off afdasdf +catch ZeroDivisionError +info catch +catch ZeroDivisionError off +info catch +catch ZeroDivisionError +c +where +quit Added: trunk/test/data/catch.right =================================================================== --- trunk/test/data/catch.right (rev 0) +++ trunk/test/data/catch.right 2008-05-23 01:04:11 UTC (rev 842) @@ -0,0 +1,37 @@ +pm.rb:3 +def zero_div +# # *************************************************** +# # Test catch +# # *************************************************** +# set debuggertesting on +Currently testing the debugger is on. +# set autoeval off +autoeval is off. +# set basename on +basename is on. +# info catch +No exceptions set to be caught. +# catch ZeroDivisionError off +*** Catch for exception ZeroDivisionError not found. +# catch ZeroDivisionError off afdasdf +*** Unknown command: "catch ZeroDivisionError off afdasdf". Try "help". +# catch ZeroDivisionError +Catch exception ZeroDivisionError. +# info catch +ZeroDivisionError +# catch ZeroDivisionError off +Catch for exception ZeroDivisionError removed. +# info catch +No exceptions set to be caught. +# catch ZeroDivisionError +Catch exception ZeroDivisionError. +# c +Catchpoint at pm.rb:5: `divided by 0' (ZeroDivisionError) + from ../rdbg.rb:23:in `runner' + from ../rdbg.rb:32 +pm.rb:5 +1/0 +# where +--> #0 Object./ at line pm.rb:5 + #1 at line pm.rb:8 +# quit Added: trunk/test/test-catch.rb =================================================================== --- trunk/test/test-catch.rb (rev 0) +++ trunk/test/test-catch.rb 2008-05-23 01:04:11 UTC (rev 842) @@ -0,0 +1,25 @@ +#!/usr/bin/env ruby +require 'test/unit' + +# begin require 'rubygems' rescue LoadError end +# require 'ruby-debug'; Debugger.start + +# Test condition command +class TestBreakpoints < Test::Unit::TestCase + + @@SRC_DIR = File.dirname(__FILE__) unless + defined?(@@SRC_DIR) + + require File.join(@@SRC_DIR, 'helper') + include TestHelper + + def test_basic + testname='catch' + Dir.chdir(@@SRC_DIR) do + script = File.join('data', testname + '.cmd') + assert_equal(true, + run_debugger(testname, + "--script #{script} -- pm.rb")) + end + end +end Property changes on: trunk/test/test-catch.rb ___________________________________________________________________ Name: svn:executable + * From nobody at rubyforge.org Fri May 23 10:57:40 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Fri, 23 May 2008 10:57:40 -0400 (EDT) Subject: [Ruby-debug-commits] [843] trunk/cli/ruby-debug/commands/save.rb: Catchpoints have changed. Message-ID: <20080523145740.B57FF18585F5@rubyforge.org> Revision: 843 Author: rockyb Date: 2008-05-23 10:57:40 -0400 (Fri, 23 May 2008) Log Message: ----------- Catchpoints have changed. Fix bug in saving them. Modified Paths: -------------- trunk/cli/ruby-debug/commands/save.rb Modified: trunk/cli/ruby-debug/commands/save.rb =================================================================== --- trunk/cli/ruby-debug/commands/save.rb 2008-05-23 01:04:11 UTC (rev 842) +++ trunk/cli/ruby-debug/commands/save.rb 2008-05-23 14:57:40 UTC (rev 843) @@ -20,7 +20,9 @@ Debugger.breakpoints.each do |b| file.puts "break #{b.source}:#{b.pos}#{" if #{b.expr}" if b.expr}" end - file.puts "catch #{Debugger.catchpoint}" if Debugger.catchpoint + Debugger.catchpoints.keys.each do |c| + file.puts "catch #{c}" + end end def save_displays(file) @@ -70,11 +72,12 @@ def help(cmd) %{ - save FILE\tsaves current debugger state to FILE as a script file. - This includes breakpoints, catchpoint, display expressions and some - settings. - Use the 'source' command in another debug session to restore them. - } +save [FILE] +Saves current debugger state to FILE as a script file. +This includes breakpoints, catchpoints, display expressions and some settings. +If no filename is given, we will fabricate one. + +Use the 'source' command in another debug session to restore them.} end end end From nobody at rubyforge.org Mon May 26 23:54:30 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 26 May 2008 23:54:30 -0400 (EDT) Subject: [Ruby-debug-commits] [845] trunk: Add save test. Message-ID: <20080527035430.5501A1858572@rubyforge.org> Revision: 845 Author: rockyb Date: 2008-05-26 23:54:29 -0400 (Mon, 26 May 2008) Log Message: ----------- Add save test. save.rb: use pretty-printed regexp. Interface, for now add restart_file accessor like the others. The processor interface need revision though. Modified Paths: -------------- trunk/cli/ruby-debug/commands/save.rb trunk/cli/ruby-debug/interface.rb Added Paths: ----------- trunk/test/data/save.cmd trunk/test/data/save.right trunk/test/test-save.rb Modified: trunk/cli/ruby-debug/commands/save.rb =================================================================== --- trunk/cli/ruby-debug/commands/save.rb 2008-05-24 01:27:15 UTC (rev 844) +++ trunk/cli/ruby-debug/commands/save.rb 2008-05-27 03:54:29 UTC (rev 845) @@ -20,6 +20,9 @@ Debugger.breakpoints.each do |b| file.puts "break #{b.source}:#{b.pos}#{" if #{b.expr}" if b.expr}" end + end + + def save_catchpoints(file) Debugger.catchpoints.keys.each do |c| file.puts "catch #{c}" end @@ -46,7 +49,9 @@ end def regexp - /^\s*sa(?:ve)?(?:\s+(.+))?$/ + /^\s* sa(?:ve)? + (?:\s+(.+))? + \s*$/ix end def execute @@ -56,6 +61,7 @@ file = open(@match[1], 'w') end save_breakpoints(file) + save_catchpoints(file) # save_displays(file) save_settings(file) print "Saved to '#{file.path}'\n" Modified: trunk/cli/ruby-debug/interface.rb =================================================================== --- trunk/cli/ruby-debug/interface.rb 2008-05-24 01:27:15 UTC (rev 844) +++ trunk/cli/ruby-debug/interface.rb 2008-05-27 03:54:29 UTC (rev 845) @@ -187,6 +187,7 @@ attr_accessor :histfile attr_accessor :history_save attr_accessor :history_length + attr_accessor :restart_file def initialize(file, out, verbose=false) super() @command_queue = [] Added: trunk/test/data/save.cmd =================================================================== --- trunk/test/data/save.cmd (rev 0) +++ trunk/test/data/save.cmd 2008-05-27 03:54:29 UTC (rev 845) @@ -0,0 +1,33 @@ +# This tests the functioning of some set/show debugger commands +set debuggertesting on +### ******************************* +### *** save/source commands *** +### ******************************* +######################################## +### test args and baseneme... +######################################## +set basename off +set autoeval off +# Should have nothing set +info break +info catch +# Should save nothing +save temp +eval File.open("temp").readlines +# Should read in nothing +source temp +info break +# Now try saving something interesting +break 10 +catch RuntimeError +save temp +eval File.open("temp").readlines +# FIXME: The below is broken +## Change parameters above +## catch RuntimeError off +## info catch +##set listsize 55 +source temp +##info break +##info catch +##show listsize Added: trunk/test/data/save.right =================================================================== --- trunk/test/data/save.right (rev 0) +++ trunk/test/data/save.right 2008-05-27 03:54:29 UTC (rev 845) @@ -0,0 +1,59 @@ +gcd.rb:4 +def gcd(a, b) +# # This tests the functioning of some set/show debugger commands +# set debuggertesting on +Currently testing the debugger is on. +# ### ******************************* +# ### *** save/source commands *** +# ### ******************************* +# ######################################## +# ### test args and baseneme... +# ######################################## +# set basename off +basename is off. +# set autoeval off +autoeval is off. +# # Should have nothing set +# info break +No breakpoints. +# info catch +No exceptions set to be caught. +# # Should save nothing +# save temp +Saved to 'temp' +# eval File.open("temp").readlines +["set autoeval off\n", "set basename off\n", "set debuggertesting on\n", "set autolist off\n", "set autoirb off\n"] +# # Should read in nothing +# source temp +autoeval is off. +basename is off. +Currently testing the debugger is on. +autolist is off. +autoirb is off. +# info break +No breakpoints. +# # Now try saving something interesting +# break 10 +Breakpoint 1 file ./gcd.rb, line 10 +# catch RuntimeError +Catch exception RuntimeError. +# save temp +Saved to 'temp' +# eval File.open("temp").readlines +["break gcd.rb:10\n", "catch RuntimeError\n", "set autoeval off\n", "set basename on\n", "set debuggertesting on\n", "set autolist off\n", "set autoirb off\n"] +# # FIXME: The below is broken +# ## Change parameters above +# ## catch RuntimeError off +# ## info catch +# ##set listsize 55 +# source temp +Breakpoint 2 file gcd.rb, line 10 +Catch exception RuntimeError. +autoeval is off. +basename is on. +Currently testing the debugger is on. +autolist is off. +autoirb is off. +# ##info break +# ##info catch +# ##show listsize Added: trunk/test/test-save.rb =================================================================== --- trunk/test/test-save.rb (rev 0) +++ trunk/test/test-save.rb 2008-05-27 03:54:29 UTC (rev 845) @@ -0,0 +1,25 @@ +#!/usr/bin/env ruby +require 'test/unit' + +# require 'rubygems' +# require 'ruby-debug'; Debugger.start(:post_mortem =>true) + +class TestSave < Test::Unit::TestCase + + @@SRC_DIR = File.dirname(__FILE__) unless + defined?(@@SRC_DIR) + + require File.join(@@SRC_DIR, 'helper') + include TestHelper + + # Test initial variables and setting/getting state. + def test_basic + testname='save' + Dir.chdir(@@SRC_DIR) do + script = File.join('data', testname + '.cmd') + assert_equal(true, + run_debugger(testname, + "--script #{script} -- gcd.rb 3 5")) + end + end +end Property changes on: trunk/test/test-save.rb ___________________________________________________________________ Name: svn:executable + *