From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86080 invoked by alias); 30 Aug 2019 16:02:23 -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 86071 invoked by uid 89); 30 Aug 2019 16:02:23 -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=H*f:sk:quVcm9B, H*f:CAF8i9mOR, H*i:CAF8i9mOR, H*i:sk:quVcm9B 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 16:02:22 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8159810C6987; Fri, 30 Aug 2019 16:02:21 +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 C7A8460605; Fri, 30 Aug 2019 16:02:20 +0000 (UTC) Subject: Re: Best way to check whether the "sim" is running standalone or by GDB To: William Tambe Cc: gdb@sourceware.org References: <93938d40-a91d-e5d6-7f20-70e683c23a97@redhat.com> From: Nick Clifton Openpgp: preference=signencrypt Message-ID: Date: Fri, 30 Aug 2019 16:02: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: 7bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00052.txt.bz2 Hi William, > What constitute the standalone code ?> > in fact, to port the simulator, I only had to implement the following: > sim_engine_run () > sim_open () > sim_create_inferior () > > All the above functions are both used when the sim is running > "standalone" or by "GDB". > > Is there another function I can define that will only be used when the > sim is running "standalone" ? Presumably you are using a Makefile.in like the other simulators. In there you define SIM_RUN_OBJS to contain the object files that are only part of the standalone simulator. So you could use a function in one of those object files. main() would be the obvious choice, if you are using your own. Or else something called from the main() defined in common/nrun.c. Cheers Nick