Running gdb in emacs.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Running gdb in emacs.

aprekates
Hi.

I found those two basic ways to start gdb in emacs:

1.  M-x gdb

2.  M-x gud-gdb

In the first case i pass the  --interpreter=mi option to enable the
gdb-mi and i can use various other windows like stackframes, registers ,
output etc.

In the second case i have only the source and a gdb window in user
interface. If i give  --interpreter=mi after M-x gud-gdb i get only a
gdb windows which seems to work in machine mode.

So i dont understand what is the proposed use case of using M-x gud-gdb
since it seems it offers a basic debugging enviroment.

Also M-x gdb does it use GUD?

Alexandros


Reply | Threaded
Open this post in threaded view
|

Re: Running gdb in emacs.

Eli Zaretskii
> From: aprekates <[hidden email]>
> Date: Thu, 16 Jan 2020 11:27:03 +0200
>
> I found those two basic ways to start gdb in emacs:
>
> 1.  M-x gdb
>
> 2.  M-x gud-gdb
>
> In the first case i pass the  --interpreter=mi option to enable the
> gdb-mi and i can use various other windows like stackframes, registers ,
> output etc.
>
> In the second case i have only the source and a gdb window in user
> interface. If i give  --interpreter=mi after M-x gud-gdb i get only a
> gdb windows which seems to work in machine mode.
>
> So i dont understand what is the proposed use case of using M-x gud-gdb
> since it seems it offers a basic debugging enviroment.

"M-x gud-gdb" is the old way of running GDB under Emacs.  It relies on
a GDB feature, called "annotations", which is deprecated by the GDB
developers, and could be removed from GDB at any moment.

"M-x gdb" with all its features was written to be the main method of
running GDB from Emacs.  We suggest that you use only "M-x gdb",
unless you have a very good reason, like some version of GDB that
doesn't support the mi interface well.

> Also M-x gdb does it use GUD?

I don't think I understand what you are asking.  Please elaborate.

Reply | Threaded
Open this post in threaded view
|

Re: Running gdb in emacs.

aprekates
  Thanks.

On 16/1/20 5:09 μ.μ., Eli Zaretskii wrote:
> "M-x gud-gdb" is the old way of running GDB under Emacs.  It relies on
> a GDB feature, called "annotations", which is deprecated by the GDB
> developers, and could be removed from GDB at any moment.
>
> "M-x gdb" with all its features was written to be the main method of
> running GDB from Emacs.  We suggest that you use only "M-x gdb",
> unless you have a very good reason, like some version of GDB that
> doesn't support the mi interface well.
>

Reply | Threaded
Open this post in threaded view
|

Re: Running gdb in emacs.

Madhu-8
In reply to this post by Eli Zaretskii
* Eli Zaretskii <[hidden email]> :
Wrote on Thu, 16 Jan 2020 17:09:03 +0200:

> "M-x gud-gdb" is the old way of running GDB under Emacs.  It relies on
> a GDB feature, called "annotations", which is deprecated by the GDB
> developers, and could be removed from GDB at any moment.
>
> "M-x gdb" with all its features was written to be the main method of
> running GDB from Emacs.  We suggest that you use only "M-x gdb",
> unless you have a very good reason, like some version of GDB that
> doesn't support the mi interface well.

I know you've given me advice before and I did try gdb-mi again, but it
I fint it is still unusable.  I can think of two reasons:

1. I am limited to using 80column frames and the windows that gdb-mi are
too small and their content cannot be viewed without too navigating
through too many keystrokes - repeated at every `step'

2. I prefer to use display-buffer-reuse-window when possible for
display-buffer.  When stepping through functions which are spread out in
different files I need to have all the files open at specific points
(i'm trying to understand the code).  Every `step' alters the window
configuration that I expect and I spend more time in getting back to
where I was before invoking the gdb action, than actually debugging.

On the other hand gud-gdb is more managable.  With annotations it also
pops to the buffer with the annotated source line (when available) but
the overall disruption is much less.