From nobody at rubyforge.org Thu Sep 24 16:37:43 2009 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 24 Sep 2009 16:37:43 -0400 (EDT) Subject: [Ruby-debug-commits] [923] trunk: Duplicate class names was masking tests from being run. Message-ID: <20090924203743.F1D323C8030@rubyforge.org> Revision: 923 Author: rockyb Date: 2009-09-24 16:37:43 -0400 (Thu, 24 Sep 2009) Log Message: ----------- Duplicate class names was masking tests from being run. Thanks to Mark Moseley for pointing out the bug. set basename now extends to breakpoint positions to facilitate testing. Modified Paths: -------------- trunk/cli/ruby-debug/commands/breakpoints.rb trunk/cli/ruby-debug/commands/info.rb trunk/test/data/annotate.right trunk/test/data/break_loop_bug.right trunk/test/data/breakpoints.right trunk/test/data/catch.right trunk/test/data/condition.cmd trunk/test/data/condition.right trunk/test/data/display.right trunk/test/data/emacs_basic.right trunk/test/data/finish.right trunk/test/data/info-var.right trunk/test/data/info.right trunk/test/data/method.right trunk/test/data/save.right trunk/test/test-catch.rb trunk/test/test-condition.rb trunk/test/test-raise.rb Modified: trunk/cli/ruby-debug/commands/breakpoints.rb =================================================================== --- trunk/cli/ruby-debug/commands/breakpoints.rb 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/cli/ruby-debug/commands/breakpoints.rb 2009-09-24 20:37:43 UTC (rev 923) @@ -81,6 +81,8 @@ errmsg "We are not in a state we can add breakpoints.\n" return end + brkpt_filename = File.basename(brkpt_filename) if + Command.settings[:basename] b = Debugger.add_breakpoint brkpt_filename, line, expr print "Breakpoint %d file %s, line %s\n", b.id, brkpt_filename, line.to_s unless syntax_valid?(expr) Modified: trunk/cli/ruby-debug/commands/info.rb =================================================================== --- trunk/cli/ruby-debug/commands/info.rb 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/cli/ruby-debug/commands/info.rb 2009-09-24 20:37:43 UTC (rev 923) @@ -142,12 +142,15 @@ end print "Num Enb What\n" brkpts.each do |b| + fname = Command.settings[:basename] ? + File.basename(b.source) : b.source + if b.expr.nil? print "%3d %s at %s:%s\n", - b.id, (b.enabled? ? 'y' : 'n'), b.source, b.pos + b.id, (b.enabled? ? 'y' : 'n'), fname, b.pos else print "%3d %s at %s:%s if %s\n", - b.id, (b.enabled? ? 'y' : 'n'), b.source, b.pos, b.expr + b.id, (b.enabled? ? 'y' : 'n'), fname, b.pos, b.expr end hits = b.hit_count if hits > 0 Modified: trunk/test/data/annotate.right =================================================================== --- trunk/test/data/annotate.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/annotate.right 2009-09-24 20:37:43 UTC (rev 923) @@ -31,10 +31,10 @@ if a > b # # "break" should trigger break annotation # break 10 -Breakpoint 1 file ./gcd.rb, line 10 +Breakpoint 1 file gcd.rb, line 10 breakpoints Num Enb What - 1 y at ./gcd.rb:10 + 1 y at gcd.rb:10  # # "delete" should trigger break annotation # delete 1 @@ -56,10 +56,10 @@  # # "b" should trigger like "break" # b 12 -Breakpoint 2 file ./gcd.rb, line 12 +Breakpoint 2 file gcd.rb, line 12 breakpoints Num Enb What - 2 y at ./gcd.rb:12 + 2 y at gcd.rb:12  # # "display" should trigger display annotation # display 1+2 @@ -78,7 +78,7 @@ stopped breakpoints Num Enb What - 2 y at ./gcd.rb:12 + 2 y at gcd.rb:12  display  @@ -131,7 +131,7 @@ Breakpoint 3 file bogus, line 5 breakpoints Num Enb What - 2 y at ./gcd.rb:12 + 2 y at gcd.rb:12 3 y at bogus:5  display Modified: trunk/test/data/break_loop_bug.right =================================================================== --- trunk/test/data/break_loop_bug.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/break_loop_bug.right 2009-09-24 20:37:43 UTC (rev 923) @@ -3,7 +3,7 @@ # set debuggertesting on Currently testing the debugger is on. # break 2 -Breakpoint 1 file ./bp_loop_issue.rb, line 2 +Breakpoint 1 file bp_loop_issue.rb, line 2 # cont Breakpoint 1 at bp_loop_issue.rb:2 bp_loop_issue.rb:2 Modified: trunk/test/data/breakpoints.right =================================================================== --- trunk/test/data/breakpoints.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/breakpoints.right 2009-09-24 20:37:43 UTC (rev 923) @@ -12,9 +12,9 @@ # set autoeval off autoeval is off. # break 6 -Breakpoint 1 file ./gcd.rb, line 6 +Breakpoint 1 file gcd.rb, line 6 # break 10 -Breakpoint 2 file ./gcd.rb, line 10 +Breakpoint 2 file gcd.rb, line 10 # break 11 *** Line 11 is not a stopping point in file "gcd.rb". # continue @@ -28,9 +28,9 @@ Breakpoint 3 at Object::gcd # info break Num Enb What - 1 y at ./gcd.rb:6 + 1 y at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 3 y at Object:gcd # continue Breakpoint 2 at gcd.rb:10 @@ -47,9 +47,9 @@ def gcd(a, b) # info break Num Enb What - 1 y at ./gcd.rb:6 + 1 y at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time @@ -57,18 +57,18 @@ *** Invalid breakpoint location: foo. # info break Num Enb What - 1 y at ./gcd.rb:6 + 1 y at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time # disable 1 # info break Num Enb What - 1 n at ./gcd.rb:6 + 1 n at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time @@ -76,7 +76,7 @@ # # We should see breakpoint 2 but not 1 # info break Num Enb What - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time Modified: trunk/test/data/catch.right =================================================================== --- trunk/test/data/catch.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/catch.right 2009-09-24 20:37:43 UTC (rev 923) @@ -34,4 +34,5 @@ # where --> #0 Object./ at line pm.rb:5 #1 at line pm.rb:8 +Warning: saved frames may be incomplete; compare with caller(0). # quit Modified: trunk/test/data/condition.cmd =================================================================== --- trunk/test/data/condition.cmd 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/condition.cmd 2009-09-24 20:37:43 UTC (rev 923) @@ -3,6 +3,7 @@ # In order to do this we need to run break, and disable # ******************************************************** set debuggertesting on +set basename on set callstyle last set autoeval off break 6 if a > b Modified: trunk/test/data/condition.right =================================================================== --- trunk/test/data/condition.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/condition.right 2009-09-24 20:37:43 UTC (rev 923) @@ -6,12 +6,14 @@ # # ******************************************************** # set debuggertesting on Currently testing the debugger is on. +# set basename on +basename is on. # set callstyle last Frame call-display style is last. # set autoeval off autoeval is off. # break 6 if a > b -Breakpoint 1 file ./gcd.rb, line 6 +Breakpoint 1 file gcd.rb, line 6 # info break Num Enb What 1 y at gcd.rb:6 if a > b @@ -20,7 +22,7 @@ Num Enb What 1 y at gcd.rb:6 # break 12 -Breakpoint 2 file ./gcd.rb, line 12 +Breakpoint 2 file gcd.rb, line 12 # condition 2 1 == a # # FIXME: should be able to catch error on: # # condition 2 if 1 == a @@ -38,7 +40,7 @@ 1 # # Now test trying to enable an invalid breakpoint # break 6 if a > -Breakpoint 3 file ./gcd.rb, line 6 +Breakpoint 3 file gcd.rb, line 6 *** Expression "a > " syntactically incorrect; breakpoint disabled. # info break Num Enb What Modified: trunk/test/data/display.right =================================================================== --- trunk/test/data/display.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/display.right 2009-09-24 20:37:43 UTC (rev 923) @@ -6,7 +6,7 @@ # set debuggertesting on Currently testing the debugger is on. # b 6 -Breakpoint 1 file ./gcd.rb, line 6 +Breakpoint 1 file gcd.rb, line 6 # c Breakpoint 1 at gcd.rb:6 gcd.rb:6 Modified: trunk/test/data/emacs_basic.right =================================================================== --- trunk/test/data/emacs_basic.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/emacs_basic.right 2009-09-24 20:37:43 UTC (rev 923) @@ -12,9 +12,9 @@ # set autoeval off autoeval is off. # break 6 -Breakpoint 1 file ./gcd.rb, line 6 +Breakpoint 1 file gcd.rb, line 6 # break 10 -Breakpoint 2 file ./gcd.rb, line 10 +Breakpoint 2 file gcd.rb, line 10 # continue Breakpoint 1 at gcd.rb:6 gcd.rb:6 @@ -28,9 +28,9 @@ Breakpoint 3 at Object::gcd # info break Num Enb What - 1 y at ./gcd.rb:6 + 1 y at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 3 y at Object:gcd # continue Breakpoint 2 at gcd.rb:10 @@ -47,9 +47,9 @@ def gcd(a, b) # info break Num Enb What - 1 y at ./gcd.rb:6 + 1 y at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time @@ -57,18 +57,18 @@ *** Invalid breakpoint location: foo. # info break Num Enb What - 1 y at ./gcd.rb:6 + 1 y at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time # disable 1 # info break Num Enb What - 1 n at ./gcd.rb:6 + 1 n at gcd.rb:6 breakpoint already hit 1 time - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time @@ -79,7 +79,7 @@ # # We should see breakpoint 2 but not 1 # info break Num Enb What - 2 y at ./gcd.rb:10 + 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd breakpoint already hit 1 time Modified: trunk/test/data/finish.right =================================================================== --- trunk/test/data/finish.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/finish.right 2009-09-24 20:37:43 UTC (rev 923) @@ -10,7 +10,7 @@ # set autoeval off autoeval is off. # break 6 -Breakpoint 1 file ./gcd.rb, line 6 +Breakpoint 1 file gcd.rb, line 6 # continue Breakpoint 1 at gcd.rb:6 gcd.rb:6 Modified: trunk/test/data/info-var.right =================================================================== --- trunk/test/data/info-var.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/info-var.right 2009-09-24 20:37:43 UTC (rev 923) @@ -21,7 +21,7 @@ self = main x = *Error in evaluation* # break 31 -Breakpoint 1 file ./info-var-bug.rb, line 31 +Breakpoint 1 file info-var-bug.rb, line 31 # # The first time through, we can do inspect. # continue Breakpoint 1 at info-var-bug.rb:31 Modified: trunk/test/data/info.right =================================================================== --- trunk/test/data/info.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/info.right 2009-09-24 20:37:43 UTC (rev 923) @@ -42,22 +42,22 @@ # help info display Expressions to display when program stops. # break 10 -Breakpoint 1 file ./gcd.rb, line 10 +Breakpoint 1 file gcd.rb, line 10 # break 12 -Breakpoint 2 file ./gcd.rb, line 12 +Breakpoint 2 file gcd.rb, line 12 # info break 10 *** No breakpoints found among list given. # info break 1 Num Enb What - 1 y at ./gcd.rb:10 + 1 y at gcd.rb:10 # info break 1 2 Num Enb What - 1 y at ./gcd.rb:10 - 2 y at ./gcd.rb:12 + 1 y at gcd.rb:10 + 2 y at gcd.rb:12 # info break Num Enb What - 1 y at ./gcd.rb:10 - 2 y at ./gcd.rb:12 + 1 y at gcd.rb:10 + 2 y at gcd.rb:12 # info file ./gcd.rb break File ./gcd.rb breakpoint line numbers: Modified: trunk/test/data/method.right =================================================================== --- trunk/test/data/method.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/method.right 2009-09-24 20:37:43 UTC (rev 923) @@ -8,7 +8,7 @@ # set autoeval off autoeval is off. # b 11 -Breakpoint 1 file ./classes.rb, line 11 +Breakpoint 1 file classes.rb, line 11 # c Breakpoint 1 at classes.rb:11 classes.rb:11 Modified: trunk/test/data/save.right =================================================================== --- trunk/test/data/save.right 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/data/save.right 2009-09-24 20:37:43 UTC (rev 923) @@ -34,13 +34,13 @@ No breakpoints. # # Now try saving something interesting # break 10 -Breakpoint 1 file ./gcd.rb, line 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"] +["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 Modified: trunk/test/test-catch.rb =================================================================== --- trunk/test/test-catch.rb 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/test-catch.rb 2009-09-24 20:37:43 UTC (rev 923) @@ -5,7 +5,7 @@ # require 'ruby-debug'; Debugger.start # Test condition command -class TestBreakpoints < Test::Unit::TestCase +class TestCatch < Test::Unit::TestCase @@SRC_DIR = File.dirname(__FILE__) unless defined?(@@SRC_DIR) Modified: trunk/test/test-condition.rb =================================================================== --- trunk/test/test-condition.rb 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/test-condition.rb 2009-09-24 20:37:43 UTC (rev 923) @@ -5,7 +5,7 @@ # require 'ruby-debug'; Debugger.start # Test condition command -class TestBreakpoints < Test::Unit::TestCase +class TestCondition < Test::Unit::TestCase @@SRC_DIR = File.dirname(__FILE__) unless defined?(@@SRC_DIR) Modified: trunk/test/test-raise.rb =================================================================== --- trunk/test/test-raise.rb 2009-04-12 00:42:31 UTC (rev 922) +++ trunk/test/test-raise.rb 2009-09-24 20:37:43 UTC (rev 923) @@ -5,7 +5,7 @@ # require 'ruby-debug'; Debugger.start # Test Debugger.load handles uncaught exceptions in the debugged program. -class TestBreakpoints < Test::Unit::TestCase +class TestRaise < Test::Unit::TestCase @@SRC_DIR = File.dirname(__FILE__) unless defined?(@@SRC_DIR)