Library interface to GDB

Brendan Simon
Thu Jun 10 16:21:00 GMT 1999

> > I rather like the idea of a "protocol" command in GDB whose subcommands
> > produce machine-readable output.
> >
> > The API to GDB basically takes two forms:
> >     - send a character to feed to readline for a command-line session
> >       (currently only one, but there's no fundamental reason why readline
> >       and the command logic couldn't be made instantiable with each instance
> >       getting its own value history and thread settings and so on).
> >     - send complete command string to be executed in a separate I/O context
> >       so that the output can be returned. This might need environment info
> >       like the thread ID and such.
> >
> > It wouldn't be hard to add a GDB option that creates a socket connection
> > to another process, and accepts input over it. There would have to be a
> > simple wrapper format so that the various channels (key input, command input,
> > stdout, error(), warning(), protocol output, etc) could be distinguished.

I thought along the same lines with respect to using sockets as the interface.
ie. classic client/server approach.  From what I know the gdbserver program is
seperate to gdb.  Maybe it could be integrated into gdb.

Brendan Simon.

More information about the Gdb mailing list