From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 57AB43851C06 for ; Sat, 13 Jun 2020 22:22:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 57AB43851C06 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jguk.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=jg@jguk.org Received: by mail-wm1-x32a.google.com with SMTP id l26so11145515wme.3 for ; Sat, 13 Jun 2020 15:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jguk.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ogt8E7r/8i3D2xonEWFgP3+EnUujNkDcV22clgIa3JQ=; b=Fw1cOYdvm1nCiGmvYH1nZrKiz68ep5K6IECrNcMzr0N9Tebkj0WhjNb0GF/c98S/M3 CZheRTD6W4fkO4dB5qjcLZoHya0TMYhIkf8JtyOn/392BxMDo0EMU0nc1dbL9T+zyUq9 7r27jWpgZYF3YvOjHy1qBIor6MGP8v6xSxSEyzpQ42gWwAknw0m+1zJax5+Udx1ocQEc 1ScMfHL7VdS7sIAMoc2fuknHIBroG04sB1h+/MGzBVyoJZ1N70Hy7pvfFx9f5GUF9eQd JQaYdT8SheXhnDTUSU+Cm9u/K27ded0Js8E1uTjibcHCv2pBYhfKYxV5hDpX5oZY4gRj dixg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ogt8E7r/8i3D2xonEWFgP3+EnUujNkDcV22clgIa3JQ=; b=uEB2yj8t/CrLQMLbpvjb5pEsHGWPWc3luVdzz0UajwZrOFTyJ8egz4QqEjsWImwBuD KlGtHE1/SIk8tFOu3amyjny2uaWbALSkyw6WIAdMBhdMkxmv7uwmQESbDDr+fHVYiYNu u2kaiu5jzLiGPXooWQRdl44WPShUXlhvuEP38DlfTR2Cf9XnxSOstX/9LjyYXq0X1hOW XqfXmaI7EnrT/LK0EWImCAio0OtubKeBD8zv8ULW6mMs81tLR5/npNp/kBz1hgGlD3Mc agzs90QIM7c1FVRRYtVYp9xm7WgqXhGAWGgWj6sfu1sqIR6qaMiXoRyKJ4GZ0ZqKijqo VPQg== X-Gm-Message-State: AOAM530gWMgJup53QrD2ySFiCrogDtwJed1m9W+4iKqEhyYGcAxKSFaZ /4nncNbaybJXqTzpKvTFCWu0RFrQNMY= X-Google-Smtp-Source: ABdhPJxQebukIsGtM+fbIzWMTrImix4CuyT9y/CZOdMFKw9xLXPPxDuHjxZ81v3ratBkqWgv2OjdcA== X-Received: by 2002:a1c:1b96:: with SMTP id b144mr5421823wmb.116.1592086944166; Sat, 13 Jun 2020 15:22:24 -0700 (PDT) Received: from [192.168.0.12] (cpc87281-slou4-2-0-cust47.17-4.cable.virginm.net. [92.236.12.48]) by smtp.gmail.com with ESMTPSA id y14sm14921613wma.25.2020.06.13.15.22.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Jun 2020 15:22:23 -0700 (PDT) Subject: Re: gdb show thread names To: Philippe Waroquiers , gdb@sourceware.org References: <030e3603-12ab-d3cb-afe7-2628acbc18e3@jguk.org> <5e3daadd5ee841b6f6d4ba4948849fa53ffe2107.camel@skynet.be> From: Jonny Grant Message-ID: Date: Sat, 13 Jun 2020 23:22:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <5e3daadd5ee841b6f6d4ba4948849fa53ffe2107.camel@skynet.be> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, TXREP, T_SPF_PERMERROR autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Sat, 13 Jun 2020 22:22:26 -0000 On 13/06/2020 13:47, Philippe Waroquiers wrote: > One year ago, I started a patch to add Ada task names and thread names. > At the end, the patch for Ada task name went in, but for the thread > names, there were still some work to do e.g. it was unclear how to > properly give the thread name in some cases and/or > have a consistent presentation of the thread name. > > The (partial) patch was giving a behaviour so that 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))] > > Philippe > > On Sat, 2020-06-13 at 01:16 +0100, Jonny Grant wrote: >> Hello >> Just wondering if gdb could show the thread names as they are created and deleted? >> >> >> [Thread 0x7fff695e9700 (LWP 3580240) exited] >> [New Thread 0x7fff98ff9700 (LWP 3580609)] >> >> $ cat /proc/3580609/comm >> ThreadPoolForeg >> >> Could be a race condition, if GDB showed the name, before it was renamed by the application, but still pretty useful to see the names. >> >> If I break, and type "info thread" I can see those still created. >> >> Jonny > Hi Philippe That looks useful. Is "sleepers" the entrypoint symbol name? I can see it is tricky because a thread may not have been named by something like pthread_setname_np() if /proc/3580609/comm is read immediately by gdb before the name could be set. Jonny