From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Ds8gOyk5HmEgCQAAWB0awg (envelope-from ) for ; Thu, 19 Aug 2021 06:57:45 -0400 Received: by simark.ca (Postfix, from userid 112) id E2F501EDFB; Thu, 19 Aug 2021 06:57:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D867A1EA7E for ; Thu, 19 Aug 2021 06:57:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F19F4388460E for ; Thu, 19 Aug 2021 10:57:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F19F4388460E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629370664; bh=MM8Yk+Ab1P5M+au6g2M9Xob5V9CSONkM7DpGqZRxJvI=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tVOstWQXEwYPyldZ3+zKCCp+hHsQd0hcn309e3SmjngUq4oZDobOf22AygPjBAPWC X4LRedv9ZhxQ3bKN6bPm6jYVmLRgrrLHSS+qtLvGXmZGqxkInznzs2MGh9mEvJx8sz MfNe3NRAvSfBqoG5G8wEG483a17HOvFOJ5JswvZk= Received: from mailsec210.isp.belgacom.be (mailsec210.isp.belgacom.be [195.238.22.106]) by sourceware.org (Postfix) with ESMTPS id CBE593858400 for ; Thu, 19 Aug 2021 10:57:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CBE593858400 IronPort-SDR: cL78l1OfwOjtrC+gtFmeYG8i+aS59z1TFnkn4AzWstk+vmpQBM98+8rNX0gh8UkExIoFXhg37E HcWm3PJxi6beMfjHpLXkRT+I2U4YLuT8yn1xSXLGlaFo3W4oJB+6xbA8cqsiOmiU4V4Wl5A92T GKbYXkbl4F3CnwPstnJaryTFHZq4OFJKorleGOASNqJQ7WufTN15lWXdfBPRmyTeBjJELkptEh yKHM9XWiPkkaZvUCOzB41qcJfbiFLo6kXnFlaAAQvRm7kJNkVGWrHcH901Q2KobbhdRwD0/6uQ M3w= X-IPAS-Result: =?us-ascii?q?A2AUBADZOB5h/yFRiNlaHQEBAQEJARIBBQUBQAmBUIN4h?= =?us-ascii?q?TOJBIhqAzgBnS4LAQEBAQEBAQEBCT4BAgQBAYRjAoIwJjgTAQIEAQEBAQMCA?= =?us-ascii?q?wEBAQEFAQEGAQEBAQEBBQQBgSOFL0aCNSKDbAEFIwQvMwgDGAICJgICVweGD?= =?us-ascii?q?6ljfzKBAYRpg06BY4EQKocNgmyDejeBVUSEAzc+h1uCZASEdoEWWkyBNgkDk?= =?us-ascii?q?WQPjgSdTS2DMoExBgudEyymdSuVaaVHgXeBfW1TgmpPKJxyQmcCBgsBAQMJg?= =?us-ascii?q?QcIE4hfAQE?= IronPort-PHdr: A9a23:i/NafRUDgwibnsotbIXPWprfVInV8KwQVTF92vMcY1JmTK2v8tzYM VDF4r011RmVB92duqwP0rKN+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpV O5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxtUiDanZb5/L Rq6oRjNusQYnIBvNrs/xhzVr3VSZu9Y33loJVWdnxb94se/4ptu+DlOtvwi6sBNT7z0c7w3Q r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ZNzUO0VHARL2Kr7GC/9SKIUfDH4BmuZ uIP5IOa+HNMQ== X-IronPort-Anti-Spam-Filtered: true Received: from 33.81-136-217.adsl-dyn.isp.belgacom.be (HELO md) ([217.136.81.33]) by relay.proximus.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2021 12:56:43 +0200 Message-ID: <774408cfd5398ab01814341b1e22194170fec354.camel@skynet.be> Subject: Re: Tools to debug multiple cores/processes at the same time? To: psmith@gnu.org, gdb@sourceware.org Date: Thu, 19 Aug 2021 12:56:42 +0200 In-Reply-To: References: <3ba28620390947de2a84cabbd1958852aad97d5e.camel@gnu.org> <97D56F18-F336-45CD-9258-CB884C7F76E5@comcast.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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: , From: Philippe Waroquiers via Gdb Reply-To: Philippe Waroquiers Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On Wed, 2021-08-18 at 17:09 -0400, Paul Smith via Gdb wrote: > 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: info threads should show the threads of all inferiors. > > * 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 thread INFERIORNR.THREADNR will switch to the listed thread. > > * 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. The command 'thread apply' can apply a command to all threads or to a selected list of threads. If you have multiple inferiors, the command can then be run for all threads of all inferiors. I do not see an (easy) way to run a command only once per inferior, when an inferior has multiple threads. For this, likely, the best would be to have a new gdb command such as inferior apply all | INFERIOR-LIST Note that the command 'show convenience' lists a convenience variable $_inferior. Philippe