public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: William Tambe <tambewilliam@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: How to determine whether GDB is single-stepping within sim_engine_run() ?
Date: Fri, 14 Aug 2020 08:41:00 +0100	[thread overview]
Message-ID: <20200814074100.GF853475@embecosm.com> (raw)
In-Reply-To: <CAF8i9mPQ=DY7UMCaLL1kkAr1TfAgCrQAOVJajVDBOOzYjQB9uw@mail.gmail.com>

* William Tambe via Gdb <gdb@sourceware.org> [2020-08-09 14:41:34 -0500]:

> Within the sim function sim_engine_run(), is there a way to determine
> whether GDB is single-stepping (ie: when using commands next step
> nexti stepi) ?
> 
> I would like to use that capability to have the simulator disable
> interrupts while single-stepping.

GDB drives the simulator through the sim_resume function, of which
there are a couple depending on what type of simulator is
implemented.

The sim_resume method takes a flag to indicate if the simulator should
single step or not, and this flag is used to set state within the
simulator object.

I would suggest figuring out which sim_resume method your simulator
uses, see how the single step flag is used, and then make use of this
same state within your sim_engine_run.

Hope that helps,
Andrew

      reply	other threads:[~2020-08-14  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-09 19:41 William Tambe
2020-08-14  7:41 ` Andrew Burgess [this message]

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=20200814074100.GF853475@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb@sourceware.org \
    --cc=tambewilliam@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).