From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6259 invoked by alias); 13 Jun 2005 20:13:58 -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 6169 invoked by uid 22791); 13 Jun 2005 20:13:52 -0000 Received: from sccrmhc11.comcast.net (HELO sccrmhc11.comcast.net) (204.127.202.55) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 13 Jun 2005 20:13:52 +0000 Received: from lucon.org ([24.6.212.230]) by comcast.net (sccrmhc11) with ESMTP id <20050613201350011003vu1ge>; Mon, 13 Jun 2005 20:13:51 +0000 Received: by lucon.org (Postfix, from userid 1000) id 78A4764607; Mon, 13 Jun 2005 13:13:50 -0700 (PDT) Date: Mon, 13 Jun 2005 20:13:00 -0000 From: "H. J. Lu" To: Rich Coe Cc: gdb@sources.redhat.com Subject: Re: no stack trace with 2.6.11 and gdb 6.3 Message-ID: <20050613201350.GA15678@lucon.org> References: <20050610193720.GA24094@nevyn.them.org> <200506102115.QAA91634@morpheus> <20050611005113.GA29491@nevyn.them.org> <20050611022148.GA14914@lucon.org> <20050613101629.4f54fde1@godzilla> <20050613152646.GB11261@lucon.org> <20050613103412.16e73c25@godzilla> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050613103412.16e73c25@godzilla> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-06/txt/msg00118.txt.bz2 On Mon, Jun 13, 2005 at 10:34:12AM -0500, Rich Coe wrote: > On Mon, 13 Jun 2005 08:26:46 -0700 > "H. J. Lu" wrote: > > On Mon, Jun 13, 2005 at 10:16:29AM -0500, Rich Coe wrote: > > > On Fri, 10 Jun 2005 19:21:48 -0700 > > > "H. J. Lu" wrote: > > > > On Fri, Jun 10, 2005 at 08:51:13PM -0400, Daniel Jacobowitz wrote: > > > > > > > > > > No, I told you that I expected it to work in CVS. If it does not, then > > > > > someone needs to reproduce your problem using an unpatched GDB and > > > > > debug it. I do not have a Red Hat x86_64 system on which to reproduce > > > > > it, but I may be able to elsewhere - if I have time. > > > > > > > > Gdb should support vDSO on Linux 2.6.11/x86_64 with this patch: > > > > > > > > http://sources.redhat.com/ml/gdb/2005-06/msg00095.html > > > > > > > > If it doesn't work, I will be interested to know. > > > > H.J. > > > > > > The patch makes it work only if you start the program from the gdb > > > command line. As I said in my original post: > > > > You are saying: > > > > 1. # gdb foo > > works. > > > > 2. But > > # foo > # foo & > > # gdb foo pid > > doesn't work? > > Yes. > > > Tell me how to reproduce it. I will take a look. > > > > Compile the following program, -m32. > run it in the background, and attach with gdb. > get a bt. > > Results: > gdb gtest 29769 > GNU gdb Red Hat Linux (6.3.0.0-1.10rh) > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1". > > Attaching to program: /data/rhcoe/data/mr/gtest, process 29769 > Reading symbols from /lib/tls/libc.so.6...done. > Loaded symbols for /lib/tls/libc.so.6 > Reading symbols from /lib/ld-linux.so.2...done. > Loaded symbols for /lib/ld-linux.so.2 > 0xffffe405 in ?? () > (gdb) bt > #0 0xffffe405 in ?? () > #1 0xffffd9f8 in ?? () > #2 0x4ba3e45d in ___newselect_nocancel () from /lib/tls/libc.so.6 > #3 0x080484fe in myselect () > #4 0x00000000 in ?? () > (gdb) add-symbol-file-from-memory 0xffffe000 > Reading symbols from shared object read from target memory...done. > (gdb) bt > #0 0xffffe405 in __kernel_vsyscall () > #1 0x4ba3e45d in ___newselect_nocancel () from /lib/tls/libc.so.6 > #2 0x080484fe in myselect () > #3 0x08048565 in func_two () > #4 0x0804858e in func_one () > #5 0x080485cf in main () You also need this patch for gdb 6.3. H.J. --- gdb/inftarg.c.attach 2004-11-11 16:46:57.000000000 -0800 +++ gdb/inftarg.c 2005-06-13 13:07:14.000000000 -0700 @@ -211,6 +211,10 @@ child_attach (char *args, int from_tty) inferior_ptid = pid_to_ptid (pid); push_target (&deprecated_child_ops); + + /* Do this first, before anything has had a chance to query the + inferiors symbol table or similar. */ + observer_notify_inferior_created (¤t_target, from_tty); } #if !defined(CHILD_POST_ATTACH)