views:

405

answers:

2

The gdbserver program allows for the remote debugging of programs. Typically, a local copy of gdb is used to interact with the remote gdbserver instance, and the program running under that remote gdbserver.

My question is: Are there client implementations of the gdb remote serial protocol (RSP) that allow programs other than gdb to interact with the gdbserver program?

This document discusses the implementation of an RSP server, but it is the client side I am primarily interested in. This implementation supports client and server, but is implemented in common lisp, and is not yet a mature library.

A: 

I am not aware of any clients of the GDB protocol.

Why would you want one?

For simple tasks (starting; stopping; examining memory addresses) you can write one from scratch pretty quickly.

For complicated tasks (unwinding stack, examining variables, etc.) you'd have to re-implement significant parts of GDB; and that should probably not be attempted without a very good reason.

Also note that GDB/gdbserver protocol is constantly evolving; there are provisions to let newer GDB deal with older gdbserver, but I am not sure if the reverse is also true.

Employed Russian
All good points; I have decided to control a local GDB via the GDB machine interface, and let the local GDB interact with the remote gdbserver
grrussel
+2  A: 

The remote gdb protocol is fully documented in the gdb manual, which is available online at http://sourceware.org/gdb/current/onlinedocs/gdb_toc.html

You have gdb to look at as a working example -- this should be enough to allow you to write a client to control gdbserver over the serial protocol. ;-)

Michael Snyder