Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB MI Interface
@ 2008-04-11  7:55 Lokesh Kumar
  2008-04-11 10:52 ` Vladimir Prus
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Lokesh Kumar @ 2008-04-11  7:55 UTC (permalink / raw)
  To: gdb

Hi all,

I want to use the GDB MI interface to communicate with gdb in the
backend of my software. Surprisingly, the current information on this
topic is very less on the web. So I thought of turning to the gdb
community itself. I had the following questions to ask -

1. Does the parser for MI output already exists ?
2. Are there some frontends debugger that are using this ? As far as I
know, the ddd and kdb both use the CLI option.
3. Has there been any documentation on how to use gdb-MI. The current
documentation is, as they say, like a reference manual.

Thanks in advance,

-Lokesh

-- 
"Doubt is not a pleasant condition, but certainty is absurd."

Lokesh Kumar


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

* Re: GDB MI Interface
  2008-04-11  7:55 GDB MI Interface Lokesh Kumar
@ 2008-04-11 10:52 ` Vladimir Prus
  2008-04-11 14:31   ` Marc Khouzam
  2008-04-11 12:19 ` André Pönitz
  2008-04-12 22:46 ` Gordon Prieur
  2 siblings, 1 reply; 11+ messages in thread
From: Vladimir Prus @ 2008-04-11 10:52 UTC (permalink / raw)
  To: gdb

Lokesh Kumar wrote:

> Hi all,
> 
> I want to use the GDB MI interface to communicate with gdb in the
> backend of my software. Surprisingly, the current information on this
> topic is very less on the web. So I thought of turning to the gdb
> community itself. I had the following questions to ask -
> 
> 1. Does the parser for MI output already exists ?

I'm not aware of any standalone parser.

> 2. Are there some frontends debugger that are using this ? As far as I
> know, the ddd and kdb both use the CLI option.

KDevelop and Eclipse use the MI interface. Both include a parser.

> 3. Has there been any documentation on how to use gdb-MI. The current
> documentation is, as they say, like a reference manual.

The current documentation is what we have.

- Volodya



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

* Re: GDB MI Interface
  2008-04-11  7:55 GDB MI Interface Lokesh Kumar
  2008-04-11 10:52 ` Vladimir Prus
@ 2008-04-11 12:19 ` André Pönitz
  2008-04-12 22:46 ` Gordon Prieur
  2 siblings, 0 replies; 11+ messages in thread
From: André Pönitz @ 2008-04-11 12:19 UTC (permalink / raw)
  To: gdb

On Friday 11 April 2008 02:07:15 Lokesh Kumar wrote:
> Hi all,

Hi Lokesh.

> I want to use the GDB MI interface to communicate with gdb in the
> backend of my software. Surprisingly, the current information on this
> topic is very less on the web. So I thought of turning to the gdb
> community itself. I had the following questions to ask -
> 
> 1. Does the parser for MI output already exists ?

I am not aware of an "official" MI parser. I am using a home grown one
which is ~260 lines of straight-forward C++, It's probably not complete,
but reads the parts I am interested in sufficiently well ;-)

> 2. Are there some frontends debugger that are using this ? As far as I
> know, the ddd and kdb both use the CLI option.

See Vladimir's posting ;-)

Apart from that I am trying to use MI as it relays structured data much better
then the CLI. The two main problems with gdb/MI is that it is (a) incomplete, 
so there are lots of "traditional" commands that do not have an MI equivalent
or whose MI equivalent just chickens out saying "not implemented", and
(b) that it seems to be a constant flux.

It's a bit of a trade-off. _Not_ using MI would give an imaginary frontend
the possibility to use Intel's debugger, too, as this can be configured
to look pretty much like the gdb CLI.

> 3. Has there been any documentation on how to use gdb-MI. The current
> documentation is, as they say, like a reference manual.

Chapter 24 in the docs found on

 http://sourceware.org/gdb/current/onlinedocs/gdb_toc.html

is usable. The problem is that there are different flavours of MI out in
the wild, and point (b) above leading to the necessity to double-check
anything written in the docs with the actual gdb incarnations you want to
support - which is a wee bit less convienient than you could dream of
in a perfect world ;-)

Regards,
Andre'


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

* RE:  Re: GDB MI Interface
  2008-04-11 10:52 ` Vladimir Prus
@ 2008-04-11 14:31   ` Marc Khouzam
  0 siblings, 0 replies; 11+ messages in thread
From: Marc Khouzam @ 2008-04-11 14:31 UTC (permalink / raw)
  To: Vladimir Prus, gdb


> > 2. Are there some frontends debugger that are using this ? As far as I
> > know, the ddd and kdb both use the CLI option.
> 
> KDevelop and Eclipse use the MI interface. Both include a parser.

In Eclipse both the CDT and DSF(DD) uses MI.
Emacs too.
All this is open source, so you can have a look if it may help.
 
