From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 731 invoked by alias); 28 Jun 2013 13:06:36 -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 717 invoked by uid 89); 28 Jun 2013 13:06:35 -0000 X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,T_FILL_THIS_FORM_SHORT autolearn=ham version=3.3.1 Received: from smarthost.idnet.net (HELO smarthost.idnet.net) (212.69.40.140) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 28 Jun 2013 13:06:33 +0000 Received: from m3.idnet.com (unknown [212.69.40.217]) by smarthost.idnet.net (Postfix) with ESMTP id 7B8F9236F51 for ; Fri, 28 Jun 2013 14:06:31 +0100 (BST) Received: from mail.idnet.net.uk (mail.idnet.net.uk [212.69.36.63]) by m3.idnet.com (Postfix) with ESMTP id 75ECC201CA for ; Fri, 28 Jun 2013 14:06:31 +0100 (BST) Received: from [213.33.91.2] by mail.idnet.net.uk (GMS 17.01.3793/NU3963.00.7ca42f0c) with ESMTP via TLS id kqrzgeda for gdb@sourceware.org; Fri, 28 Jun 2013 14:06:25 +0100 Message-ID: <51CD8A52.1010905@embecosm.com> Date: Fri, 28 Jun 2013 13:06:00 -0000 From: Jeremy Bennett Reply-To: jeremy.bennett@embecosm.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Yao Qi CC: gdb@sourceware.org Subject: Re: Why does "target remote" to a non-stop target stop one thread References: <51CCA2AB.1000008@embecosm.com> <51CD45EE.6030501@codesourcery.com> In-Reply-To: <51CD45EE.6030501@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-AuthenticatedSender: jeremy.bennett.embecosm.com@idnet.net.uk X-SW-Source: 2013-06/txt/msg00071.txt.bz2 On 28/06/13 10:14, Yao Qi wrote: > On 06/28/2013 04:38 AM, Jeremy Bennett wrote: >> hen I connect to the target, even in non-stop mode, it insists on >> stopping one thread. The comment in notice_new_inferior () is: >> >>> > /* We're going to install breakpoints, and poke at memory, >>> > ensure that the inferior is stopped for a moment while we do >>> > that. */ >> My question is, why we need to stop any thread. Surely the whole point >> of non-stop mode is that we don't generally want to stop any threads if >> it can be avoided. > > Hi Jeremy, > AFAIK, "non-stop" means when GDB is examining one stopped thread while > other threads are _not stopped_. > > See > http://sourceware.org/gdb/onlinedocs/gdb/Non_002dStop-Mode.html#Non_002dStop-Mode > > > GDB needs the thread stopped because ptrace can't be performed on the > running thread. > Hi Yao, Thanks for the explanation. Since I am working on a RTOS that does not use ptrace, and can perform actions on running threads, I don't need to stop. So it looks like something like the patch suggested by Raphael Zulliger that makes this configurable depending on the target would be a useful. I'll work on this. Jeremy -- Tel: +44 (1590) 610184 Cell: +44 (7970) 676050 SkypeId: jeremybennett Email: jeremy.bennett@embecosm.com Web: www.embecosm.com Twitter: @embecosm