From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 8E4153857016 for ; Fri, 14 Aug 2020 07:41:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8E4153857016 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x32c.google.com with SMTP id g75so7116856wme.4 for ; Fri, 14 Aug 2020 00:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ic/llqDw3YreFllWKJz1gz2DgpqIPVOxnA78kv18ULw=; b=c4yHY0BZGcwKJn0cMrDKVo6z2PJ6bv0GxlG81xRDv6cgHdBWGJTUQM5x25dDjiLQr0 X1siSgMQd6t96qyNUylTA3YsnuFCLBN+VCto8/c7sAU5yufNkf8JHFVidXQK1iDjmogW raeTtXVOHT2jjA5ufx7l7T7RKSAbZjywkpRUBXaFMSm14jQkgpJKzCCtvjTYMeESnh8H bkyaaCBsIJldwQ2kRP+ezCHJbW99QNjfOowIgNMSVKtH9cgCX0obyqXhLAhY4aI56RUV woUzyM6qZXAoM7qzRu8Fp0ihA+dE3DnLSaRT1jdNeToXZoVqMucrxN5voUV2tnUxf/6z 9v6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ic/llqDw3YreFllWKJz1gz2DgpqIPVOxnA78kv18ULw=; b=UHxhEbeEXcm3wOc0dpLoVtdM8vLGDp5nNoZntiLm5td+KCtl27rxG3CC5TcwcsSInh 5+UvCvJq1B+qs3loEZbjsBs2E2G9rkMDci8P5SesvoD49GCJvVaeDVDVx8eLzRkSOTAq umEb177awICuwzWTZ1HUWaacqiGpEXa8MDkDqsKutFYFwz4+DnIMVeHFo9EamVXRtZhB Q3uGxl2wLXJ56BwOrmQiuW/LdozU8kq6+Uh4biNbV3h2v89zrk0o6Xqug68UQpOPXO5+ jweNfi00QwKRDnTmuz1XqgzMk2fX+NyK72jxddfT7utjHvk4eFK2aHwxmWZTLBu5otuz IPdQ== X-Gm-Message-State: AOAM530nHVZb36uC4/LWqznnx07wCTI4lNoEnYAKxk6Fr60GyiP2CLJI Vfkjyf1+umt/c2hEW4rEDr3s6A== X-Google-Smtp-Source: ABdhPJz3mcYyKTzB6HXzswMgy9odLWDRuFtX4+6fCTbgxuHH8gH6OQmQcj9eLRUf76zT9P/tgMdviw== X-Received: by 2002:a1c:2742:: with SMTP id n63mr1357363wmn.24.1597390861631; Fri, 14 Aug 2020 00:41:01 -0700 (PDT) Received: from localhost (host86-186-80-213.range86-186.btcentralplus.com. [86.186.80.213]) by smtp.gmail.com with ESMTPSA id g3sm15361093wrb.59.2020.08.14.00.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 00:41:00 -0700 (PDT) Date: Fri, 14 Aug 2020 08:41:00 +0100 From: Andrew Burgess To: William Tambe Cc: gdb@sourceware.org Subject: Re: How to determine whether GDB is single-stepping within sim_engine_run() ? Message-ID: <20200814074100.GF853475@embecosm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.6.15-200.fc31.x86_64 (x86_64) X-Uptime: 08:38:39 up 26 days, 16:53, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2020 07:41:04 -0000 * William Tambe via Gdb [2020-08-09 14:41:34 -0500]: > Within the sim function sim_engine_run(), is there a way to determine > whether GDB is single-stepping (ie: when using commands next step > nexti stepi) ? > > I would like to use that capability to have the simulator disable > interrupts while single-stepping. GDB drives the simulator through the sim_resume function, of which there are a couple depending on what type of simulator is implemented. The sim_resume method takes a flag to indicate if the simulator should single step or not, and this flag is used to set state within the simulator object. I would suggest figuring out which sim_resume method your simulator uses, see how the single step flag is used, and then make use of this same state within your sim_engine_run. Hope that helps, Andrew