From: Jim Blandy <jimb@codesourcery.com>
To: Wenbo Yang <wenbo.yang@simplnano.com>
Cc: dave.tw@gmail.com, gdb@sourceware.org
Subject: Re: What should a CPU simulator support?
Date: Thu, 05 Jul 2007 19:14:00 -0000 [thread overview]
Message-ID: <m3d4z64q8w.fsf@codesourcery.com> (raw)
In-Reply-To: <468C57AE.8020801@simplnano.com> (Wenbo Yang's message of "Thu, 05 Jul 2007 10:30:06 +0800")
Wenbo Yang <wenbo.yang@simplnano.com> writes:
>> I'm trying to implement a gdb stub for a CPU simulator.
>> The CPU simulator interprets each instruction in a big while loop.
>> My question is: Is it enough for my simulator to support a single step
>> run (simulate a single instruction per called) function to the gdb
>> stub?
> If your simulator supports "break" or similar instruction, and the GDB
> for your architecture can do software single stepping, I think you can
> realize this function.
(I didn't see the original post, so I'm not sure I have the full
context.)
You really shouldn't need to mess with software single-stepping when
using a simulator. It's a big distraction, and given the structure of
your simulator, it should be easy to provide what GDB wants directly.
The functions GDB requires are listed in 'include/gdb/remote-sim.h';
none of those should be hard to implement in a simulator; the 'sim'
directory contains many examples of how to hook things up. You should
consider using the 'sim/common' code if you can, but if not, look at
'sim/m32c' for a very simple-minded approach. gdb-if.c implements the
remote-sim.h functions in terms of the rest of the sim, which was
originally written as a stand-alone simulator.
next prev parent reply other threads:[~2007-07-05 19:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-05 2:30 Wenbo Yang
2007-07-05 19:14 ` Jim Blandy [this message]
[not found] ` <c9d32f760707051300r192ea70bj3edcfc00892c5714@mail.gmail.com>
2007-07-05 21:32 ` Jim Blandy
2007-07-06 10:27 ` Robert Norton
2007-07-06 12:02 ` Daniel Jacobowitz
2007-07-06 12:10 ` Robert Norton
2007-07-06 12:20 ` Daniel Jacobowitz
2007-07-06 21:56 ` Eric Weddington
2007-07-06 22:13 ` 'Daniel Jacobowitz'
[not found] <c9d32f760707031824u7836642aud35629ae88fbfe3@mail.gmail.com>
2007-07-04 1:26 ` s88
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=m3d4z64q8w.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--cc=dave.tw@gmail.com \
--cc=gdb@sourceware.org \
--cc=wenbo.yang@simplnano.com \
/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