From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19524 invoked by alias); 3 Sep 2019 19:26:20 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 19511 invoked by uid 89); 3 Sep 2019 19:26:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_05,HTML_MESSAGE,SPF_PASS autolearn=ham version=3.3.1 spammy=sim, HX-Spam-Relays-External:sk:mail.ta, H*RU:sk:mail.ta, H*c:alternative X-HELO: mail.tachyum.com Received: from mail.tachyum.com (HELO mail.tachyum.com) (66.160.133.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Sep 2019 19:26:18 +0000 Received: from THQ-IP-EX1.tachyum.com (relayhost.tachyum.com [10.7.1.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.tachyum.com (Postfix) with ESMTPS id 17BB210B for ; Tue, 3 Sep 2019 12:29:18 -0700 (PDT) Received: from THQ-IP-EX1.tachyum.com (10.7.1.6) by THQ-IP-EX1.tachyum.com (10.7.1.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1779.2; Tue, 3 Sep 2019 12:26:16 -0700 Received: from THQ-IP-EX1.tachyum.com ([::1]) by THQ-IP-EX1.tachyum.com ([::1]) with mapi id 15.01.1779.004; Tue, 3 Sep 2019 12:26:16 -0700 From: Michael Morrell To: "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 Message-ID: <793aa4b72fb04ad0bbba378d660953ae@tachyum.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-09/txt/msg00003.txt.bz2 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_STAND= ALONE) and when called from GDB, it is SIM_OPEN_DEBUG. This can be saved a= nd checked later. A typical call in sim_open is: SIM_DESC sd =3D sim_state_alloc(kind, callback); which saves kind in the sd structure. You can use STATE_OPEN_KIND(sd) to e= xamine it in any function that receives an "sd". Hope this helps. Michael