From nobody at rubyforge.org Wed Oct 13 21:41:49 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 13 Oct 2010 21:41:49 -0400 (EDT) Subject: [Ruby-debug-commits] [953] trunk: improve list and list - (backwards) handling when hitting end of file. Message-ID: <20101014014149.C125519782F8@rubyforge.org> Revision: 953 Author: rockyb Date: 2010-10-13 21:41:49 -0400 (Wed, 13 Oct 2010) Log Message: ----------- improve list and list - (backwards) handling when hitting end of file. Modified Paths: -------------- trunk/CHANGES trunk/ChangeLog trunk/cli/ruby-debug/commands/list.rb trunk/lib/ChangeLog trunk/test/data/list.right Modified: trunk/CHANGES =================================================================== --- trunk/CHANGES 2010-09-20 11:06:17 UTC (rev 952) +++ trunk/CHANGES 2010-10-14 01:41:49 UTC (rev 953) @@ -3,6 +3,7 @@ - Various bug fixes: * reload command. * plain 'info' command + * improve list and list - (backwards) handling when hitting end of file - Add ability to specify port to debug on - Allow breakpoints at class methods - "quit!" is same as "quit unconditionally" Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-09-20 11:06:17 UTC (rev 952) +++ trunk/ChangeLog 2010-10-14 01:41:49 UTC (rev 953) @@ -1,3 +1,9 @@ +2010-09-20 11:06 Rocky Bernstein + + * ChangeLog, Rakefile, lib/ChangeLog, test/test-init.rb: "rake + test" of ruby-debug gem should now work without requiring or + using ruby-debug-base code. Rubyforge tracker #28560. + 2010-09-20 09:33 Rocky Bernstein * ChangeLog, Rakefile, lib/ChangeLog: Make sure version file is Modified: trunk/cli/ruby-debug/commands/list.rb =================================================================== --- trunk/cli/ruby-debug/commands/list.rb 2010-09-20 11:06:17 UTC (rev 952) +++ trunk/cli/ruby-debug/commands/list.rb 2010-10-14 01:41:49 UTC (rev 953) @@ -69,12 +69,12 @@ # If we can show from B to E then we return B, otherwise we return the # previous line @state.previous_line. def display_list(b, e, file, current) - print "[%d, %d] in %s\n", b, e, file lines = LineCache::getlines(file, Command.settings[:reload_source_on_change]) if lines - return @state.previous_line if b >= lines.size + b = lines.size - (e - b) if b >= lines.size e = lines.size if lines.size < e + print "[%d, %d] in %s\n", b, e, file [b, 1].max.upto(e) do |n| if n > 0 && lines[n-1] if n == current @@ -88,7 +88,7 @@ errmsg "No sourcefile available for %s\n", file return @state.previous_line end - return e == lines.size ? @state.previous_line : b + return b end end end Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2010-09-20 11:06:17 UTC (rev 952) +++ trunk/lib/ChangeLog 2010-10-14 01:41:49 UTC (rev 953) @@ -1,3 +1,9 @@ +2010-09-20 11:06 Rocky Bernstein + + * ChangeLog: "rake test" of ruby-debug gem should now work without + requiring or using ruby-debug-base code. Rubyforge tracker + #28560. + 2010-09-20 09:33 Rocky Bernstein * ChangeLog: Make sure version file is closed. Thanks to Mamoru Modified: trunk/test/data/list.right =================================================================== --- trunk/test/data/list.right 2010-09-20 11:06:17 UTC (rev 952) +++ trunk/test/data/list.right 2010-10-14 01:41:49 UTC (rev 953) @@ -99,7 +99,7 @@ => 4 def gcd(a, b) 5 # Make: a <= b # list 20 -[15, 24] in ./gcd.rb +[15, 18] in ./gcd.rb 15 return gcd(b-a, a) 16 end 17 From nobody at rubyforge.org Fri Oct 15 10:45:12 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Fri, 15 Oct 2010 10:45:12 -0400 (EDT) Subject: [Ruby-debug-commits] [954] trunk: Go over documentation (1st pass) including that created by rdoc. Message-ID: <20101015144512.CCADE1678316@rubyforge.org> Revision: 954 Author: rockyb Date: 2010-10-15 10:45:12 -0400 (Fri, 15 Oct 2010) Log Message: ----------- Go over documentation (1st pass) including that created by rdoc. Better instructions for how to build on MS Windows and the include cross-compile.sh script I use. Update rubyforge URL's used to building ChangeLogs. Modified Paths: -------------- trunk/CHANGES trunk/ChangeLog trunk/INSTALL.SVN trunk/Rakefile trunk/cli/ruby-debug/command.rb trunk/cli/ruby-debug/interface.rb trunk/cli/ruby-debug/processor.rb trunk/ext/breakpoint.c trunk/ext/ruby_debug.c trunk/lib/ChangeLog trunk/lib/ruby-debug-base.rb Added Paths: ----------- trunk/cross-compile.sh Modified: trunk/CHANGES =================================================================== --- trunk/CHANGES 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/CHANGES 2010-10-15 14:45:12 UTC (rev 954) @@ -1,4 +1,5 @@ 0.10.4 +10/27/10 - Various bug fixes: * reload command. @@ -9,6 +10,7 @@ - "quit!" is same as "quit unconditionally" - irb improvements: Access to non-executing rdebug commands inside irb via "dbgr" method + - Go over documentation including that created by rdoc. - For emacs package: add README, INSTALL, AUTHORS. 0.10.3 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/ChangeLog 2010-10-15 14:45:12 UTC (rev 954) @@ -1,3 +1,9 @@ +2010-10-14 01:41 Rocky Bernstein + + * CHANGES, ChangeLog, cli/ruby-debug/commands/list.rb, + lib/ChangeLog, test/data/list.right: improve list and list - + (backwards) handling when hitting end of file. + 2010-09-20 11:06 Rocky Bernstein * ChangeLog, Rakefile, lib/ChangeLog, test/test-init.rb: "rake Modified: trunk/INSTALL.SVN =================================================================== --- trunk/INSTALL.SVN 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/INSTALL.SVN 2010-10-15 14:45:12 UTC (rev 954) @@ -1,7 +1,8 @@ -Building and Installing ruby-debug from rubyforge's Subversion Repository (svn) +Building and Installing ruby-debug from rubyforge's Subversion +Repository (svn) -The below are Unix-centric instructions. If you have Microsoft Windows see -the section on building Microsoft Windows. +The below are Unix-centric instructions. If you have Microsoft +Windows, see the section on building Microsoft Windows. 0. Prerequisites: To build the package you'll need at a minimum: @@ -101,44 +102,28 @@ using Microsoft Visual Studio C 6 which is not sold anymore and is rather old. -Instead I suggest building via mingw/msys. -http://eigenclass.org/hiki.rb?cmd=view&p=cross+compiling+rcovrt&key=mingw has instructions on how to do. Some amendments to these instructions. +I suggest building via mingw/msys cross compiler. +http://eigenclass.org/hiki.rb?cmd=view&p=cross+compiling+rcovrt&key=mingw has instructions on how to do. -First, those instructions are a little GNU/Linux centric. If you are -using Ubuntu or Debian, then this should be the easiest to follow the -instructions. On Ubuntu or Debian there is a mingw3 Debian -package. Installing that will give you the cross compiler that is a -prerequisite. Alternatively if you are running MS Windows I notice -that cygwin also has a mingw package. Or possibly you could use MinGW -directly. For other OS's you might have to build a cross-compiler, -i.e. gcc which emits win32 code and can create a win32 DLL. +Note those instructions are a little GNU/Linux centric. On Ubuntu or +Debian there is a mingw32 Debian package. Installing that will give +you the cross compiler that is a prerequisite. Alternatively if you +are running MS Windows I notice that cygwin also has a mingw +package. Or possibly you could use MinGW directly. For other OS's you +might have to build a cross-compiler, i.e. gcc which emits win32 code +and can create a win32 DLL. -After you have a cross compiler you need to download the Ruby source -and basically build a ruby interpreter. The cross-compile.sh script -works although when I downloaded it, it had lots of blank space at the -beginning which will mess up the Unix magic interpretation. That is -remove the blanks in front of "#/bin/sh" +After you have a cross compiler, you need to download the Ruby source +and basically build a ruby interpreter. I use cross-compile.sh script +in this directory. You may want to customize it for your needs. -On my system, this script fails in running "make ruby" because the -fake.rb that got created needed to have a small change: +Once you have a cross-compiled rubyw.exe interpreter, the directory +you want be is in ruby-debug/trunk/ext/win32, not ruby-debug/ext. - ALT_SEPARATOR = "\"; \ -should be - ALT_SEPARATOR = "\\"; \ +So let's say you've installed the cross-compiled install rubyw.exe in +/usr/local/ruby-mingw32/rubyw.exe. Here then are the commands to build +ruby-debug-base-xxx-mswin32.gem -After fixing this, run - make ruby -Also, I needed to run - make rubyw - -And then "make install" as indicated. - -Once all of that's in place, the place you want be is in -ruby-debug/trunk/ext/win32, not ruby-debug/ext. - -So let's say you've installed the cross-compiled install ruby in -/usr/local/ruby-mingw32/. Here then are the commands to build ruby-debug-base-xxx-mswin32.gem - cd .../ruby-debug/trunk/ext/win32 ruby -I /usr/local/ruby-mingw32/lib/ruby/1.8/i386-mingw32 ../extconf.rb make # Not rake Modified: trunk/Rakefile =================================================================== --- trunk/Rakefile 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/Rakefile 2010-10-15 14:45:12 UTC (rev 954) @@ -117,9 +117,9 @@ desc "Create a GNU-style ChangeLog via svn2cl" task :ChangeLog do - system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk") - system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/ext -o ext/ChangeLog") - system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/lib -o lib/ChangeLog") + system('svn2cl --authors=svn2cl_usermap http://ruby-debug.rubyforge.org/svn/trunk') + system("svn2cl --authors=svn2cl_usermap http://ruby-debug.rubyforge.org/svn/trunk/ext -o ext/ChangeLog") + system("svn2cl --authors=svn2cl_usermap http://ruby-debug.rubyforge.org/svn/trunk/lib -o lib/ChangeLog") end # Base GEM Specification @@ -257,6 +257,7 @@ rdoc.options << '--main' << 'README' rdoc.rdoc_files.include('bin/**/*', 'cli/ruby-debug/commands/*.rb', + 'cli/ruby-debug/*.rb', 'lib/**/*.rb', 'ext/**/ruby_debug.c', 'README', Modified: trunk/cli/ruby-debug/command.rb =================================================================== --- trunk/cli/ruby-debug/command.rb 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/cli/ruby-debug/command.rb 2010-10-15 14:45:12 UTC (rev 954) @@ -6,14 +6,29 @@ RUBY_DEBUG_DIR = File.expand_path(File.dirname(__FILE__)) unless defined?(RUBY_DEBUG_DIR) - class Command # :nodoc: + # A Debugger::Command object is is the base class for commands that + # implement a single debugger command. Individual debugger commands + # will be a subclass of this. The singleton class object is the + # command manager for all commands. + # + # Each debugger command is expected to have the following methods: + # _regexp_:: A regular expression which input strings are matched + # against. It is the ruby-debug programmer's responsibility + # to make sure that these regular expressions match disjoint + # sets of strings. Otherwise one is arbitrarily used. + # _execute:: Ruby code implement the command. + # _help_:: Descriptive help for the commmand. Used by the 'help' command + # Debugger::CommandHelp + # _help_command:: The name of the command listed in help. + # + class Command SubcmdStruct=Struct.new(:name, :min, :short_help, :long_help) unless defined?(SubcmdStruct) include Columnize - # Find param in subcmds. param id downcased and can be abbreviated - # to the minimum length listed in the subcommands + # Find _param_ in _subcmds_. The _param_ id downcased and can be + # abbreviated to the minimum length listed in the subcommands def find(subcmds, param) param.downcase! for try_subcmd in subcmds do @@ -46,6 +61,11 @@ commands << klass end + # Read in and "include" all the subclasses of the + # Debugger::Command class. For example + # Debugger::CommandQuitCommand is one of them. The list of Ruby + # files to read are all the files that end .rb in directory + # Debugger::RUBY_DEBUG_DIR def load_commands Dir[File.join(Debugger.const_get(:RUBY_DEBUG_DIR), 'commands', '*')].each do |file| require file if file =~ /\.rb$/ Modified: trunk/cli/ruby-debug/interface.rb =================================================================== --- trunk/cli/ruby-debug/interface.rb 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/cli/ruby-debug/interface.rb 2010-10-15 14:45:12 UTC (rev 954) @@ -1,5 +1,11 @@ module Debugger - class Interface # :nodoc: + + # An _Interface_ is the kind of input/output interaction that goes + # on between the user and the debugged program. It includes things + # like how one wants to show error messages, or read input. This is + # the base class. Subclasses inlcude Debugger::LocalInterface, + # Debugger::RemoteInterface and Debugger::ScriptInterface. + class Interface attr_writer :have_readline # true if Readline is available def initialize @@ -35,9 +41,16 @@ print afmt(msg) end + # Things we do before terminating. + def finalize + end + end - class LocalInterface < Interface # :nodoc: + # A _LocalInterface_ is the kind of I/O interactive performed when + # the user interface is in the same process as the debugged program. + # Compare with Debugger::RemoteInterface. + class LocalInterface < Interface attr_accessor :command_queue attr_accessor :histfile attr_accessor :history_save @@ -133,7 +146,11 @@ end end - class RemoteInterface < Interface # :nodoc: + # A _RemoteInterface_ is the kind of I/O interactive performed when + # the user interface is in a different process (and possibly + # different computer) than the debugged program. Compare with + # Debugger::LocalInterface. + class RemoteInterface < Interface attr_accessor :command_queue attr_accessor :histfile attr_accessor :history_save @@ -165,9 +182,6 @@ send_command "CONFIRM #{prompt}" end - def finalize - end - def read_command(prompt) send_command "PROMPT #{prompt}" end @@ -190,7 +204,11 @@ end end - class ScriptInterface < Interface # :nodoc: + # A _ScriptInterface_ is used when we are reading debugger commands + # from a command-file rather than an interactive user. Command files + # appear in a users initialization script (e.g. .rdebugrc) and appear + # when running the debugger command _source_ (Debugger::SourceCommand). + class ScriptInterface < Interface attr_accessor :command_queue attr_accessor :histfile attr_accessor :history_save @@ -206,10 +224,7 @@ @history_length = 256 # take gdb default @histfile = '' end - - def finalize - end - + def read_command(prompt) while result = @file.gets puts "# #{result}" if @verbose @@ -221,10 +236,15 @@ result.chomp! end + # Do we have ReadLine support? When running an debugger command + # script, we are not interactive so we just return _false_. def readline_support? false end + # _confirm_ is called before performing a dangerous action. In + # running a debugger script, we don't want to prompt, so we'll pretend + # the user has unconditionally said "yes" and return String "y". def confirm(prompt) 'y' end Modified: trunk/cli/ruby-debug/processor.rb =================================================================== --- trunk/cli/ruby-debug/processor.rb 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/cli/ruby-debug/processor.rb 2010-10-15 14:45:12 UTC (rev 954) @@ -1,28 +1,38 @@ require 'ruby-debug/interface' require 'ruby-debug/command' +# _Debugger_ is the module name space for ruby-debug. module Debugger - # Should this be a mixin? - class Processor # :nodoc + # A processor handles the kind of front-end to program interaction. + # Debugger::Processor is the the base class with subclasses + # Debugger::CommandProcessor and Debugger::ControlCommandProcessor. + class Processor attr_accessor :interface attr_reader :processor attr_reader :commands - # Format msg with gdb-style annotation header + # Format _msg_ with gdb-style annotation header. def afmt(msg, newline="\n") "\032\032#{msg}#{newline}" end + # Print "annotation" message _msg_. Annotation messages are used + # by the GNU-Emacs front-end to get status about stacks and + # the state of the debugger without having to poll it for information def aprint(msg) print afmt(msg) if Debugger.annotate.to_i > 2 end - # FIXME: use delegate? + # Print a debugger error message; _args_ should be compatible + # with something you would pass to Kernel::print. def errmsg(*args) @interface.errmsg(*args) end + # Print a normal debugger message; _args_ should be compatible + # with something you would pass to Kernel::print. + # # Callers of this routine should make sure to use comma to # separate format argments rather than %. Otherwise it seems that # if the string you want to print has format specifier, which @@ -35,7 +45,10 @@ end - class CommandProcessor < Processor # :nodoc: + # A Debugger::CommandProcessor is the kind of Debugger::Processor + # used when you are running inside the same process as the debugged + # program. + class CommandProcessor < Processor attr_reader :display # FIXME: get from Command regexp method. @@ -83,7 +96,7 @@ require 'pathname' # For cleanpath - # Regularize file name. + # Regularize or "canonicalize" file name _filename_. # This is also used as a common funnel place if basename is # desired or if we are working remotely and want to change the # basename. Or we are eliding filenames. @@ -108,7 +121,10 @@ end print file_line end - + + # Create a "protected" version of method _mname_. A protected + # method handles all unhandled exceptions that would cause the + # program to terminate. def self.protect(mname) alias_method "__#{mname}", mname module_eval %{ @@ -127,7 +143,9 @@ end } end - + + # This is a callback routine when the debugged program hits a + # breakpoint event. For example ruby-debug-base calls this. def at_breakpoint(context, breakpoint) aprint 'stopped' if Debugger.annotate.to_i > 2 n = Debugger.breakpoints.index(breakpoint) + 1 @@ -140,6 +158,8 @@ end protect :at_breakpoint + # This is a callback routine when the debugged program hits a + # catchpoint. For example ruby-debug-base calls this. def at_catchpoint(context, excpt) aprint 'stopped' if Debugger.annotate.to_i > 2 file = CommandProcessor.canonic_file(context.frame_file(0)) @@ -172,20 +192,31 @@ end protect :at_tracing + # This is a callback routine when the debugged program hits a + # "line" (or statement boundary) event. For example + # ruby-debug-base calls this. def at_line(context, file, line) process_commands(context, file, line) end protect :at_line + # This is a callback routine when the debugged program hits a + # "return" event. For example ruby-debug-base calls this. + # Note: right now ruby-debug-base does not call this. Perhaps + # other bases routines such as the one in JRuby do. def at_return(context, file, line) context.stop_frame = -1 process_commands(context, file, line) end + # Return the command object to run given input string _input_. def lookup(input) @commands.find{ |c| c.match(input) } end + # Run a single command specified by string _input_; _commands_ is and + # Array of possible debugger command objects and _context_ is + # a Debugger::Context object. def one_cmd(commands, context, input) if cmd = lookup(input) if context.dead? && cmd.class.need_context @@ -206,7 +237,7 @@ private - # The prompt shown before reading a command. + # Return a prompt string to show before reading a command. def prompt(context) p = '(rdb:%s) ' % (context.dead? ? 'post-mortem' : context.thnum) p = afmt("pre-prompt")+p+"\n"+afmt("prompt") if @@ -214,14 +245,14 @@ return p end - # Run these commands, for example display commands or possibly - # the list or irb in an "autolist" or "autoirb". - # We return a list of commands that are acceptable to run bound - # to the current state. + # Run commands that we always have to run before a entering a + # command loop. For example commands registered via debugger "set + # display", "set autolist", or set "autoirb". We return a list of + # commands that are acceptable to run bound to the current state. def always_run(context, file, line, run_level) event_cmds = Command.commands.select{|cmd| cmd.event } - # Remove some commands in post-mortem + # Remove some commands if we are post mortem. event_cmds = event_cmds.find_all do |cmd| cmd.allow_in_post_mortem end if context.dead? @@ -246,7 +277,9 @@ return state, commands end - # Handle debugger commands + # This the main debugger command-line loop. Here we read a + # debugger command, perform it, and ask for another one unless we + # are told to continue execution or terminate. def process_commands(context, file, line) state, @commands = always_run(context, file, line, 1) $rdebug_state = state if Command.settings[:debuggertesting] @@ -290,7 +323,11 @@ end postloop(@commands, context) end # process_commands - + + # Things we do before entering the debugger command loop. + # Note: in the trepanning debuggers this and always_run have been + # merged. To do this and get the order right we add a priority level + # for each hook. def preloop(commands, context) aprint('stopped') if Debugger.annotate.to_i > 2 if context.dead? @@ -315,6 +352,7 @@ end end + # Things we do after leaving the debugger command loop. def postcmd(commands, context, cmd) if Debugger.annotate.to_i > 0 cmd = @last_cmd unless cmd @@ -335,9 +373,14 @@ end end + # Things we do after leaving the debugger command loop. def postloop(commands, context) end + # Run a command in String _cmd_, but tag output with annotation + # specified in String _label+. +commands_ is an Array of all + # possible debugger command objects, and _context_ is a + # Debugger::Context object. def annotation(label, commands, context, cmd) print afmt(label) one_cmd(commands, context, cmd) @@ -374,15 +417,26 @@ yield self end - # FIXME: use delegate? + # Print a debugger error message; _args_ should be compatible + # with something you would pass to Kernel::print. def errmsg(*args) @interface.errmsg(*args) end + # Print a normal debugger message; _args_ should be compatible + # with something you would pass to Kernel::print. + # + # Callers of this routine should make sure to use comma to + # separate format argments rather than %. Otherwise it seems that + # if the string you want to print has format specifier, which + # could happen if you are trying to show say a source-code line + # with "puts" or "print" in it, this print routine will give an + # error saying it is looking for more arguments. def print(*args) @interface.print(*args) end + # confirm is called before performing a dangerous action. def confirm(*args) @interface.confirm(*args) end @@ -397,13 +451,19 @@ end end - class ControlCommandProcessor < Processor # :nodoc: + # A Debugger::ControlCommandProcessor is the kind of Debugger::Processor + # used the debugged program is running remotely. It is also entered + # after the debugged program has terminated. + class ControlCommandProcessor < Processor def initialize(interface) super() @interface = interface @debugger_context_was_dead = true # Assume we haven't started. end - + + # This the main debugger command-line loop. Here we read a + # debugger command, perform it, and ask for another one unless we + # are told to continue execution or terminate. def process_commands(verbose=false) control_cmds = Command.commands.select do |cmd| cmd.allow_in_control @@ -437,8 +497,9 @@ @interface.close end - # The prompt shown before reading a command. - # Note: have an unused 'context' parameter to match the local interface. + # Return a prompt string to show before reading a command. Note: The + # _context_ parameter is not used. It must be provided so that the + # interface matches Debugger::CommandProcessor#prompt. def prompt(context) p = '(rdb:ctrl) ' p = afmt("pre-prompt")+p+"\n"+afmt("prompt") if @@ -457,14 +518,27 @@ def proceed end + # Print a debugger error message; _args_ should be compatible + # with something you would pass to Kernel::print. def errmsg(*args) @interface.print(*args) end + # Print a normal debugger message; _args_ should be compatible + # with something you would pass to Kernel::print. + # + # Callers of this routine should make sure to use comma to + # separate format argments rather than %. Otherwise it seems that + # if the string you want to print has format specifier, which + # could happen if you are trying to show say a source-code line + # with "puts" or "print" in it, this print routine will give an + # error saying it is looking for more arguments. def print(*args) @interface.print(*args) end - + + # confirm is called before performing a dangerous action. In + # control processor we always return "yes" or "y". def confirm(*args) 'y' end Added: trunk/cross-compile.sh =================================================================== --- trunk/cross-compile.sh (rev 0) +++ trunk/cross-compile.sh 2010-10-15 14:45:12 UTC (rev 954) @@ -0,0 +1,12 @@ +#!/bin/bash +env ac_cv_func_getpgrp_void=no \ + ac_cv_func_setpgrp_void=yes \ + rb_cv_negative_time_t=no \ + ac_cv_func_memcmp_working=yes \ + rb_cv_binary_elf=no \ + ./configure \ + --host=i586-mingw32msvc \ + --target=i386-mingw32 \ + --build=i686-linux \ + --prefix=/usr/local/ruby-mingw32 +make ruby rubyw && sudo make install Property changes on: trunk/cross-compile.sh ___________________________________________________________________ Added: svn:executable + * Modified: trunk/ext/breakpoint.c =================================================================== --- trunk/ext/breakpoint.c 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/ext/breakpoint.c 2010-10-15 14:45:12 UTC (rev 954) @@ -256,7 +256,7 @@ /* * call-seq: - * context.breakpoint -> breakpoint + * context.breakpoint -> Breakpoint * * Returns a context-specific temporary Breakpoint object. */ Modified: trunk/ext/ruby_debug.c =================================================================== --- trunk/ext/ruby_debug.c 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/ext/ruby_debug.c 2010-10-15 14:45:12 UTC (rev 954) @@ -8,7 +8,6 @@ #define DEBUG_VERSION "0.10.4rc2" - #ifdef _WIN32 struct FRAME { VALUE self; @@ -534,8 +533,9 @@ } /* - * This is a NASTY HACK. For some reasons rb_f_binding is declared - * static in eval.c. So we create a cons up call to binding in C. + * A nasty hack to be able to get at the +Kernel.binding+ method. + * +rb_f_binding+ is declared static in eval.c. So copy and save our own value + * of it by looking up the method name in the Kernel module. */ static VALUE create_binding(VALUE self) @@ -2173,9 +2173,10 @@ /* * Document-class: Context * - * == Summary - * - * Debugger keeps a single instance of this class for each Ruby thread. + * The Debugger module keeps a single instance of this class for + * each Ruby thread. It contains a call-stack information, thread + * information, breakpoint information and the reason the program is + * stopped. */ static void Init_context() @@ -2214,9 +2215,10 @@ /* * call-seq: - * Debugger.breakpoints -> array + * Debugger.breakpoints -> Array * - * Returns an array of breakpoints. + * Returns an Array of Breakpoint objects; all the breakpoints that + * have been created. */ static VALUE debug_breakpoints(VALUE self) @@ -2251,10 +2253,7 @@ /* * Document-class: Debugger * - * == Summary - * - * This is a singleton class allows controlling the debugger. Use it to start/stop debugger, - * set/remove breakpoints, etc. + * _Debugger_ is the module name space for ruby-debug. */ #if defined(_WIN32) __declspec(dllexport) Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/lib/ChangeLog 2010-10-15 14:45:12 UTC (rev 954) @@ -1,3 +1,8 @@ +2010-10-14 01:41 Rocky Bernstein + + * ChangeLog: improve list and list - (backwards) handling when + hitting end of file. + 2010-09-20 11:06 Rocky Bernstein * ChangeLog: "rake test" of ruby-debug gem should now work without Modified: trunk/lib/ruby-debug-base.rb =================================================================== --- trunk/lib/ruby-debug-base.rb 2010-10-14 01:41:49 UTC (rev 953) +++ trunk/lib/ruby-debug-base.rb 2010-10-15 14:45:12 UTC (rev 954) @@ -218,8 +218,9 @@ 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 _steps_ line + # events occur. Before entering the debugger, a user-defined + # startup script is may be read. # # 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" @@ -227,10 +228,12 @@ # debugger. Settings _steps_ 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. - - # If a block is given (and the debugger hasn't been started, we run the - # block under the debugger. Alas, when a block is given, we can't support - # running the startup script or support the steps option. FIXME. + # + # If block _block_ is given (and the debugger hasn't been started, + # we run the block under the debugger. + # + # FIXME: Alas, when a block is given, we can't support running the + # startup script or support the steps option. def debugger(steps = 1, &block) if block Debugger.start({}, &block) From nobody at rubyforge.org Fri Oct 15 11:16:15 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Fri, 15 Oct 2010 11:16:15 -0400 (EDT) Subject: [Ruby-debug-commits] [955] trunk/cli/ruby-debug: More rdoc work. Message-ID: <20101015151615.38B8A185839D@rubyforge.org> Revision: 955 Author: rockyb Date: 2010-10-15 11:16:14 -0400 (Fri, 15 Oct 2010) Log Message: ----------- More rdoc work. Modified Paths: -------------- trunk/cli/ruby-debug/command.rb trunk/cli/ruby-debug/commands/help.rb trunk/cli/ruby-debug/commands/quit.rb Modified: trunk/cli/ruby-debug/command.rb =================================================================== --- trunk/cli/ruby-debug/command.rb 2010-10-15 14:45:12 UTC (rev 954) +++ trunk/cli/ruby-debug/command.rb 2010-10-15 15:16:14 UTC (rev 955) @@ -11,16 +11,19 @@ # will be a subclass of this. The singleton class object is the # command manager for all commands. # - # Each debugger command is expected to have the following methods: - # _regexp_:: A regular expression which input strings are matched - # against. It is the ruby-debug programmer's responsibility - # to make sure that these regular expressions match disjoint - # sets of strings. Otherwise one is arbitrarily used. - # _execute:: Ruby code implement the command. - # _help_:: Descriptive help for the commmand. Used by the 'help' command - # Debugger::CommandHelp - # _help_command:: The name of the command listed in help. + # Each debugger command is expected to implement the following methods: + # _regexp_:: A regular expression which input strings are matched + # against. If we have a match, run this command. + # It is the ruby-debug programmer's responsibility + # to make sure that these regular expressions match disjoint + # sets of strings. Otherwise one is arbitrarily used. + # _execute_:: Ruby code that implements the command. + # _help_:: Should return a String containing descriptive help for + # the commmand. Used by the 'help' command Debugger::HelpCommand + # _help_command_:: The name of the command listed via help. # + # _help_ and _help_command_ methods are singleton methods, not + # instance methods like _regexp_ and _execute_. class Command SubcmdStruct=Struct.new(:name, :min, :short_help, :long_help) unless defined?(SubcmdStruct) @@ -41,6 +44,8 @@ end class << self + # An Array containing Debugger::Command classes that implment each + # of the debugger commands. def commands @commands ||= [] end @@ -63,7 +68,7 @@ # Read in and "include" all the subclasses of the # Debugger::Command class. For example - # Debugger::CommandQuitCommand is one of them. The list of Ruby + # Debugger::QuitCommand is one of them. The list of Ruby # files to read are all the files that end .rb in directory # Debugger::RUBY_DEBUG_DIR def load_commands @@ -95,7 +100,9 @@ @@settings_map ||= {} end private :settings_map - + + # Returns a Hash of Debugger settings, @settings. If doesn't exist + # we create a @settings hash with [] setter and getter and return that. def settings unless true and defined? @settings and @settings @settings = Object.new @@ -185,10 +192,17 @@ @state.print(*args) end + # Called when we are about to do a dangerous operation. _msg_ + # contains a prompt message. Return _true_ if confirmed or _false_ + # if not confirmed. def confirm(msg) @state.confirm(msg) == 'y' end + # debug_eval like Kernel.eval or Object.instance_eval but using + # the bindings for the debugged program. If there is a + # syntax-error like exception in running eval, print an + # appropriate message and throw :debug_error def debug_eval(str, b = get_binding) begin val = eval(str, b) @@ -206,6 +220,10 @@ end end + # debug_eval like Kernel.eval or Object.instance_eval but using + # the bindings for the debugged program. If there is a syntax + # error kind of exception in running eval, no warning is given and + # nil is returned. def debug_silent_eval(str) begin eval(str, get_binding) @@ -214,6 +232,7 @@ end end + # Return a binding object for the debugged program. def get_binding @state.context.frame_binding(@state.frame_pos) end Modified: trunk/cli/ruby-debug/commands/help.rb =================================================================== --- trunk/cli/ruby-debug/commands/help.rb 2010-10-15 14:45:12 UTC (rev 954) +++ trunk/cli/ruby-debug/commands/help.rb 2010-10-15 15:16:14 UTC (rev 955) @@ -4,10 +4,13 @@ class HelpCommand < Command self.allow_in_control = true + # An input line is matched against this regular expression. If we have + # a match, run this command. def regexp /^\s* h(?:elp)? (?:\s+(.+))? $/x end + # The code that implements this command. def execute if @match[1] args = @match[1].split @@ -41,10 +44,12 @@ end class << self + # The command name listed via 'help' def help_command 'help' end + # Returns a String given the help description of this command def help(cmd) %{ h[elp]\t\tprint this help Modified: trunk/cli/ruby-debug/commands/quit.rb =================================================================== --- trunk/cli/ruby-debug/commands/quit.rb 2010-10-15 14:45:12 UTC (rev 954) +++ trunk/cli/ruby-debug/commands/quit.rb 2010-10-15 15:16:14 UTC (rev 955) @@ -4,6 +4,8 @@ class QuitCommand < Command self.allow_in_control = true + # An input line is matched against this regular expression. If we have + # a match, run this command. def regexp / ^\s* (?:q(?:uit)?|exit) \s* @@ -12,6 +14,7 @@ /ix end + # The code that implements this command. def execute if @match[1] or confirm("Really quit? (y/n) ") @state.interface.finalize @@ -20,10 +23,12 @@ end class << self + # The command name listed via 'help' def help_command %w[quit exit] end + # Returns a String given the help description of this command def help(cmd) %{ q[uit] [!|unconditionally]\texit from debugger. From nobody at rubyforge.org Thu Oct 21 17:03:49 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 21 Oct 2010 17:03:49 -0400 (EDT) Subject: [Ruby-debug-commits] [956] trunk/ext/ruby_debug.c: Remove gcc warning and redundant code. Message-ID: <20101021210350.06D5B197828C@rubyforge.org> Revision: 956 Author: rockyb Date: 2010-10-21 17:03:49 -0400 (Thu, 21 Oct 2010) Log Message: ----------- Remove gcc warning and redundant code. Rubyforge Issue #28654. Thanks to Mamoru Tasaka. Modified Paths: -------------- trunk/ext/ruby_debug.c Modified: trunk/ext/ruby_debug.c =================================================================== --- trunk/ext/ruby_debug.c 2010-10-15 15:16:14 UTC (rev 955) +++ trunk/ext/ruby_debug.c 2010-10-21 21:03:49 UTC (rev 956) @@ -6,7 +6,7 @@ #include #include -#define DEBUG_VERSION "0.10.4rc2" +#define DEBUG_VERSION "0.10.4rc3" #ifdef _WIN32 struct FRAME { @@ -479,7 +479,7 @@ if(frame_n >= debug_context->stack_len) { debug_context->stack_len += STACK_SIZE_INCREMENT; - debug_context->frames = REALLOC_N(debug_context->frames, debug_frame_t, debug_context->stack_len); + REALLOC_N(debug_context->frames, debug_frame_t, debug_context->stack_len); } debug_frame = &debug_context->frames[frame_n]; debug_frame->argc = ruby_frame->argc; From nobody at rubyforge.org Thu Oct 21 17:08:00 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 21 Oct 2010 17:08:00 -0400 (EDT) Subject: [Ruby-debug-commits] [957] ruby-debug-0.10.4rc3/: Tag 0.10.4rc3 release. Message-ID: <20101021210800.8C7821858378@rubyforge.org> Revision: 957 Author: rockyb Date: 2010-10-21 17:08:00 -0400 (Thu, 21 Oct 2010) Log Message: ----------- Tag 0.10.4rc3 release. Added Paths: ----------- ruby-debug-0.10.4rc3/ From nobody at rubyforge.org Wed Oct 27 08:58:31 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 27 Oct 2010 08:58:31 -0400 (EDT) Subject: [Ruby-debug-commits] [958] trunk: Get ready for release 0.10.4 Message-ID: <20101027125831.4C78D1858377@rubyforge.org> Revision: 958 Author: rockyb Date: 2010-10-27 08:58:30 -0400 (Wed, 27 Oct 2010) Log Message: ----------- Get ready for release 0.10.4 Modified Paths: -------------- trunk/ChangeLog trunk/ext/ruby_debug.c trunk/lib/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-10-21 21:08:00 UTC (rev 957) +++ trunk/ChangeLog 2010-10-27 12:58:30 UTC (rev 958) @@ -1,3 +1,25 @@ +2010-10-21 21:03 Rocky Bernstein + + * ext/ruby_debug.c: Remove gcc warning and redundant code. + Rubyforge Issue #28654. Thanks to Mamoru Tasaka. + +2010-10-15 15:16 Rocky Bernstein + + * cli/ruby-debug/command.rb, cli/ruby-debug/commands/help.rb, + cli/ruby-debug/commands/quit.rb: More rdoc work. + +2010-10-15 14:45 Rocky Bernstein + + * CHANGES, ChangeLog, INSTALL.SVN, Rakefile, + cli/ruby-debug/command.rb, cli/ruby-debug/interface.rb, + cli/ruby-debug/processor.rb, cross-compile.sh, ext/breakpoint.c, + ext/ruby_debug.c, lib/ChangeLog, lib/ruby-debug-base.rb: Go over + documentation (1st pass) including that created by rdoc. + Better instructions for how to build on MS Windows and the + include + cross-compile.sh script I use. + Update rubyforge URL's used to building ChangeLogs. + 2010-10-14 01:41 Rocky Bernstein * CHANGES, ChangeLog, cli/ruby-debug/commands/list.rb, Modified: trunk/ext/ruby_debug.c =================================================================== --- trunk/ext/ruby_debug.c 2010-10-21 21:08:00 UTC (rev 957) +++ trunk/ext/ruby_debug.c 2010-10-27 12:58:30 UTC (rev 958) @@ -6,7 +6,7 @@ #include #include -#define DEBUG_VERSION "0.10.4rc3" +#define DEBUG_VERSION "0.10.4" #ifdef _WIN32 struct FRAME { Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2010-10-21 21:08:00 UTC (rev 957) +++ trunk/lib/ChangeLog 2010-10-27 12:58:30 UTC (rev 958) @@ -1,3 +1,12 @@ +2010-10-15 14:45 Rocky Bernstein + + * ChangeLog, ruby-debug-base.rb: Go over documentation (1st pass) + including that created by rdoc. + Better instructions for how to build on MS Windows and the + include + cross-compile.sh script I use. + Update rubyforge URL's used to building ChangeLogs. + 2010-10-14 01:41 Rocky Bernstein * ChangeLog: improve list and list - (backwards) handling when From nobody at rubyforge.org Wed Oct 27 09:04:50 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 27 Oct 2010 09:04:50 -0400 (EDT) Subject: [Ruby-debug-commits] [959] ruby-debug-0.10.4/: Tag release 0.10.4 Message-ID: <20101027130450.AE2A119782CD@rubyforge.org> Revision: 959 Author: rockyb Date: 2010-10-27 09:04:50 -0400 (Wed, 27 Oct 2010) Log Message: ----------- Tag release 0.10.4 Added Paths: ----------- ruby-debug-0.10.4/ From nobody at rubyforge.org Wed Oct 27 09:14:11 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 27 Oct 2010 09:14:11 -0400 (EDT) Subject: [Ruby-debug-commits] [960] trunk: Bump ruby-debug-extra version. Message-ID: <20101027131411.96F551858385@rubyforge.org> Revision: 960 Author: rockyb Date: 2010-10-27 09:14:11 -0400 (Wed, 27 Oct 2010) Log Message: ----------- Bump ruby-debug-extra version. Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac trunk/lib/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-10-27 13:04:50 UTC (rev 959) +++ trunk/ChangeLog 2010-10-27 13:14:11 UTC (rev 960) @@ -1,3 +1,8 @@ +2010-10-27 12:58 Rocky Bernstein + + * ChangeLog, ext/ruby_debug.c, lib/ChangeLog: Get ready for release + 0.10.4 + 2010-10-21 21:03 Rocky Bernstein * ext/ruby_debug.c: Remove gcc warning and redundant code. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2010-10-27 13:04:50 UTC (rev 959) +++ trunk/configure.ac 2010-10-27 13:14:11 UTC (rev 960) @@ -1,4 +1,4 @@ -AC_INIT(ruby-debug-extra, 0.10.4rc1,) +AC_INIT(ruby-debug-extra, 0.10.4,) AC_CONFIG_SRCDIR(doc/ruby-debug.texi) AM_INIT_AUTOMAKE Modified: trunk/lib/ChangeLog =================================================================== --- trunk/lib/ChangeLog 2010-10-27 13:04:50 UTC (rev 959) +++ trunk/lib/ChangeLog 2010-10-27 13:14:11 UTC (rev 960) @@ -1,3 +1,7 @@ +2010-10-27 12:58 Rocky Bernstein + + * ChangeLog: Get ready for release 0.10.4 + 2010-10-15 14:45 Rocky Bernstein * ChangeLog, ruby-debug-base.rb: Go over documentation (1st pass) From nobody at rubyforge.org Wed Oct 27 09:14:45 2010 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 27 Oct 2010 09:14:45 -0400 (EDT) Subject: [Ruby-debug-commits] [961] ruby-debug-0.10.4/trunk/: Release 0.10.4 again. Message-ID: <20101027131445.5C5FC1858381@rubyforge.org> Revision: 961 Author: rockyb Date: 2010-10-27 09:14:45 -0400 (Wed, 27 Oct 2010) Log Message: ----------- Release 0.10.4 again. Added Paths: ----------- ruby-debug-0.10.4/trunk/