[Ruby-debug-commits] [827] trunk: Test line number in "continue" command for validity.

nobody at rubyforge.org nobody at rubyforge.org
Tue Apr 29 09:37:13 EDT 2008


Revision: 827
Author:   rockyb
Date:     2008-04-29 09:37:13 -0400 (Tue, 29 Apr 2008)

Log Message:
-----------
Test line number in "continue" command for validity.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/cli/ruby-debug/commands/breakpoints.rb
    trunk/cli/ruby-debug/commands/continue.rb
    trunk/lib/ChangeLog
    trunk/test/data/frame.cmd
    trunk/test/data/frame.right

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-04-29 09:11:09 UTC (rev 826)
+++ trunk/ChangeLog	2008-04-29 13:37:13 UTC (rev 827)
@@ -1,3 +1,44 @@
+2008-04-29 09:11  Rocky Bernstein
+
+	* cli/ruby-debug/commands/method.rb,
+	  cli/ruby-debug/commands/set.rb,
+	  cli/ruby-debug/commands/variables.rb, test/classes.rb,
+	  test/data/method.cmd, test/data/method.right,
+	  test/data/methodsig.cmd, test/data/methodsig.right,
+	  test/data/setshow.right, test/test-method.rb: Add "method
+	  signature" command to show a method's signature.
+
+2008-04-29 08:23  Rocky Bernstein
+
+	* test/config.yaml: Forgot to add this on last commit.
+
+2008-04-28 16:42  Rocky Bernstein
+
+	* cli/ruby-debug/commands/set.rb, test/data/setshow.cmd,
+	  test/data/setshow.right: Catch errors in improper set callstyle
+	  parameter. Bug #19792
+
+2008-04-28 16:16  Rocky Bernstein
+
+	* ChangeLog, lib/ChangeLog, test/helper.rb: From Martin Krauskopf
+	  via patch #19779
+	  
+	  Allow folks to configure Ruby used for CLI tests in the
+	  test/config.yaml. The defaults are for native Ruby, so nothing
+	  needs
+	  to be done for ruby-debug.
+	  
+	  Developers of interfaces other than cli might override
+	  config.yaml by
+	  customized config.private.yaml which is ignored. So there will be
+	  no
+	  trash in e.g. 'svn st' output when developer customize the Ruby
+	  to be
+	  used.
+	  
+	  Handy for alternative interface implementations using
+	  svn:externals.
+
 2008-04-27 08:28  Rocky Bernstein
 
 	* emacs/rdebug-cmd.el, emacs/rdebug-track.el: Reduce spurious

Modified: trunk/cli/ruby-debug/commands/breakpoints.rb
===================================================================
--- trunk/cli/ruby-debug/commands/breakpoints.rb	2008-04-29 09:11:09 UTC (rev 826)
+++ trunk/cli/ruby-debug/commands/breakpoints.rb	2008-04-29 13:37:13 UTC (rev 827)
@@ -1,5 +1,7 @@
 module Debugger
-  class AddBreakpoint < Command # :nodoc:
+
+  # Implements debugger "break" command.
+  class AddBreakpoint < Command
     self.allow_in_control = true
     
     def regexp
@@ -106,7 +108,8 @@
     end
   end
 
-  class DeleteBreakpointCommand < Command # :nodoc:
+  # Implements debugger "delete" command.
+  class DeleteBreakpointCommand < Command
     self.allow_in_control = true
 
     def regexp

Modified: trunk/cli/ruby-debug/commands/continue.rb
===================================================================
--- trunk/cli/ruby-debug/commands/continue.rb	2008-04-29 09:11:09 UTC (rev 826)
+++ trunk/cli/ruby-debug/commands/continue.rb	2008-04-29 13:37:13 UTC (rev 827)
@@ -1,4 +1,5 @@
 module Debugger
+
   # Implements debugger "continue" command.
   class ContinueCommand < Command
     self.allow_in_post_mortem = false
@@ -8,11 +9,20 @@
     end
 
     def execute
+      unless @state.context
+        errmsg "We are not in a state we can continue.\n"
+        return 
+      end
       if @match[1] && !@state.context.dead?
-        file = File.expand_path(@state.file)
-        line = get_int(@match[1], "Continue", 0, nil, 0)
-        return unless line
-        @state.context.set_breakpoint(file, line)
+        filename = File.expand_path(@state.file)
+        line_number = get_int(@match[1], "Continue", 0, nil, 0)
+        return unless line_number
+        unless LineCache.trace_line_numbers(filename).member?(line_number)
+          errmsg("Line %d is not a stopping point in file \"%s\".\n", 
+                 line_number, filename) 
+          return
+        end
+        @state.context.set_breakpoint(filename, line_number)
       end
       @state.proceed
     end

Modified: trunk/lib/ChangeLog
===================================================================
--- trunk/lib/ChangeLog	2008-04-29 09:11:09 UTC (rev 826)
+++ trunk/lib/ChangeLog	2008-04-29 13:37:13 UTC (rev 827)
@@ -1,3 +1,24 @@
+2008-04-28 16:16  Rocky Bernstein
+
+	* trunk/ChangeLog, ChangeLog, trunk/test/helper.rb: From Martin
+	  Krauskopf via patch #19779
+	  
+	  Allow folks to configure Ruby used for CLI tests in the
+	  test/config.yaml. The defaults are for native Ruby, so nothing
+	  needs
+	  to be done for ruby-debug.
+	  
+	  Developers of interfaces other than cli might override
+	  config.yaml by
+	  customized config.private.yaml which is ignored. So there will be
+	  no
+	  trash in e.g. 'svn st' output when developer customize the Ruby
+	  to be
+	  used.
+	  
+	  Handy for alternative interface implementations using
+	  svn:externals.
+
 2008-04-22 02:49  Rocky Bernstein
 
 	* trunk/doc/ruby-debug.texi, ruby-debug-base.rb: Experiment with

Modified: trunk/test/data/frame.cmd
===================================================================
--- trunk/test/data/frame.cmd	2008-04-29 09:11:09 UTC (rev 826)
+++ trunk/test/data/frame.cmd	2008-04-29 13:37:13 UTC (rev 827)
@@ -3,6 +3,9 @@
 # ***************************************************
 set debuggertesting on
 set callstyle last
+# Invalid line number in continue command
+continue 3
+# This time, for sure!
 continue 6
 where
 up

Modified: trunk/test/data/frame.right
===================================================================
--- trunk/test/data/frame.right	2008-04-29 09:11:09 UTC (rev 826)
+++ trunk/test/data/frame.right	2008-04-29 13:37:13 UTC (rev 827)
@@ -7,6 +7,10 @@
 Currently testing the debugger is on.
 # set callstyle last
 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".
+# # This time, for sure!
 # continue 6
 gcd.rb:6
 if a > b




More information about the Ruby-debug-commits mailing list