rdebug / emacs / gud

J

Jim Weirich

I'm trying to run rdebug from within emacs using gud (Grand Unified
Debugger, or something like that).

I see there is a rdebug.el package for this. And using it gives me the
ability to set breakpoints by visiting the source file pressing the
approppriate key bindings, which is nice.

But using GUD in other languages (particularly C) gives more. In
particular, it will display a window containing the file being debugged
and indicate the current line executing.

Currently the rdebug.el package is not doing the dynamic source code
display for me. Is my setup wrong? Is rdebug.el not setup to support
that? Am I missing something?

Thanks.

-- Jim Weirich
 
A

Alex Shulgin

Currently the rdebug.el package is not doing the dynamic source code
display for me. Is my setup wrong? Is rdebug.el not setup to support
that? Am I missing something?

Probably. I have no problem debugging ruby code with my setup:

Debian/lenny (testing)
emacs22.1+1-2
ruby1.8-elisp version 1.8.6.36-3
 
J

Jim Weirich

Alex said:
Probably. I have no problem debugging ruby code with my setup:

Thanks. Just to be clear, "no problem" means that you *are* getting the
live source update, right?
Debian/lenny (testing)
emacs22.1+1-2
ruby1.8-elisp version 1.8.6.36-3

(interesting ... what is the -elisp designation on your ruby version
imply?)

I should have listed my system specs too.

MacOS 10.4.10
GNU Emacs 22.1.1 (i386-apple-darwin8.10.1, Aquamacs Distribution 1.1)
(also GNU Emacs 22.1.1 (i386-apple-darwin8.9.1))
Ruby 1.8.5 [i686-darwin8.8.1]

Also tried on:

Linux/Debian (Linux li19-167)
GNU Emacs 22.1.1 (i486-pc-linux-gnu)
ruby 1.8.6 [i686-linux]

Thanks for the feedback.

-- Jim Weirich
 
A

Alex Shulgin

Thanks. Just to be clear, "no problem" means that you *are* getting the
live source update, right?

Right. :)
(interesting ... what is the -elisp designation on your ruby version
imply?)

ruby1.8-elisp is a Debian package which adds Emacs Lisp scripts for
ruby editing and debugging to emacsen (XEmacs or GNU Emacs). The ruby
itself is 1.8.6, I should have listed it too...
I should have listed my system specs too.

MacOS 10.4.10
GNU Emacs 22.1.1 (i386-apple-darwin8.10.1, Aquamacs Distribution 1.1)
(also GNU Emacs 22.1.1 (i386-apple-darwin8.9.1))
Ruby 1.8.5 [i686-darwin8.8.1]

Also tried on:

Linux/Debian (Linux li19-167)
GNU Emacs 22.1.1 (i486-pc-linux-gnu)
ruby 1.8.6 [i686-linux]

May be you are missing the very ruby-elisp files or you have some
version conflict (*.el files vs. ruby or *.el files vs Emacs). :)
 
J

Jim Weirich

Alex said:
May be you are missing the very ruby-elisp files or you have some
version conflict (*.el files vs. ruby or *.el files vs Emacs). :)

Found the problem: The regexp used to filter the output of rdebug to
determine the source code line was not correct.

Original Version: "\\([^:\n]*\\):\\([0-9]+\\):.*\n"

Fixed Version: "^Z^Z\\([^:\n]*\\):\\([0-9]+\\).*\n"

(yes, the first two character of the regexp are control-Z)

That fixed it for me. I added the control z's and removing the second
colon and now everything is working fine. This leads me to suspect that
the ruby-debug gem and the rdebug.el emacs file are out of sync.

My ruby-debug gem is version 0.9.3. There are no version markings in
the rdebug.el file.

-- Jim Weirich
 
R

Rocky Bernstein

My apologies for not seeing this sooner. It has come to my attention
that there is a rdebug.el distributed with Ruby 1.8.6.

Independently I had been writing/revising my own rdebug.el. and it's now
in ruby-debug's SVN in the emacs directory. Had I known there was
another rdebug.el around, I think I would have tried to avoid that
confusion.

The rdebug.el in SVN a bit more filled out. It probably can be used with
0.9.3 (since I started writing it in that release). But it really should
be used with the ruby-debug that is in SVN since rdebug now supports
gdb-style annotations. Also the rdebug.el in SVN probably should be used
with Emacs 23. (It might however work in Emacs 22).

I'll write to the author of the other rdebug.el to see what we can do.
Perhaps this can be used to support older Emacs versions.

As for getting this cleared up so in Ruby 1.8.7, I'm kind of new to this
and would appreciate suggestions. At a minimum I will post a tracker
ticket.

My apologies for the confusion.

Jim said:
Alex said:
May be you are missing the very ruby-elisp files or you have some
version conflict (*.el files vs. ruby or *.el files vs Emacs). :)

Found the problem: The regexp used to filter the output of rdebug to
determine the source code line was not correct.

Original Version: "\\([^:\n]*\\):\\([0-9]+\\):.*\n"

Fixed Version: "^Z^Z\\([^:\n]*\\):\\([0-9]+\\).*\n"

(yes, the first two character of the regexp are control-Z)

That fixed it for me. I added the control z's and removing the second
colon and now everything is working fine. This leads me to suspect that
the ruby-debug gem and the rdebug.el emacs file are out of sync.

My ruby-debug gem is version 0.9.3. There are no version markings in
the rdebug.el file.

-- Jim Weirich
 
R

Rocky Bernstein

One other thing I forgot to mention. It was not clear to me which rdebug
was getting referred to. Probably not the one I have been using (since
it works just fine). The other rdebug.el which is distributed in the
misc directory of Ruby 1.8.6 is by Martin Nordholts <enselic@...>

I've added an SVN $Id$ line in the rdebug.el in ruby-debug's SVN, so
hopefully this will reduce confusion in the future.


Rocky said:
My apologies for not seeing this sooner. It has come to my attention
that there is a rdebug.el distributed with Ruby 1.8.6.

Independently I had been writing/revising my own rdebug.el. and it's now
in ruby-debug's SVN in the emacs directory. Had I known there was
another rdebug.el around, I think I would have tried to avoid that
confusion.

The rdebug.el in SVN a bit more filled out. It probably can be used with
0.9.3 (since I started writing it in that release). But it really should
be used with the ruby-debug that is in SVN since rdebug now supports
gdb-style annotations. Also the rdebug.el in SVN probably should be used
with Emacs 23. (It might however work in Emacs 22).

I'll write to the author of the other rdebug.el to see what we can do.
Perhaps this can be used to support older Emacs versions.

As for getting this cleared up so in Ruby 1.8.7, I'm kind of new to this
and would appreciate suggestions. At a minimum I will post a tracker
ticket.

My apologies for the confusion.

Jim said:
Alex said:
May be you are missing the very ruby-elisp files or you have some
version conflict (*.el files vs. ruby or *.el files vs Emacs). :)

Found the problem: The regexp used to filter the output of rdebug to
determine the source code line was not correct.

Original Version: "\\([^:\n]*\\):\\([0-9]+\\):.*\n"

Fixed Version: "^Z^Z\\([^:\n]*\\):\\([0-9]+\\).*\n"

(yes, the first two character of the regexp are control-Z)

That fixed it for me. I added the control z's and removing the second
colon and now everything is working fine. This leads me to suspect that
the ruby-debug gem and the rdebug.el emacs file are out of sync.

My ruby-debug gem is version 0.9.3. There are no version markings in
the rdebug.el file.

-- Jim Weirich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top