GDB, microcontroller ISS and HDL simulator

Jeremy Bennett
Wed Sep 10 15:56:00 GMT 2008

On Mon, 2008-09-08 at 21:23 +0200, Seb Astien wrote:
> I am not sure that this mailing list is the correct one, so sorry if I
> bother you.
> I have a newbie question, but I didn't find the answer on Internet.

Hi Seb,

I'll try to help - I was a newbie not long ago. You may also find the
#gdb IRC channel on, port 6667 useful. I've always
found the developers there very helpful.

> Here is my problem.
> I am working with a small custom microcontroller (8-bits), which is
> not supported by gdb, and I would like to know if it is possible to
> use gdb as a debbugger (and how).
> In the details I would like to connect a ISS to gdb (or gdb shall be
> changed to understand the instruction set of the microcontroller?). On
> the other end the ISS is connected with the HDL simulator for the
> interaction with the peripherals.
> I have seen that gdb can be "contacted" through TCP/IP, but I didn't
> know how, neither how I can explain to gdb what are the registers, how
> (and who throught the ISS and GDB) to give the instruction on both
> side.
> I would be very happy with some how-to/examples/documentation

GDB can talk over its Remote Server Protocol (RSP) via TCP/IP to targets
like your microcontroller. GDB implements the client end of the

You need to add a description of you architecture to GDB, so it
understands what your microcontroller can do. You can then connect to
your target with the GDB "target remote" command. GDB will turn all its
usual commands (load, run, break, step etc) into a stream of commands
over the RSP.

Separately you then need to implement a gdbserver to listen to those
commands and apply them to your microcontroller. The GDB distribution
contains some examples, which you can use as a starting point.

There is a description of the RSP and gdbserver in the main GDB User
Guide (see the chapter on Debugging Remote Programs and the appendix
describing the Remote Serial Protocol). The GDB Internals manual will
tell you more about the architecture description

I wrote a HOWTO on porting GDB earlier this year, which may help you:

This should help particulary with defining your architecture. The
example I used did not use RSP, but the description in the GDB User
Guide should help you get started there.

Hope this is useful.


Tel:      +44 (1202) 416955
Cell:     +44 (7970) 676050
SkypeID: jeremybennett

More information about the Gdb mailing list