> > 3. Has there been any documentation on how to use gdb-MI. The current
> > documentation is, as they say, like a reference manual.
> 
> The current documentation is what we have.

This is the documentation I use for MI.  It has served me pretty well up
to now for my work in DSF.

http://sourceware.org/gdb/current/onlinedocs/gdb_25.html#SEC240

Of course, we use the CDT code as a great guide.
Having such an example it often a great complement to the doc.

Marc


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

* Re: GDB MI Interface
  2008-04-11  7:55 GDB MI Interface Lokesh Kumar
  2008-04-11 10:52 ` Vladimir Prus
  2008-04-11 12:19 ` André Pönitz
@ 2008-04-12 22:46 ` Gordon Prieur
  2008-04-14  2:18   ` Lokesh Kumar
  2 siblings, 1 reply; 11+ messages in thread
From: Gordon Prieur @ 2008-04-12 22:46 UTC (permalink / raw)
  To: Lokesh Kumar; +Cc: gdb


Lokesh Kumar wrote:
> Hi all,
>
> I want to use the GDB MI interface to communicate with gdb in the
> backend of my software. Surprisingly, the current information on this
> topic is very less on the web. So I thought of turning to the gdb
> community itself. I had the following questions to ask -
>
> 1. Does the parser for MI output already exists ?
>   

No. You need to write your own.


> 2. Are there some frontends debugger that are using this ? As far as I
> know, the ddd and kdb both use the CLI option.
>   

The NetBeans C/C++ gdb module uses gdb/mi.


> 3. Has there been any documentation on how to use gdb-MI. The current
> documentation is, as they say, like a reference manual.
>   

