From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 71C0C398B86E for ; Wed, 18 Aug 2021 20:25:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71C0C398B86E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id CE599860A7; Wed, 18 Aug 2021 20:25:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqfXg5Dgbz3HlG; Wed, 18 Aug 2021 20:25:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 591952E206; Wed, 18 Aug 2021 20:25:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: psmith@gnu.org, gdb@sourceware.org References: <3ba28620390947de2a84cabbd1958852aad97d5e.camel@gnu.org> From: John Baldwin Subject: Re: Tools to debug multiple cores/processes at the same time? Message-ID: <63ff89cc-d0ef-7d38-577e-7e099e0250f8@FreeBSD.org> Date: Wed, 18 Aug 2021 13:25:21 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <3ba28620390947de2a84cabbd1958852aad97d5e.camel@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, 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 20:25:27 -0000 On 8/18/21 12:55 PM, Paul Smith via Gdb wrote: > What I'm really wondering is, has anyone heard of something like this, > or is there any support (even partial support) for something like this > in GDB today? I get that it seems like a somewhat specialized request. > > Debugging multiple live processes at the same time would also be great, > of course. I haven't tried this myself, but you might be able to do this by adding multiple inferiors (one inferior per process). You can use 'add-inferior' to add new inferiors and 'info inferiors' to list them. 'inferior N' switches between inferiors, though 'info threads' also shows threads from all inferiors and you can switch by threads as well. When debugging a process that forks and have detach-on-fork disabled, each process ends up in a separate inferior. I haven't tried, but you can perhaps use 'core' or 'attach' in each inferior to attach to multiple cores or processes. There is a knob that affects scheduling (does a continue all processes or just the current one?) for the live case. I'm not sure if you can have convenience variables be per-inferior, and I'm not sure if we currently have a convenience variable that exposes the current inferior. I suspect you probably would have access to that if you were to write your custom commands in python rather than as user commands. -- John Baldwin