Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: s88 <dave.tw@gmail.com>
Cc: "Wenbo Yang" <wenbo.yang@simplnano.com>,  gdb@sourceware.org
Subject: Re: What should a CPU simulator support?
Date: Thu, 05 Jul 2007 21:32:00 -0000	[thread overview]
Message-ID: <m3ejjmfsfk.fsf@codesourcery.com> (raw)
In-Reply-To: <c9d32f760707051300r192ea70bj3edcfc00892c5714@mail.gmail.com> (dave.tw@gmail.com's message of "Fri, 6 Jul 2007 04:00:35 +0800")


s88 <dave.tw@gmail.com> writes:
> Let me try to define my question clearly.
>
> I have a ARM simulator. I want this simulator to be a target of the gdb.
> And I write a gdb_stub for this simulator,too.
> I'll use the remote debugging to connect this target (ARM simulator) in the way
> of "target remote IP_ADDRESS:PORT".
> So, I want to make sure if the ARM simulator support single instruction
> execution. It should handle the gdb's command by the gdb stub?

There are two ways for GDB to connect to a simulator:

- You can make the simulator into a '.a' library, have it implement
  the interface in include/gdb/remote-sim.h, and link it directly with
  GDB.  Then the GDB 'target sim' command will initialize the
  simulator, and subsequent 'run', 'continue', 'step' (etc.) commands
  will apply to it.

  This is simplest for the end user: no separate program to start up,
  no separate program file to find, and so on.

- You can make the simulator into a server for the GDB remote
  protocol.  Here, the interface to be implemented is described in the
  "Remote Protocol" appendix of the GDB manual.  As that appendix
  says:

       For any COMMAND not supported by the stub, an empty response
    (`$#00') should be returned.  That way it is possible to extend the
    protocol.  A newer GDB can tell if a packet is supported based on that
    response.

       A stub is required to support the `g', `G', `m', `M', `c', and `s'
    COMMANDs.  All other COMMANDs are optional.

  Note that the 's' (single-step) command is required.

  If you make your simulator speak the remote protocol on its stdin
  and stdout, then your user can use the new 'target remote | COMMAND'
  syntax to run the simulator, which simplifies things a bit.


  parent reply	other threads:[~2007-07-05 21:32 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
     [not found]   ` <c9d32f760707051300r192ea70bj3edcfc00892c5714@mail.gmail.com>
2007-07-05 21:32     ` Jim Blandy [this message]
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=m3ejjmfsfk.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