[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Debugging Ruby Core

Saladin Mundi

9/23/2008 7:39:00 AM

Hello everyone,

is there a debugger which I could use for debugging the C-Core if I
modify it?

Thanks so much,

sala
--
Posted via http://www.ruby-....

8 Answers

Alex Fenton

9/23/2008 8:07:00 PM

0

Saladin Mundi wrote:

> is there a debugger which I could use for debugging the C-Core if I
> modify it?

There's nothing special about Ruby's C core. You can use whatever
debugger goes with the compiler you use, eg Microsoft's debugging tools
if compiled with MSVC; gdb if compiled with gcc (although I've found gdb
on MingW / Windows pretty unstable).

If you want a step-through debugger for Ruby, I'd look into ruby-debug.
It's much faster than ruby's stdlib pure-ruby debugger, and also has
nice integration eg with emacs.

alex

Saladin Mundi

9/24/2008 11:26:00 AM

0

Thank you,
I'll have a look!

--
Posted via http://www.ruby-....

Lex Williams

9/24/2008 12:45:00 PM

0

Alex Fenton wrote:
> Saladin Mundi wrote:
>
>> is there a debugger which I could use for debugging the C-Core if I
>> modify it?
>
> There's nothing special about Ruby's C core. You can use whatever
> debugger goes with the compiler you use, eg Microsoft's debugging tools
> if compiled with MSVC; gdb if compiled with gcc (although I've found gdb
> on MingW / Windows pretty unstable).
>
> If you want a step-through debugger for Ruby, I'd look into ruby-debug.
> It's much faster than ruby's stdlib pure-ruby debugger, and also has
> nice integration eg with emacs.
>
> alex

But , in order to do this ( with gdb ) , shouldn't ruby be recompiled
with -g ? Or that option is already set ?
--
Posted via http://www.ruby-....

Alex Fenton

9/24/2008 1:47:00 PM

0

Lex Williams wrote:
> Alex Fenton wrote:
>> Saladin Mundi wrote:
>>
>>> is there a debugger which I could use for debugging the C-Core if I
>>> modify it?
>> There's nothing special about Ruby's C core. You can use whatever
>> debugger goes with the compiler you use, eg Microsoft's debugging tools
>> if compiled with MSVC; gdb if compiled with gcc (although I've found gdb
>> on MingW / Windows pretty unstable).
>
> But , in order to do this ( with gdb ) , shouldn't ruby be recompiled
> with -g ? Or that option is already set ?

-g flag to gcc is needed, but recompilation isn't always going to be
necessary.

The last time I built ruby (MingW, 1.9.0-4) gcc got the options "-g -O2"
without having to do anything special, just "./configure; make"

Distro / vendor supplied rubies will vary in how they're compiled.

a

Saladin Mundi

9/24/2008 2:02:00 PM

0

> The last time I built ruby (MingW, 1.9.0-4) gcc got the options "-g -O2"
> without having to do anything special, just "./configure; make"

I also use MingGW.
Do I have to put -g 02 in the config "string" ?

(Now I only use:
/configure --with-baseruby=/home/MYUSERNAME/ruby-1.8.6/bin/ruby.exe
--prefix=/rubytest --program-suffix=test
)

How would it look like with the gnu debugger?
--
Posted via http://www.ruby-....

Tim Hunter

9/24/2008 2:12:00 PM

0

Saladin Mundi wrote:
>> The last time I built ruby (MingW, 1.9.0-4) gcc got the options "-g -O2"
>> without having to do anything special, just "./configure; make"
>
> I also use MingGW.
> Do I have to put -g 02 in the config "string" ?
>
> (Now I only use:
> /configure --with-baseruby=/home/MYUSERNAME/ruby-1.8.6/bin/ruby.exe
> --prefix=/rubytest --program-suffix=test
> )
>
> How would it look like with the gnu debugger?

Typically you specify additional/overriding gcc flags with the CFLAGS
environment variable, so you could say

export CFLAGS=-g
/configure ...whatever...

I'm surprised that Alex got "-g -O2" automatically. I would not expect
Ruby to compile with debugging information by default.
--
Posted via http://www.ruby-....

Pit Capitain

10/2/2008 6:21:00 AM

0

Saladin, did you succeed in debugging the MinGW Ruby? I'm interested
in this, too.

Regards,
Pit

Saladin Mundi

10/2/2008 2:49:00 PM

0

Pit Capitain wrote:
> Saladin, did you succeed in debugging the MinGW Ruby? I'm interested
> in this, too.

Hey Pit,
well not really. I used this tutorial
http://www.ruby-mine.de/2007/5/7/ruby-1-9-aus-neuen-snapshots-auf-windows...
from Ruby-Mine.de (unless its in german)

Additionally I installed the gnu debugger into msys. But I have no real
clue how to really use the debugger. For my actual tasks it is enough to
look into the msys console when compiling Ruby.

I had a closer look into the compiling dialog from msys and there it
shows me the line "gcc -g -02 ....." (like Alex mentioned).

If this is equivalent to the gnu debugger than I have it. I'm a little
bit overstrained with it because I don't really now what I could really
do with it.

--
Posted via http://www.ruby-....