Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@transmeta.com>
To: "Rama Singh" <rama10nov@yahoo.co.in>
Cc: gdb@sources.redhat.com
Subject: GDB interface with simulator
Date: Fri, 14 Nov 2003 17:07:00 -0000	[thread overview]
Message-ID: <16309.3013.454023.207019@casey.transmeta.com> (raw)
In-Reply-To: <20031114071511.26663.qmail@web8005.mail.in.yahoo.com>

=?iso-8859-1?q?Rama=20Singh?= writes:
 > I wish to use my simulator as an
 > independent process running on the same machine or on
 > other machine. 

Old versions of gdb had a file in gdb/gdbserver called low-sim.c.
IIRC, one would use this file in gdbserver and would link gdbserver
with libsim.a.  You would then run this program on the host
you want to run your simulator on and use "target remote <simhost>:<port>"
in gdb to talk to gdbserver+sim.

Maybe you could grab that file from an old version of gdb (e.g. 5.3)
and try to make it work with the version of gdb you have.
[or maybe even just build gdbserver from 5.3 sources]

I don't recall why support for gdbserver+sim has been removed.
Maybe I'm mistaken and it's still there and I just can't see it.

 > 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?

The other way to go is to write a gdb stub and compile that
into the application.  You will need the stub's i/o routines
to use the socket.  sim/common/dv-sockser.c provides one
implementation of low level socket support that you need.
Some of the provided sims use this, so that should give you
enough examples to work from.

It does require having a working stub though.
One way to debug your stub would be to do both,
but now we're getting fancy, and you might want to
try just one of them for now.


  parent reply	other threads:[~2003-11-14 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-14  7:15 Rama Singh
2003-11-14  7:43 ` John Williams
2003-11-14 11:56   ` Rama Singh
2003-11-14 17:07 ` Doug Evans [this message]
2003-11-14 18:55   ` Daniel Jacobowitz
2003-11-14 19:07     ` Theodore A. Roth
2003-11-14 19:36     ` Doug Evans
2003-11-20 18:02     ` Rama Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16309.3013.454023.207019@casey.transmeta.com \
    --to=dje@transmeta.com \
    --cc=gdb@sources.redhat.com \
    --cc=rama10nov@yahoo.co.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox