From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130226 invoked by alias); 30 Aug 2019 15:24:48 -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 130079 invoked by uid 89); 30 Aug 2019 15:24:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=Clifton, clifton, H*f:sk:93938d4, H*i:sk:93938d4 X-HELO: mail-lj1-f178.google.com Received: from mail-lj1-f178.google.com (HELO mail-lj1-f178.google.com) (209.85.208.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Aug 2019 15:24:41 +0000 Received: by mail-lj1-f178.google.com with SMTP id x18so6891799ljh.1 for ; Fri, 30 Aug 2019 08:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o47aEXpw8IS1pc4URhJR9X0X9iAILkmrfgCLaaxxMqA=; b=skXWHPij0LgPX23LzGYjeo5yHiKc/Q01/pesMt9aHB4nFYIwQEAibI+bN2T9JR7mNn tBVUZP2QE5ZYIHCVQQR3PEPixlSKZzlkhYKWTCni8fuFP6ARHf7JEJq4f9pSTUa6ymmy UWNJHSHXrXs6Isprqr5eHsDXuEc6fgvYDUkZtuC3fKedjmCQOOYJiuan5fwO1FAzgXPs ICORxNakL+aS3syUTOK36xdnmSP69hSdLaFnN7+484I8aaXrrZG9IzwEjlJa3tLsVctS wq+5VYj7OJBUv1pRcbIpnZrsWq5xkKBSPrWpvpfE7WOAdcIinJ5WuXGWCgrdxPl3kSrw gPLA== MIME-Version: 1.0 References: <93938d40-a91d-e5d6-7f20-70e683c23a97@redhat.com> In-Reply-To: <93938d40-a91d-e5d6-7f20-70e683c23a97@redhat.com> From: William Tambe Date: Fri, 30 Aug 2019 15:24:00 -0000 Message-ID: Subject: Re: Best way to check whether the "sim" is running standalone or by GDB To: Nick Clifton Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-08/txt/msg00051.txt.bz2 On Fri, Aug 30, 2019 at 4:54 AM Nick Clifton wrote: > > 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. 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" ? > > Cheers > Nick > > > >