From: Michael Morrell <mmorrell@tachyum.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Best way to check whether the "sim" is running standalone or by GDB
Date: Tue, 03 Sep 2019 19:26:00 -0000 [thread overview]
Message-ID: <793aa4b72fb04ad0bbba378d660953ae@tachyum.com> (raw)
William,
> What is the best way to check whether the "sim" is running standalone or by GDB ?
In sim_open, the first parameter is "SIM_OPEN_KIND kind". When sim_open is called in standalone (i.e., from nrun.c), this parameter is SIM_OPEN_STANDALONE) and when called from GDB, it is SIM_OPEN_DEBUG. This can be saved and checked later.
A typical call in sim_open is:
SIM_DESC sd = sim_state_alloc(kind, callback);
which saves kind in the sd structure. You can use STATE_OPEN_KIND(sd) to examine it in any function that receives an "sd".
Hope this helps.
Michael
next reply other threads:[~2019-09-03 19:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 19:26 Michael Morrell [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-08-29 2:15 William Tambe
2019-08-29 18:05 ` William Tambe
2019-08-30 9:54 ` Nick Clifton
2019-08-30 15:24 ` William Tambe
2019-08-30 16:02 ` Nick Clifton
2021-01-15 6:04 ` Mike Frysinger
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=793aa4b72fb04ad0bbba378d660953ae@tachyum.com \
--to=mmorrell@tachyum.com \
--cc=gdb@sourceware.org \
/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).