From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24866 invoked by alias); 17 Jul 2002 22:08:01 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 24854 invoked from network); 17 Jul 2002 22:08:00 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 17 Jul 2002 22:08:00 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 500B45EA11; Wed, 17 Jul 2002 17:07:59 -0500 (EST) To: "Lucy Zhang" Cc: Subject: Re: multi-thread debugging not working References: <008001ea898d$73096110$9a0a0109@zhangl> <20020716202321.GA28627@nevyn.them.org> <002201ea89ac$0bfdbce0$9a0a0109@zhangl> From: Jim Blandy Date: Wed, 17 Jul 2002 15:08:00 -0000 In-Reply-To: <002201ea89ac$0bfdbce0$9a0a0109@zhangl> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-07/txt/msg00171.txt.bz2 "Lucy Zhang" writes: > Yes, the newer version of GDB solved the previous problem. > > Now I have a new problem with not being able to debug my multi-threaded > program. I'm debugging using an ELF core dump that was coverted from another > format. The program i'm debugging has about 20 threads. It may be because > the ELF file i'm creating is missing certain information. Right now I'm at a > loss as to what could be missing which GDB might be looking for in order to > see the multiple threads. Does anyone have any ideas on how GDB recognize > threads from an ELF core dump? Try running the command `readelf -n' on your core dump. In a multi-threaded core dump, you should see something like this: $ readelf -n core.9940 Notes at offset 0x00000254 with length 0x00000d4c: Owner Data size Description CORE 0x0000007c NT_PRPSINFO (prpsinfo structure) CORE 0x00000090 NT_PRSTATUS (prstatus structure) CORE 0x0000006c NT_FPREGSET (floating point registers) LINUX 0x00000200 NT_PRXFPREG (user_xfpregs structure) CORE 0x00000090 NT_PRSTATUS (prstatus structure) CORE 0x0000006c NT_FPREGSET (floating point registers) LINUX 0x00000200 NT_PRXFPREG (user_xfpregs structure) CORE 0x00000090 NT_PRSTATUS (prstatus structure) CORE 0x0000006c NT_FPREGSET (floating point registers) LINUX 0x00000200 NT_PRXFPREG (user_xfpregs structure) CORE 0x00000090 NT_PRSTATUS (prstatus structure) CORE 0x0000006c NT_FPREGSET (floating point registers) LINUX 0x00000200 NT_PRXFPREG (user_xfpregs structure) This program had four threads in it; note that there's one prstatus structure, one user_xfpregs structure, and one floating point register structure for each thread. If you only see one of each kind of register note, then there's only one thread in the core file.