From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22091 invoked by alias); 8 Nov 2009 15:04:37 -0000 Received: (qmail 21898 invoked by uid 22791); 8 Nov 2009 15:04:35 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Nov 2009 15:04:31 +0000 Received: (qmail 25050 invoked from network); 8 Nov 2009 15:02:29 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Nov 2009 15:02:29 -0000 From: Vladimir Prus To: gdb@sources.redhat.com Subject: [MI] Extending -list-thread-groups --available to show cores Date: Mon, 09 Nov 2009 01:36:00 -0000 User-Agent: KMail/1.12.90 (Linux/2.6.24-25-generic; KDE/4.3.73; i686; svn-1043485; 2009-11-01) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200911081804.31988.vladimir@codesourcery.com> 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 X-SW-Source: 2009-11/txt/msg00078.txt.bz2 Current GDB has a MI command -list-thread-groups to nagivate the hierarchy of the debugged thing. This command also the the --available option that cause GDB to report the processes that can be attached to, as opposed to processes currently being debugged. We were recently asked to slightly extend the returned information to include the core where each thread runs. Such information is of little use for typical Linux application, since threads are migrated between cores. However, it's useful for both custom Linux applications that specifically pin threads to specific cores, and for embedded systems. Therefore, I plan to add a new field to the thread information that is output by -list-thread-groups --available, named 'core' that will give the number of the core. E.g. -list-thread-groups ^done,groups=[{id="17",type="process",pid="yyy",num_children="2",cores=[1,2]}] -list-thread-groups 17 ^done,threads=[{id="2",target-id="Thread 0xb7e14b90 (LWP 21257)",cores=[1] frame={level="0",addr="0xffffe410",func="__kernel_vsyscall",args=[]},state="running"}, Related to that, it would be somewhat inefficient to issue -list-thread-groups for every avaialable process to discover the full list of threads on specific core, so it would be nice to pass several thread groups, like so: -list-thread-groups 17 18 ^done,groups=[{id="17", types="process", ..., threads=[{id="2",target-id="Thread 0xb7e14b90 (LWP 21257)",cores=[1]}]}, {id="18", types="process", ..., Finally, we were asked to make the *stopped notification to report the core on which the stop has happened, as additional field. While those changes seem relatively minor and in line with previous MI developments, I wanted to pass them here. If there are no objections, I'll work in implementation during coming weeks. Thanks, Volodya