From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126556 invoked by alias); 7 Sep 2017 12:50:43 -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 126540 invoked by uid 89); 7 Sep 2017 12:50:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=hacks, connections, maint, palves 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; Thu, 07 Sep 2017 12:50:37 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4AE6961461; Thu, 7 Sep 2017 12:50:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4AE6961461 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9165361B70; Thu, 7 Sep 2017 12:50:35 +0000 (UTC) Subject: Re: Debugging Multiple Inferiors To: florent vion , gdb@sourceware.org References: From: Pedro Alves Message-ID: Date: Thu, 07 Sep 2017 12:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00015.txt.bz2 On 09/07/2017 01:09 PM, florent vion wrote: > Hi the experts, > > Do you know if it is possible to debug two cortex-m in parallel with > one gdb session using inferiors? Interesting! And apropos too. If possible, I'd love to hear more about the use case. It's not possible today, but hopefully that won't be for too long. See below. > Do I need to enable the non stop mode if I use the remote protocol? ... > It seems that the remote target behaves as an Highlander, "there can > be only one"... Indeed. However, I've actually been working on lifting that limitation. You can find my WIP branch here: https://github.com/palves/gdb/commits/palves/multi-target It's a WIP, still with a couple of quick hacks in place, but it's good enough to debug multiple remote connections at the same time using that, provided the remote stubs support the same set of remote protocol extensions (which is not an issue if you have two exactly equal boards) and provided the remote target/stub supports non-stop mode. If you want to give it a try, know that user-visible all-stop mode does work, however you'll need to do "maint set target-non-stop on" before connecting to force the remote connection itself to use non-stop mode. I've been focusing on "target extended-remote" (+ "run"), but I expect that "target remote" should work too. (If it doesn't yet, I'll want to fix it.) FYI, if you're curious about implementation details, earlier attempts at multi-target are described here: https://sourceware.org/gdb/wiki/MultiTarget While my new implementation is different/new, a good part of the info on that page is still relevant, since it lists the problem that need to be addressed. Perhaps the main difference in my approach is that nowadays GDB is a C++ program and I'm making target_ops a C++ class hierarchy, and that I'm not extending PTID, but instead making core of gdb use thread_info/inferior/target_ops pointers more. Thanks, Pedro Alves