From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 3F4DF38515FB for ; Wed, 18 Aug 2021 21:09:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3F4DF38515FB Received: from fencepost.gnu.org ([2001:470:142:3::e]:39398) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGSo1-0007BA-BS for gdb@sourceware.org; Wed, 18 Aug 2021 17:09:01 -0400 Received: from [160.231.0.90] (port=11649 helo=pdslaptop) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGSo1-0003PL-7L for gdb@sourceware.org; Wed, 18 Aug 2021 17:09:01 -0400 Message-ID: Subject: Re: Tools to debug multiple cores/processes at the same time? From: Paul Smith Reply-To: psmith@gnu.org To: gdb@sourceware.org Date: Wed, 18 Aug 2021 17:09:00 -0400 In-Reply-To: <97D56F18-F336-45CD-9258-CB884C7F76E5@comcast.net> References: <3ba28620390947de2a84cabbd1958852aad97d5e.camel@gnu.org> <97D56F18-F336-45CD-9258-CB884C7F76E5@comcast.net> Organization: GNU's Not UNIX! Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 18 Aug 2021 21:09:03 -0000 On Wed, 2021-08-18 at 16:53 -0400, Paul Koning wrote: > There is multiple target support, which I haven't had a chance to try > yet but from what I remember reading is a recently added GDB > feature. It should handle your case plus even stranger ones, such as > multiple processes running different code, or even running on > different instruction sets. It's just what you need for debugging > distributed applications. Yeah, I saw that, and it might be the kernel of something that could support what I'm talking about, except I don't think it manages different "convenience variable namespaces" per inferior. But the main thing is it doesn't seem like it supports running the same command in all inferiors, other than by manually setting each one and running the command. Maybe some kind of embedded Python facility could be created to do this, such as John mentions... I'm not sure what the python support is currently for multiple inferiors. Let me give an example of a debugging session: * start a session with 3 core files * run a command that shows info about each core (assume a python "showinfo" command that show all threads with some details about each one). Maybe a command like: (gdb) all: showinfo i1: i2: i3: * For each core, go to a certain thread (of course the thread numbers will be different in each core): (gdb) i1: thr 7 (gdb) i2: thr 9 (gdb) i3: thr 23 * Run a command that returns some value and stores it in a convenience variable, on all cores: (gdb) all: set $v = $findstuff() * Run a command that shows some value, on all cores: (gdb) all: p $v->someDetail i1: $1 = 7 i2: $1 = 44 i3: $1 = 165 I dunno, something like that. Alternatively maybe it would be simpler for output for each inferior to go to a separate terminal or whatever.