From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65736 invoked by alias); 30 Aug 2019 09:54:54 -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 65679 invoked by uid 89); 30 Aug 2019 09:54:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Aug 2019 09:54:52 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1B753CA19; Fri, 30 Aug 2019 09:54:51 +0000 (UTC) Received: from [10.36.117.200] (ovpn-117-200.ams2.redhat.com [10.36.117.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C80A5C1D6; Fri, 30 Aug 2019 09:54:51 +0000 (UTC) To: William Tambe , gdb@sourceware.org References: From: Nick Clifton Openpgp: preference=signencrypt Subject: Re: Best way to check whether the "sim" is running standalone or by GDB Message-ID: <93938d40-a91d-e5d6-7f20-70e683c23a97@redhat.com> Date: Fri, 30 Aug 2019 09:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00050.txt.bz2 Hi William, >> What is the best way to check whether the "sim" is running standalone >> or by GDB ? Possibly not the best way, but one way is to use a global variable to indicate the presence of the standalone driver. eg: int running_standalone = 0; ... if (! running_standalone) sim_engine_halt (sim_stopped, SIM_SIGTRAP); Then in your standalone code, initialise the variable to non-zero. Cheers Nick