**Bilingual Debugger for rdb and gdb**

--------------------------------------------------------------------
    Copyright (C) 2007 Rikiya Ayukawa <ayukawa@sde.cs.titech.ac.jp>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
 
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
--------------------------------------------------------------------

1. Preparation

- you may have to install gcc, gdb and ruby


2. How to install

	$ ./configure
	$ make
	# make install

If ruby isn't in $PATH, you must specify ruby's full path
when executing configure:

	$ ./configure RUBYPATH=<ruby's full path>
	$ make
	# make install

3. How to use

For example, you can debug 'tests/hello/test.rb'.
'test.rb' use the C extension called 'hello.so'.

	$ cp init.gdb tests/hello
	$ cd tests/hello
	$ gdb ruby
	(gdb) source init.gdb        # important!
	(gdb) run -rbidebug test.rb  # important!
	(rdb:1) next
	(rdb:1) list
          [-2, 7] in test.rb
          1  require 'hello'
          2
       => 3  Hello::hello("foo")
          4  num = Hello::hello("bar")
          5
          6  puts num
	(rdb:1) step
          [Switching to Thread 0xb7f646c0 (LWP 4986)]
          Breakpoint 3 at 0xf2467e: file hello.c, line 9.
          wrap_hello (self=3085984300, str=3085983100) at hello.c:9
          9       VALUE wrap_hello(VALUE self, VALUE str){
	(gdb) list
          4       int hello(const char* str){
          5         printf("Hello %s\n", str);
          6         return 0;
          7       }
          8
          9       VALUE wrap_hello(VALUE self, VALUE str){
          10        int val = hello(RSTRING(str)->ptr);
          11        return INT2FIX(val);
          12      }
          13
	(gdb)

You can also use gud-mode in the emacs.
   1. Invoke the emacs.
   2. Invoke gud-mode in the emacs. (M-x gdb)
   3. And you can debug 'test.rb' as well as the above example.
