From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32682 invoked by alias); 14 Aug 2009 23:09:53 -0000 Received: (qmail 32624 invoked by uid 22791); 14 Aug 2009 23:09:53 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,SPF_PASS,TBC X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Aug 2009 23:09:47 +0000 Received: (qmail 9746 invoked from network); 14 Aug 2009 23:09:46 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Aug 2009 23:09:46 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, tromey@redhat.com Subject: Re: [patch] Replace reread_symbols by load+free calls Date: Fri, 14 Aug 2009 23:12:00 -0000 User-Agent: KMail/1.9.10 Cc: Jan Kratochvil References: <8ac60eac0906101839t4d3978fyc1c6d3b3e2eccb6e@mail.gmail.com> <20090625192120.GA29930@host0.dyn.jankratochvil.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908150010.00090.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: 2009-08/txt/msg00209.txt.bz2 I have to apologize too, since I dropped the conversation too. On Friday 14 August 2009 23:34:31, Tom Tromey wrote: > I realize you pulled this patch from consideration. But, FWIW, I tend > to think it is a good idea, because it ensures that all the hooks and > observers will be run identically in both cases. I have to say that I didn't think it was a good idea, because of the way the change ties the objfiles to solib.c, and the fact that it makes it so that an objfile pointer becomes more volatile. That is, with that change, all roots holding an objfile pointer need to be crawled, while as is today, an objfile object's internals are the business of objfile.c and symfile.c, and an objfile client can hold a pointer across objfile rereads, while the pointer stays valid. There were also some FIXME comments related to bfd_get_mtime in the patch that looked like misunderstandings, and that threw me off. Maybe I just didn't understand them. :-/ There's also this comment in the current code that makes that suggested change scare me: /* There are various functions like symbol_file_add, symfile_bfd_open, syms_from_objfile, etc., which might appear to do what we want. But they have various other effects which we *don't* want. So we just do stuff ourselves. (...) */ ... as we'd be going in the opposite direction (the patch uses symbol_file_add). I wonder how much would we simplify reread_symbols by moving the each-objfile rereading code to objfile.c, and refactor it to share code with allocate_objfile, free_objfile, etc., and thus also making it easier to make hooks and observers be consistent. -- Pedro Alves