From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12909 invoked by alias); 21 Apr 2010 16:12:42 -0000 Received: (qmail 12896 invoked by uid 22791); 21 Apr 2010 16:12:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Apr 2010 16:12:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0B84F2BACD4; Wed, 21 Apr 2010 12:12:35 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7wmZ41+YLKI0; Wed, 21 Apr 2010 12:12:34 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E15942BAB38; Wed, 21 Apr 2010 12:12:34 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 77572F5895; Wed, 21 Apr 2010 09:12:34 -0700 (PDT) Date: Wed, 21 Apr 2010 16:12:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org, Tristan Gingold Subject: Re: [RFA/commit] Check library name rather than member name when rereading symbols. Message-ID: <20100421161234.GC19194@adacore.com> References: <1271863083-15509-1-git-send-email-brobecker@adacore.com> <201004211640.21421.pedro@codesourcery.com> <08697AC4-EB29-4F1B-BF7F-86EF17945F92@adacore.com> <201004211658.18223.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="76DTJ5CE0DCVQemd" Content-Disposition: inline In-Reply-To: <201004211658.18223.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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-04/txt/msg00691.txt.bz2 --76DTJ5CE0DCVQemd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 413 > So, could you tweak the comment a bit while there? I'd suggest: > > /* If this object is from an archive (what you usually create with > `ar', often called a `static library' on most systems, though > a `shared library' on AIX is also an archive), then you should > stat on the archive name, not member name. */ Absolutely - thanks for digging out the info. Here is an updated version... -- Joel --76DTJ5CE0DCVQemd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="symfile.diff" Content-length: 2176 commit f747aae3d5099a7e4c294b2b62e10346e561a5a6 Author: Joel Brobecker Date: Tue Apr 20 14:13:34 2010 -0400 Check library name rather than member name when rereading symbols. On Darwin, we have lots of complaints being emitted when restarting a program: (gdb) start `a-except.o' has disappeared; keeping its symbols. `unwind-dw2.o' has disappeared; keeping its symbols. `s-except.o' has disappeared; keeping its symbols. `s-traceb.o' has disappeared; keeping its symbols. These object files are part of the GNAT runtime, and were never available. The warning comes from the fact that we're checking whether the .o files in the GNAT shared runtime have changed whereas we should be checking whether the GNAT shared library itself has changed. This patch implements this. Although it is really only useful on a platform such as Darwin (debug info stored in .o files), we believe that this is the right thing to do in general. This change should be a noop for all the other platforms in any case. gdb/ChangeLog (from Tristan Gingold & Pedro Alves): * symfile.c (reread_symbols): Also search for file in libraries. Update comment. Tested on x86_64-darwin and x86_64-linux. diff --git a/gdb/symfile.c b/gdb/symfile.c index eda26cc..d11069c 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2291,14 +2291,13 @@ reread_symbols (void) if (objfile->separate_debug_objfile_backlink) continue; -#ifdef DEPRECATED_IBM6000_TARGET - /* If this object is from a shared library, then you should - stat on the library name, not member name. */ - + /* If this object is from an archive (what you usually create with + `ar', often called a `static library' on most systems, though + a `shared library' on AIX is also an archive), then you should + stat on the archive name, not member name. */ if (objfile->obfd->my_archive) res = stat (objfile->obfd->my_archive->filename, &new_statbuf); else -#endif res = stat (objfile->name, &new_statbuf); if (res != 0) { --76DTJ5CE0DCVQemd--