This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Library interface to GDB


On 28 May 1999 10:28:35 +0200, Martin Baulig <martin@home-of-linux.org> wrote:

> Andrew Cagney <ac131313@cygnus.com> writes:
> 
> > If there is going to an interface added to GDB then I think that it
> > should be implemented in a way that lends its self to maintainability
> > over a longer time frame.  While a CORBA interface is flavor of the
> > month, I believe that other people have different (although potentially
> > related) ideas. RMS, for instance, has pointed out that GDB should have
> > an interface that allowed scheme/guile to be integrated (as the official
> > scripting language).
> 
> Yes, I agree. It's nice to have a CORBA interface for gdb, but that should
> be separeted from the actual gdb distribution - this can for instance be
> handled by applications like dryad.
> 
> However, a guile interface really sounds good - especially since this is
> the official scripting language. Maybe I can give it a try ...

IMO libgdb should provide more than a simple interface to the gdb commands.
Ideally it should provide an object-oriented view of the GDB internal
structures. All the GDB structures that are used internally by GDB, frames,
symbols, values, breakpoints and so on, would become classes and would have
methods that operate on them.

If these objects are exported in a scripting language then writing extensions
would be very easy, since you have access to GDB's internals. For example you
could imagine an interface to the outside world that uses the HTTP protocol and
returns the data in an XML format. You could relatively easy build a graphical
user interface that's running in Netscape, just replace the output format of
the data to use HTML instead of XML. Or you can write a Corba interface that
exports these GDB objects or provides an API for building GUIs.

In the WDB project (http://www.hp.com/esy/lang/tools/Debuggers/WDB/index.html)
we are working on integrating Python into GDB and exporting the GDB structures
as first class objects in it. Python (http://www.python.org) is an interpreted
object-oriented language with very powerful capabilities and rich libraries.

With this layer built on top of GDB, you can use a language bridge to export
the Python objects into other languages like Guile or Perl. The Python objects
would appear as native objects in these languages so you could send messages in
a transparent way from Perl or Guile to an object whose implementation is
written in Python. If the bridge is multi-directional, the other way are also
possible, invoking Guile or Perl methods from Python. Such an idea is already
implemented by the ILU project (see ftp://ftp.parc.xerox.com/pub/ilu/ilu.html).

This way we basically give our users the language of their choice to implement
extensions.

Greetings,
-- 
Ovidiu Predescu <ovidiu@cup.hp.com>
http://www.geocities.com/SiliconValley/Monitor/7464/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]