From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by sourceware.org (Postfix) with ESMTPS id D24DF386F439 for ; Mon, 15 Jun 2020 20:53:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D24DF386F439 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-x343.google.com with SMTP id u26so825785wmn.1 for ; Mon, 15 Jun 2020 13:53:45 -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=J9O7j/4sUm/MjXKzCWjpECwUGLRBCC2QmdwH9Q8Rvpk=; b=AsKhRHEc+rxVdy6zYr3brqL3sHNQOqJso/7BdM0vHFG9YcAAyleZ1mWdfRqVC8k+q+ 3fxGTCAVsTpHAG5RCu1g8b2d+/uBsAVlNCD9SsoH0g7ncdE5ybx5PrHHwZRigPmuJkHp ziVd7UjnYMZ9qcoFint10pC4MiQ15LeB/DpCM+jyh2AOH8ivKXQazaKCG3asZ5ARiXGN D7VIUczTFB6qqjMCvoYOxAI5dMKSkZoY7DsVc+T2p8LTG7QZrP0up8r8AAMwPge/e4HP Z7yk1Aax6AtAbZaYGVYey5EFw+HAlw66Bff+7rlHnVFiVWz26Nd/CNFSec2jVhGyCZ8V ja1g== 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=J9O7j/4sUm/MjXKzCWjpECwUGLRBCC2QmdwH9Q8Rvpk=; b=X5/iXSEt4ZPUkoBV2jx6hWpWw2nVixbql7FpEedTEzosH0LXCq1LSOHN8vc9K/WHR5 regGoa2vEmVBQsaQve7hQ1DMFgvKoI6DtPlnTGzcLNWKUNWuJOV/KXT+o7sWtzaPMHGi g+UHsUcf1PPIdMvgsa+Q13i6UKbvJ1wNWw/PaglAqKIosQKZBgIaSW6Ywzx8mgRn4Sgx Qgp6n+hN+RjJVYLZagyMuiXCs9jiJZqXTY4UbuDhaJ3OjoW7PMOK7TToEWEWA7Z8ylKu c57hproTl/LQPs/l5arYid0S3nMlhHkhoX/G9WLvPcGr1hZ3GSE0aX/OlRptFCHlNDj0 d33g== X-Gm-Message-State: AOAM530a7J5o5kgBoGaA1apQ64GvsTi5CzBXsDtCL7koGz0nlL/bOec9 Tx0RdTzBLJ/XFplkO0uOIR5jBEyuVhU= X-Google-Smtp-Source: ABdhPJz0ydYTTzoIHPA6p88Pj8fC1uT4R2QGVFwVLDxjleNofxzaO79UFFscg+I6xt4p2zqPPLPztA== X-Received: by 2002:a1c:8107:: with SMTP id c7mr1171364wmd.20.1592254424489; Mon, 15 Jun 2020 13:53:44 -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 w15sm926345wmk.30.2020.06.15.13.53.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jun 2020 13:53:43 -0700 (PDT) Subject: Re: gdb show thread names To: Philippe Waroquiers , Pedro Alves , gdb@sourceware.org References: <030e3603-12ab-d3cb-afe7-2628acbc18e3@jguk.org> <5e3daadd5ee841b6f6d4ba4948849fa53ffe2107.camel@skynet.be> <9cbff50e-5268-98a9-7648-af53bacc1940@redhat.com> From: Jonny Grant Message-ID: Date: Mon, 15 Jun 2020 21:53:42 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 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: Mon, 15 Jun 2020 20:53:47 -0000 On 15/06/2020 17:21, Philippe Waroquiers wrote: > On Mon, 2020-06-15 at 16:51 +0100, Pedro Alves wrote: >> >> Starting program: /home/pedro/brno/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.threads/names/names >> [Thread debugging using libthread_db enabled] >> Using host libthread_db library "/lib64/libthread_db.so.1". >> [New Thread 0x7ffff74b8700 (LWP 24171) "main"] >> [New Thread 0x7ffff6cb7700 (LWP 24172) "main"] >> [New Thread 0x7ffff64b6700 (LWP 24173) "main"] >> >> Thread 1 "main" hit Breakpoint 1, all_threads_ready () at /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.threads/names.c:51 >> 51 } >> (gdb) info threads >> Id Target Id Frame >> * 1 Thread 0x7ffff7fb5740 (LWP 24170) "main" all_threads_ready () at /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.threads/names.c:51 >> 2 Thread 0x7ffff74b8700 (LWP 24171) "carrot" 0x00007ffff7bc89aa in futex_wait (private=0, expected=4, futex_word=0x7fffffffd604) at ../sysdeps/unix/sysv/linux/futex-internal.h:61 >> 3 Thread 0x7ffff6cb7700 (LWP 24172) "potato" 0x00007ffff7bc89aa in futex_wait (private=0, expected=4, futex_word=0x7fffffffd604) at ../sysdeps/unix/sysv/linux/futex-internal.h:61 >> 4 Thread 0x7ffff64b6700 (LWP 24173) "celery" 0x00007ffff7bc89aa in futex_wait (private=0, expected=4, futex_word=0x7fffffffd604) at ../sysdeps/unix/sysv/linux/futex-internal.h:61 >> (gdb) >> >> I.e., printing the thread name when the thread is created >> looks more confusing than helpful to me. > Yes, that is confusing. > > And for the following events, when I tried, the patch was far to be ready > e.g. for the exit events, it gives (for the above): > (gdb) c > Continuing. > [Thread 0x7ffff743d700 (LWP 22783) exited] > [Thread 0x7ffff7c3e700 (LWP 22782) exited] > [Thread 0x7ffff7c3f740 (LWP 22778) "main" exited] > > So, unclear why there is no carrot, potato or celery in the 2 exited threads > but "main" is present. > (and sometimes there is no names in any exited event). > > So, when I looked at it, it needed quite some more work ... > > Philippe > Hi, Maybe it is more complicated than it is worth after all. Although, I did think new threads inherited the process executable name, rather than the main() symbol. It's easy enough for me to press ^C and then type "info threads" so maybe it is fine as it is. Would start to get awkward if GDB needs to interrupt and poll the proc "comm" file for each LWP etc Regards, Jonny