From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21713 invoked by alias); 10 Sep 2008 15:56:13 -0000 Received: (qmail 21538 invoked by uid 22791); 10 Sep 2008 15:56:12 -0000 X-Spam-Check-By: sourceware.org Received: from mail.idnet.net.uk (HELO mail.idnet.net.uk) (212.69.36.63) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 Sep 2008 15:55:06 +0000 Received: from [91.135.5.64] by mail.idnet.net.uk (GMS 15.01.3664/NU3963.00.7ca42f0c) with ESMTP id sbiqwlba for gdb@sourceware.org; Wed, 10 Sep 2008 16:55:01 +0100 Subject: Re: GDB, microcontroller ISS and HDL simulator From: Jeremy Bennett Reply-To: jeremy.bennett@embecosm.com To: gdb@sourceware.org Cc: Seb Astien In-Reply-To: <6a0f357f0809081223j2749b3ffg2230a6a64058965@mail.gmail.com> References: <6a0f357f0809081223j2749b3ffg2230a6a64058965@mail.gmail.com> Content-Type: text/plain Date: Wed, 10 Sep 2008 15:56:00 -0000 Message-Id: <1221062101.2827.228.camel@thomas> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-AuthenticatedSender: jeremy.bennett.embecosm.com@idnet.net.uk X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00061.txt.bz2 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 irc.freenode.net, 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 protocol. 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: http://www.embecosm.com/download/ean3.html 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. Jeremy -- Tel: +44 (1202) 416955 Cell: +44 (7970) 676050 SkypeID: jeremybennett Email: jeremy.bennett@embecosm.com Web: www.embecosm.com