Chapter 25 of the gdb manual 
(http://sourceware.org/gdb/current/onlinedocs/gdb_25.html)
describes the interface.

Gordon

> Thanks in advance,
>
> -Lokesh
>
>   


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

* Re: GDB MI Interface
  2008-04-12 22:46 ` Gordon Prieur
@ 2008-04-14  2:18   ` Lokesh Kumar
  2008-04-14 13:32     ` Nick Roberts
  2008-04-14 13:43     ` Bob Rossi
  0 siblings, 2 replies; 11+ messages in thread
From: Lokesh Kumar @ 2008-04-14  2:18 UTC (permalink / raw)
  To: Gordon Prieur; +Cc: gdb

Hi,

I think I found what I was looking for. Sharing it here for others as well.

On Fri, Apr 11, 2008 at 8:07 AM, Gordon Prieur <Gordon.Prieur@sun.com> wrote:
>
>  Lokesh Kumar wrote:
>
> > Hi all,
> >
> > I want to use the GDB MI interface to communicate with gdb in the
> > backend of my software. Surprisingly, the current information on this
> > topic is very less on the web. So I thought of turning to the gdb
> > community itself. I had the following questions to ask -
> >
> > 1. Does the parser for MI output already exists ?
> >
> >
>
>  No. You need to write your own.

http://sourceforge.net/projects/libmigdb/

This library provides all the function that one may need to start gdb,
interact with it (seeting breakpoints, watchpoints, run, stop, step
etc.) and parse the output. A good tool for someone planning to use
GDB MI.
>
>
>
>
> > 2. Are there some frontends debugger that are using this ? As far as I
> > know, the ddd and kdb both use the CLI option.
> >
> >
>
>  The NetBeans C/C++ gdb module uses gdb/mi.
>
>
>
>
> > 3. Has there been any documentation on how to use gdb-MI. The current
> > documentation is, as they say, like a reference manual.
> >
> >
>
>  Chapter 25 of the gdb manual
> (http://sourceware.org/gdb/current/onlinedocs/gdb_25.html)
>  describes the interface.
>
>  Gordon
>
>
> > Thanks in advance,
> >
> > -Lokesh
> >
> >
> >
>



-- 
"Doubt is not a pleasant condition, but certainty is absurd."

Lokesh Kumar

Mobile: +1 917 319 0360


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

* Re: GDB MI Interface
  2008-04-14  2:18   ` Lokesh Kumar
@ 2008-04-14 13:32     ` Nick Roberts
  2008-04-16  8:10       ` Doug Evans
  2008-04-14 13:43     ` Bob Rossi
  1 sibling, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2008-04-14 13:32 UTC (permalink / raw)
  To: Lokesh Kumar; +Cc: Gordon Prieur, gdb

 > http://sourceforge.net/projects/libmigdb/
 > 
 > This library provides all the function that one may need to start gdb,
 > interact with it (seeting breakpoints, watchpoints, run, stop, step
 > etc.) and parse the output. A good tool for someone planning to use
 > GDB MI.

It appears that the last release was 2004-07-20 and that there is no mailing
list.  I don't recall the author being active on this list.  MI is still
evolving so I suggest that if you are are going to use this library that you
follow events here and share your experiences.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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

* Re: GDB MI Interface
  2008-04-14  2:18   ` Lokesh Kumar
  2008-04-14 13:32     ` Nick Roberts
@ 2008-04-14 13:43     ` Bob Rossi
  1 sibling, 0 replies; 11+ messages in thread
From: Bob Rossi @ 2008-04-14 13:43 UTC (permalink / raw)
  To: Lokesh Kumar; +Cc: Gordon Prieur, gdb

On Sun, Apr 13, 2008 at 02:41:10PM -0700, Lokesh Kumar wrote:
> Hi,
> 
> I think I found what I was looking for. Sharing it here for others as well.

You could start by looking at,
  http://cgdb.svn.sourceforge.net/viewvc/cgdb/cgdb/trunk/lib/gdbmi/
It is _not_ currently an implementation that works. However, it does use
the push parser feature of bison that is just about to be released. This
allows the generated parser to be used asynchronously. I think I'm going
to have time to finish this library this year, but I can't promise.

Bob Rossi


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

* Re: GDB MI Interface
  2008-04-14 13:32     ` Nick Roberts
@ 2008-04-16  8:10       ` Doug Evans
  2008-04-16  9:47         ` Tom Tromey
  2008-04-16 15:20         ` Daniel Jacobowitz
  0 siblings, 2 replies; 11+ messages in thread
From: Doug Evans @ 2008-04-16  8:10 UTC (permalink / raw)
  To: Nick Roberts; +Cc: Lokesh Kumar, Gordon Prieur, gdb

On Sun, Apr 13, 2008 at 3:05 PM, Nick Roberts <nickrob@snap.net.nz> wrote:
>  > http://sourceforge.net/projects/libmigdb/
>   >
>   > This library provides all the function that one may need to start gdb,
>   > interact with it (seeting breakpoints, watchpoints, run, stop, step
>   > etc.) and parse the output. A good tool for someone planning to use
>   > GDB MI.
>
>  It appears that the last release was 2004-07-20 and that there is no mailing
>  list.  I don't recall the author being active on this list.  MI is still
>  evolving so I suggest that if you are are going to use this library that you
>  follow events here and share your experiences.

I wonder if it would be useful to add something like this to the GDB
tree.  Maybe not this specific implementation, but something with the
same purpose.  Put a python wrapper on it and ... cool.  OTOH, it'd be
sort of like the new python scripting support but inverted (python
<--> gdb instead of gdb <--> python, if that makes any sense).

Is it lamentable that we have both gdbmi and (soon) a real scripting
interface with no real commonality?  Just thinking out loud ... I
don't have an answer.


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

* Re: GDB MI Interface
  2008-04-16  8:10       ` Doug Evans
@ 2008-04-16  9:47         ` Tom Tromey
  2008-04-16 15:20         ` Daniel Jacobowitz
  1 sibling, 0 replies; 11+ messages in thread
From: Tom Tromey @ 2008-04-16  9:47 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> Is it lamentable that we have both gdbmi and (soon) a real scripting
Doug> interface with no real commonality?  Just thinking out loud ... I
Doug> don't have an answer.

I worried about this a bit, particularly when hacking up the event
code to be able to notify python even when some other interpreter has
been chosen.

Now I think the two things are orthogonal.

You need something like MI so that UIs, even text-y ones like Emacs,
can drive gdb intelligently.

But, for folks using the CLI, you need better scripting than what has
historically been provided.  I suppose in theory this could be
provided by whatever is driving MI -- but perhaps at the cost of
having to rewrite app-specific gdb scripts once per UI.

Tom


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

* Re: GDB MI Interface
  2008-04-16  8:10       ` Doug Evans
  2008-04-16  9:47         ` Tom Tromey
@ 2008-04-16 15:20         ` Daniel Jacobowitz
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2008-04-16 15:20 UTC (permalink / raw)
  To: Doug Evans; +Cc: Nick Roberts, Lokesh Kumar, Gordon Prieur, gdb

On Tue, Apr 15, 2008 at 01:46:28PM -0700, Doug Evans wrote:
> Is it lamentable that we have both gdbmi and (soon) a real scripting
> interface with no real commonality?  Just thinking out loud ... I
> don't have an answer.

I don't think it is.  My limited implementation experience with trying
to exploit commonality found the scripting interface too cumbersome.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2008-04-16  0:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-11  7:55 GDB MI Interface Lokesh Kumar
2008-04-11 10:52 ` Vladimir Prus
2008-04-11 14:31   ` Marc Khouzam
2008-04-11 12:19 ` André Pönitz
2008-04-12 22:46 ` Gordon Prieur
2008-04-14  2:18   ` Lokesh Kumar
2008-04-14 13:32     ` Nick Roberts
2008-04-16  8:10       ` Doug Evans
2008-04-16  9:47         ` Tom Tromey
2008-04-16 15:20         ` Daniel Jacobowitz
2008-04-14 13:43     ` Bob Rossi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox