From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114315 invoked by alias); 23 Apr 2018 01:28:31 -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 114291 invoked by uid 89); 23 Apr 2018 01:28:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Jan, jan, Whenever X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Apr 2018 01:28:29 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w3N1SMYS026149 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 22 Apr 2018 21:28:27 -0400 Received: by simark.ca (Postfix, from userid 112) id A1A051EF60; Sun, 22 Apr 2018 21:28:22 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id E89731E17E; Sun, 22 Apr 2018 21:28:20 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 23 Apr 2018 01:37:00 -0000 From: Simon Marchi To: Jan Vrany Cc: gdb@sourceware.org Subject: Re: How to use -list-target-features MI command In-Reply-To: References: Message-ID: <7d2d750c39c73c13c2d0e04667475d8f@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.4 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 23 Apr 2018 01:28:22 +0000 X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00016.txt.bz2 Hi Jan, On 2018-04-09 10:22, Jan Vrany wrote: > Hi there, > > I need to know (in advance) whether the target supports async > mode or not. > I know that -list-target-features can be used for that, but > not sure when and how to use -list-target-features. > > The documentation says: > > "Whenever a target can change, due to commands such as -target-select, > -target-attach or -exec-run, the list of target features may change, > and the frontend should obtain it again." > > However, once I issue `-exec-run` using a target with no async mode > support, I will not get the result of -list-target-feature before > debugee stops. I think that's kind of expected. If the run target does not support mi-async, GDB can't parse and reply to MI commands while the target is executing. GDB reads and replies to your -list-target-features only when the target stops. One way to hack around it would be to use for example the new "starti" command, which breaks at (before?) the first instruction of the program, issue -list-target-features, and then continue. There might be some better/cleaner solution, but that's what comes to mind right now. > Another problem is that user may enter CLI command manually. In case, > how do I find out that target may have changed and I should check for > features? I don't see a way right now that you could know about that. There would need to be a new asynchronous event emitted when the target stack changes. Simon