From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29964 invoked by alias); 6 Aug 2010 09:57:18 -0000 Received: (qmail 29953 invoked by uid 22791); 6 Aug 2010 09:57:16 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD 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; Fri, 06 Aug 2010 09:57:08 +0000 Received: (qmail 16019 invoked from network); 6 Aug 2010 09:57:06 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Aug 2010 09:57:06 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA]corelow.c: Add tid to add_to_thread_list Date: Fri, 06 Aug 2010 09:57:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-24-generic; KDE/4.4.2; x86_64; ; ) Cc: Hui Zhu References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008061057.03037.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2010-08/txt/msg00058.txt.bz2 On Friday 06 August 2010 03:55:51, Hui Zhu wrote: > 2010-08-06 Hui Zhu > > * corelow.c(add_to_thread_list): Add tid. > > --- > corelow.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > --- a/corelow.c > +++ b/corelow.c > @@ -244,7 +244,7 @@ add_to_thread_list (bfd *abfd, asection > { > ptid_t ptid; > int core_tid; > - int pid, lwpid; > + int pid, lwpid, tid; > asection *reg_sect = (asection *) reg_sect_arg; > > if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0) > @@ -278,7 +278,13 @@ add_to_thread_list (bfd *abfd, asection > if (current_inferior ()->pid == 0) > inferior_appeared (current_inferior (), pid); > > - ptid = ptid_build (pid, lwpid, 0); > + tid = 0; > + do > + { > + ptid = ptid_build (pid, lwpid, tid); > + tid ++; > + } > + while (find_thread_ptid (ptid)); > > add_thread (ptid); Sorry, no. It's not a good idea to have the corelow target using both the lwpid and the tid fields. It leaves no room for a thread_stratum target on top to use. Going by what someone said on the other thread: > The goal was always that something could post process the output of > the kernel crashdump and create something that is gdb compatible. It > looks to me like it would take just a moment to strip out all of the > idle threads. What are exactly these "threads" with no PID? How useful is it for gdb to expose them as threads? Are these the idle threads, one per core, not associated with any process? Are we talking about a regular process core dump, or some other core dump? From the comment quoted above, it appears that it would be expected that something just stripped out / ignored these "threads"/notes. Say, a post processor tool, or bfd, or gdb. BTW, with this particular patch, you've only gotten past this one problem, but, you'll be tripping on others. For example, all register accesses for lwpid=XXX,tid=0, lwpid=XXX,tid=1, lwpid=XXX,tid=2, etc., will be going to the same .reg/XXX section. -- Pedro Alves