Call_stack 0.1.0: ruby-breakpoint/breakpointer working in 1

Source code and additional information at
eigenclass.org
Release information:
eigenclass.org

This release includes two RubyGems packages: a binary one for Win32 and
a
platform-independent one for all those with a compiler, so
gem install call_stack

Overview

Binding.of_caller depended on a bug that was fixed in 1.8.5. Therefore,
neither Binding.of_caller nor ruby-breakpoint/Rails’ breakpointer work
anymore with Ruby 1.8.5.

call_stack contains a new Binding.of_caller implementation that works
with
Ruby 1.8.5, allowing you to use ruby-breakpoint and Rails’ breakpointer.

call_stack can be also be used to obtain backtrace information in a
running
program.

Binding.of_caller compatibility

call_stack provides an alternative implementation of Binding.of_caller
that
works on Ruby > 1.8.4. You can use it by loading breakpoint185.rb before
running your program.

If you’re using Rails and want to debug your applications using
breakpoints,
you can proceed as usual, with the exception that breakpoint185.rb must
be
loaded when your application is running. For instance, you can execute
your
app with
ruby -rbreakpoint185 script/server
instead of just ruby script/server.

NOTE: RubyGems is unable to handle -rlib options passed to Ruby.
If you installed call_stack via RubyGems, you’ll have to do
ruby -e “require ‘breakpoint185’; load ‘script/server’”
(assuming you’ve set RUBYOPT=-rubygems, otherwise prepend it to the
above line
or add require ‘rubygems’) or something to the same effect.

Call stack information

call_stack provides Kernel#call_stack, which will return an array with
information (class, method, file, line, binding, language (C or Ruby))
about the current stack frame and its callers. Please refer to the Rdoc
documentation.

Thanks

Kent S.

  • create_binding() was stolen from his excellent ruby-debug, replacing
    rb_funcall()

License

Use and redistribution of call_stack subject to the same terms as Ruby.