ruby-debug / ruby-debug-base19 Goto Github PK
View Code? Open in Web Editor NEWFast Ruby debugger - core component for Ruby 1.9
Home Page: http://teamcity.jetbrains.com/project.html?projectId=project51
License: BSD 2-Clause "Simplified" License
Fast Ruby debugger - core component for Ruby 1.9
Home Page: http://teamcity.jetbrains.com/project.html?projectId=project51
License: BSD 2-Clause "Simplified" License
= ruby-debug == Content This repository contains sources of two gems: * ruby-debug-base - backend for the ruby (mri & jruby) debugger: https://rubygems.org/gems/ruby-debug-base * ruby-debug - CLI for the ruby-debug-base: https://rubygems.org/gems/ruby-debug == Overview ruby-debug is a fast implementation of the standard debugger debug.rb. The faster execution speed is achieved by utilizing a new hook in the Ruby C API. == Requirements ruby-debug requires Ruby 1.8.4 or higher. Unless you get the packages as a binary (Microsoft Windows binaries are sometimes available), you'll need a C compiler and Ruby development headers, and a Make program so the extension in ruby-debug-base can be compiled when it is installed. To install on Microsoft Windows, unless you run under cygwin or mingw you'll need Microsoft Visual C++ 6.0 also known as VC6. http://rubyforge.org/tracker/index.php?func=detail&aid=16774&group_id=1900&atid=7436 suggests why. == Install ruby-debug is provided as a RubyGem. To install: <tt>gem install ruby-debug</tt> This should also pull in <tt>ruby-debug-base</tt> as a dependency. (If you install ruby-debug-base explicitly, you can add in the <tt>--test</tt> option after "install" to have the regression test run before installing.) For Emacs support and the Reference Manual, get <tt>ruby-debug-extra</tt>. This is not a RubyGem, you'll need a Make program and a POSIX shell. With this installed, run: sh ./configure make make test # optional, but a good idea sudo make install ==== Install on MS Windows Compiling under cygwin or mingw works like it does on Unix. * Have Microsoft Visual C++ 6.0 (VC6) installed - exactly that version. * Set the appropriate environment variables. * run `nmake'. * Copy ruby_debug.so to `win32'. * Go to the ruby_debug root. * rake win32_gem * The file is in named `rdebug-debug-base-0.10.0-mswin32.gem'. == Usage There are two ways of running ruby-debug. === rdebug executable: $ rdebug <your-script> When you start your script this way, the debugger will stop at the first line of code in the script file. So you will be able to set up your breakpoints. === ruby-debug API The second way is to use the ruby-debug API to interrupt your code execution at run time. require 'ruby-debug' ; Debugger.start ... def your_method ... debugger ... end or require 'ruby-debug' ; Debugger.start do ... debugger end When Kernel#debugger method is executed, the debugger is activated and you will be able to inspect and step through your code. == Performance The <tt>debug.rb</tt> script that comes with the standard Ruby library uses <tt>Kernel#set_trace_func</tt> API. Implementing the debugger in pure Ruby has a negative impact on the speed of your program execution. This is because the Ruby interpreter creates a Binding object each trace call, even though it is not being used most of the time. ruby-debug moves most of the functionality for Binding access and for breakpoint testing to a native extension. Because this code is in C and because and can be selectively enabled or disabled, the overhead in running your program can be minimized. == License See LICENSE for license information. = ruby-debug-base for JRuby == Overview (j)ruby-debug-base provides the fast debugger extension for JRuby interpreter. It is the same as ruby-debug-base native C extension from ruby-debug project (http://rubyforge.org/projects/ruby-debug/), but for JRuby. == Install (j)ruby-debug-base is available as a RubyGem: jruby -S gem install ruby-debug-base == Usage The usage is then the same as with native ruby-debugger, but you might need to force JRuby which has to run in interpreted mode. Simplest usage is: $ jruby --debug -S rdebug <your-script> Or easier, you might create 'jruby-dm' ('dm' for 'debugger-mode'): $ cat ~/bin/jruby-dm #!/bin/bash jruby --debug "$@" Then you may run just as you used to: $ jruby-dm -S rdebug <your-script> For more information see: http://bashdb.sourceforge.net/ruby-debug.html To build run: $ rake java gem == License See MIT-LICENSE for license information.
Just trying to install (MRI 2.1.5 on Yosemite) gives me this:
/Users/gisborne/.rvm/gems/ruby-2.1.5/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:268:in `block (2 levels) in read': Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-2.1.5-p273.tar.gz and all I got was a 404! (URI::NotFoundError)
Note the "1.9". If I use local source for ruby, I get this:
$ gem install ruby-debug19 -- --with-ruby-include=/Users/gisborne/.rvm/src/ruby-2.1.5/
…
compiling ruby_debug.c
ruby_debug.c:27:19: error: conflicting types for 'rb_iseq_compile_with_option'
RUBY_EXTERN VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
^
/Users/gisborne/.rvm/src/ruby-2.1.5/vm_core.h:685:7: note: previous declaration is here
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt);
…
Same two problems occur with ruby-2.0.0-p598
Hi,
I received an error when execute a test in ruby 1.9.2
Failure/Error: debugger
undefined method `run_init_script' for Debugger:Module
Have some idea?
Please see:
http://redmine.ruby-lang.org/issues/5193
This breaks ruby-debug-base19 on ruby 1.9.3. Could you add your comments to this issue? Or is there a way to work around this?
Thanks - Charlie
I'm using ruby debug and have configured RubyMine Breakpoint Exception to stop on NoMethodError so I can trap for certain errors in the place where my code is having issues. When I start the debugger I get this error:
/Users/mbp2/.rvm/gems/[email protected]/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:58: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.7.0]
-- control frame ----------
c:0069 p:0084 s:0268 b:0267 l:000266 d:000266 METHOD /Users/calvin_mbp2/.rvm/gems/[email protected]/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:58
c:0068 p:0040 s:0260 b:0260 l:000259 d:000259 METHOD /Users/calvin_mbp2/.rvm/gems/[email protected]/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:46
c:0067 p:---- s:0254 b:0254 l:000253 d:000253 FINISH
...
/Users/calvin_mbp2/.rvm/gems/[email protected]/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:46:in method_missing' /Users/calvin_mbp2/.rvm/gems/[email protected]/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:58:in
raise_nil_warning_for'
-- C level backtrace information -------------------------------------------
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
I am running with the following environment:
ruby 1.9.2-p290
Rails 3.1.0 on RVM
ruby-debug-base19x (0.11.30.pre10, 0.11.28)
ruby-debug-ide (0.4.17.beta8, 0.4.17.beta5)
Rubymine 4.0.3 for the IDE.
I have done some investigation and have commented out the config to log nils and get slightly farther. In that case the debug session starts up but when the breakpoint is triggered, I then get the same exception shown in the stack above.
Question: Is this a problem with ruby debug or ruby-debug-ide or is this symptom related to Rubymine? Is there a way to run, and debug into the stackframe without blowing up or resulting in segmentation fault...
Thanks in advance for any insight or recommendations you can make that will help.
gem install {linecache19-0.5.13.gem,ruby-debug-base19-0.11.26.gem} -- --with-ruby-include=$(echo ~/.rbenv/versions/1.9.3-p0/)
Building native extensions. This could take a while...
Successfully installed linecache19-0.5.13
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-base19-0.11.26.gem:
ERROR: Failed to build gem native extension.
/Users/leehambley/.rbenv/versions/1.9.3-p0/bin/ruby extconf.rb --with-ruby-include=/Users/leehambley/.rbenv/versions/1.9.3-p0/
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/leehambley/.rbenv/versions/1.9.3-p0/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
extconf.rb:16:in `block in <main>': break from proc-closure (LocalJumpError)
from /Users/leehambley/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `call'
from /Users/leehambley/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `create_makefile_with_core'
from extconf.rb:32:in `<main>'
Gem files will remain installed in /Users/leehambley/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.26 for inspection.
Results logged to /Users/leehambley/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.26/ext/ruby_debug/gem_make.out
1 gem installed
Installing ri documentation for linecache19-0.5.13...
Installing RDoc documentation for linecache19-0.5.13...
I'm really struggling to understand the problem here, sources from ruby were compiled with this trivial build symbols hiding patch Which I require to make perftools.rb work.
Please don't consider this a "please help a noob" ticket, I've spent a lot of time on this, and the config works for others, for what it's worth OS is OSX Snow Lion, with LLVM gcc
version
12:33 cache (master) $ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Hi,
ruby-debug-base doesn't compile with the latest ruby 1.9.3 from head. The problem is that the signature of rb_iseq_compile_with_options has changed.
In ruby 1.9.2:
rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE line, VALUE opt)
In ruby 1.9.3
rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt)
Note the additional filepath parameter.
Are you planning on adding 1.9.3 support anytime soon? Happy to help test if you'd like.
Thanks - Charlie
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.