gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging embedded system with GDB


From: Charles Manning
Subject: Re: Debugging embedded system with GDB
Date: Wed, 6 Aug 2008 09:11:58 +1200
User-agent: KMail/1.9.6

On Wednesday 06 August 2008 03:16:27 TriKri wrote:
> Hello!
>
> I am going to debug an embedded system running a MIPS processor, via an
> EJTAG probe, using GDB, so I need to know what functionality GDB needs in
> order to be able to do the debugging.
>
> I have written software for communicating with the probe, enabling a
> communication between the computer and the MIPS processor running on the
> embedded system. The probe communicates with the processor via a TAP (Test
> Access Port) interface, and it has functions for telling the CPU to execute
> certain instructions (machine code), and for reading/writing from/to the
> CPU register. I suppose GDB needs those functions at least. But how do I
> set up GDB to communicate with my program? Do I have to make the program a
> shared library? Does GDB need any more functions for debugging? If there is
> any good guide teaching me how to set up GDB with the program I would be
> glad to know.

The easiest way is to make a server that conforms to the gdb remote protocol.

From the gdb side you connect via:

(gdb) target remote host:1234

where host and 1234 specify where the server is. It is common to run the 
server on the same host as gdb, making the host localhost.

The server converts the gdb remote protocol into calls to your probe library.

There are numerous examples, particularly for ARM. Check out openocd at 
http://openocd.berlios.de/web/ this will show you the structure and protocol 
handling for a server.

-- CHarles




reply via email to

[Prev in Thread] Current Thread [Next in Thread]