all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* GUD GDB integration
@ 2018-05-23  8:23 Juan Rafael García Blanco
  2018-05-23 15:46 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Juan Rafael García Blanco @ 2018-05-23  8:23 UTC (permalink / raw
  To: help-gnu-emacs@gnu.org

Hi all,

I wanted to know how gud and gdb interact, i.e. by parsing gdb's output or using gdb's built-in scripting engine. I have gone through gud.el and I understand interaction is accomplished by parsing gdb's output. Could you please confirm my understanding?
If so, why is this approach better than writing event handlers using gdb's scheme interpreter? My first guess is because of simplicity and compatibility (scripting was introduced in gdb 7.0). I guess it is simpler and maybe even faster to parse gdb's output than to setup some kind of client-server architecture to receive notifications from gdb event handlers.

The context for this question is that I'm writing a gdb client, not for emacs, that somehow resembles what gud does. So I wanted to know what gud does because it is widely used and it is known to work.

Any comment would be very much appreciated.

Thank you very much,
Juan.

P Please consider the environment before printing this e-mail.

______________________
This message including any attachments may contain confidential 
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la 
Informacion siendo para uso exclusivo del destinatario, quedando 
prohibida su divulgacion copia o distribucion a terceros sin la 
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje 
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado. 
Gracias por su colaboracion.

______________________




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GUD GDB integration
  2018-05-23  8:23 GUD GDB integration Juan Rafael García Blanco
@ 2018-05-23 15:46 ` Eli Zaretskii
  2018-05-24  6:05   ` Juan Rafael García Blanco
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2018-05-23 15:46 UTC (permalink / raw
  To: help-gnu-emacs

> From: Juan Rafael García Blanco <jrblanco@gmv.com>
> Date: Wed, 23 May 2018 08:23:04 +0000
> 
> I wanted to know how gud and gdb interact, i.e. by parsing gdb's output or using gdb's built-in scripting engine. I have gone through gud.el and I understand interaction is accomplished by parsing gdb's output. Could you please confirm my understanding?

There are 2 interfaces: the old one in gud.el uses the CLI output with
annotations, the new one in gdb-mi.el uses the GDB/MI interface.

> If so, why is this approach better than writing event handlers using gdb's scheme interpreter?

Not sure what you mean by that.  How would Emacs invoke the GDB's
Guile interface?

> The context for this question is that I'm writing a gdb client, not for emacs, that somehow resembles what gud does. So I wanted to know what gud does because it is widely used and it is known to work.

You can look in gdb-mi.el to see the code which uses GDB/MI.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: GUD GDB integration
  2018-05-23 15:46 ` Eli Zaretskii
@ 2018-05-24  6:05   ` Juan Rafael García Blanco
  2018-05-24 15:16     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Juan Rafael García Blanco @ 2018-05-24  6:05 UTC (permalink / raw
  To: Eli Zaretskii, help-gnu-emacs@gnu.org


> -----Original Message-----
> From: help-gnu-emacs [mailto:help-gnu-emacs-
> bounces+jrblanco=gmv.com@gnu.org] On Behalf Of Eli Zaretskii
> Sent: Wednesday, May 23, 2018 5:46 PM
> To: help-gnu-emacs@gnu.org
> Subject: Re: GUD GDB integration
>
> > From: Juan Rafael García Blanco <jrblanco@gmv.com>
> > Date: Wed, 23 May 2018 08:23:04 +0000
> >
> > I wanted to know how gud and gdb interact, i.e. by parsing gdb's output or
> using gdb's built-in scripting engine. I have gone through gud.el and I
> understand interaction is accomplished by parsing gdb's output. Could you
> please confirm my understanding?
>
> There are 2 interfaces: the old one in gud.el uses the CLI output with
> annotations, the new one in gdb-mi.el uses the GDB/MI interface.
>
Thank you. I did not know about annotations.

> > If so, why is this approach better than writing event handlers using gdb's
> scheme interpreter?
>
> Not sure what you mean by that.  How would Emacs invoke the GDB's
> Guile interface?
>
Well, actually, gdb's guile/python interface would invoke Emacs back when
hitting a breakpoint, exception, ... I think it is a way to handle gdb events
synchronously, instead of reading and parsing gdb's output; but that would
require a connection from the guile part back to Emacs.

> > The context for this question is that I'm writing a gdb client, not for emacs,
> that somehow resembles what gud does. So I wanted to know what gud
> does because it is widely used and it is known to work.
>
> You can look in gdb-mi.el to see the code which uses GDB/MI.
Thank you very much. I will look into that implementation. Thanks.

P Please consider the environment before printing this e-mail.

______________________
This message including any attachments may contain confidential 
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la 
Informacion siendo para uso exclusivo del destinatario, quedando 
prohibida su divulgacion copia o distribucion a terceros sin la 
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje 
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado. 
Gracias por su colaboracion.

______________________




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GUD GDB integration
  2018-05-24  6:05   ` Juan Rafael García Blanco
@ 2018-05-24 15:16     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-05-24 15:16 UTC (permalink / raw
  To: help-gnu-emacs

> From: Juan Rafael García Blanco <jrblanco@gmv.com>
> Date: Thu, 24 May 2018 06:05:04 +0000
> 
> > > If so, why is this approach better than writing event handlers using gdb's
> > scheme interpreter?
> >
> > Not sure what you mean by that.  How would Emacs invoke the GDB's
> > Guile interface?
> >
> Well, actually, gdb's guile/python interface would invoke Emacs back when
> hitting a breakpoint, exception, ... I think it is a way to handle gdb events
> synchronously, instead of reading and parsing gdb's output; but that would
> require a connection from the guile part back to Emacs.

I don't see how such a "connection" could work.  The available methods
of communications supported by Emacs either assume Emacs is talking to
a subprocess (via a PTY or a pipe), or support simple display-related
operations used by emacsclient.  Anything else will need development
on the Emacs side, and it cannot be done in Lisp, AFAIU.

IOW, there's no way currently to have Guile interpreter in GDB to
"invoke" Emacs, i.e. instruct Emacs to display a buffer or file in
some specific manner that users of debuggers expect.  E.g., how would
you display breakpoint positions on the fringe?



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-24 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-23  8:23 GUD GDB integration Juan Rafael García Blanco
2018-05-23 15:46 ` Eli Zaretskii
2018-05-24  6:05   ` Juan Rafael García Blanco
2018-05-24 15:16     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.