agardiner / rubinius-debug-base

A ruby-debug-base implementation for Rubinius

This URL has Read+Write access

rubinius-debug-base / README
100644 59 lines (42 sloc) 2.164 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
This is the README for the Rubinius implementation of ruby-debug-base.
This provides the base level debugging functionality that can then be
used by ruby-debug to debug Ruby scripts on Rubinius.
 
Although Rubinius provides a built-in debugger, there are advantages
in providing support for an existing Ruby debugger such as ruby-debug:
 - ruby-debug is a mature Ruby debugger, with substantially more functionality
   than the Rubinius debugger (at least at this point)
 - ruby-debug is the standard debugging framework used by Ruby IDEs such
   as NetBeans and Aptana/RadRails. By allowing ruby-debug to run on Rubinius,
   we gain the ability to debug Ruby scripts on Rubinius via these IDEs.
 
== Installation
 
To install ruby-debug on Rubinius, use the following steps:
1. Build the Rubinius ruby-debug-base gem:
rake gem
 
2. Install ruby-debug under Rubinius:
# from your Rubinius install directory
shotgun/rubinius gem install ruby-debug --ignore-dependencies
shotgun/rubinius gem install columnize
 
3. Install the Rubinius ruby-debug-base gem:
shotgun/rubinius gem install <path to Rubinius ruby-debug-base gem>
 
== Ruby-debug patches
 
At present, there are a couple of issues in ruby-debug that must be patched
in order to get ruby-debug to work on Rubinius. One of these appears to be a
minor syntax issue, and the other is an issue that is pending resolution in
Rubinius.
 
1. At line 74 of cli/ruby-debug/command.rb, replace the definition of
settings_map with the following code (to work around a Rubinius issue related to
metaclasses and class variables):
 
      def settings_map
        unless class_variable_defined? :@@settings_map
          @@settings_map = {}
        end
        @@settings_map
      end
 
2. At line 32 of cli/ruby-debug/commands/list.rb, add a space between the - and 1,
i.e. change the line so that it reads as follows:
 
        e = b + listsize - 1
 
The Rubinius parser regards the existing code as a unary minus, which leads it to
interpret this code as a syntax error.
 
== Running ruby-debug on Rubinius
 
To run ruby-debug on rubinius, you can use the following:
 
shotgun/rubinius bin/rdebug <path to file to debug>