From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27579 invoked by alias); 5 Jun 2019 22:24:24 -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 27523 invoked by uid 89); 5 Jun 2019 22:24:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mailsec114.isp.belgacom.be Received: from mailsec114.isp.belgacom.be (HELO mailsec114.isp.belgacom.be) (195.238.20.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Jun 2019 22:24:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1559773454; x=1591309454; h=message-id:subject:from:to:date:in-reply-to:references: mime-version:content-transfer-encoding; bh=kOCnHvGGSm2mHjoe/gbZyW5b4dwyGqmgOyICKuuxyoY=; b=lY5/m5f3DPapimWsW6rduFAkOB857sesJyTXOC1Rg430dit9hCZUVIXS 7YWZnLoFRChaZZs0RrW4d5XWgPylpw==; Received: from 161.32-242-81.adsl-dyn.isp.belgacom.be (HELO md) ([81.242.32.161]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 06 Jun 2019 00:24:11 +0200 Message-ID: <1559773451.1454.57.camel@skynet.be> Subject: Re: [RFA] Give thread names in thread events, give Ada task names in more output. From: Philippe Waroquiers To: Pedro Alves , gdb-patches@sourceware.org Date: Wed, 05 Jun 2019 22:24:00 -0000 In-Reply-To: <592e4423-0204-607f-3165-60aa0a3b4652@redhat.com> References: <20190518182306.22937-1-philippe.waroquiers@skynet.be> <592e4423-0204-607f-3165-60aa0a3b4652@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00134.txt.bz2 On Wed, 2019-06-05 at 10:02 +0100, Pedro Alves wrote: > 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. Pedro and Tom, Thanks for the feedback and suggestions. I will see how to go on with this. Maybe the best is to do this in 3 different patches: * a patch adding the Ada task name where relevant * a patch adding in the thread events the thread name and the other things suggested by Pedro * a third patch that replaces (where relevant) target_pid_to_str by something like target_pid_to_thr_id_str Philippe