From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27290 invoked by alias); 5 Jun 2019 09:02:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27281 invoked by uid 89); 5 Jun 2019 09:02:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f47.google.com Received: from mail-wm1-f47.google.com (HELO mail-wm1-f47.google.com) (209.85.128.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Jun 2019 09:02:45 +0000 Received: by mail-wm1-f47.google.com with SMTP id z23so1409002wma.4 for ; Wed, 05 Jun 2019 02:02:44 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:4eeb:42ff:feef:f164? ([2001:8a0:f913:f700:4eeb:42ff:feef:f164]) by smtp.gmail.com with ESMTPSA id p3sm21545605wrd.47.2019.06.05.02.02.42 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 02:02:42 -0700 (PDT) Subject: Re: [RFA] Give thread names in thread events, give Ada task names in more output. To: Philippe Waroquiers , gdb-patches@sourceware.org References: <20190518182306.22937-1-philippe.waroquiers@skynet.be> From: Pedro Alves Message-ID: <592e4423-0204-607f-3165-60aa0a3b4652@redhat.com> Date: Wed, 05 Jun 2019 09:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190518182306.22937-1-philippe.waroquiers@skynet.be> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-06/txt/msg00115.txt.bz2 On 5/18/19 7:23 PM, Philippe Waroquiers wrote: > With this patch, we e.g. get: > [New Thread 0x7ffff701b700 (LWP 13891) "sleepers"] > [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13890) "sleepers")] > instead of: > [New Thread 0x7ffff701b700 (LWP 13918)] > [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13917))] > > For Ada tasks, we e.g. get: > [Switching to task 2 task_list(1)] > [Current task is 2 task_list(1)] > instead of > [Switching to task 2] > [Current task is 2] BTW, if you're looking at improving this, take a look what I was proposing here: https://sourceware.org/ml/gdb-patches/2019-04/msg00448.html (gdb) r Starting program: build/gdb/testsuite/outputs/gdb.threads/schedlock/schedlock [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [Thread 1.2 (0x7ffff74b8700 (LWP 13984) "sleepers") appeared] [Thread 1.2 (0x7ffff74b8700 (LWP 13984) "sleepers") exited] [Inferior 1 (process 13980) exited normally] (gdb) Specifically, I think it'd be quite useful to show the thread's gdb number. I'd say that is more useful than the thread name, even, because you can use "info threads" to find the name from the unique gdb id, but converse isn't so easy. > @@ -986,10 +986,9 @@ should_print_thread (const char *requested_threads, int default_inf_num, > return 1; > } > > -/* Return the string to display in "info threads"'s "Target Id" > - column, for TP. */ > +/* See gdbthread.h. */ > > -static std::string > +std::string > thread_target_id_str (thread_info *tp) > { The commit's description talks about thread names, but note that thread_target_id_str prints more than the name -- it also prints the thread's extra info. Thanks, Pedro Alves