This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: GDB interface with simulator
- From: John Williams <jwilliams at itee dot uq dot edu dot au>
- To: Rama Singh <rama10nov at yahoo dot co dot in>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 14 Nov 2003 17:43:48 +1000
- Subject: Re: GDB interface with simulator
- References: <20031114071511.26663.qmail@web8005.mail.in.yahoo.com>
Hi Rama,
Rama Singh wrote:
I am working on a cycle accurate simulator and for the
purpose of debugging application, I wish to use gdb.
Now gdb has in build support for about a dozen most
popular simulators. It interacts with the simulator as
a library. I wish to use my simulator as an
independent process running on the same machine or on
other machine.
Is it posible to have gdb interact with a simulator
over a socket? Also where can I find more information
on this? I believe that implementing this will involve
writing a gdb stub that will compile with the
application and thus interact with the host gdb. Am I
getting things correctly or is there some other
possible way too?
Take a look at the gdbserver application, distributed with GDB.
Speifically, the remote-utils.c file will show you the socket interface,
and provide some tips on how to implement it.
You basically just implement stubs to read/write memory, query
registers, set breakpoints, that sort of thing.
Then, read
http://sources.redhat.com/gdb/current/onlinedocs/gdb_33.html
to see the format of the remote debugging packets.
You might just be able to integrate the gdbserver application into your
simulator.
Good luck,
John