From nobody at rubyforge.org Tue Apr 1 20:27:48 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 1 Apr 2008 20:27:48 -0400 (EDT) Subject: [Ruby-debug-commits] [785] trunk/emacs: Short-key mode is turning itself on rather than off sometimes. Message-ID: <20080402002748.C015718586E3@rubyforge.org> Revision: 785 Author: rockyb Date: 2008-04-01 20:27:48 -0400 (Tue, 01 Apr 2008) Log Message: ----------- Short-key mode is turning itself on rather than off sometimes. More control over trying to get rid of it when desired. Modified Paths: -------------- trunk/emacs/rdebug-core.el trunk/emacs/rdebug-shortkey.el Modified: trunk/emacs/rdebug-core.el =================================================================== --- trunk/emacs/rdebug-core.el 2008-03-30 03:01:39 UTC (rev 784) +++ trunk/emacs/rdebug-core.el 2008-04-02 00:27:48 UTC (rev 785) @@ -310,9 +310,7 @@ (not (eq (process-status process) 'run))) (rdebug-internal-short-key-mode-off) (rdebug-set-window-configuration-state 'original) - ;; This unbinds the special debugger keys of the source buffers. - (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist) - rdebug-debugger-support-minor-mode-map-when-deactive)))) + (rdebug-reset-keymaps)))) ;; Perform initializations common to all debuggers. @@ -475,6 +473,13 @@ (delete-window w))) (kill-buffer buffer)))) +(defun rdebug-reset-keymaps() + "This unbinds the special debugger keys of the source buffers." + (interactive) + (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist) + rdebug-debugger-support-minor-mode-map-when-deactive)) + + (defun rdebug-customize () "Use `customize' to edit the settings of the `rdebug' debugger." (interactive) Modified: trunk/emacs/rdebug-shortkey.el =================================================================== --- trunk/emacs/rdebug-shortkey.el 2008-03-30 03:01:39 UTC (rev 784) +++ trunk/emacs/rdebug-shortkey.el 2008-04-02 00:27:48 UTC (rev 785) @@ -147,7 +147,8 @@ (save-current-buffer (dolist (buf (buffer-list)) (set-buffer buf) - (if rdebug-internal-short-key-mode + (when rdebug-internal-short-key-mode + (setq rdebug-internal-short-key-mode nil) (rdebug-internal-short-key-mode -1)))))) (provide 'rdebug-shortkey) From nobody at rubyforge.org Tue Apr 1 20:50:27 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 1 Apr 2008 20:50:27 -0400 (EDT) Subject: [Ruby-debug-commits] [786] trunk/emacs: Auto indent. Message-ID: <20080402005027.ADB361858664@rubyforge.org> Revision: 786 Author: rockyb Date: 2008-04-01 20:50:27 -0400 (Tue, 01 Apr 2008) Log Message: ----------- Auto indent. Modified Paths: -------------- trunk/emacs/rdebug-annotate.el trunk/emacs/rdebug-core.el trunk/emacs/rdebug-shortkey.el Modified: trunk/emacs/rdebug-annotate.el =================================================================== --- trunk/emacs/rdebug-annotate.el 2008-04-02 00:27:48 UTC (rev 785) +++ trunk/emacs/rdebug-annotate.el 2008-04-02 00:50:27 UTC (rev 786) @@ -209,11 +209,11 @@ ;; Process the annotation. (cond ((string= name "starting") - (setq rdebug-inferior-status "running")) + (setq rdebug-inferior-status "running")) ((string= name "stopped") - (setq rdebug-inferior-status "stopped")) + (setq rdebug-inferior-status "stopped")) ((string= name "exited") - (setq rdebug-inferior-status "exited")) + (setq rdebug-inferior-status "exited")) ((string= name "pre-prompt") ;; Strip of the trailing \n (this is probably ;; a bug in processor.rb). @@ -225,10 +225,10 @@ ((string= name "source") (if (string-match gud-rdebug-marker-regexp item) ;; Extract the frame position from the marker. - (setq gud-last-frame - (cons (match-string 1 item) - (string-to-number - (match-string 2 item)))))) + (setq gud-last-frame + (cons (match-string 1 item) + (string-to-number + (match-string 2 item)))))) (t (rdebug-process-annotation name contents)))) ;; This is not a one-liner, and we haven't seen the next ;; annotation, so we have to treat this as a partial Modified: trunk/emacs/rdebug-core.el =================================================================== --- trunk/emacs/rdebug-core.el 2008-04-02 00:27:48 UTC (rev 785) +++ trunk/emacs/rdebug-core.el 2008-04-02 00:50:27 UTC (rev 786) @@ -477,7 +477,7 @@ "This unbinds the special debugger keys of the source buffers." (interactive) (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist) - rdebug-debugger-support-minor-mode-map-when-deactive)) + rdebug-debugger-support-minor-mode-map-when-deactive)) (defun rdebug-customize () Modified: trunk/emacs/rdebug-shortkey.el =================================================================== --- trunk/emacs/rdebug-shortkey.el 2008-04-02 00:27:48 UTC (rev 785) +++ trunk/emacs/rdebug-shortkey.el 2008-04-02 00:50:27 UTC (rev 786) @@ -95,8 +95,8 @@ (if (eq rdebug-original-read-only :off) (setq rdebug-original-read-only buffer-read-only)) (setq buffer-read-only t)) - (setq buffer-read-only rdebug-original-read-only) - (setq rdebug-original-read-only :off)) + (setq buffer-read-only rdebug-original-read-only) + (setq rdebug-original-read-only :off)) (defun rdebug-buffer-killed-p (buffer) @@ -148,8 +148,8 @@ (dolist (buf (buffer-list)) (set-buffer buf) (when rdebug-internal-short-key-mode - (setq rdebug-internal-short-key-mode nil) - (rdebug-internal-short-key-mode -1)))))) + (setq rdebug-internal-short-key-mode nil) + (rdebug-internal-short-key-mode -1)))))) (provide 'rdebug-shortkey) From nobody at rubyforge.org Thu Apr 3 08:06:34 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 3 Apr 2008 08:06:34 -0400 (EDT) Subject: [Ruby-debug-commits] [787] trunk/cli/ruby-debug/commands/irb.rb: irb is no longer 'experimental' . Message-ID: <20080403120634.A859518586AD@rubyforge.org> Revision: 787 Author: rockyb Date: 2008-04-03 08:06:34 -0400 (Thu, 03 Apr 2008) Log Message: ----------- irb is no longer 'experimental'. 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-04-02 00:50:27 UTC (rev 786) +++ trunk/cli/ruby-debug/commands/irb.rb 2008-04-03 12:06:34 UTC (rev 787) @@ -33,6 +33,8 @@ end module Debugger + + # Implements debugger "help" command. class IRBCommand < Command # :nodoc: register_setting_get(:autoirb) do @@ -79,7 +81,7 @@ def help(cmd) %{ - irb\tstarts an IRB session. (EXPERIMENTAL) + irb\tstarts an Interactive Ruby (IRB) session. } end end From nobody at rubyforge.org Thu Apr 3 10:15:39 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 3 Apr 2008 10:15:39 -0400 (EDT) Subject: [Ruby-debug-commits] [788] trunk/test: test-pm.rb, post-mortem-osx.right: Allow for tmate command on OSX. Message-ID: <20080403141539.3C0EE18585F5@rubyforge.org> Revision: 788 Author: rockyb Date: 2008-04-03 10:15:38 -0400 (Thu, 03 Apr 2008) Log Message: ----------- test-pm.rb, post-mortem-osx.right: Allow for tmate command on OSX. annotate.*: make sure 'set force on' doesn't happen. Modified Paths: -------------- trunk/test/data/annotate.cmd trunk/test/data/annotate.right trunk/test/test-pm.rb Added Paths: ----------- trunk/test/data/post-mortem-osx.right Modified: trunk/test/data/annotate.cmd =================================================================== --- trunk/test/data/annotate.cmd 2008-04-03 12:06:34 UTC (rev 787) +++ trunk/test/data/annotate.cmd 2008-04-03 14:15:38 UTC (rev 788) @@ -3,6 +3,7 @@ # ******************************************************** set debuggertesting on set callstyle last +set force off set annotate 3 # Get into gcd step 2 Modified: trunk/test/data/annotate.right =================================================================== --- trunk/test/data/annotate.right 2008-04-03 12:06:34 UTC (rev 787) +++ trunk/test/data/annotate.right 2008-04-03 14:15:38 UTC (rev 788) @@ -7,6 +7,8 @@ Currently testing the debugger is on. # set callstyle last Frame call-display style is last. +# set force off +force-stepping is off. # set annotate 3 Annotation level is 3 # # Get into gcd @@ -81,7 +83,7 @@ display  stack ---> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10 +--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6 #1 at line gcd.rb:18  variables @@ -89,8 +91,8 @@ b = 5 self = main  -source gcd.rb:10 -return nil if a <= 0 +source gcd.rb:6 +if a > b # # Test error annotations # up 10 error-begin @@ -99,7 +101,7 @@ display  stack ---> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10 +--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6 #1 at line gcd.rb:18  variables @@ -114,7 +116,7 @@ display  stack ---> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10 +--> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6 #1 at line gcd.rb:18  variables Added: trunk/test/data/post-mortem-osx.right =================================================================== --- trunk/test/data/post-mortem-osx.right (rev 0) +++ trunk/test/data/post-mortem-osx.right 2008-04-03 14:15:38 UTC (rev 788) @@ -0,0 +1,31 @@ +pm.rb:3 +def zero_div +# # *************************************************** +# # This tests post-mortem handling. +# # *************************************************** +# set debuggertesting on +Currently testing the debugger is on. +# continue +pm.rb:5 +1/0 +# # Should have got a divide by 0 error +# info program +The program crashed. +Exception: # +# where +--> #0 / at line pm.rb:5 + #1 at line pm.rb:8 +# up +#1 at line pm.rb:8 +# p x +2 +# help +Type 'help ' for help on a specific command + +Available commands: +backtrace delete edit frame list ps restart source undisplay +break disable enable help method putl save thread up +catch display eval info p quit set tmate var +condition down exit irb pp reload show trace where + +# quit Modified: trunk/test/test-pm.rb =================================================================== --- trunk/test/test-pm.rb 2008-04-03 12:06:34 UTC (rev 787) +++ trunk/test/test-pm.rb 2008-04-03 14:15:38 UTC (rev 788) @@ -1,5 +1,6 @@ #!/usr/bin/env ruby require 'test/unit' +require 'rbconfig' # begin require 'rubygems' rescue LoadError end # require 'ruby-debug'; Debugger.start @@ -24,6 +25,7 @@ ENV['COLUMNS'] = '80' testname='post-mortem' script = File.join('data', testname + '.cmd') + testname += '-osx' if Config::CONFIG['host_os'] =~ /^darwin/ assert_equal(true, run_debugger(testname, "--script #{script} --post-mortem pm.rb")) From nobody at rubyforge.org Thu Apr 3 10:22:12 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 3 Apr 2008 10:22:12 -0400 (EDT) Subject: [Ruby-debug-commits] [789] trunk/Rakefile: We'll require linecache 0.4 or better. Message-ID: <20080403142212.5F66818586C2@rubyforge.org> Revision: 789 Author: rockyb Date: 2008-04-03 10:22:12 -0400 (Thu, 03 Apr 2008) Log Message: ----------- We'll require linecache 0.4 or better. (Use SVN for now. Will be released at same time as ruby-debug). Modified Paths: -------------- trunk/Rakefile Modified: trunk/Rakefile =================================================================== --- trunk/Rakefile 2008-04-03 14:15:38 UTC (rev 788) +++ trunk/Rakefile 2008-04-03 14:22:12 UTC (rev 789) @@ -116,7 +116,7 @@ spec.required_ruby_version = '>= 1.8.2' spec.date = Time.now spec.rubyforge_project = 'ruby-debug' - spec.add_dependency('linecache', '>= 0.3') + spec.add_dependency('linecache', '>= 0.4') spec.test_files = FileList[BASE_TEST_FILE_LIST] From nobody at rubyforge.org Thu Apr 3 15:01:31 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 3 Apr 2008 15:01:31 -0400 (EDT) Subject: [Ruby-debug-commits] [790] trunk: Allow setting :post_mortem => true from Debugger.start. Message-ID: <20080403190131.56AFE18586A4@rubyforge.org> Revision: 790 Author: rockyb Date: 2008-04-03 15:01:30 -0400 (Thu, 03 Apr 2008) Log Message: ----------- Allow setting :post_mortem => true from Debugger.start. Modified Paths: -------------- trunk/ChangeLog trunk/doc/ruby-debug.texi trunk/lib/ChangeLog trunk/lib/ruby-debug-base.rb Added Paths: ----------- trunk/test/pm-base.rb Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-04-03 14:22:12 UTC (rev 789) +++ trunk/ChangeLog 2008-04-03 19:01:30 UTC (rev 790) @@ -1,3 +1,13 @@ +2008-03-30 03:01 Rocky Bernstein + + * doc/ruby-debug.texi: Note that rdebug with test/unit might work. + +2008-03-28 13:53 Rocky Bernstein + + * ChangeLog, emacs/rdebug-annotate.el, lib/ChangeLog: Don't + unconditionally turn on short-key mode when annotations are on. + Use rdebug-short-key-mode setting to decide. + 2008-03-23 17:47 Rocky Bernstein * ChangeLog, Rakefile, cli/ruby-debug/commands/set.rb, Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-03 14:22:12 UTC (rev 789) +++ trunk/doc/ruby-debug.texi 2008-04-03 19:01:30 UTC (rev 790) @@ -3102,8 +3102,42 @@ If however you haven't invoked @code{rdebug} at the outset, but instead call @code{ruby-debug} from inside your program, to set up -post-mortem debugging you need to call - at code{Debugger.post_mortem}. This method can be called in two +post-mortem debugging set the @code{post_mortem} key in + at code{Debugger.start}. Here's an example modified from + at url{http://www.datanoise.com/articles/2006/12/20/post-mortem-debugging}: + + at smallexample + $ @b{cat t.rb } + require 'rubygems' + require 'ruby-debug' ; Debugger.start(:post_mortem => true) + + def t1 + raise 'test' + end + def t2 + t1 + end + t2 + + $ @b{ruby t.rb } + t.rb:8: raise 'test' + (rdb:post-mortem) @b{l=} + [3, 12] in t.rb + 3 + 4 Debugger.start + 5 Debugger.post_mortem + 6 + 7 def t1 + => 8 raise 'test' + 9 end + 10 def t2 + 11 t1 + 12 end + (rdb:post-mortem) + at end smallexample + +Alternatively you cancall @code{Debugger.post_mortem} after rdebug has +been started. The @code{post_mortem} method can be called in two ways. Called without a block, it installs a global @code{at_exit} hook that intercepts exceptions not handled by your Ruby script. In contrast to using the @code{--post-mortem} option, when this hook @@ -3200,6 +3234,9 @@ Debugger.start(:init => false) # or Debugger.start(@{:init => false@}) @end smallexample +If you want post-mortem debugging, you can also supply + at code{:post_mortem => true} in @code{Debugger.start}. + @item Debugger.started? @vindex @code{Debugger.started?} Boolean. Return @code{true} if debugger has been started. Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-04-03 14:22:12 UTC (rev 789) +++ trunk/lib/ChangeLog 2008-04-03 19:01:30 UTC (rev 790) @@ -1,3 +1,9 @@ +2008-03-28 13:53 Rocky Bernstein + + * trunk/ChangeLog, trunk/emacs/rdebug-annotate.el, ChangeLog: Don't + unconditionally turn on short-key mode when annotations are on. + Use rdebug-short-key-mode setting to decide. + 2008-03-23 17:47 Rocky Bernstein * trunk/ChangeLog, trunk/Rakefile, Modified: trunk/lib/ruby-debug-base.rb =================================================================== --- trunk/lib/ruby-debug-base.rb 2008-04-03 14:22:12 UTC (rev 789) +++ trunk/lib/ruby-debug-base.rb 2008-04-03 19:01:30 UTC (rev 790) @@ -202,7 +202,11 @@ Debugger.const_set('INITIAL_DIR', Dir.pwd) unless defined? Debugger::INITIAL_DIR end - Debugger.started? ? nil : Debugger.start_(&block) + retval = Debugger.started? ? nil : Debugger.start_(&block) + if options[:post_mortem] + post_mortem + end + return retval end # Added: trunk/test/pm-base.rb =================================================================== --- trunk/test/pm-base.rb (rev 0) +++ trunk/test/pm-base.rb 2008-04-03 19:01:30 UTC (rev 790) @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +# Test post-mortem handling using only ruby-debug-base. +src_dir = File.dirname(__FILE__) +%w(ext lib cli).each do |dir| + $:.unshift File.join(src_dir, '..', dir) +end +require 'ruby-debug-base' + +class CommandProcessor + def at_line(context, file, line) + puts 'file: %s, line: %s' % [ File.basename(file), line ] + exit! + end +end + +Debugger.start(:post_mortem => true) +Debugger.handler = CommandProcessor.new +def zero_div + 1/0 +end +zero_div + Property changes on: trunk/test/pm-base.rb ___________________________________________________________________ Name: svn:executable + * From nobody at rubyforge.org Thu Apr 3 15:13:28 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 3 Apr 2008 15:13:28 -0400 (EDT) Subject: [Ruby-debug-commits] [791] trunk/doc/ruby-debug.texi: Small typos. Message-ID: <20080403191328.0BF3B18586A6@rubyforge.org> Revision: 791 Author: rockyb Date: 2008-04-03 15:13:27 -0400 (Thu, 03 Apr 2008) Log Message: ----------- Small typos. Modified Paths: -------------- trunk/doc/ruby-debug.texi Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-03 19:01:30 UTC (rev 790) +++ trunk/doc/ruby-debug.texi 2008-04-03 19:13:27 UTC (rev 791) @@ -3136,9 +3136,9 @@ (rdb:post-mortem) @end smallexample -Alternatively you cancall @code{Debugger.post_mortem} after rdebug has -been started. The @code{post_mortem} method can be called in two -ways. Called without a block, it installs a global @code{at_exit} hook +Alternatively you can call @code{Debugger.post_mortem()} after rdebug has +been started. The @code{post_mortem()} method can be called in two +ways. Called without a block, it installs a global @code{at_exit()} hook that intercepts exceptions not handled by your Ruby script. In contrast to using the @code{--post-mortem} option, when this hook occurs after the call stack has been rolled back. (I'm not sure if From nobody at rubyforge.org Fri Apr 4 15:22:43 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Fri, 4 Apr 2008 15:22:43 -0400 (EDT) Subject: [Ruby-debug-commits] [792] trunk/cli/ruby-debug/commands/eval.rb: Sometimes remove_method isn' t defined. Message-ID: <20080404192243.21DCF18585F9@rubyforge.org> Revision: 792 Author: rockyb Date: 2008-04-04 15:22:42 -0400 (Fri, 04 Apr 2008) Log Message: ----------- Sometimes remove_method isn't defined. Modified Paths: -------------- trunk/cli/ruby-debug/commands/eval.rb Modified: trunk/cli/ruby-debug/commands/eval.rb =================================================================== --- trunk/cli/ruby-debug/commands/eval.rb 2008-04-03 19:13:27 UTC (rev 791) +++ trunk/cli/ruby-debug/commands/eval.rb 2008-04-04 19:22:42 UTC (rev 792) @@ -8,7 +8,8 @@ def dbg_print(*args) $__dbg_interface.print(*args) end - remove_method :puts if self.respond_to?(:puts) + remove_method :puts if self.respond_to?(:puts) && + defined?(remove_method) def dbg_puts(*args) $__dbg_interface.print(*args) $__dbg_interface.print("\n") From nobody at rubyforge.org Sat Apr 5 22:13:06 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sat, 5 Apr 2008 22:13:06 -0400 (EDT) Subject: [Ruby-debug-commits] [793] trunk/test: read_command on OSX seems to work differently. Message-ID: <20080406021306.C8E4618585E7@rubyforge.org> Revision: 793 Author: rockyb Date: 2008-04-05 22:13:06 -0400 (Sat, 05 Apr 2008) Log Message: ----------- read_command on OSX seems to work differently. Punt for now. Modified Paths: -------------- trunk/test/test-init.rb Added Paths: ----------- trunk/test/data/test-init-osx.right Added: trunk/test/data/test-init-osx.right =================================================================== --- trunk/test/data/test-init-osx.right (rev 0) +++ trunk/test/data/test-init-osx.right 2008-04-06 02:13:06 UTC (rev 793) @@ -0,0 +1,4 @@ +gcd-dbg.rb:18 +if a > b +"./gcd-dbg.rb" +Argument list to give program being debugged when it is started is "5". Modified: trunk/test/test-init.rb =================================================================== --- trunk/test/test-init.rb 2008-04-04 19:22:42 UTC (rev 792) +++ trunk/test/test-init.rb 2008-04-06 02:13:06 UTC (rev 793) @@ -1,5 +1,6 @@ #!/usr/bin/env ruby require 'test/unit' +require 'rbconfig' # begin require 'rubygems' rescue LoadError end # require 'ruby-debug'; Debugger.start @@ -24,7 +25,12 @@ ENV['EMACS'] = old_emacs ENV['COLUMNS'] = old_columns - expected = File.open(File.join('data', 'test-init.right')).readlines + right_file = if Config::CONFIG['host_os'] =~ /^darwin/ + 'test-init-osx.right' + else + 'test-init.right' + end + expected = File.open(File.join('data', right_file)).readlines assert_equal(expected, lines) File.delete(debugger_output) if expected == lines end From nobody at rubyforge.org Sat Apr 5 23:03:30 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sat, 5 Apr 2008 23:03:30 -0400 (EDT) Subject: [Ruby-debug-commits] [794] trunk: Assigning $0 on cygwin seems weird. Message-ID: <20080406030330.2FE1318585F0@rubyforge.org> Revision: 794 Author: rockyb Date: 2008-04-05 23:03:29 -0400 (Sat, 05 Apr 2008) Log Message: ----------- Assigning $0 on cygwin seems weird. cygwin readline different too Modified Paths: -------------- trunk/bin/rdebug trunk/test/test-init.rb Added Paths: ----------- trunk/test/data/test-init-cygwin.right Modified: trunk/bin/rdebug =================================================================== --- trunk/bin/rdebug 2008-04-06 02:13:06 UTC (rev 793) +++ trunk/bin/rdebug 2008-04-06 03:03:29 UTC (rev 794) @@ -28,12 +28,17 @@ # However This is just a little more than I want to take on right # now, so I think I'll stick with the slightly hacky approach. $RDEBUG_0 = $0 - $0 = if '.' == File.dirname(Debugger::PROG_SCRIPT) and + + # cygwin does some sort of funky truncation on $0 ./abcdef => ./ab + # probably something to do with 3-letter extension truncation. + # The hacky workaround is to do slice assignment. Ugh. + d0 = if '.' == File.dirname(Debugger::PROG_SCRIPT) and Debugger::PROG_SCRIPT[0..0] != '.' File.join('.', Debugger::PROG_SCRIPT) else Debugger::PROG_SCRIPT end + $0[0..-1] = d0 end bt = Debugger.debug_load(Debugger::PROG_SCRIPT, options.stop) if bt Added: trunk/test/data/test-init-cygwin.right =================================================================== --- trunk/test/data/test-init-cygwin.right (rev 0) +++ trunk/test/data/test-init-cygwin.right 2008-04-06 03:03:29 UTC (rev 794) @@ -0,0 +1,7 @@ +gcd-dbg.rb:18 +if a > b +(rdb:1) p Debugger::PROG_SCRIPT +"./gcd-dbg.rb" +(rdb:1) show args +Argument list to give program being debugged when it is started is "5". +(rdb:1) quit unconditionally Modified: trunk/test/test-init.rb =================================================================== --- trunk/test/test-init.rb 2008-04-06 02:13:06 UTC (rev 793) +++ trunk/test/test-init.rb 2008-04-06 03:03:29 UTC (rev 794) @@ -25,8 +25,11 @@ ENV['EMACS'] = old_emacs ENV['COLUMNS'] = old_columns - right_file = if Config::CONFIG['host_os'] =~ /^darwin/ + right_file = case Config::CONFIG['host_os'] + when /^darwin/ 'test-init-osx.right' + when /^cygwin/ + 'test-init-cygwin.right' else 'test-init.right' end From nobody at rubyforge.org Sun Apr 6 20:36:19 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 6 Apr 2008 20:36:19 -0400 (EDT) Subject: [Ruby-debug-commits] [795] trunk: ruby-debug-base.rb: document Debugger.start parameters. Message-ID: <20080407003619.77610185861F@rubyforge.org> Revision: 795 Author: rockyb Date: 2008-04-06 20:36:19 -0400 (Sun, 06 Apr 2008) Log Message: ----------- ruby-debug-base.rb: document Debugger.start parameters. CHANGES: Revise what's happened test-shortkey.el: A failing regression test because I think rdebug-shortkey-mode is not correct. Modified Paths: -------------- trunk/CHANGES trunk/ChangeLog trunk/emacs/Makefile.am trunk/emacs/rdebug-shortkey.el trunk/lib/ChangeLog trunk/lib/ruby-debug-base.rb Added Paths: ----------- trunk/emacs/test/test-shortkey.el Modified: trunk/CHANGES =================================================================== --- trunk/CHANGES 2008-04-06 03:03:29 UTC (rev 794) +++ trunk/CHANGES 2008-04-07 00:36:19 UTC (rev 795) @@ -1,6 +1,6 @@ 0.10.1 +4/10/08 - in honor of the 30th Birthday of Kate Schwarz - - bin/rdebug * "rdebug --post-mortem" now really catches uncaught exceptions and @@ -72,8 +72,12 @@ * preface ruby_debug global Ruby variables with rdebug_. - * Change Debugger.start() to save things (like $0 and ARGV) necessary to - allow restart. It now takes an optional option argument. + * Change Debugger.start() to accept an optional options argument + :init => true saves things (like $0 and ARGV) necessary to + allow restart. Default: true + :post_mortem => true runs post-mortem on an uncaught exception + Default: false + The old Debugger.start() is now renamed to Debugger.start_() * split of line caching to an external gem. We now only allow setting @@ -81,7 +85,12 @@ * Incompatible enhancement: even return/end will now call event handler + See ChangeLog for full details, and the reference guide for more complete + documentation of these changes. + 0.10.0 +12/25/07 + - '-r' option can be used to require additional libraries. - --noquit option added to stay in debugger when the program exits - gdb-like --annotate option added. Can be used by front-ends to get information Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-04-06 03:03:29 UTC (rev 794) +++ trunk/ChangeLog 2008-04-07 00:36:19 UTC (rev 795) @@ -1,3 +1,55 @@ +2008-04-06 03:03 Rocky Bernstein + + * bin/rdebug, test/data/test-init-cygwin.right, test/test-init.rb: + Assigning $0 on cygwin seems weird. cygwin readline different too + +2008-04-06 02:13 Rocky Bernstein + + * test/data/test-init-osx.right, test/test-init.rb: read_command on + OSX seems to work differently. Punt for now. + +2008-04-04 19:22 Rocky Bernstein + + * cli/ruby-debug/commands/eval.rb: Sometimes remove_method isn't + defined. + +2008-04-03 19:13 Rocky Bernstein + + * doc/ruby-debug.texi: Small typos. + +2008-04-03 19:01 Rocky Bernstein + + * ChangeLog, doc/ruby-debug.texi, lib/ChangeLog, + lib/ruby-debug-base.rb, test/pm-base.rb: Allow setting + :post_mortem => true from Debugger.start. + +2008-04-03 14:22 Rocky Bernstein + + * Rakefile: We'll require linecache 0.4 or better. (Use SVN for + now. Will be released at same time as ruby-debug). + +2008-04-03 14:15 Rocky Bernstein + + * test/data/annotate.cmd, test/data/annotate.right, + test/data/post-mortem-osx.right, test/test-pm.rb: test-pm.rb, + post-mortem-osx.right: Allow for tmate command on OSX. + annotate.*: make sure 'set force on' doesn't happen. + +2008-04-03 12:06 Rocky Bernstein + + * cli/ruby-debug/commands/irb.rb: irb is no longer 'experimental'. + +2008-04-02 00:50 Rocky Bernstein + + * emacs/rdebug-annotate.el, emacs/rdebug-core.el, + emacs/rdebug-shortkey.el: Auto indent. + +2008-04-02 00:27 Rocky Bernstein + + * emacs/rdebug-core.el, emacs/rdebug-shortkey.el: Short-key mode is + turning itself on rather than off sometimes. More control over + trying to get rid of it when desired. + 2008-03-30 03:01 Rocky Bernstein * doc/ruby-debug.texi: Note that rdebug with test/unit might work. Modified: trunk/emacs/Makefile.am =================================================================== --- trunk/emacs/Makefile.am 2008-04-06 03:03:29 UTC (rev 794) +++ trunk/emacs/Makefile.am 2008-04-07 00:36:19 UTC (rev 795) @@ -45,7 +45,9 @@ test/test-fns.el \ test/test-gud.el \ test/test-indent.el \ - test/test-regexp.el + test/test-regexp.el \ + test/test-shortkey.el + EXTRA_DIST = $(lisp_files) $(check_DATA) ELCFILES = rdebug.elc \ rdebug-annotate.elc \ @@ -80,7 +82,9 @@ check-frames \ check-gud \ check-indent \ - check-regexp + check-regexp \ + check-shortkey + check: $(CHECK_FILES) check-annotate: rdebug-annotate.el @@ -114,6 +118,10 @@ check-regexp: rdebug-regexp.el (cd $(srcdir)/test && \ $(EMACS) -batch -q -l test-regexp.el ) + +check-shortkey: rdebug-shortkey.el + (cd $(srcdir)/test && \ + $(EMACS) -batch -q -l test-shortkey.el ) endif PHONY = $(CHECK_FILES) Modified: trunk/emacs/rdebug-shortkey.el =================================================================== --- trunk/emacs/rdebug-shortkey.el 2008-04-06 03:03:29 UTC (rev 794) +++ trunk/emacs/rdebug-shortkey.el 2008-04-07 00:36:19 UTC (rev 795) @@ -47,6 +47,8 @@ ;; controls if `rdebug-internal-short-key-mode' should be activated or ;; not. +(require 'rdebug-source) + (define-minor-mode rdebug-short-key-mode "When enabled, short keys can be used in source buffers in `rdebug'." :group 'rdebug Added: trunk/emacs/test/test-shortkey.el =================================================================== --- trunk/emacs/test/test-shortkey.el (rev 0) +++ trunk/emacs/test/test-shortkey.el 2008-04-07 00:36:19 UTC (rev 795) @@ -0,0 +1,44 @@ +;; -*- emacs-lisp -*- +;; This program has to be run from the directory it is currently in and +;; the rdebug code has to be in the parent directory +(load-file "./elk-test.el") + +;; FIXME? Should we use "require 'rdebug" here. +;; Would have to prepend . to load-path. +(load-file "../rdebug-shortkey.el") + +(deftest "rdebug-shortkey-mode-test" + (let ((buf (generate-new-buffer "shortkey readwrite"))) + (with-current-buffer buf + (setq buffer-read-only nil) + ;; turning on short-key-mode make buffer read-only + (rdebug-short-key-mode) + (assert-equal t buffer-read-only) + + ;; turning off short-key-mode should make buffer read-write again + (rdebug-short-key-mode) + (assert-equal nil buffer-read-only)) + (kill-buffer buf)) + + (let ((buf (generate-new-buffer "shortkey readonly"))) + (with-current-buffer buf + (setq buffer-read-only t) + + ;; turning on short-key-mode keep buffer read-only + (rdebug-short-key-mode) + (assert-equal t buffer-read-only) + + ;; turning off short-key-mode should make buffer read-write again + (rdebug-short-key-mode) + (assert-equal nil buffer-read-only) + (kill-buffer buf)))) + +;; ------------------------------------------------------------------- +;; Build and run the test suite. +;; + +(build-suite "rdebug-suite" + "rdebug-shortkey-mode-test") +(run-elk-test "rdebug-suite" + "test things in rdebug-shortkey.el") + Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-04-06 03:03:29 UTC (rev 794) +++ trunk/lib/ChangeLog 2008-04-07 00:36:19 UTC (rev 795) @@ -1,3 +1,9 @@ +2008-04-03 19:01 Rocky Bernstein + + * trunk/ChangeLog, trunk/doc/ruby-debug.texi, ChangeLog, + ruby-debug-base.rb, trunk/test/pm-base.rb: Allow setting + :post_mortem => true from Debugger.start. + 2008-03-28 13:53 Rocky Bernstein * trunk/ChangeLog, trunk/emacs/rdebug-annotate.el, ChangeLog: Don't Modified: trunk/lib/ruby-debug-base.rb =================================================================== --- trunk/lib/ruby-debug-base.rb 2008-04-06 03:03:29 UTC (rev 794) +++ trunk/lib/ruby-debug-base.rb 2008-04-07 00:36:19 UTC (rev 795) @@ -6,7 +6,8 @@ # Default options to Debugger.start DEFAULT_START_SETTINGS = { - :init => true # Set $0 and save ARGV? + :init => true, # Set $0 and save ARGV? + :post_mortem => false # post-mortem debugging on uncaught exception? } unless defined?(DEFAULT_START_SETTINGS) class Context @@ -177,21 +178,26 @@ # Debugger.start(options) -> bool # Debugger.start(options) { ... } -> obj # - # This method is internal and activates the debugger. Use - # Debugger.start (from ruby-debug-base.rb) instead. + # This method is internal and activates the debugger. Use + # Debugger.start (from ruby-debug-base.rb) instead. # - # If it's called without a block it returns +true+, unless debugger - # was already started. If a block is given, it starts debugger and - # yields to block. When the block is finished executing it stops - # the debugger with Debugger.stop method. + # If it's called without a block it returns +true+, unless debugger + # was already started. If a block is given, it starts debugger and + # yields to block. When the block is finished executing it stops + # the debugger with Debugger.stop method. # - # Note that if you want to stop debugger, you must call - # Debugger.stop as many time as you called Debugger.start - # method. + # Note that if you want to stop debugger, you must call + # Debugger.stop as many time as you called Debugger.start + # method. # - # occur if you ran the debugger via rdebug. In particular, - # These things like setting program name and arguments make it possible - # for "restart" to work. + # +options+ is a hash used to set various debugging options. + # Set :init true if you want to save ARGV and some variables which + # make a debugger restart possible. Only the first time :init is set true + # will values get set. Since ARGV is saved, you should make sure + # it hasn't been changed before the (first) call. + # Set :post_mortem true if you want to enter post-mortem debugging + # on an uncaught exception. Once post-mortem debugging is set, it can't + # be unset. def start(options={}, &block) options = Debugger::DEFAULT_START_SETTINGS.merge(options) if options[:init] From nobody at rubyforge.org Mon Apr 7 23:09:59 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 7 Apr 2008 23:09:59 -0400 (EDT) Subject: [Ruby-debug-commits] [796] trunk: Fix bug in --trace. Message-ID: <20080408030959.AFABD1858624@rubyforge.org> Revision: 796 Author: rockyb Date: 2008-04-07 23:09:59 -0400 (Mon, 07 Apr 2008) Log Message: ----------- Fix bug in --trace. Add regression test for that as well. Reduce (but alas not eliminate) extraneous line tracing. Modified Paths: -------------- trunk/bin/rdebug trunk/cli/ruby-debug/processor.rb trunk/test/tdebug.rb Added Paths: ----------- trunk/test/data/trace.right Modified: trunk/bin/rdebug =================================================================== --- trunk/bin/rdebug 2008-04-07 00:36:19 UTC (rev 795) +++ trunk/bin/rdebug 2008-04-08 03:09:59 UTC (rev 796) @@ -239,6 +239,7 @@ rdebug_path += '.cmd' unless rdebug_path =~ /\.cmd$/i end Debugger::RDEBUG_SCRIPT = rdebug_path + Debugger::RDEBUG_FILE = __FILE__ Debugger::INITIAL_DIR = Dir.pwd opts.parse! ARGV rescue StandardError => e @@ -302,7 +303,8 @@ # activate post-mortem Debugger.post_mortem if options.post_mortem - Debugger.tracing = options.stop = false if options.tracing + options.stop = false if options.tracing + Debugger.tracing = options.tracing if !options.quit if Debugger.started? Modified: trunk/cli/ruby-debug/processor.rb =================================================================== --- trunk/cli/ruby-debug/processor.rb 2008-04-07 00:36:19 UTC (rev 795) +++ trunk/cli/ruby-debug/processor.rb 2008-04-08 03:09:59 UTC (rev 796) @@ -152,6 +152,7 @@ protect :at_catchpoint def at_tracing(context, file, line) + return if Debugger::RDEBUG_FILE == file # Don't trace ourself @last_file = CommandProcessor.canonic_file(file) file = CommandProcessor.canonic_file(file) unless file == @last_file and @last_line == line and Added: trunk/test/data/trace.right =================================================================== --- trunk/test/data/trace.right (rev 0) +++ trunk/test/data/trace.right 2008-04-08 03:09:59 UTC (rev 796) @@ -0,0 +1,23 @@ +Tracing(1):gcd.rb:4 def gcd(a, b) +Tracing(1):gcd.rb:18 gcd(3,5) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:15 return gcd(b-a, a) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:15 return gcd(b-a, a) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:13 return a Modified: trunk/test/tdebug.rb =================================================================== --- trunk/test/tdebug.rb 2008-04-07 00:36:19 UTC (rev 795) +++ trunk/test/tdebug.rb 2008-04-08 03:09:59 UTC (rev 796) @@ -37,12 +37,17 @@ # However This is just a little more than I want to take on right # now, so I think I'll stick with the slightly hacky approach. $RDEBUG_0 = $0 - $0 = if '.' == File.dirname(Debugger::PROG_SCRIPT) and + + # cygwin does some sort of funky truncation on $0 ./abcdef => ./ab + # probably something to do with 3-letter extension truncation. + # The hacky workaround is to do slice assignment. Ugh. + d0 = if '.' == File.dirname(Debugger::PROG_SCRIPT) and Debugger::PROG_SCRIPT[0..0] != '.' File.join('.', Debugger::PROG_SCRIPT) else Debugger::PROG_SCRIPT end + $0[0..-1] = d0 end bt = Debugger.debug_load(Debugger::PROG_SCRIPT, !options.nostop) if bt @@ -155,6 +160,7 @@ rdebug_path += '.cmd' unless rdebug_path =~ /\.cmd$/i end Debugger::RDEBUG_SCRIPT = rdebug_path + Debugger::RDEBUG_FILE = __FILE__ Debugger::INITIAL_DIR = Dir.pwd opts.parse! ARGV rescue StandardError => e From nobody at rubyforge.org Mon Apr 7 23:10:39 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 7 Apr 2008 23:10:39 -0400 (EDT) Subject: [Ruby-debug-commits] [797] trunk/test/test-trace.rb: Oops forget this test Message-ID: <20080408031039.A24ED1858651@rubyforge.org> Revision: 797 Author: rockyb Date: 2008-04-07 23:10:39 -0400 (Mon, 07 Apr 2008) Log Message: ----------- Oops forget this test Added Paths: ----------- trunk/test/test-trace.rb Added: trunk/test/test-trace.rb =================================================================== --- trunk/test/test-trace.rb (rev 0) +++ trunk/test/test-trace.rb 2008-04-08 03:10:39 UTC (rev 797) @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby +require 'test/unit' + +# begin require 'rubygems' rescue LoadError end +# require 'ruby-debug'; Debugger.start + +# Test 'edit' command handling. +class TestEdit < Test::Unit::TestCase + + @@SRC_DIR = File.dirname(__FILE__) unless + defined?(@@SRC_DIR) + + require File.join(@@SRC_DIR, 'helper') + include TestHelper + + def test_basic + + filter = Proc.new{|got_lines, correct_lines| + got_lines.collect!{|l| l =~ /:gcd\.rb:/? l : nil}.compact! + puts got_lines + } + + testname='trace' + Dir.chdir(@@SRC_DIR) do + assert_equal(true, + run_debugger(testname, + "-nx --trace gcd.rb 3 5", nil, filter)) + end + end +end Property changes on: trunk/test/test-trace.rb ___________________________________________________________________ Name: svn:executable + * From nobody at rubyforge.org Mon Apr 7 23:14:42 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 7 Apr 2008 23:14:42 -0400 (EDT) Subject: [Ruby-debug-commits] [798] trunk/test/tdebug.rb: Track rdebug. Message-ID: <20080408031442.4762D1858646@rubyforge.org> Revision: 798 Author: rockyb Date: 2008-04-07 23:14:41 -0400 (Mon, 07 Apr 2008) Log Message: ----------- Track rdebug. Modified Paths: -------------- trunk/test/tdebug.rb Modified: trunk/test/tdebug.rb =================================================================== --- trunk/test/tdebug.rb 2008-04-08 03:10:39 UTC (rev 797) +++ trunk/test/tdebug.rb 2008-04-08 03:14:41 UTC (rev 798) @@ -199,7 +199,8 @@ Debugger.interface = Debugger::ScriptInterface.new(options.script, STDOUT, true) end -Debugger.tracing = options.nostop = true if options.tracing +options.stop = false if options.tracing +Debugger.tracing = options.tracing # Make sure Ruby script syntax checks okay. # Otherwise we get a load message that looks like rdebug has From nobody at rubyforge.org Mon Apr 7 23:17:33 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 7 Apr 2008 23:17:33 -0400 (EDT) Subject: [Ruby-debug-commits] [799] trunk/test/data: Test line numbers changed. Message-ID: <20080408031733.8DF491858640@rubyforge.org> Revision: 799 Author: rockyb Date: 2008-04-07 23:17:33 -0400 (Mon, 07 Apr 2008) Log Message: ----------- Test line numbers changed. Sigh Modified Paths: -------------- trunk/test/data/output.right trunk/test/data/quit.right Modified: trunk/test/data/output.right =================================================================== --- trunk/test/data/output.right 2008-04-08 03:14:41 UTC (rev 798) +++ trunk/test/data/output.right 2008-04-08 03:17:33 UTC (rev 799) @@ -31,11 +31,11 @@ two stopped stack ---> #0 debug_program at line tdebug.rb:48 +--> #0 debug_program at line tdebug.rb:53  variables self = main  -source tdebug.rb:48 +source tdebug.rb:53 if bt # quit Modified: trunk/test/data/quit.right =================================================================== --- trunk/test/data/quit.right 2008-04-08 03:14:41 UTC (rev 798) +++ trunk/test/data/quit.right 2008-04-08 03:17:33 UTC (rev 799) @@ -1,4 +1,4 @@ -tdebug.rb:48 +tdebug.rb:53 if bt # # *************************************************** # # This tests the quit. From nobody at rubyforge.org Tue Apr 8 06:19:42 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 06:19:42 -0400 (EDT) Subject: [Ruby-debug-commits] [800] trunk: processor.rb: Silence possibly more warnings under $DEBUG Message-ID: <20080408101942.92B9B18585D6@rubyforge.org> Revision: 800 Author: rockyb Date: 2008-04-08 06:19:42 -0400 (Tue, 08 Apr 2008) Log Message: ----------- processor.rb: Silence possibly more warnings under $DEBUG test/*: another linetrace test using the linetrace command. Modified Paths: -------------- trunk/cli/ruby-debug/processor.rb trunk/test/test-trace.rb Added Paths: ----------- trunk/test/data/linetrace.cmd trunk/test/data/linetrace.right Modified: trunk/cli/ruby-debug/processor.rb =================================================================== --- trunk/cli/ruby-debug/processor.rb 2008-04-08 03:17:33 UTC (rev 799) +++ trunk/cli/ruby-debug/processor.rb 2008-04-08 10:19:42 UTC (rev 800) @@ -152,7 +152,8 @@ protect :at_catchpoint def at_tracing(context, file, line) - return if Debugger::RDEBUG_FILE == file # Don't trace ourself + return if defined?(Debugger::RDEBUG_FILE) && + Debugger::RDEBUG_FILE == file # Don't trace ourself @last_file = CommandProcessor.canonic_file(file) file = CommandProcessor.canonic_file(file) unless file == @last_file and @last_line == line and @@ -389,6 +390,7 @@ def initialize(interface) super() @interface = interface + @debugger_context_was_dead = true # Assume we haven't started. end def process_commands Added: trunk/test/data/linetrace.cmd =================================================================== --- trunk/test/data/linetrace.cmd (rev 0) +++ trunk/test/data/linetrace.cmd 2008-04-08 10:19:42 UTC (rev 800) @@ -0,0 +1,6 @@ +# ******************************************************** +# This tests the 'linetrace' command. +# ******************************************************** +set basename on +set linetrace on +continue Added: trunk/test/data/linetrace.right =================================================================== --- trunk/test/data/linetrace.right (rev 0) +++ trunk/test/data/linetrace.right 2008-04-08 10:19:42 UTC (rev 800) @@ -0,0 +1,32 @@ +gcd.rb:4 +def gcd(a, b) +# # ******************************************************** +# # This tests the 'linetrace' command. +# # ******************************************************** +# set basename on +basename is on. +# set linetrace on +line tracing is on. +# continue +Tracing(1):gcd.rb:18 gcd(3,5) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:15 return gcd(b-a, a) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:15 return gcd(b-a, a) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:13 return a Modified: trunk/test/test-trace.rb =================================================================== --- trunk/test/test-trace.rb 2008-04-08 03:17:33 UTC (rev 799) +++ trunk/test/test-trace.rb 2008-04-08 10:19:42 UTC (rev 800) @@ -13,11 +13,10 @@ require File.join(@@SRC_DIR, 'helper') include TestHelper - def test_basic + def test_trace_option filter = Proc.new{|got_lines, correct_lines| got_lines.collect!{|l| l =~ /:gcd\.rb:/? l : nil}.compact! - puts got_lines } testname='trace' @@ -27,4 +26,21 @@ "-nx --trace gcd.rb 3 5", nil, filter)) end end + + def test_linetrace_command + + filter = Proc.new{|got_lines, correct_lines| + got_lines.collect!{|l| l !~ /:rdbg\.rb:/? l : nil}.compact! + } + + testname='linetrace' + Dir.chdir(@@SRC_DIR) do + script = File.join('data', testname + '.cmd') + assert_equal(true, + run_debugger(testname, + "--script #{script} -- gcd.rb 3 5", nil, + filter)) + + end + end end From nobody at rubyforge.org Tue Apr 8 06:23:15 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 06:23:15 -0400 (EDT) Subject: [Ruby-debug-commits] [801] trunk/test: Another linetrace test. Message-ID: <20080408102315.7BDF218585D6@rubyforge.org> Revision: 801 Author: rockyb Date: 2008-04-08 06:23:15 -0400 (Tue, 08 Apr 2008) Log Message: ----------- Another linetrace test. This time with linetrace+ set. Modified Paths: -------------- trunk/test/test-trace.rb Added Paths: ----------- trunk/test/data/linetracep.right Added: trunk/test/data/linetracep.right =================================================================== --- trunk/test/data/linetracep.right (rev 0) +++ trunk/test/data/linetracep.right 2008-04-08 10:23:15 UTC (rev 801) @@ -0,0 +1,25 @@ +gcd.rb:4 +def gcd(a, b) +# # ******************************************************** +# # This tests the 'linetrace+' command. +# # ******************************************************** +# set basename on +basename is on. +# set linetrace+ on +line tracing style is different consecutive lines. +# set linetrace on +line tracing is on. +# continue +Tracing(1):gcd.rb:18 gcd(3,5) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:15 return gcd(b-a, a) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:15 return gcd(b-a, a) +Tracing(1):gcd.rb:6 if a > b +Tracing(1):gcd.rb:10 return nil if a <= 0 +Tracing(1):gcd.rb:12 if a == 1 or b-a == 0 +Tracing(1):gcd.rb:13 return a Modified: trunk/test/test-trace.rb =================================================================== --- trunk/test/test-trace.rb 2008-04-08 10:19:42 UTC (rev 800) +++ trunk/test/test-trace.rb 2008-04-08 10:23:15 UTC (rev 801) @@ -43,4 +43,21 @@ end end + + def test_linetrace_plus_command + + filter = Proc.new{|got_lines, correct_lines| + got_lines.collect!{|l| l !~ /:rdbg\.rb:/? l : nil}.compact! + } + + testname='linetracep' + Dir.chdir(@@SRC_DIR) do + script = File.join('data', testname + '.cmd') + assert_equal(true, + run_debugger(testname, + "--script #{script} -- gcd.rb 3 5", nil, + filter)) + + end + end end From nobody at rubyforge.org Tue Apr 8 10:01:34 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 10:01:34 -0400 (EDT) Subject: [Ruby-debug-commits] [802] trunk/emacs: Attempt a fix at shortkey internal. Message-ID: <20080408140135.208081858622@rubyforge.org> Revision: 802 Author: rockyb Date: 2008-04-08 10:01:34 -0400 (Tue, 08 Apr 2008) Log Message: ----------- Attempt a fix at shortkey internal. There be dragons here. Not sure what's going on. Modified Paths: -------------- trunk/emacs/rdebug-shortkey.el trunk/emacs/test/test-shortkey.el Modified: trunk/emacs/rdebug-shortkey.el =================================================================== --- trunk/emacs/rdebug-shortkey.el 2008-04-08 10:23:15 UTC (rev 801) +++ trunk/emacs/rdebug-shortkey.el 2008-04-08 14:01:34 UTC (rev 802) @@ -93,12 +93,16 @@ (make-local-variable 'rdebug-original-read-only) ;; Note, without the third state, :off, activating the mode more ;; than once would overwrite the real original value. - (when rdebug-internal-short-key-mode - (if (eq rdebug-original-read-only :off) - (setq rdebug-original-read-only buffer-read-only)) - (setq buffer-read-only t)) - (setq buffer-read-only rdebug-original-read-only) - (setq rdebug-original-read-only :off)) + (if (eq rdebug-original-read-only nil) + (setq rdebug-original-read-only + (if buffer-read-only t :off))) + (if rdebug-internal-short-key-mode + ;; Turn on shortkey mode + (setq buffer-read-only t) + ;; Turn off shortkey mode + (if (eq rdebug-original-read-only t) + (setq buffer-read-only t) + (setq buffer-read-only nil)))) (defun rdebug-buffer-killed-p (buffer) Modified: trunk/emacs/test/test-shortkey.el =================================================================== --- trunk/emacs/test/test-shortkey.el 2008-04-08 10:23:15 UTC (rev 801) +++ trunk/emacs/test/test-shortkey.el 2008-04-08 14:01:34 UTC (rev 802) @@ -12,11 +12,11 @@ (with-current-buffer buf (setq buffer-read-only nil) ;; turning on short-key-mode make buffer read-only - (rdebug-short-key-mode) + (rdebug-internal-short-key-mode 1) (assert-equal t buffer-read-only) ;; turning off short-key-mode should make buffer read-write again - (rdebug-short-key-mode) + (rdebug-internal-short-key-mode -1) (assert-equal nil buffer-read-only)) (kill-buffer buf)) @@ -25,11 +25,11 @@ (setq buffer-read-only t) ;; turning on short-key-mode keep buffer read-only - (rdebug-short-key-mode) + (rdebug-internal-short-key-mode 1) (assert-equal t buffer-read-only) ;; turning off short-key-mode should make buffer read-write again - (rdebug-short-key-mode) + (rdebug-internal-short-key-mode -1) (assert-equal nil buffer-read-only) (kill-buffer buf)))) From nobody at rubyforge.org Tue Apr 8 10:02:36 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 10:02:36 -0400 (EDT) Subject: [Ruby-debug-commits] [803] trunk/test/data/linetracep.cmd: Forgot to add this for the linetrace+ test. Message-ID: <20080408140236.7464F1858608@rubyforge.org> Revision: 803 Author: rockyb Date: 2008-04-08 10:02:36 -0400 (Tue, 08 Apr 2008) Log Message: ----------- Forgot to add this for the linetrace+ test. Added Paths: ----------- trunk/test/data/linetracep.cmd Added: trunk/test/data/linetracep.cmd =================================================================== --- trunk/test/data/linetracep.cmd (rev 0) +++ trunk/test/data/linetracep.cmd 2008-04-08 14:02:36 UTC (rev 803) @@ -0,0 +1,7 @@ +# ******************************************************** +# This tests the 'linetrace+' command. +# ******************************************************** +set basename on +set linetrace+ on +set linetrace on +continue From nobody at rubyforge.org Tue Apr 8 10:12:58 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 10:12:58 -0400 (EDT) Subject: [Ruby-debug-commits] [804] trunk/test/tdebug.rb: tdebug.rb alignment with rdebug Message-ID: <20080408141258.1DC1D1858662@rubyforge.org> Revision: 804 Author: rockyb Date: 2008-04-08 10:12:57 -0400 (Tue, 08 Apr 2008) Log Message: ----------- tdebug.rb alignment with rdebug Modified Paths: -------------- trunk/test/tdebug.rb Modified: trunk/test/tdebug.rb =================================================================== --- trunk/test/tdebug.rb 2008-04-08 14:02:36 UTC (rev 803) +++ trunk/test/tdebug.rb 2008-04-08 14:12:57 UTC (rev 804) @@ -199,7 +199,7 @@ Debugger.interface = Debugger::ScriptInterface.new(options.script, STDOUT, true) end -options.stop = false if options.tracing +options.nostop = true if options.tracing Debugger.tracing = options.tracing # Make sure Ruby script syntax checks okay. @@ -224,7 +224,8 @@ end # activate post-mortem Debugger.post_mortem if options.post_mortem -Debugger.tracing = options.nostop = true if options.tracing +options.stop = false if options.tracing +Debugger.tracing = options.tracing if options.noquit if Debugger.started? From nobody at rubyforge.org Tue Apr 8 10:16:42 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 10:16:42 -0400 (EDT) Subject: [Ruby-debug-commits] [805] trunk/test/data/raise.right: Another test data line number change Message-ID: <20080408141642.C5DCF1858641@rubyforge.org> Revision: 805 Author: rockyb Date: 2008-04-08 10:16:42 -0400 (Tue, 08 Apr 2008) Log Message: ----------- Another test data line number change Modified Paths: -------------- trunk/test/data/raise.right Modified: trunk/test/data/raise.right =================================================================== --- trunk/test/data/raise.right 2008-04-08 14:12:57 UTC (rev 804) +++ trunk/test/data/raise.right 2008-04-08 14:16:42 UTC (rev 805) @@ -17,9 +17,9 @@ Catch exception 5. # step ./raise.rb:3 - ./tdebug.rb:47:in `debug_load' - ./tdebug.rb:47:in `debug_program' - ./tdebug.rb:235 + ./tdebug.rb:52:in `debug_load' + ./tdebug.rb:52:in `debug_program' + ./tdebug.rb:243 ../rdbg.rb:23:in `load' ../rdbg.rb:23:in `runner' ../rdbg.rb:32 From nobody at rubyforge.org Tue Apr 8 10:52:15 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 10:52:15 -0400 (EDT) Subject: [Ruby-debug-commits] [806] trunk: autorequire is deprecated and presumably no longer needed http ://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/182827 Message-ID: <20080408145216.106351858646@rubyforge.org> Revision: 806 Author: rockyb Date: 2008-04-08 10:52:15 -0400 (Tue, 08 Apr 2008) Log Message: ----------- autorequire is deprecated and presumably no longer needed http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/182827 Modified Paths: -------------- trunk/ChangeLog trunk/Rakefile trunk/lib/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-04-08 14:16:42 UTC (rev 805) +++ trunk/ChangeLog 2008-04-08 14:52:15 UTC (rev 806) @@ -1,3 +1,65 @@ +2008-04-08 14:16 Rocky Bernstein + + * test/data/raise.right: Another test data line number change + +2008-04-08 14:12 Rocky Bernstein + + * test/tdebug.rb: tdebug.rb alignment with rdebug + +2008-04-08 14:02 Rocky Bernstein + + * test/data/linetracep.cmd: Forgot to add this for the linetrace+ + test. + +2008-04-08 14:01 Rocky Bernstein + + * emacs/rdebug-shortkey.el, emacs/test/test-shortkey.el: Attempt a + fix at shortkey internal. There be dragons here. Not sure what's + going on. + +2008-04-08 10:23 Rocky Bernstein + + * test/data/linetracep.right, test/test-trace.rb: Another linetrace + test. This time with linetrace+ set. + +2008-04-08 10:19 Rocky Bernstein + + * cli/ruby-debug/processor.rb, test/data/linetrace.cmd, + test/data/linetrace.right, test/test-trace.rb: processor.rb: + Silence possibly more warnings under $DEBUG + test/*: another linetrace test using the linetrace command. + +2008-04-08 03:17 Rocky Bernstein + + * test/data/output.right, test/data/quit.right: Test line numbers + changed. Sigh + +2008-04-08 03:14 Rocky Bernstein + + * test/tdebug.rb: Track rdebug. + +2008-04-08 03:10 Rocky Bernstein + + * test/test-trace.rb: Oops forget this test + +2008-04-08 03:09 Rocky Bernstein + + * bin/rdebug, cli/ruby-debug/processor.rb, test/data/trace.right, + test/tdebug.rb: Fix bug in --trace. Add regression test for that + as well. + Reduce (but alas not eliminate) extraneous line tracing. + +2008-04-07 00:36 Rocky Bernstein + + * CHANGES, ChangeLog, emacs/Makefile.am, emacs/rdebug-shortkey.el, + emacs/test/test-shortkey.el, lib/ChangeLog, + lib/ruby-debug-base.rb: ruby-debug-base.rb: document + Debugger.start parameters. + CHANGES: Revise what's happened + test-shortkey.el: A failing regression test because I think + rdebug-shortkey-mode + is not correct. + 2008-04-06 03:03 Rocky Bernstein * bin/rdebug, test/data/test-init-cygwin.right, test/test-init.rb: Modified: trunk/Rakefile =================================================================== --- trunk/Rakefile 2008-04-08 14:16:42 UTC (rev 805) +++ trunk/Rakefile 2008-04-08 14:52:15 UTC (rev 806) @@ -110,7 +110,6 @@ spec.platform = Gem::Platform::RUBY spec.require_path = "lib" spec.extensions = ["ext/extconf.rb"] - spec.autorequire = "ruby-debug-base" spec.files = BASE_FILES.to_a spec.required_ruby_version = '>= 1.8.2' @@ -142,7 +141,6 @@ spec.require_path = "cli" spec.bindir = "bin" spec.executables = ["rdebug"] - spec.autorequire = "ruby-debug" spec.files = CLI_FILES.to_a spec.required_ruby_version = '>= 1.8.2' Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-04-08 14:16:42 UTC (rev 805) +++ trunk/lib/ChangeLog 2008-04-08 14:52:15 UTC (rev 806) @@ -1,3 +1,14 @@ +2008-04-07 00:36 Rocky Bernstein + + * trunk/CHANGES, trunk/ChangeLog, trunk/emacs/Makefile.am, + trunk/emacs/rdebug-shortkey.el, + trunk/emacs/test/test-shortkey.el, ChangeLog, ruby-debug-base.rb: + ruby-debug-base.rb: document Debugger.start parameters. + CHANGES: Revise what's happened + test-shortkey.el: A failing regression test because I think + rdebug-shortkey-mode + is not correct. + 2008-04-03 19:01 Rocky Bernstein * trunk/ChangeLog, trunk/doc/ruby-debug.texi, ChangeLog, From nobody at rubyforge.org Tue Apr 8 15:55:37 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 8 Apr 2008 15:55:37 -0400 (EDT) Subject: [Ruby-debug-commits] [807] trunk/emacs: Logic in rdebug-internal-short-key-mode reworked. Message-ID: <20080408195537.DB36A18585F8@rubyforge.org> Revision: 807 Author: andersl Date: 2008-04-08 15:55:37 -0400 (Tue, 08 Apr 2008) Log Message: ----------- Logic in rdebug-internal-short-key-mode reworked. Test case updated. Modified Paths: -------------- trunk/emacs/rdebug-shortkey.el trunk/emacs/test/test-shortkey.el Modified: trunk/emacs/rdebug-shortkey.el =================================================================== --- trunk/emacs/rdebug-shortkey.el 2008-04-08 14:52:15 UTC (rev 806) +++ trunk/emacs/rdebug-shortkey.el 2008-04-08 19:55:37 UTC (rev 807) @@ -70,10 +70,12 @@ map) "Keymap used in `rdebug-internal-short-key-mode'.") -(defvar rdebug-original-read-only :off - "The value `buffer-read-only' should be restored to after short key mode. +(defvar rdebug-original-read-only nil + "The value `buffer-read-only' should be restored to after short key mode.") -When :off, the mode is not active.") +;; `define-minor-mode' does not set if the mode was on or off prior to being called. +(defvar rdebug-internal-short-key-mode-previous-state nil + "Used to determine when 'rdebug-internal-short-key-mode' changed state.") ;; Implementation note: This is the mode that does all the work, it's ;; local to the buffer that is affected. @@ -91,20 +93,22 @@ :lighter " ShortKeys" :keymap rdebug-internal-short-key-mode-map (make-local-variable 'rdebug-original-read-only) - ;; Note, without the third state, :off, activating the mode more - ;; than once would overwrite the real original value. - (if (eq rdebug-original-read-only nil) - (setq rdebug-original-read-only - (if buffer-read-only t :off))) - (if rdebug-internal-short-key-mode - ;; Turn on shortkey mode - (setq buffer-read-only t) - ;; Turn off shortkey mode - (if (eq rdebug-original-read-only t) - (setq buffer-read-only t) - (setq buffer-read-only nil)))) + (make-local-variable 'rdebug-internal-short-key-mode-previous-state) + ;; Ensure action only is performed when the state actually is toggled. + (unless (eq rdebug-internal-short-key-mode-previous-state + rdebug-internal-short-key-mode) + (if rdebug-internal-short-key-mode + ;; Mode is being turned on. + (progn + (setq rdebug-original-read-only buffer-read-only) + (setq buffer-read-only t)) + ;; Mode is being turned off. + (setq buffer-read-only rdebug-original-read-only)) + ;; Save the current state, so we can determine when the state is + ;; toggled in the future. + (setq rdebug-internal-short-key-mode-previous-state + rdebug-internal-short-key-mode))) - (defun rdebug-buffer-killed-p (buffer) "Return t if BUFFER is killed." (not (buffer-name buffer))) @@ -126,7 +130,7 @@ (save-current-buffer (set-buffer buffer) ;; Make gud-comint-buffer local - (if gud-comint-buffer + (if gud-comint-buffer (make-local-variable 'gud-comint-buffer)) (rdebug-internal-short-key-mode 1))))))))) @@ -141,6 +145,12 @@ (rdebug-short-key-mode 1)) +(defun rdebug-turn-off-short-key-mode () + "Turn off `rdebug-short-key-mode'." + (interactive) + (rdebug-short-key-mode -1)) + + (defun rdebug-short-key-mode-maybe-activate () (if rdebug-short-key-mode (rdebug-internal-short-key-mode-on) @@ -154,7 +164,6 @@ (dolist (buf (buffer-list)) (set-buffer buf) (when rdebug-internal-short-key-mode - (setq rdebug-internal-short-key-mode nil) (rdebug-internal-short-key-mode -1)))))) (provide 'rdebug-shortkey) Modified: trunk/emacs/test/test-shortkey.el =================================================================== --- trunk/emacs/test/test-shortkey.el 2008-04-08 14:52:15 UTC (rev 806) +++ trunk/emacs/test/test-shortkey.el 2008-04-08 19:55:37 UTC (rev 807) @@ -4,7 +4,8 @@ (load-file "./elk-test.el") ;; FIXME? Should we use "require 'rdebug" here. -;; Would have to prepend . to load-path. +;; Would have to prepend . to load-path. +(setq load-path (cons ".." load-path)) (load-file "../rdebug-shortkey.el") (deftest "rdebug-shortkey-mode-test" @@ -12,12 +13,28 @@ (with-current-buffer buf (setq buffer-read-only nil) ;; turning on short-key-mode make buffer read-only - (rdebug-internal-short-key-mode 1) + (rdebug-internal-short-key-mode 1) (assert-equal t buffer-read-only) - + ;; turning off short-key-mode should make buffer read-write again (rdebug-internal-short-key-mode -1) + (assert-equal nil buffer-read-only) + + ;; -------------------- + ;; Check multiple "on": and "off:s". + + (rdebug-internal-short-key-mode 1) + (assert-equal t buffer-read-only) + + (rdebug-internal-short-key-mode 1) + (assert-equal t buffer-read-only) + + (rdebug-internal-short-key-mode 1) + (assert-equal t buffer-read-only) + + (rdebug-internal-short-key-mode -1) (assert-equal nil buffer-read-only)) + (kill-buffer buf)) (let ((buf (generate-new-buffer "shortkey readonly"))) @@ -28,17 +45,17 @@ (rdebug-internal-short-key-mode 1) (assert-equal t buffer-read-only) - ;; turning off short-key-mode should make buffer read-write again + ;; The buffer was originally in read-only mode, it should remain + ;; there. (rdebug-internal-short-key-mode -1) - (assert-equal nil buffer-read-only) - (kill-buffer buf)))) + (assert-equal t buffer-read-only)) + (kill-buffer buf))) ;; ------------------------------------------------------------------- ;; Build and run the test suite. ;; -(build-suite "rdebug-suite" +(build-suite "rdebug-suite" "rdebug-shortkey-mode-test") (run-elk-test "rdebug-suite" "test things in rdebug-shortkey.el") - From nobody at rubyforge.org Wed Apr 9 17:22:18 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 9 Apr 2008 17:22:18 -0400 (EDT) Subject: [Ruby-debug-commits] [808] trunk/doc/rdebug-emacs.texi: New chapter for multi-window debugging. Message-ID: <20080409212218.BC9E918585F5@rubyforge.org> Revision: 808 Author: andersl Date: 2008-04-09 17:22:18 -0400 (Wed, 09 Apr 2008) Log Message: ----------- New chapter for multi-window debugging. Intro reworked. NOTE: Menu nodes not updated. Modified Paths: -------------- trunk/doc/rdebug-emacs.texi Modified: trunk/doc/rdebug-emacs.texi =================================================================== --- trunk/doc/rdebug-emacs.texi 2008-04-08 19:55:37 UTC (rev 807) +++ trunk/doc/rdebug-emacs.texi 2008-04-09 21:22:18 UTC (rev 808) @@ -42,10 +42,10 @@ @top Debugging with ruby-debug under GNU Emacs @menu -* autoloaded functions:: +* installation:: +* getting started:: * Debugger Buffers:: * Emacs Debugger Commands:: -* Emacs with Annotate:: A richer debugging environment Indexes (nodes containing large menus) * Emacs Command Index:: An item for each GNU/Emacs command name. * Emacs Function Index:: An item for each Emacs Function. @@ -54,7 +54,7 @@ @detailmenu --- The Detailed Node Listing --- -Autoloaded functions +getting started * Emacs rdebug:: Invoke the ruby debugger initially * Emacs shell tracking mode:: Entering rdebug from an existing shell buffer @@ -89,30 +89,50 @@ @cindex @value{Emacs} A special interface which comes with Ruby that allows you to use @value{Emacs} to view (and edit) the source files for the program you -are debugging with @value{DBG}. However you must be using - at value{Emacs} version 21, but with @value{Emacs} version 22 or 23 +are debugging with @value{DBG}. However you must be using at least +version 21 of @value{Emacs}, but with @value{Emacs} version 22 or 23 there are even more debugging features available. @code{M-x -show-emacs-version} inside @value{Emacs} will tell you what version -you are running. +show-emacs-version} inside @value{Emacs} will tell you what version you +are running. -To use this interface, you to load @code{rdebug.el}. +This package provide a full-fledged debugging environment, on par with +modern integrated development environments. Once the debugger has been +activated, the Emacs frame is divided into a number of dedicated +debugger windows. at footnote{If you are an @value{Emacs} traditionalist, +you can, of course, run this package with only a shell and source +buffer} - at smallexample - (require 'rdebug) - at end smallexample +This package comes with a number of predefined window layout. It is +fully customizable so you can create your own. -Once this is done, some commands become autoloaded. In particular - at kbd{rdebug}, @kbd{rdebug-turn-on-debugger-support}, - at kbd{turn-on-rdebugtrack-mode} and @kbd{rdebug-track-attach}. + at c ------------------------------------------------------------------- - at node autoloaded functions - at chapter Autoloaded functions + at node getting started + at chapter getting started + @menu +* Installation:: How to install this package * Emacs rdebug:: Invoke the ruby debugger initially * Emacs shell tracking mode:: Entering rdebug from an existing shell buffer @end menu + at node Installation + at section Installation + +To use this interface, load the file @code{rdebug.el}. This file is a +light-weight file, basically it only contains a handful of + at code{autoload} directives. + +For example, you can place the following in your @code{~/.emacs} file: + + at smallexample + (require 'rdebug) + at end smallexample + +In addition, you must have Ruby and ruby-debug installed. + + @node Emacs rdebug @section Emacs rdebug @@ -147,7 +167,9 @@ @node Emacs shell tracking mode @section Entering rdebug from an existing shell buffer -Many times it's not feasible to enter the debugger from the outset. Instead a call to the debugger is put inside the program. +Many times it's not feasible to enter the debugger from the outset. +Instead a call to the debugger is put inside the program. + @c See @xref{Unit Testing Session}. It is also possible in GNU emacs to use a (``comint'') shell and set a @@ -155,15 +177,259 @@ another window. @xref{Interactive Shell, , Shell, Emacs, The @value{Emacs} Manual}. -To enable, this run @kbd{M-x turn-on-rdebug-track-mode}. There is some overhead -involved in scanning output, so if you are not debugging Ruby programs -you probably want to turn this off which can be done via the M-x - at code{turn-off-rdebugtrack} command. +To enable, this run @kbd{M-x turn-on-rdebug-track-mode}. There is some +overhead involved in scanning output, so if you are not debugging Ruby +programs you probably want to turn this off which can be done via the + at code{M-x turn-off-rdebugtrack} command. -If you want to use even more integration and tracking, run @kbd{M-x -rdebug-track-attach} and then inside the debugger give the debugger -command @kbd{set annotate 3}. Emacs interaction when annotate is in effect is described in @xref{Emacs with Annotate}. + at c ------------------------------------------------------------------- + at node The Multi-window Mode + at chapter Multi-window + +In the multi-window debugger mode, a number of buffers are visible when +the debugger starts. This chapter will describe each of them, in +addition it will descibe the features associated with the multi-window +mode. + +The default layout looks like the following: + + at verbatim ++----------------------------------------------------------------------+ +| Toolbar | ++-----------------------------------+----------------------------------+ +| | | +| Debugger shell | Variables buffer | +| | | ++-----------------------------------+----------------------------------+ +| | | +| Source buffer | Output buffer | +| | | ++-----------------------------------+----------------------------------+ +| | | +| Stack buffer | Breakpoints buffer | +| | | ++-----------------------------------+----------------------------------+ + at end verbatim + + at section Activating Multi-window mode + +The variable @code{rdebug-many-windows} controls if multi-window mode +should be used, it is enabled by default. When starting the debugger +using the @code{M-x rdebug} mode the command line option @code{--emacs +3} must be specified (this is also the default). + +When attaching to an already running debugger process, you must give the +debugger command @kbd{set annotate 3}. + + at section Window Layouts + +When the debugger is started, the original window layout of + at value{Emacs} is replaced with the window layout of the debugger. You +can switch back and forth between the original window layout and the +debugger layout using + at kbd{M-x rdebug-display-original-window-configuration} and + at kbd{M-x rdebug-display-debugger-window-configuration}. + +If, for some reason, the debugger layout has been garbarged you can +restore it to the original state using @kbd{M-x +rdebug-restore-debugger-window-layout}. + +The debugger provides a number of different window layouts. The easies +way to try them out is to use the menu @kbd{ +} and select any in the section starting with @code{Standard}. + + + at section The buffers + +All buffers in this section share a set of commands for common debugger +operations and for switching between buffers. In addition, each buffer +has got a set of dedicated commands. + +All debugger buffers, with the exception of source and the debugger +shell window, are called @emph{secondary buffers}. + + at subsection Keybindings for all Debugger Windows + +The debugger provides key-bindings that work in all debugger windows. +They are desgined to match keys of commonly used debugger environments. +You can use @kbd{ } to +change the keybindings. The following are provided: + + at multitable @columnfractions 0.4 0.2 0.2 0.2 + at headitem Command @tab Standard @tab Eclipse @tab Netbeans + at item Run @tab f5 @tab @tab + at item Quit @tab S-f5 @tab @tab + at item Toggle Breakpoint @tab f9 @tab @tab + at item Enable/Disable Breakpoint @tab C-f9 @tab S-C-b @tab S-f8 + at item Step over @tab f10 @tab f6 @tab f8 + at item Step into @tab f11 @tab f5 @tab f7 + at item Step out @tab S-f11 @tab f7 @tab M-S-f7 + + at end multitable + + + + at subsection Keybindings for Secondary Buffers + +The following commands are available in all secondary windows. + +Capital letters move between secondary buffers as mentioned above (jump +to if visible or replace a secondary if not). + + at table @kbd + at item SPACE +step (edebug compatible) + at item < +Up in the stack trace + at item > +Down in the stack trace + at item ? +Help + at item B +Display breakpoints buffer + at item C +Display command buffer + at item O +Display program output + at item S +Display source window + at item T +Display stack trace buffer + at item V +display variables buffer + at item W +display watch buffer + at item b +Set breakpoint + at item c +Continue (i.e. run) + at item d +Remove breakpoint + at item f +Finish (i.e. step out of the current function) + at item n +Next (i.e. step into function) + at item p +print + at item q +Quit + at item r +Restart + at item s +Step (i.e. step over function) + at end table + +You can use the same commands in the source buffer if you enable + at code{rdebug-short-key-mode}. The best way to do this is to add the +following to your init file: + + at smallexample + (add-hook 'rdebug-mode-hook 'rdebug-turn-on-short-key-mode) + at end smallexample + + + + at subsection The Debugger Shell Buffer + +The @emph{debgger shell window} is the main communication channel +between @value{DBG} and @value{Emacs}. You can use the shell to issue +debugger commands directly. In addition, any @value{Emacs} debugger +command you issue will be translated into shell commands, and the output +will be parsed. + +It is the ambition that the @value{Emacs} debugger interface should be +in a state where the debugger shell window would not need to be visible. + + at subsection The Source Buffer + +The @emph{source buffers} (or buffers) contains the actual Ruby source +code that is being debugged. A small arrow in the left fringe displays +the current line. Active breakpoints are dipslayed as red dots and +passive as grey. + + at subsection The Output Buffer + +The @emph{output buffer} displays any output the debugged program emits. + +The option @code{rdebug-use-separate-io-buffer} controls if the output +buffer should be used, or if the output would go into the debugger shell +buffer. + + at subsection The Variables Buffer + +In this buffer, local and object variables are displayed. The values of +the variables can be edited. + + at table @kbd + at item RET +Edit the value + at item e +Print the value + at item x +Pretty-print the value + at end table + + at subsection The Stack Trace Buffer + +The @emph{stack trace} buffer displays the function that is currently +being debugger, the function that called it, etc., all the way up to the +originally called function. + +You can navigate in the stack trace buffer in order to see the source of +any function in the call chain. The Variables buffer will also be +updated to reflect the local variables of that function. + + at table @kbd + at item RET +Select a function to display + at item +Go to a stack frame + at end table + + at subsection The Watch Buffer + +The @emph{Watch Buffer} can display arbitrary expressions, including, +but not limited to, global variables. + + at table @kbd + at item a +Add a watch expression + at item C-d, d +Delete a watch expression + at item RET, e +Edit a watch expression + at item +Go to the expression + at end table + + at subsection The Breakpoints Buffer + +The @emph{Breakpoints Buffer} displays all breakpoints that currenty are +defined and shows if they are enabled or disabled. + + at table @kbd + at item t +Toggle a breakpoint between enabled and disabled + at item i +Add a breakpoint condition + at item ret +Goto a breakpoint + at item C-d +Delete a breakpoint + at item +Go to the expression + at end table + + at subsection The Help Buffer + +The @emph{Help Buffer} is displayed whenever you press @code{?}. It will +display a help text on the available debugger commands and commands to +navigate between the buffers. + + + at c ------------------------------------------------------------------- + @node Debugger Buffers @chapter Debugger Buffers @@ -713,106 +979,6 @@ Set temporary breakpoint at current line. @end table - at node Emacs with Annotate - at chapter A richer debugging environment using @code{--annotate} - -When @code{--annotate 3} is added as an option to the @code{rdebug} -command, extra information is passed between @value{Emacs} and - at value{DBG}. For each debug session several internal buffers set up -and constantly updated. They contain information about the current -state of the program. The names of the buffers start @code{*rdebug-}; -they are: - - at itemize @bullet - at item @code{*rdebug-breakpoints- at emph{program-name}*} - -A buffer containing breakpoint information. - - at item @code{*rdebug-watch- at emph{program-name}*} - -A buffer containing display expressions - at c (@pxref{DisplayCommands}). - at item @code{*rdebug-output- at emph{program-name}*} - -A buffer containing output produced in running the program so far. - at item @code{*rdebug-stack- at emph{program-name}*} - -The call stack for the current thread - at item @code{*rdebug-variables- at emph{program-name}*} - -A buffer containing local variables (@code{local_variables}) and -instance variables (@code{instance_variables}). - at end itemize - at kindex secondary buffers. -These are called @emph{secondary buffers}. - -Because screen real-estate is limited, some of these buffers may be -visible in a frame and some not. There are commands to switch to these -buffers moving to the visible frame if the buffer is visible, or -replacing the secondary buffer that the command was issued from with -the desired secondary buffer. - -Capital letters move between secondary buffers as mentioned above (jump -to if visible or replace a secondary if not). - - at table @kbd - at item SPACE -step (edebug compatible) - at item < -up (Gud uses this and Emacs uses M-< for beginning of buffer) - at item > -down (Gud uses this and Emacs uses M-> for beginning of buffer) - at item ? -help - at item B -goto/display breakpoints buffer - at item C -goto/display command buffer - at item O -goto/display program output - at item S -goto/display source window - at item T -goto/display stack-buffer (Perl uses T for stack trace) - at item V -goto/display variables buffer - at item W -goto/display watch buffer - at item b -set breakpoint (edebug compatible) - at item c -continue (edebug compatible) - at item d -remove break - at item f -finish - at item n -next (edebug compatible) - at item p -print - at item q -quit (edebug compatible) - at item r -restart - at item s -step - at end table - -Some secondary buffers may have specific commands applicable, but -there are very few of these. - - at verbatim -Buffer specific commands - Stack buffer - return: set frame at this position - - variables buffer - return: edit the variable's value - - breakpoints: - return toggle breakpoint (enable/disable it) - at end verbatim - @node Emacs Command Index @unnumbered Emacs Command Index @printindex pg From nobody at rubyforge.org Wed Apr 9 22:03:41 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 9 Apr 2008 22:03:41 -0400 (EDT) Subject: [Ruby-debug-commits] [809] trunk: Cosmetic stuff: spelling corrections. Message-ID: <20080410020342.22CDB185866A@rubyforge.org> Revision: 809 Author: rockyb Date: 2008-04-09 22:03:41 -0400 (Wed, 09 Apr 2008) Log Message: ----------- Cosmetic stuff: spelling corrections. Update node structure so texinfo doesn't complain. Modified Paths: -------------- trunk/ChangeLog trunk/doc/rdebug-emacs.texi trunk/lib/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-04-09 21:22:18 UTC (rev 808) +++ trunk/ChangeLog 2008-04-10 02:03:41 UTC (rev 809) @@ -1,3 +1,9 @@ +2008-04-08 14:52 Rocky Bernstein + + * ChangeLog, Rakefile, lib/ChangeLog: autorequire is deprecated and + presumably no longer needed + http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/182827 + 2008-04-08 14:16 Rocky Bernstein * test/data/raise.right: Another test data line number change Modified: trunk/doc/rdebug-emacs.texi =================================================================== --- trunk/doc/rdebug-emacs.texi 2008-04-09 21:22:18 UTC (rev 808) +++ trunk/doc/rdebug-emacs.texi 2008-04-10 02:03:41 UTC (rev 809) @@ -38,40 +38,40 @@ @end titlepage @page - at node Top + at node Top, getting started, (dir), (dir) @top Debugging with ruby-debug under GNU Emacs @menu -* installation:: -* getting started:: -* Debugger Buffers:: -* Emacs Debugger Commands:: -Indexes (nodes containing large menus) -* Emacs Command Index:: An item for each GNU/Emacs command name. -* Emacs Function Index:: An item for each Emacs Function. -* Emacs Key Binding Index:: An item for each Emacs Debugger Command. +* getting started:: +* The Multi-window Mode:: +* Debugger Buffers:: +* Emacs Debugger Commands:: Indexes (nodes containing large menus) +* Emacs Command Index:: An item for each GNU/Emacs command name. +* Emacs Function Index:: An item for each Emacs Function. +* Emacs Key Binding Index:: An item for each Emacs Debugger Command. @detailmenu --- The Detailed Node Listing --- getting started -* Emacs rdebug:: Invoke the ruby debugger initially -* Emacs shell tracking mode:: Entering rdebug from an existing shell buffer +* Installation:: How to install this package +* Emacs rdebug:: Invoke the ruby debugger initially +* Emacs shell tracking mode:: Entering rdebug from an existing shell buffer Debugger Buffers -* Debugger Command Buffer:: -* Emacs Source:: Commands from the source script +* Debugger Command Buffer:: +* Emacs Source:: Commands from the source script Emacs Debugger Commands -* Emacs Debugger Common Commands:: -* Emacs Debugger Breakpoint Buffer Commands:: -* Emacs Debugger Stack Buffer Commands:: -* Emacs Debugger Variable Buffer Commands:: -* Emacs Debugger Watch Buffer Commands:: -* Emacs GUD Commands:: +* Emacs Debugger Common Commands:: +* Emacs Debugger Breakpoint Buffer Commands:: +* Emacs Debugger Stack Buffer Commands:: +* Emacs Debugger Variable Buffer Commands:: +* Emacs Debugger Watch Buffer Commands:: +* Emacs GUD Commands:: @end detailmenu @end menu @@ -102,22 +102,22 @@ you can, of course, run this package with only a shell and source buffer} -This package comes with a number of predefined window layout. It is +This package comes with a number of predefined window layouts. It is fully customizable so you can create your own. @c ------------------------------------------------------------------- - at node getting started + at node getting started, The Multi-window Mode, Top, Top @chapter getting started @menu -* Installation:: How to install this package -* Emacs rdebug:: Invoke the ruby debugger initially -* Emacs shell tracking mode:: Entering rdebug from an existing shell buffer +* Installation:: How to install this package +* Emacs rdebug:: Invoke the ruby debugger initially +* Emacs shell tracking mode:: Entering rdebug from an existing shell buffer @end menu - at node Installation + at node Installation, Emacs rdebug, getting started, getting started @section Installation To use this interface, load the file @code{rdebug.el}. This file is a @@ -133,7 +133,7 @@ In addition, you must have Ruby and ruby-debug installed. - at node Emacs rdebug + at node Emacs rdebug, Emacs shell tracking mode, Installation, getting started @section Emacs rdebug Use the command @kbd{M-x rdebug} in @sc{gnu} Emacs to start debugging. @@ -164,7 +164,7 @@ way---for example, @kbd{C-c C-c} for an interrupt, @kbd{C-c C-z} for a stop. - at node Emacs shell tracking mode + at node Emacs shell tracking mode, , Emacs rdebug, getting started @section Entering rdebug from an existing shell buffer Many times it's not feasible to enter the debugger from the outset. @@ -184,15 +184,15 @@ @c ------------------------------------------------------------------- - at node The Multi-window Mode + at node The Multi-window Mode, Debugger Buffers, getting started, Top @chapter Multi-window In the multi-window debugger mode, a number of buffers are visible when the debugger starts. This chapter will describe each of them, in -addition it will descibe the features associated with the multi-window +addition it will describe the features associated with the multi-window mode. -The default layout looks like the following: +The default multi-window layout looks like the following: @verbatim +----------------------------------------------------------------------+ @@ -231,7 +231,7 @@ @kbd{M-x rdebug-display-original-window-configuration} and @kbd{M-x rdebug-display-debugger-window-configuration}. -If, for some reason, the debugger layout has been garbarged you can +If, for some reason, the debugger layout has been garbled you can restore it to the original state using @kbd{M-x rdebug-restore-debugger-window-layout}. @@ -252,7 +252,7 @@ @subsection Keybindings for all Debugger Windows The debugger provides key-bindings that work in all debugger windows. -They are desgined to match keys of commonly used debugger environments. +They are designed to match keys of commonly used debugger environments. You can use @kbd{ } to change the keybindings. The following are provided: @@ -332,7 +332,7 @@ @subsection The Debugger Shell Buffer -The @emph{debgger shell window} is the main communication channel +The @emph{debugger shell window} is the main communication channel between @value{DBG} and @value{Emacs}. You can use the shell to issue debugger commands directly. In addition, any @value{Emacs} debugger command you issue will be translated into shell commands, and the output @@ -345,7 +345,7 @@ The @emph{source buffers} (or buffers) contains the actual Ruby source code that is being debugged. A small arrow in the left fringe displays -the current line. Active breakpoints are dipslayed as red dots and +the current line. Active breakpoints are displayed as red dots and passive as grey. @subsection The Output Buffer @@ -405,7 +405,7 @@ @subsection The Breakpoints Buffer -The @emph{Breakpoints Buffer} displays all breakpoints that currenty are +The @emph{Breakpoints Buffer} displays all breakpoints that currently are defined and shows if they are enabled or disabled. @table @kbd @@ -430,15 +430,15 @@ @c ------------------------------------------------------------------- - at node Debugger Buffers + at node Debugger Buffers, Emacs Debugger Commands, The Multi-window Mode, Top @chapter Debugger Buffers @menu -* Debugger Command Buffer:: -* Emacs Source:: Commands from the source script +* Debugger Command Buffer:: +* Emacs Source:: Commands from the source script @end menu - at node Debugger Command Buffer + at node Debugger Command Buffer, Emacs Source, Debugger Buffers, Debugger Buffers @section Emacs Debugger Command buffer Each time @value{DBG} displays a stack frame, Emacs automatically finds the @@ -660,7 +660,7 @@ @xref{Debugger Operation, , , Emacs, The @value{Emacs} Manual}. - at node Emacs Source + at node Emacs Source, , Debugger Command Buffer, Debugger Buffers @section Commands from the source script @table @kbd @@ -776,19 +776,19 @@ @end table - at node Emacs Debugger Commands + at node Emacs Debugger Commands, Emacs Command Index, Debugger Buffers, Top @chapter Emacs Debugger Commands @menu -* Emacs Debugger Common Commands:: -* Emacs Debugger Breakpoint Buffer Commands:: -* Emacs Debugger Stack Buffer Commands:: -* Emacs Debugger Variable Buffer Commands:: -* Emacs Debugger Watch Buffer Commands:: -* Emacs GUD Commands:: +* Emacs Debugger Common Commands:: +* Emacs Debugger Breakpoint Buffer Commands:: +* Emacs Debugger Stack Buffer Commands:: +* Emacs Debugger Variable Buffer Commands:: +* Emacs Debugger Watch Buffer Commands:: +* Emacs GUD Commands:: @end menu - at node Emacs Debugger Common Commands + at node Emacs Debugger Common Commands, Emacs Debugger Breakpoint Buffer Commands, Emacs Debugger Commands, Emacs Debugger Commands @section Emacs Debugger Common Commands The commands in this section are used to make a secondary buffer @@ -887,7 +887,7 @@ @end table - at node Emacs Debugger Breakpoint Buffer Commands + at node Emacs Debugger Breakpoint Buffer Commands, Emacs Debugger Stack Buffer Commands, Emacs Debugger Common Commands, Emacs Debugger Commands @section Emacs Debugger Breakpoint Buffer Commands @table @kbd @@ -901,7 +901,7 @@ @var{rdebug-breakpoints-mode-map}. @end table - at node Emacs Debugger Stack Buffer Commands + at node Emacs Debugger Stack Buffer Commands, Emacs Debugger Variable Buffer Commands, Emacs Debugger Breakpoint Buffer Commands, Emacs Debugger Commands @section Emacs Debugger Stack Buffer Commands @table @kbd @@ -913,7 +913,7 @@ @var{rdebug-frames-mode-map}. @end table - at node Emacs Debugger Variable Buffer Commands + at node Emacs Debugger Variable Buffer Commands, Emacs Debugger Watch Buffer Commands, Emacs Debugger Stack Buffer Commands, Emacs Debugger Commands @section Emacs Debugger Variable Buffer Commands @table @kbd @@ -921,7 +921,7 @@ @findex rdebug-variables-edit @end table - at node Emacs Debugger Watch Buffer Commands + at node Emacs Debugger Watch Buffer Commands, Emacs GUD Commands, Emacs Debugger Variable Buffer Commands, Emacs Debugger Commands @section Emacs Debugger Watch Buffer Commands @table @kbd @@ -940,7 +940,7 @@ @var{rdebug-watch-mode-map}. @end table - at node Emacs GUD Commands + at node Emacs GUD Commands, , Emacs Debugger Watch Buffer Commands, Emacs Debugger Commands @section Emacs Debugger GUD Commands @table @kbd @@ -979,15 +979,15 @@ Set temporary breakpoint at current line. @end table - at node Emacs Command Index + at node Emacs Command Index, Emacs Function Index, Emacs Debugger Commands, Top @unnumbered Emacs Command Index @printindex pg - at node Emacs Function Index + at node Emacs Function Index, Emacs Key Binding Index, Emacs Command Index, Top @unnumbered Emacs Function Index @printindex fn - at node Emacs Key Binding Index + at node Emacs Key Binding Index, , Emacs Function Index, Top @unnumbered Key Binding Index @printindex ky Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-04-09 21:22:18 UTC (rev 808) +++ trunk/lib/ChangeLog 2008-04-10 02:03:41 UTC (rev 809) @@ -1,3 +1,9 @@ +2008-04-08 14:52 Rocky Bernstein + + * trunk/ChangeLog, trunk/Rakefile, ChangeLog: autorequire is + deprecated and presumably no longer needed + http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/182827 + 2008-04-07 00:36 Rocky Bernstein * trunk/CHANGES, trunk/ChangeLog, trunk/emacs/Makefile.am, From nobody at rubyforge.org Thu Apr 10 04:00:11 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 10 Apr 2008 04:00:11 -0400 (EDT) Subject: [Ruby-debug-commits] [810] trunk: Last change before 0.10.1 release. Message-ID: <20080410080012.093E91858682@rubyforge.org> Revision: 810 Author: rockyb Date: 2008-04-10 04:00:11 -0400 (Thu, 10 Apr 2008) Log Message: ----------- Last change before 0.10.1 release. Modified Paths: -------------- trunk/ChangeLog trunk/Rakefile trunk/lib/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-04-10 02:03:41 UTC (rev 809) +++ trunk/ChangeLog 2008-04-10 08:00:11 UTC (rev 810) @@ -1,3 +1,19 @@ +2008-04-10 02:03 Rocky Bernstein + + * ChangeLog, doc/rdebug-emacs.texi, lib/ChangeLog: Cosmetic stuff: + spelling corrections. Update node structure so texinfo + doesn't complain. + +2008-04-09 21:22 Anders Lindgren + + * doc/rdebug-emacs.texi: New chapter for multi-window debugging. + Intro reworked. NOTE: Menu nodes not updated. + +2008-04-08 19:55 Anders Lindgren + + * emacs/rdebug-shortkey.el, emacs/test/test-shortkey.el: Logic in + rdebug-internal-short-key-mode reworked. Test case updated. + 2008-04-08 14:52 Rocky Bernstein * ChangeLog, Rakefile, lib/ChangeLog: autorequire is deprecated and Modified: trunk/Rakefile =================================================================== --- trunk/Rakefile 2008-04-10 02:03:41 UTC (rev 809) +++ trunk/Rakefile 2008-04-10 08:00:11 UTC (rev 810) @@ -115,7 +115,7 @@ spec.required_ruby_version = '>= 1.8.2' spec.date = Time.now spec.rubyforge_project = 'ruby-debug' - spec.add_dependency('linecache', '>= 0.4') + spec.add_dependency('linecache', '>= 0.3') spec.test_files = FileList[BASE_TEST_FILE_LIST] Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-04-10 02:03:41 UTC (rev 809) +++ trunk/lib/ChangeLog 2008-04-10 08:00:11 UTC (rev 810) @@ -1,3 +1,9 @@ +2008-04-10 02:03 Rocky Bernstein + + * trunk/ChangeLog, trunk/doc/rdebug-emacs.texi, ChangeLog: Cosmetic + stuff: spelling corrections. Update node structure so texinfo + doesn't complain. + 2008-04-08 14:52 Rocky Bernstein * trunk/ChangeLog, trunk/Rakefile, ChangeLog: autorequire is From nobody at rubyforge.org Thu Apr 10 04:49:22 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 10 Apr 2008 04:49:22 -0400 (EDT) Subject: [Ruby-debug-commits] [811] trunk: linecache is required by ruby-debug-base not ruby-debug. Message-ID: <20080410084923.F24FA1858688@rubyforge.org> Revision: 811 Author: rockyb Date: 2008-04-10 04:49:11 -0400 (Thu, 10 Apr 2008) Log Message: ----------- linecache is required by ruby-debug-base not ruby-debug. Thanks Martin! Modified Paths: -------------- trunk/ChangeLog trunk/cli/ruby-debug/command.rb trunk/lib/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-04-10 08:00:11 UTC (rev 810) +++ trunk/ChangeLog 2008-04-10 08:49:11 UTC (rev 811) @@ -1,3 +1,8 @@ +2008-04-10 08:00 Rocky Bernstein + + * ChangeLog, Rakefile, lib/ChangeLog: Last change before 0.10.1 + release. + 2008-04-10 02:03 Rocky Bernstein * ChangeLog, doc/rdebug-emacs.texi, lib/ChangeLog: Cosmetic stuff: Modified: trunk/cli/ruby-debug/command.rb =================================================================== --- trunk/cli/ruby-debug/command.rb 2008-04-10 08:00:11 UTC (rev 810) +++ trunk/cli/ruby-debug/command.rb 2008-04-10 08:49:11 UTC (rev 811) @@ -1,6 +1,5 @@ require 'rubygems' require 'columnize' -require 'linecache' require 'ruby-debug/helper' module Debugger Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2008-04-10 08:00:11 UTC (rev 810) +++ trunk/lib/ChangeLog 2008-04-10 08:49:11 UTC (rev 811) @@ -1,3 +1,8 @@ +2008-04-10 08:00 Rocky Bernstein + + * trunk/ChangeLog, trunk/Rakefile, ChangeLog: Last change before + 0.10.1 release. + 2008-04-10 02:03 Rocky Bernstein * trunk/ChangeLog, trunk/doc/rdebug-emacs.texi, ChangeLog: Cosmetic From nobody at rubyforge.org Thu Apr 10 09:31:03 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 10 Apr 2008 09:31:03 -0400 (EDT) Subject: [Ruby-debug-commits] [812] branches/ver_0_10_1/: Release 0.10.1 tag Message-ID: <20080410133103.5AD89185861C@rubyforge.org> Revision: 812 Author: rockyb Date: 2008-04-10 09:31:02 -0400 (Thu, 10 Apr 2008) Log Message: ----------- Release 0.10.1 tag Added Paths: ----------- branches/ver_0_10_1/ Copied: branches/ver_0_10_1 (from rev 811, trunk) From nobody at rubyforge.org Thu Apr 10 09:31:45 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 10 Apr 2008 09:31:45 -0400 (EDT) Subject: [Ruby-debug-commits] [813] tags/ruby-debug-0.10.1/: Release 0.10.1 tag Message-ID: <20080410133145.E7050185861C@rubyforge.org> Revision: 813 Author: rockyb Date: 2008-04-10 09:31:45 -0400 (Thu, 10 Apr 2008) Log Message: ----------- Release 0.10.1 tag Added Paths: ----------- tags/ruby-debug-0.10.1/ Copied: tags/ruby-debug-0.10.1 (from rev 812, trunk) From nobody at rubyforge.org Thu Apr 10 09:33:09 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 10 Apr 2008 09:33:09 -0400 (EDT) Subject: [Ruby-debug-commits] [814] tags/ruby-debug-0.10.0/: Release 0.10.0 tag Message-ID: <20080410133309.7B21E1858617@rubyforge.org> Revision: 814 Author: rockyb Date: 2008-04-10 09:33:09 -0400 (Thu, 10 Apr 2008) Log Message: ----------- Release 0.10.0 tag Added Paths: ----------- tags/ruby-debug-0.10.0/ Copied: tags/ruby-debug-0.10.0 (from rev 813, branches/ver_0_10_0) From nobody at rubyforge.org Fri Apr 11 18:24:40 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Fri, 11 Apr 2008 18:24:40 -0400 (EDT) Subject: [Ruby-debug-commits] [815] trunk/doc/rdebug-emacs.texi: Section on 'customize' added. Message-ID: <20080411222440.5004918586BF@rubyforge.org> Revision: 815 Author: andersl Date: 2008-04-11 18:24:39 -0400 (Fri, 11 Apr 2008) Log Message: ----------- Section on 'customize' added. Modified Paths: -------------- trunk/doc/rdebug-emacs.texi Modified: trunk/doc/rdebug-emacs.texi =================================================================== --- trunk/doc/rdebug-emacs.texi 2008-04-10 13:33:09 UTC (rev 814) +++ trunk/doc/rdebug-emacs.texi 2008-04-11 22:24:39 UTC (rev 815) @@ -38,11 +38,11 @@ @end titlepage @page - at node Top, getting started, (dir), (dir) + at node Top, Getting started, (dir), (dir) @top Debugging with ruby-debug under GNU Emacs @menu -* getting started:: +* Getting started:: * The Multi-window Mode:: * Debugger Buffers:: * Emacs Debugger Commands:: Indexes (nodes containing large menus) @@ -53,7 +53,7 @@ @detailmenu --- The Detailed Node Listing --- -getting started +Getting started * Installation:: How to install this package * Emacs rdebug:: Invoke the ruby debugger initially @@ -108,16 +108,17 @@ @c ------------------------------------------------------------------- - at node getting started, The Multi-window Mode, Top, Top - at chapter getting started + at node Getting started, The Multi-window Mode, Top, Top + at chapter Getting started @menu * Installation:: How to install this package * Emacs rdebug:: Invoke the ruby debugger initially * Emacs shell tracking mode:: Entering rdebug from an existing shell buffer +* Configurating this package:: Introducing the configure system @end menu - at node Installation, Emacs rdebug, getting started, getting started + at node Installation, Emacs rdebug, Getting started, Getting started @section Installation To use this interface, load the file @code{rdebug.el}. This file is a @@ -133,7 +134,7 @@ In addition, you must have Ruby and ruby-debug installed. - at node Emacs rdebug, Emacs shell tracking mode, Installation, getting started + at node Emacs rdebug, Emacs shell tracking mode, Installation, Getting started @section Emacs rdebug Use the command @kbd{M-x rdebug} in @sc{gnu} Emacs to start debugging. @@ -164,7 +165,7 @@ way---for example, @kbd{C-c C-c} for an interrupt, @kbd{C-c C-z} for a stop. - at node Emacs shell tracking mode, , Emacs rdebug, getting started + at node Emacs shell tracking mode, Configurating this package, Emacs rdebug, Getting started @section Entering rdebug from an existing shell buffer Many times it's not feasible to enter the debugger from the outset. @@ -182,9 +183,18 @@ programs you probably want to turn this off which can be done via the @code{M-x turn-off-rdebugtrack} command. + + at node Configurating this package, , Emacs rdebug, Getting started + at section Configurating this package + +In this manual we present a number of @value{Emacs} lisp variables and +functions that you can use to configure the debugger interface. In +addition, you can use the @value{Emacs} @emph{customize} system, see the + at kbd{ } menu item. + @c ------------------------------------------------------------------- - at node The Multi-window Mode, Debugger Buffers, getting started, Top + at node The Multi-window Mode, Debugger Buffers, Getting started, Top @chapter Multi-window In the multi-window debugger mode, a number of buffers are visible when @@ -251,11 +261,15 @@ @subsection Keybindings for all Debugger Windows -The debugger provides key-bindings that work in all debugger windows. -They are designed to match keys of commonly used debugger environments. -You can use @kbd{ } to -change the keybindings. The following are provided: +The debugger provides key-bindings that work in all debugger windows, +including Ruby source buffers. The key bindings are designed to match +keys of commonly used debugger environments. +The variable @code{rdebug-populate-common-keys-function} can be assigned +to a function that should bind the keys use. Three functions are +provided @code{rdebug-populate-common-keys-standard}, + at code{...-eclipse}, and @code{...-netbeans}. + @multitable @columnfractions 0.4 0.2 0.2 0.2 @headitem Command @tab Standard @tab Eclipse @tab Netbeans @item Run @tab f5 @tab @tab From nobody at rubyforge.org Tue Apr 15 19:56:45 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 15 Apr 2008 19:56:45 -0400 (EDT) Subject: [Ruby-debug-commits] [816] trunk/doc/ruby-debug.texi: Note that Debugger. start is currently broken when used with a block. Message-ID: <20080415235645.CE96218585E2@rubyforge.org> Revision: 816 Author: rockyb Date: 2008-04-15 19:56:45 -0400 (Tue, 15 Apr 2008) Log Message: ----------- Note that Debugger.start is currently broken when used with a block. Modified Paths: -------------- trunk/doc/ruby-debug.texi Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-11 22:24:39 UTC (rev 815) +++ trunk/doc/ruby-debug.texi 2008-04-15 23:56:45 UTC (rev 816) @@ -3209,14 +3209,15 @@ This needs to be done before entering the debugger; therefore a call to the debugger issue a @code{Debugger.start} call if necessary. -If called without a block, @code{Debugger.start}returns @code{true} if +If called without a block, @code{Debugger.start} returns @code{true} if the debugger was already started. But if you want to know if the debugger has already been started @code{Debugger.started?} can tell you. + at emph{Currently broken:} If a block is given, the debugger is started and @code{yields} to block. When the block is finished executing, the debugger stopped with -the @code{Debugger.stop method}. To completely stop the debugger and remove +the @code{Debugger.stop method}. But if you want to completely stop debugger, you must call @code{Debugger.stop} as many times as you called Debugger.start From nobody at rubyforge.org Sat Apr 19 09:22:13 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sat, 19 Apr 2008 09:22:13 -0400 (EDT) Subject: [Ruby-debug-commits] [818] trunk: Change test for whether we have moved off a line or not for purposes Message-ID: <20080419132213.E3773185869F@rubyforge.org> Revision: 818 Author: rockyb Date: 2008-04-19 09:22:12 -0400 (Sat, 19 Apr 2008) Log Message: ----------- Change test for whether we have moved off a line or not for purposes of stopping at a breakpoint on a line. The line events for which there are normally two stops are on NODE if's before the if and after the expression evaluation. Tracker #19594. Modified Paths: -------------- trunk/ext/ruby_debug.c trunk/test/data/breakpoints.cmd trunk/test/data/breakpoints.right trunk/test/data/emacs_basic.right trunk/test/test-break-bad.rb trunk/test/test-emacs-basic.rb Added Paths: ----------- trunk/test/bp_loop_issue.rb trunk/test/data/break_loop_bug.cmd trunk/test/data/break_loop_bug.right Modified: trunk/ext/ruby_debug.c =================================================================== --- trunk/ext/ruby_debug.c 2008-04-16 01:11:44 UTC (rev 817) +++ trunk/ext/ruby_debug.c 2008-04-19 13:22:12 UTC (rev 818) @@ -718,11 +718,24 @@ if(debug == Qtrue) fprintf(stderr, "%s:%d [%s] %s\n", file, line, get_event_name(event), rb_id2name(mid)); + /* There can be many event calls per line, but we only want + *one* breakpoint per line. */ if(debug_context->last_line != line || debug_context->last_file == NULL || strcmp(debug_context->last_file, file) != 0) { CTX_FL_SET(debug_context, CTX_FL_ENABLE_BKPT); moved = 1; + } else if(event == RUBY_EVENT_LINE) + { + /* There are two line-event trace hook calls per IF node - one + before the expression eval an done afterwards. + */ + static int if_eval_event = 0; + if_eval_event = (NODE_IF == nd_type(node)) ? !if_eval_event : 0; + if (!if_eval_event) + { + CTX_FL_SET(debug_context, CTX_FL_ENABLE_BKPT); + } } } else if(event != RUBY_EVENT_RETURN && event != RUBY_EVENT_C_RETURN) Added: trunk/test/bp_loop_issue.rb =================================================================== --- trunk/test/bp_loop_issue.rb (rev 0) +++ trunk/test/bp_loop_issue.rb 2008-04-19 13:22:12 UTC (rev 818) @@ -0,0 +1,3 @@ +1.upto(2) { + sleep 0.01 +} Added: trunk/test/data/break_loop_bug.cmd =================================================================== --- trunk/test/data/break_loop_bug.cmd (rev 0) +++ trunk/test/data/break_loop_bug.cmd 2008-04-19 13:22:12 UTC (rev 818) @@ -0,0 +1,5 @@ +set debuggertesting on +break 2 +cont +cont +cont Added: trunk/test/data/break_loop_bug.right =================================================================== --- trunk/test/data/break_loop_bug.right (rev 0) +++ trunk/test/data/break_loop_bug.right 2008-04-19 13:22:12 UTC (rev 818) @@ -0,0 +1,15 @@ +bp_loop_issue.rb:1 +1.upto(2) { +# set debuggertesting on +Currently testing the debugger is on. +# break 2 +Breakpoint 1 file ./bp_loop_issue.rb, line 2 +# cont +Breakpoint 1 at bp_loop_issue.rb:2 +bp_loop_issue.rb:2 +sleep 0.01 +# cont +Breakpoint 1 at bp_loop_issue.rb:2 +bp_loop_issue.rb:2 +sleep 0.01 +# cont Modified: trunk/test/data/breakpoints.cmd =================================================================== --- trunk/test/data/breakpoints.cmd 2008-04-16 01:11:44 UTC (rev 817) +++ trunk/test/data/breakpoints.cmd 2008-04-19 13:22:12 UTC (rev 818) @@ -16,7 +16,7 @@ continue where info program -c 10 +c 6 info break break foo info break Modified: trunk/test/data/breakpoints.right =================================================================== --- trunk/test/data/breakpoints.right 2008-04-16 01:11:44 UTC (rev 817) +++ trunk/test/data/breakpoints.right 2008-04-19 13:22:12 UTC (rev 818) @@ -41,18 +41,17 @@ #1 at line gcd.rb:18 # info program Program stopped. It stopped at a breakpoint. -# c 10 -Breakpoint 3 at Object:gcd -gcd.rb:4 -def gcd(a, b) +# c 6 +Breakpoint 2 at gcd.rb:10 +gcd.rb:10 +return nil if a <= 0 # info break Num Enb What 1 y at gcd.rb:6 breakpoint already hit 1 time 2 y at gcd.rb:10 - breakpoint already hit 1 time + breakpoint already hit 2 times 3 y at Object:gcd - breakpoint already hit 1 time # break foo *** Invalid breakpoint location: foo. # info break @@ -60,26 +59,23 @@ 1 y at gcd.rb:6 breakpoint already hit 1 time 2 y at gcd.rb:10 - breakpoint already hit 1 time + breakpoint already hit 2 times 3 y at Object:gcd - breakpoint already hit 1 time # disable 1 # info break Num Enb What 1 n at gcd.rb:6 breakpoint already hit 1 time 2 y at gcd.rb:10 - breakpoint already hit 1 time + breakpoint already hit 2 times 3 y at Object:gcd - breakpoint already hit 1 time # delete 1 # # We should see breakpoint 2 but not 1 # info break Num Enb What 2 y at gcd.rb:10 - breakpoint already hit 1 time + breakpoint already hit 2 times 3 y at Object:gcd - breakpoint already hit 1 time # # We should still be able to access 2 # disable 2 # disable bar Modified: trunk/test/data/emacs_basic.right =================================================================== --- trunk/test/data/emacs_basic.right 2008-04-16 01:11:44 UTC (rev 817) +++ trunk/test/data/emacs_basic.right 2008-04-19 13:22:12 UTC (rev 818) @@ -42,9 +42,8 @@ # info program Program stopped. It stopped at a breakpoint. # c 10 -Breakpoint 3 at Object:gcd -gcd.rb:4 -def gcd(a, b) +gcd.rb:10 +return nil if a <= 0 # info break Num Enb What 1 y at gcd.rb:6 @@ -52,7 +51,6 @@ 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd - breakpoint already hit 1 time # break foo *** Invalid breakpoint location: foo. # info break @@ -62,7 +60,6 @@ 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 @@ -71,7 +68,6 @@ 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd - breakpoint already hit 1 time # enable breakpoint 1 # enable br 10 Enable breakpoints argument '10' needs to at most 3. @@ -82,7 +78,6 @@ 2 y at gcd.rb:10 breakpoint already hit 1 time 3 y at Object:gcd - breakpoint already hit 1 time # # We should still be able to access 2 # disable 2 # enable Modified: trunk/test/test-break-bad.rb =================================================================== --- trunk/test/test-break-bad.rb 2008-04-16 01:11:44 UTC (rev 817) +++ trunk/test/test-break-bad.rb 2008-04-19 13:22:12 UTC (rev 818) @@ -22,4 +22,15 @@ "--script #{script} -- gcd.rb 3 5")) end end + + def test_break_loop + testname='break_loop_bug' + Dir.chdir(@@SRC_DIR) do + script = File.join('data', testname + '.cmd') + assert_equal(true, + run_debugger(testname, + "--script #{script} -- bp_loop_issue.rb")) + end + end + end Modified: trunk/test/test-emacs-basic.rb =================================================================== --- trunk/test/test-emacs-basic.rb 2008-04-16 01:11:44 UTC (rev 817) +++ trunk/test/test-emacs-basic.rb 2008-04-19 13:22:12 UTC (rev 818) @@ -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 the --emacs-basic option. class TestEmacsBasic < Test::Unit::TestCase From nobody at rubyforge.org Sun Apr 20 17:38:30 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 20 Apr 2008 17:38:30 -0400 (EDT) Subject: [Ruby-debug-commits] [819] trunk/doc: rdebug-emacs.texi: update nodes so makeinfo will work. Message-ID: <20080420213830.201A218585DB@rubyforge.org> Revision: 819 Author: rockyb Date: 2008-04-20 17:38:29 -0400 (Sun, 20 Apr 2008) Log Message: ----------- rdebug-emacs.texi: update nodes so makeinfo will work. rdebug-texi: Note slight preference for ruby -rtracer over rdebug --trace. Modified Paths: -------------- trunk/doc/rdebug-emacs.texi trunk/doc/ruby-debug.texi Modified: trunk/doc/rdebug-emacs.texi =================================================================== --- trunk/doc/rdebug-emacs.texi 2008-04-19 13:22:12 UTC (rev 818) +++ trunk/doc/rdebug-emacs.texi 2008-04-20 21:38:29 UTC (rev 819) @@ -184,7 +184,7 @@ @code{M-x turn-off-rdebugtrack} command. - at node Configurating this package, , Emacs rdebug, Getting started + at node Configurating this package, , Emacs shell tracking mode, Getting started @section Configurating this package In this manual we present a number of @value{Emacs} lisp variables and Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-19 13:22:12 UTC (rev 818) +++ trunk/doc/ruby-debug.texi 2008-04-20 21:38:29 UTC (rev 819) @@ -1330,8 +1330,31 @@ @item -x | --trace @cindex @code{-x} @cindex @code{--trace} -Turn on line tracing. +Turn on line tracing. Running: + at smallexample + rdebug --trace @emph{rubyscript.rb} + at end smallexample +is much line running: + at smallexample + ruby -rtracer @emph{rubyscript.rb} + at end smallexample +If all you want to do however is get a linetrace, @code{tracer}, not + at code{rdebug}, may be faster: + at smallexample +$ @b{time ruby -rtracer gcd.rb 34 21 > /dev/null} + +real 0m0.266s +user 0m0.008s +sys 0m0.000s +$ @b{time rdebug --trace gcd.rb 34 21 > /dev/null} + +real 0m0.875s +user 0m0.448s +sys 0m0.056s +$ + at end smallexample + @end table @node rdebug default options From nobody at rubyforge.org Mon Apr 21 22:49:19 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 21 Apr 2008 22:49:19 -0400 (EDT) Subject: [Ruby-debug-commits] [820] trunk: Experiment with debugger(steps=0). Message-ID: <20080422024919.41AF218585A8@rubyforge.org> Revision: 820 Author: rockyb Date: 2008-04-21 22:49:18 -0400 (Mon, 21 Apr 2008) Log Message: ----------- Experiment with debugger(steps=0). Puts us in the debugger call, but this may be the best we can do for now. See tracker #19639. Modified Paths: -------------- trunk/doc/ruby-debug.texi trunk/lib/ruby-debug-base.rb Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-20 21:38:29 UTC (rev 819) +++ trunk/doc/ruby-debug.texi 2008-04-22 02:49:18 UTC (rev 820) @@ -6,7 +6,7 @@ @set ttDBG @code{@value{DBG}} @set Emacs @sc{gnu} Emacs - at set RDEBUG_VERSION 0.10.1 + at set RDEBUG_VERSION 0.10.2 @macro Example {} @iftex @@ -1121,7 +1121,7 @@ If you don't need to pass dash options to your program which might get confused with the debugger options, then you don't need to add the - at code{--}. + at option{--}. To get a brief list of options and descriptions, use the @code{--help} option. @@ -1175,9 +1175,9 @@ on the same computer or via a socket to another process possibly on a different computer. -Many options appear as a long option name, such as @code{--help}, and -a short one letter option name, such as @code{-h}. A double dash -(@code{--} is used to separate options which go to @code{rdebug} from +Many options appear as a long option name, such as @option{--help}, and +a short one letter option name, such as @option{-h}. A double dash +(@option{--} is used to separate options which go to @code{rdebug} from options that are intended to go to your Ruby script. Options (if any) to @code{rdebug} should come first. If there is no possibility of the Ruby script to be debugged getting confused with @code{rdebug}'s @@ -1185,34 +1185,34 @@ @table @code @item --help - at cindex @code{-h} - at cindex @code{--help} + at cindex @option{-h} + at cindex @option{--help} This option causes @ttDBG{} to print some basic help and exit. @item -v | --version - at cindex @code{-v} + at cindex @option{-v} This option causes @ttDBG{} to print its version number and exit. @item -A | --annotate @var{level} - at cindex @code{-A} - at cindex @code{--annotation} @var{level} + at cindex @option{-A} + at cindex @option{--annotation} @var{level} Set gdb-style annotation @var{level}, a number. Additional information is output automatically when program state is changed. This can be used by front-ends such as GNU Emacs to post this updated information without having to poll for it. @item -c | --client - at cindex @code{-c} - at cindex @code{--client} + at cindex @option{-c} + at cindex @option{--client} Connect to remote debugger. The remote debugger should have been set up previously our you will get a connection error and @code{rdebug} will terminate. @item --cport @var{port} - at cindex @code{--cport} @var{port} + at cindex @option{--cport} @var{port} Port used for control commands. @item --debug - at cindex @code{--debug} + at cindex @option{--debug} Set @code{$DEBUG} to @code{true}. This option is compatible with Ruby's. @@ -1225,20 +1225,20 @@ @item --emacs-basic Activates full GNU Emacs mode. @c (@pxref{GNU Emacs}). -This is the equivalent of setting the options @code{--emacs-basic}, - at code{annotate=3}, @code{--no-stop}, @code{-no-control} and - at code{--post-mortem}. +This is the equivalent of setting the options @option{--emacs-basic}, + at code{annotate=3}, @option{--no-stop}, @option{-no-control} and + at option{--post-mortem}. @item -h | --host @var{host-address} Connect host address for remote debugging. @item -I --include @var{PATH} - at cindex @code{-I} @var{PATH} - at cindex @code{--include} @var{PATH} + at cindex @option{-I} @var{PATH} + at cindex @option{--include} @var{PATH} Add @var{PATH} to @code{$LOAD_PATH} @item --keep-frame-binding - at cindex @code{--keep-frame-binding} + at cindex @option{--keep-frame-binding} Bindings are used to set the proper environment in evaluating expression inside the debugger. Under normal circumstances, I don't believe most people will ever need this option. @@ -1270,74 +1270,68 @@ is partly why this debugger doesn't work on Ruby 1.9. @item -m | --post-mortem - at cindex @code{-m} - at cindex @code{--post-mortem} + at cindex @option{-m} + at cindex @option{--post-mortem} If your program raises an exception that isn't caught you can enter the debugger for inspection of what went wrong. You may also want to -use this option in conjunction with @code{--no-stop}. See also +use this option in conjunction with @option{--no-stop}. See also @ref{Post-Mortem Debugging}. @item --no-control - at cindex @code{--no-control} + at cindex @option{--no-control} Do not automatically start control thread. @item --no-quit - at cindex @code{--no-quit} + at cindex @option{--no-quit} Restart the debugger when your program terminates normally. @item --no-rewrite-program - at cindex @code{--no-rewrite-program} + at cindex @option{--no-rewrite-program} Normally @code{rdebug} will reset the program name @code{$0} from its name to the debugged program, and set the its name in variable @code{$RDEBUG_0}. In the unlikely even you don't want this use this option. @item --no-stop - at cindex @code{--no-stop} + at cindex @option{--no-stop} Normally the @code{rdebug} stops before executing the first statement. If instead you want it to start running initially and will perhaps break it later in the running, use this options. @item -p | --port @var{port} - at cindex @code{-p} @var{port} - at cindex @code{--port} @var{port} + at cindex @option{-p} @var{port} + at cindex @option{--port} @var{port} Port used for remote debugging. @item -r | --require @var{library} - at cindex @code{-r} - at cindex @code{--require} + at cindex @option{-r} + at cindex @option{--require} Require the library, before executing your script. However if the library happened to be @code{debug}, we'll just ignore the require (since we're already a debugger). This option is compatible with Ruby's. @item --script @var{file} - at cindex @code{--script} + at cindex @option{--script} Require the library, before executing your script. However if the library hap-pend to be @code{debug}, we'll just ignore the require (since we're already a debugger). This option is compatible with Ruby's. @item -s | --server - at cindex @code{-s} - at cindex @code{--server} + at cindex @option{-s} + at cindex @option{--server} Debug the program but listen for remote connections on the default -port or port set up via the @code{--port} option. See also @code{--wait}. +port or port set up via the @option{--port} option. See also @option{--wait}. @item -w | --wait - at cindex @code{-w} - at cindex @code{--wait} + at cindex @option{-w} + at cindex @option{--wait} Debug the program but stop waiting for a client connection first. This -option automatically sets @code{--server} option. +option automatically sets @option{--server} option. @item -x | --trace - at cindex @code{-x} - at cindex @code{--trace} -Turn on line tracing. Running: - at smallexample - rdebug --trace @emph{rubyscript.rb} - at end smallexample -is much line running: - at smallexample - ruby -rtracer @emph{rubyscript.rb} - at end smallexample + at cindex @option{-x} + at cindex @option{--trace} +Turn on line tracing. Running @command{rdebug --trace @emph{rubyscript.rb}} +is much like running: @command{ruby -rtracer @emph{rubyscript.rb}} If all you want to do however is get a linetrace, @code{tracer}, not @code{rdebug}, may be faster: @@ -1362,13 +1356,13 @@ @DBG{} has many command-line options; it seems that some people want to set them differently from the our defaults. For example, some -people may want @code{--no-quit --no-control} to be the default +people may want @option{--no-quit --no-control} to be the default behavior. One could write a wrapper script or set a shell alias to handle this. @DBG{} has another way to do this as well. Before processing command options if the file @code{$HOME/.rdboptrc} is found it is loaded. If you want to set the defaults in some other way, you can put Ruby code here and set variable @code{options} which is an -OpenStruct. For example here's how you'd set @code{-no-quit} and +OpenStruct. For example here's how you'd set @option{-no-quit} and change the default control port to 5000. @smallexample @@ -3115,7 +3109,7 @@ of running code, no longer work. The most reliable way to set up post-mortem debugging is to use the - at code{--post-mortem} option in invoking @code{rdebug}. See @ref{rdebug + at option{--post-mortem} option in invoking @code{rdebug}. See @ref{rdebug command-line options}. This traps/wraps at the debugger ``load'' of your Ruby script. When this is done, your program is stopped after the exception takes place, but before the stack has been @@ -3163,7 +3157,7 @@ been started. The @code{post_mortem()} method can be called in two ways. Called without a block, it installs a global @code{at_exit()} hook that intercepts exceptions not handled by your Ruby script. In -contrast to using the @code{--post-mortem} option, when this hook +contrast to using the @option{--post-mortem} option, when this hook occurs after the call stack has been rolled back. (I'm not sure if this in fact makes any difference operationally; I'm just stating it because that's how it works.) @@ -3495,9 +3489,62 @@ @item debugger @ovar{steps=1} @vindex @code{Kernel::debugger} -Enters the debugger in the current thread after a stepping @var{steps} steps. +Enters the debugger in the current thread after a stepping @var{steps} line-event steps. Before entering the debugger startup script is read. +Setting @var{steps} to 0 will cause a break in the debugger subroutine +and not wait for eany line event to occur. This could be useful you +want to stop right after the last statement in some scope. + +Consider this example: + at smallexample +$ cat scope-test.rb + +require 'rubygems' +require 'ruby-debug' ; Debugger.start +1.times do + a = 1 + debugger # implied steps=1 + end +y = 1 + +$ scope-test.rb:8 +y = 1 +(rdb:1) p a +NameError Exception: undefined local variable or method `a' for main:Object +(rdb:1) + at end smallexample +The debugger will get at the line event which follows @samp{a=1}. This +is outside the @code{do} block scope where @var{a} is defined. If +instead you want to stop before leaving the @code{do} loop it is +possibly to stop right inside the @code{debugger}; call with 0 zero parameter: + at smallexample +$ cat scope-test.rb + +require 'rubygems' +require 'ruby-debug' ; Debugger.start +1.times do + a = 1 + debugger(0) +end +y = 1 + +$ scope-test.rb:8 +../lib/ruby-debug-base.rb:175 +Debugger.current_context.stop_frame = 0 +(rdb:1) where +--> #0 Kernel.debugger(steps#Fixnum) at line ../lib/ruby-debug-base.rb:175 + #1 at line scope-test.rb:6 + #2 at line scope-test.rb:4 +(rdb:1) up +#1 at line scope-test.rb:6 +(rdb:1) p a +1 +(rdb:1) + at end smallexample +As seen above you will have to position the frame up one to be back in +your debugged program rather than in the debugger. + @item breakpoint @ovar{steps=1} @vindex @code{Kernel::breakpoint} An alias for debugger. Modified: trunk/lib/ruby-debug-base.rb =================================================================== --- trunk/lib/ruby-debug-base.rb 2008-04-20 21:38:29 UTC (rev 819) +++ trunk/lib/ruby-debug-base.rb 2008-04-22 02:49:18 UTC (rev 820) @@ -164,14 +164,24 @@ end module Kernel + + # Enters the debugger in the current thread after _steps_ line events occur. + # Before entering the debugger startup script is read. # - # Enters the debugger in the current thread after a number of - # _steps_ made. - # + # Setting _steps_ to 0 will cause a break in the debugger subroutine + # and not wait for a line event to occur. You will have to go "up 1" + # in order to be back in your debugged program rather than the + # debugger. Settings _stess_ to 0 could be useful you want to stop + # right after the last statement in some scope, because the next + # step will take you out of some scope. def debugger(steps = 1) Debugger.start unless Debugger.started? Debugger.run_init_script(StringIO.new) - Debugger.current_context.stop_next = steps + if 0 == steps + Debugger.current_context.stop_frame = 0 + else + Debugger.current_context.stop_next = steps + end end alias breakpoint debugger unless respond_to?(:breakpoint) From nobody at rubyforge.org Thu Apr 24 22:54:44 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 24 Apr 2008 22:54:44 -0400 (EDT) Subject: [Ruby-debug-commits] [821] trunk: Try to get rdebug-track under control again. Message-ID: <20080425025445.126B118585CC@rubyforge.org> Revision: 821 Author: rockyb Date: 2008-04-24 22:54:44 -0400 (Thu, 24 Apr 2008) Log Message: ----------- Try to get rdebug-track under control again. Remove "<" in the command buffer as a local key setting. Make more checkdoc friendly. Modified Paths: -------------- trunk/CHANGES trunk/emacs/rdebug-cmd.el trunk/emacs/rdebug-gud.el trunk/emacs/rdebug-source.el trunk/emacs/rdebug-track.el Modified: trunk/CHANGES =================================================================== --- trunk/CHANGES 2008-04-22 02:49:18 UTC (rev 820) +++ trunk/CHANGES 2008-04-25 02:54:44 UTC (rev 821) @@ -1,3 +1,6 @@ +0.10.2 + - debugger(steps=0) breaks inside of debugger rather than wait for a line event. + 0.10.1 4/10/08 - in honor of the 30th Birthday of Kate Schwarz Modified: trunk/emacs/rdebug-cmd.el =================================================================== --- trunk/emacs/rdebug-cmd.el 2008-04-22 02:49:18 UTC (rev 820) +++ trunk/emacs/rdebug-cmd.el 2008-04-25 02:54:44 UTC (rev 821) @@ -51,8 +51,8 @@ "Set breakpoint at current line.") (gud-def gud-cont "continue" "\C-r" "Continue with display.") -;;; (gud-def gud-down "down %p" "<" -;;; "Down N stack frames (numeric arg).") + (gud-def gud-down "down %p" "<" + "Down N stack frames (numeric arg).") (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") (gud-def gud-source-resync "up 0" "\C-l" @@ -71,7 +71,6 @@ (gud-def gud-where "where" "T" "Show stack trace.") - (local-set-key "<" 'rdebug-newer-frame) (local-set-key [M-insert] 'rdebug-internal-short-key-mode) (local-set-key [M-down] 'rdebug-locring-newer) (local-set-key [M-up] 'rdebug-locring-older) Modified: trunk/emacs/rdebug-gud.el =================================================================== --- trunk/emacs/rdebug-gud.el 2008-04-22 02:49:18 UTC (rev 820) +++ trunk/emacs/rdebug-gud.el 2008-04-25 02:54:44 UTC (rev 821) @@ -40,15 +40,21 @@ (defun gud-rdebug-massage-args (file args) + "Change FILE and list ARGS before running the debugger. + +gud requires this routine to be defined." args) -(defun gud-rdebug-find-file (f) - "This routine rdebug and gud call when they encounter a Ruby -program file." - (find-file-noselect f 'nowarn)) +(defun gud-rdebug-find-file (file) + "`rdebug' and `gud' call this with FILE when they encounter a Ruby program file." + (find-file-noselect file 'nowarn)) + (defun rdebug-display-line (file line &optional move-arrow) + "Arrange for marker to appear in at FILE and LINE. +The line marker might appear in the Emacs fringe or as an overlay arroe. +Optional argument MOVE-ARROW indicates whether to move any previous indicator." (if file (let ((oldpos (and gud-overlay-arrow-position (marker-position gud-overlay-arrow-position))) @@ -98,7 +104,7 @@ (defun rdebug-continue (&optional arg) "Run a debugger \"continue\" command. -With a numeric argument, continue to that line number of the current file." +With a numeric ARG, continue to that line number of the current file." (interactive "p") (if arg (rdebug-call (format "continue %d" arg)) @@ -108,7 +114,7 @@ (defun rdebug-next (&optional arg) "Run a debugger \"next\" command, respecting `rdebug-stepping-prefix'. -With a numeric argument, continue to that line number of the current file." +With a numeric ARG, continue to that line number of the current file." (interactive "p") (rdebug-stepping "next" arg)) @@ -120,8 +126,7 @@ stepping commands (\"next\", or \"step\").") (defun rdebug-print-cmd (expr &optional cmd) - "Run a debugger print (pl, ps, pp, p) command on `expr'; `cmd' -contains the command to run" + "Run a debugger print (pl, ps, pp, p) command on `EXPR'; `CMD' is the command to run." (interactive "s") (unless cmd (setq cmd "pp")) (rdebug-call-return (format "%s %s " cmd expr) :tooltip)) @@ -195,8 +200,7 @@ (defun rdebug-set-stepping-prefix () "Set the granularity of stepping on the subsequent 'next' or 'step' command. -As long as repeated next or step commands are given, they inherit this setting. -" +As long as repeated next or step commands are given, they inherit this setting." (interactive) (setq rdebug-stepping-prefix (this-command-keys))) @@ -208,18 +212,27 @@ (rdebug-stepping "step" arg)) (defun rdebug-newer-frame () - "Run a debugger \"down\" command to an older frame. + "Run a debugger \"down\" command to an newer frame. If we try to go down from frame 0, wrap to the end of the file" (interactive) (let* ((buf-name (rdebug-get-secondary-buffer-name "frame")) - (buf (get-buffer buf-name))) + (buf (or (get-buffer buf-name) (current-buffer)))) (with-current-buffer buf - ;; Should we add a mode to disable wrapping? + ;; Should we add a mode to disable wrapping? (if (equal rdebug-frames-current-frame-number 0) (rdebug-call "frame -1") (rdebug-call "down 1"))))) +(defun rdebug-older-frame () + "Run a debugger \"up\" command to an older frame." + (interactive) + (let* ((buf-name (rdebug-get-secondary-buffer-name "frame")) + (buf (or (get-buffer buf-name) (current-buffer)))) + (with-current-buffer buf + ;; Should we add a mode to disable wrapping? + (rdebug-call "up 1")))) + (provide 'rdebug-gud) ;;; Local variables: Modified: trunk/emacs/rdebug-source.el =================================================================== --- trunk/emacs/rdebug-source.el 2008-04-22 02:49:18 UTC (rev 820) +++ trunk/emacs/rdebug-source.el 2008-04-25 02:54:44 UTC (rev 821) @@ -457,7 +457,7 @@ (define-key map "+" 'rdebug-set-stepping-prefix) (define-key map "-" 'rdebug-set-stepping-prefix) (define-key map "<" 'rdebug-newer-frame) - (define-key map ">" 'gud-up) + (define-key map ">" 'rdebug-older-frame) ;; (define-key map "a" 'gud-args) ;; (define-key map "b" 'gud-break) (define-key map "c" 'rdebug-continue) Modified: trunk/emacs/rdebug-track.el =================================================================== --- trunk/emacs/rdebug-track.el 2008-04-22 02:49:18 UTC (rev 820) +++ trunk/emacs/rdebug-track.el 2008-04-25 02:54:44 UTC (rev 821) @@ -164,6 +164,8 @@ (rdebug-track-overlay-arrow t) (rdebug-set-frame-top-arrow (current-buffer)) (set (make-local-variable 'gud-comint-buffer) origbuf) + (set (make-local-variable 'gud-delete-prompt-marker) + (make-marker)) (pop-to-buffer origbuf t) (rdebug-locring-add gud-last-frame rdebug-source-location-ring)) From nobody at rubyforge.org Sun Apr 27 04:28:30 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 27 Apr 2008 04:28:30 -0400 (EDT) Subject: [Ruby-debug-commits] [822] trunk/emacs: Reduce spurious read-only setting when short-key is turned Message-ID: <20080427082830.5E6131858632@rubyforge.org> Revision: 822 Author: rockyb Date: 2008-04-27 04:28:29 -0400 (Sun, 27 Apr 2008) Log Message: ----------- Reduce spurious read-only setting when short-key is turned on/off in the command buffer. Modified Paths: -------------- trunk/emacs/rdebug-cmd.el trunk/emacs/rdebug-track.el Modified: trunk/emacs/rdebug-cmd.el =================================================================== --- trunk/emacs/rdebug-cmd.el 2008-04-25 02:54:44 UTC (rev 821) +++ trunk/emacs/rdebug-cmd.el 2008-04-27 08:28:29 UTC (rev 822) @@ -39,6 +39,7 @@ ;; (set (make-local-variable 'gud-minor-mode) 'rdebug) (set (make-local-variable 'rdebug-call-queue) '()) + (set (make-local-variable 'rdebug-original-read-only) buffer-read-only) (make-local-variable 'rdebug-source-location-ring-size) ; ...to global val. (set (make-local-variable 'rdebug-source-location-ring) (make-ring rdebug-source-location-ring-size)) Modified: trunk/emacs/rdebug-track.el =================================================================== --- trunk/emacs/rdebug-track.el 2008-04-25 02:54:44 UTC (rev 821) +++ trunk/emacs/rdebug-track.el 2008-04-27 08:28:29 UTC (rev 822) @@ -246,6 +246,7 @@ (setq rdebug-track-is-tracking-p t) (local-set-key "\C-cg" 'rdebug-goto-traceback-line) (local-set-key "\C-cG" 'rdebug-goto-dollarbang-traceback-line) + (add-hook 'comint-output-filter-functions 'rdebug-track-track-stack-file) (run-mode-hooks 'rdebug-track-mode-hook)) From nobody at rubyforge.org Mon Apr 28 12:42:47 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 28 Apr 2008 12:42:47 -0400 (EDT) Subject: [Ruby-debug-commits] [824] trunk: Catch errors in improper set callstyle parameter. Message-ID: <20080428164247.96C5518585CF@rubyforge.org> Revision: 824 Author: rockyb Date: 2008-04-28 12:42:47 -0400 (Mon, 28 Apr 2008) Log Message: ----------- Catch errors in improper set callstyle parameter. Bug #19792 Modified Paths: -------------- trunk/cli/ruby-debug/commands/set.rb trunk/test/data/setshow.cmd trunk/test/data/setshow.right Modified: trunk/cli/ruby-debug/commands/set.rb =================================================================== --- trunk/cli/ruby-debug/commands/set.rb 2008-04-28 16:16:38 UTC (rev 823) +++ trunk/cli/ruby-debug/commands/set.rb 2008-04-28 16:42:47 UTC (rev 824) @@ -110,15 +110,17 @@ when /^basename$/ Command.settings[:basename] = set_on when /^callstyle$/ - arg = args[0].downcase.to_sym - case arg - when :short, :last, :tracked - Command.settings[:callstyle] = arg - Debugger.track_frame_args = arg == :tracked ? true : false - else - print "Invalid call style #{arg}. Should be one of: " + - "'short', 'last', or 'tracked'.\n" + if args[0] + arg = args[0].downcase.to_sym + case arg + when :short, :last, :tracked + Command.settings[:callstyle] = arg + Debugger.track_frame_args = arg == :tracked ? true : false + return + end end + print "Invalid call style #{arg}. Should be one of: " + + "'short', 'last', or 'tracked'.\n" when /^trace$/ Command.settings[:stack_trace_on_error] = set_on when /^fullpath$/ Modified: trunk/test/data/setshow.cmd =================================================================== --- trunk/test/data/setshow.cmd 2008-04-28 16:16:38 UTC (rev 823) +++ trunk/test/data/setshow.cmd 2008-04-28 16:42:47 UTC (rev 824) @@ -46,3 +46,11 @@ puts 'printed via autoeval' set autoeval off puts 'autoeval should not run this' +#### Test 'callstyle'... +set callstyle +set callstyle short +set callstyle last +set callstyle tracked +set callstyle foo + + Modified: trunk/test/data/setshow.right =================================================================== --- trunk/test/data/setshow.right 2008-04-28 16:16:38 UTC (rev 823) +++ trunk/test/data/setshow.right 2008-04-28 16:42:47 UTC (rev 824) @@ -80,3 +80,15 @@ autoeval is off. # puts 'autoeval should not run this' *** Unknown command: "puts 'autoeval should not run this'". Try "help". +# #### Test 'callstyle'... +# set callstyle +Invalid call style . Should be one of: 'short', 'last', or 'tracked'. +Frame call-display style is last. +# set callstyle short +# set callstyle last +# set callstyle tracked +# set callstyle foo +Invalid call style foo. Should be one of: 'short', 'last', or 'tracked'. +Frame call-display style is tracked. +# +# From nobody at rubyforge.org Tue Apr 29 04:23:45 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 29 Apr 2008 04:23:45 -0400 (EDT) Subject: [Ruby-debug-commits] [825] trunk/test/config.yaml: Forgot to add this on last commit. Message-ID: <20080429082345.3906318585B9@rubyforge.org> Revision: 825 Author: rockyb Date: 2008-04-29 04:23:44 -0400 (Tue, 29 Apr 2008) Log Message: ----------- Forgot to add this on last commit. Added Paths: ----------- trunk/test/config.yaml Added: trunk/test/config.yaml =================================================================== --- trunk/test/config.yaml (rev 0) +++ trunk/test/config.yaml 2008-04-29 08:23:44 UTC (rev 825) @@ -0,0 +1,8 @@ +# Do not commit personal changes here back to the repository. Create +# config.private.yaml which, if exists, is preferred to this one. + +# either should be on the $PATH or use full path +ruby: ruby + +# possibility to specify interpreter parameters +#ruby_params: -w From nobody at rubyforge.org Tue Apr 29 05:11:09 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 29 Apr 2008 05:11:09 -0400 (EDT) Subject: [Ruby-debug-commits] [826] trunk: Add "method signature" command to show a method's signature. Message-ID: <20080429091109.C8968185863C@rubyforge.org> Revision: 826 Author: rockyb Date: 2008-04-29 05:11:09 -0400 (Tue, 29 Apr 2008) Log Message: ----------- Add "method signature" command to show a method's signature. Modified Paths: -------------- trunk/cli/ruby-debug/commands/method.rb trunk/cli/ruby-debug/commands/set.rb trunk/cli/ruby-debug/commands/variables.rb trunk/test/data/setshow.right Added Paths: ----------- trunk/test/classes.rb trunk/test/data/method.cmd trunk/test/data/method.right trunk/test/data/methodsig.cmd trunk/test/data/methodsig.right trunk/test/test-method.rb Modified: trunk/cli/ruby-debug/commands/method.rb =================================================================== --- trunk/cli/ruby-debug/commands/method.rb 2008-04-29 08:23:44 UTC (rev 825) +++ trunk/cli/ruby-debug/commands/method.rb 2008-04-29 09:11:09 UTC (rev 826) @@ -1,6 +1,47 @@ module Debugger - class MethodCommand < Command # :nodoc: + + begin + require 'methodsig' + have_methodsig = true + rescue LoadError + have_methodsig = false + end + + # Implements the debugger 'method sig' command. + class MethodSigCommand < Command def regexp + /^\s*m(?:ethod)?\s+sig\s+(\S+)\s*$/ + end + + def execute + obj = debug_eval('method(:%s)' % @match[1]) + if obj.is_a?(Method) + begin + print "%s\n", obj.signature.to_s + rescue + errmsg("Can't get signature for '#{@match[1]}'\n") + end + else + errmsg("Can't make method out of '#{@match[1]}'\n") + end + end + + class << self + def help_command + 'method' + end + + def help(cmd) + %{ + m[ethod] signature\t\tshow the signature of a method + } + end + end + end if have_methodsig + + # Implements the debugger 'method' command. + class MethodCommand < Command + def regexp /^\s*m(?:ethod)?\s+((iv)|(i(:?nstance\s+)?)\s+)?/ end @@ -39,4 +80,5 @@ end end end + end Modified: trunk/cli/ruby-debug/commands/set.rb =================================================================== --- trunk/cli/ruby-debug/commands/set.rb 2008-04-29 08:23:44 UTC (rev 825) +++ trunk/cli/ruby-debug/commands/set.rb 2008-04-29 09:11:09 UTC (rev 826) @@ -116,6 +116,7 @@ when :short, :last, :tracked Command.settings[:callstyle] = arg Debugger.track_frame_args = arg == :tracked ? true : false + print "%s\n" % show_setting(try_subcmd.name) return end end Modified: trunk/cli/ruby-debug/commands/variables.rb =================================================================== --- trunk/cli/ruby-debug/commands/variables.rb 2008-04-29 08:23:44 UTC (rev 825) +++ trunk/cli/ruby-debug/commands/variables.rb 2008-04-29 09:11:09 UTC (rev 826) @@ -24,14 +24,15 @@ end end - class VarClassVarCommand < Command # :nodoc: + # Implements the debugger 'var class' command. + class VarClassVarCommand < Command def regexp /^\s*v(?:ar)?\s+cl(?:ass)?/ end def execute unless @state.context - print "can't get class variables here.\n" + errmsg "can't get class variables here.\n" return end var_class_self @@ -107,7 +108,7 @@ class VarInstanceCommand < Command # :nodoc: def regexp - /^\s*v(?:ar)?\s+i(?:nstance)?\s*/ + /^\s*v(?:ar)?\s+ins(?:tance)?\s*/ end def execute @@ -128,7 +129,8 @@ end end - class VarLocalCommand < Command # :nodoc: + # Implements the debugger 'var local' command. + class VarLocalCommand < Command def regexp /^\s*v(?:ar)?\s+l(?:ocal)?\s*$/ end @@ -153,4 +155,45 @@ end end end + + # Implements the debugger 'var inherit' command. + begin + require 'classtree' + have_classtree = true + rescue LoadError + have_classtree = false + end + + class VarInheritCommand < Command + def regexp + /^\s*v(?:ar)?\s+ct\s*/ + end + + def execute + unless @state.context + errmsg "can't get object inheritance.\n" + return + end + puts @match.post_match + obj = debug_eval("#{@match.post_match}.classtree") + if obj + print obj + else + errmsg "Trouble getting object #{@match.post_match}\n" + end + end + + class << self + def help_command + 'var' + end + + def help(cmd) + %{ + v[ar] ct\t\t\tshow class heirarchy of object + } + end + end + end if have_classtree + end Added: trunk/test/classes.rb =================================================================== --- trunk/test/classes.rb (rev 0) +++ trunk/test/classes.rb 2008-04-29 09:11:09 UTC (rev 826) @@ -0,0 +1,11 @@ +class Mine + def initialize + @myvar = 'init' + end + def mymethod(a, b=5) + end + def self.classmeth + end +end +me = Mine.new +metoo = Mine(new) Added: trunk/test/data/method.cmd =================================================================== --- trunk/test/data/method.cmd (rev 0) +++ trunk/test/data/method.cmd 2008-04-29 09:11:09 UTC (rev 826) @@ -0,0 +1,10 @@ +# ******************************************************** +# This tests the 'method' command +# ******************************************************** +set debuggertesting on +set autoeval off +b 11 +c +method Mine +m iv me +quit Added: trunk/test/data/method.right =================================================================== --- trunk/test/data/method.right (rev 0) +++ trunk/test/data/method.right 2008-04-29 09:11:09 UTC (rev 826) @@ -0,0 +1,21 @@ +classes.rb:1 +class Mine +# # ******************************************************** +# # This tests the 'method' command +# # ******************************************************** +# set debuggertesting on +Currently testing the debugger is on. +# set autoeval off +autoeval is off. +# b 11 +Breakpoint 1 file ./classes.rb, line 11 +# c +Breakpoint 1 at classes.rb:11 +classes.rb:11 +metoo = Mine(new) +# method Mine +mymethod + +# m iv me + at myvar = "init" +# quit Added: trunk/test/data/methodsig.cmd =================================================================== --- trunk/test/data/methodsig.cmd (rev 0) +++ trunk/test/data/methodsig.cmd 2008-04-29 09:11:09 UTC (rev 826) @@ -0,0 +1,10 @@ +# ******************************************************** +# This tests the 'method' command +# ******************************************************** +set debuggertesting on +set autoeval off +b 3 +c +method sig initialize +method sig mymethod +quit Added: trunk/test/data/methodsig.right =================================================================== --- trunk/test/data/methodsig.right (rev 0) +++ trunk/test/data/methodsig.right 2008-04-29 09:11:09 UTC (rev 826) @@ -0,0 +1,20 @@ +classes.rb:1 +class Mine +# # ******************************************************** +# # This tests the 'method' command +# # ******************************************************** +# set debuggertesting on +Currently testing the debugger is on. +# set autoeval off +autoeval is off. +# b 3 +Breakpoint 1 file ./classes.rb, line 3 +# c +Breakpoint 1 at classes.rb:3 +classes.rb:3 + at myvar = 'init' +# method sig initialize +Mine#initialize() +# method sig mymethod +Mine#mymethod(a, b=5) +# quit Modified: trunk/test/data/setshow.right =================================================================== --- trunk/test/data/setshow.right 2008-04-29 08:23:44 UTC (rev 825) +++ trunk/test/data/setshow.right 2008-04-29 09:11:09 UTC (rev 826) @@ -85,8 +85,11 @@ Invalid call style . Should be one of: 'short', 'last', or 'tracked'. Frame call-display style is last. # set callstyle short +Frame call-display style is short. # set callstyle last +Frame call-display style is last. # set callstyle tracked +Frame call-display style is tracked. # set callstyle foo Invalid call style foo. Should be one of: 'short', 'last', or 'tracked'. Frame call-display style is tracked. Added: trunk/test/test-method.rb =================================================================== --- trunk/test/test-method.rb (rev 0) +++ trunk/test/test-method.rb 2008-04-29 09:11:09 UTC (rev 826) @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'test/unit' + +# require 'rubygems' +# require 'ruby-debug'; Debugger.start(:post_mortem => true) + +class TestMethod < Test::Unit::TestCase + + @@SRC_DIR = File.dirname(__FILE__) unless + defined?(@@SRC_DIR) + + require File.join(@@SRC_DIR, 'helper') + include TestHelper + + def test_basic + testname='method' + Dir.chdir(@@SRC_DIR) do + script = File.join('data', testname + '.cmd') + assert_equal(true, + run_debugger(testname, + "--script #{script} -- classes.rb")) + begin + require 'methodsig' + testname='methodsig' + script = File.join('data', testname + '.cmd') + assert_equal(true, + run_debugger(testname, + "--script #{script} -- classes.rb")) + rescue LoadError + puts "Skipping method sig test" + end + end + end +end Property changes on: trunk/test/test-method.rb ___________________________________________________________________ Name: svn:executable + * From nobody at rubyforge.org Tue Apr 29 09:37:13 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 29 Apr 2008 09:37:13 -0400 (EDT) Subject: [Ruby-debug-commits] [827] trunk: Test line number in "continue" command for validity. Message-ID: <20080429133713.8716E1858622@rubyforge.org> 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 From nobody at rubyforge.org Tue Apr 29 10:00:53 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 29 Apr 2008 10:00:53 -0400 (EDT) Subject: [Ruby-debug-commits] [828] trunk: Small doc and test improvements on 'method signature' Message-ID: <20080429140054.08EE11858605@rubyforge.org> Revision: 828 Author: rockyb Date: 2008-04-29 10:00:53 -0400 (Tue, 29 Apr 2008) Log Message: ----------- Small doc and test improvements on 'method signature' Modified Paths: -------------- trunk/cli/ruby-debug/commands/method.rb trunk/doc/ruby-debug.texi trunk/test/classes.rb trunk/test/data/methodsig.right Modified: trunk/cli/ruby-debug/commands/method.rb =================================================================== --- trunk/cli/ruby-debug/commands/method.rb 2008-04-29 13:37:13 UTC (rev 827) +++ trunk/cli/ruby-debug/commands/method.rb 2008-04-29 14:00:53 UTC (rev 828) @@ -10,7 +10,7 @@ # Implements the debugger 'method sig' command. class MethodSigCommand < Command def regexp - /^\s*m(?:ethod)?\s+sig\s+(\S+)\s*$/ + /^\s*m(?:ethod)?\s+sig(?:nature)?\s+(\S+)\s*$/ end def execute @@ -33,7 +33,7 @@ def help(cmd) %{ - m[ethod] signature\t\tshow the signature of a method + m[ethod] sig[nature] \tshow the signature of a method } end end @@ -74,7 +74,7 @@ def help(cmd) %{ m[ethod] i[nstance] \tshow methods of object - m[ethod] iv \tshow instance variables of object + m[ethod] iv \t\tshow instance variables of object m[ethod] \t\tshow instance methods of class or module } end Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-29 13:37:13 UTC (rev 827) +++ trunk/doc/ruby-debug.texi 2008-04-29 14:00:53 UTC (rev 828) @@ -2038,6 +2038,17 @@ end @end smallexample on @var{object}. + at item signature @var{object} + at kindex method signature @var{object} +Show procedure signature of method @var{object}. + at emph{This command is available only if the nodewrap is installed.} + at smallexample + def mymethod(a, b=5, &bock) + end + (rdb:1) @b{method sig mymethod} + Mine#mymethod(a, b=5, &bock) + at end smallexample +on @var{object}. @item method @var{class-or-module} @kindex method @var{class-or-module} Show methods of the class or module, @var{class-or-module}. Basically Modified: trunk/test/classes.rb =================================================================== --- trunk/test/classes.rb 2008-04-29 13:37:13 UTC (rev 827) +++ trunk/test/classes.rb 2008-04-29 14:00:53 UTC (rev 828) @@ -2,7 +2,7 @@ def initialize @myvar = 'init' end - def mymethod(a, b=5) + def mymethod(a, b=5, &block) end def self.classmeth end Modified: trunk/test/data/methodsig.right =================================================================== --- trunk/test/data/methodsig.right 2008-04-29 13:37:13 UTC (rev 827) +++ trunk/test/data/methodsig.right 2008-04-29 14:00:53 UTC (rev 828) @@ -16,5 +16,5 @@ # method sig initialize Mine#initialize() # method sig mymethod -Mine#mymethod(a, b=5) +Mine#mymethod(a, b=5, &block) # quit From nobody at rubyforge.org Wed Apr 30 16:14:01 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 30 Apr 2008 16:14:01 -0400 (EDT) Subject: [Ruby-debug-commits] [829] trunk/doc/ruby-debug.texi: Fix doc for binding_n(). Message-ID: <20080430201401.6F74C1D78018@rubyforge.org> Revision: 829 Author: rockyb Date: 2008-04-30 16:14:00 -0400 (Wed, 30 Apr 2008) Log Message: ----------- Fix doc for binding_n(). Modified Paths: -------------- trunk/doc/ruby-debug.texi Modified: trunk/doc/ruby-debug.texi =================================================================== --- trunk/doc/ruby-debug.texi 2008-04-29 14:00:53 UTC (rev 828) +++ trunk/doc/ruby-debug.texi 2008-04-30 20:14:00 UTC (rev 829) @@ -3558,11 +3558,13 @@ @item breakpoint @ovar{steps=1} @vindex @code{Kernel::breakpoint} -An alias for debugger. +An alias for debugger. @item binding_n @ovar{n=0} @vindex @code{Kernel::binding_n} -Returns a binding of @var{n}-th call frame. +Returns a @samp{binding()} for the @var{n}-th call frame. Note however +that you need to first call @samp{Debugger.start} before issuing this +call. @end table