From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24166 invoked by alias); 8 Jan 2002 18:36:39 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23748 invoked from network); 8 Jan 2002 18:36:25 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 8 Jan 2002 18:36:25 -0000 Received: from drow by nevyn.them.org with local (Exim 3.33 #1 (Debian)) id 16O17S-0007FG-00 for ; Tue, 08 Jan 2002 13:37:06 -0500 Received: from nevyn.them.org (mail@NEVYN.RES.CMU.EDU [128.2.145.6]) by mail.redhat.com (8.11.6/8.8.7) with ESMTP id g08IUkd20690; Tue, 8 Jan 2002 13:30:46 -0500 Received: from drow by nevyn.them.org with local (Exim 3.33 #1 (Debian)) id 16O122-0007CP-00; Tue, 08 Jan 2002 13:31:30 -0500 Date: Tue, 08 Jan 2002 10:36:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: gdb-patches@sources.redhat.com, kettenis@science.uva.nl, kevinb@redhat.com Subject: Re: [RFA] Find and read symbol files after attach (linux) Message-ID: <20020108133130.A27580@nevyn.them.org> Mail-Followup-To: Michael Snyder , gdb-patches@sources.redhat.com, kettenis@science.uva.nl, kevinb@redhat.com References: <200201080040.g080e0h29987@reddwarf.cygnus.com> <20020107215957.A9170@nevyn.them.org> <3C3B332E.774C4E2E@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C3B332E.774C4E2E@redhat.com> User-Agent: Mutt/1.3.23i Resent-From: dan@debian.org Resent-Date: Tue, 8 Jan 2002 13:37:06 -0500 Resent-To: gdb-patches@sources.redhat.com Resent-Message-Id: X-SW-Source: 2002-01/txt/msg00139.txt.bz2 On Tue, Jan 08, 2002 at 09:58:06AM -0800, Michael Snyder wrote: > Daniel Jacobowitz wrote: > > > > On Mon, Jan 07, 2002 at 04:40:00PM -0800, Michael Snyder wrote: > > > [oops, hit send too soon...] > > > This change allows GDB to find and read the symbol files (including > > > all shared libraries) on Linux when you attach to an anonymous PID. > > > It should work for all Linuxen, but for now I've only added it to the > > > linux.mh and nm-linux.h files in config/i386. Please feel free to > > > add it to your targets. > > > > [without actually looking at it...] > > > > (A) Is there any reason not to do it for all Linuxen in > > config/nm-linux.h? > > Probably can. I was being conservative. I'd prefer you to do this, then. I believe it will work. > > (B) Why do we need /proc to do this? We should be able to use the > > information in the link map - which we already access in solib-svr4.h - > > to get all of this. > > There may be another method of doing it -- I just used the > method I know (copied from Solaris). We need to discover > the mapped memory regions so you can find the "debug_base". > But this isn't one of my strong areas, so you may well know > a better way to do the same thing. Well, Mark's comment is completely correct. Eventually I remembered that this works by looking up data at _DYNAMIC, which means we need the executable first :) I believe that we should be able to find the rest of what we need by the shared library code, without the mappings file, though. I also thought that this would just 'work'. Have you tried with the code to find the executable but without the code to find shared libraries? What happens? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer