From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24243 invoked by alias); 12 Feb 2009 18:06:59 -0000 Received: (qmail 24160 invoked by uid 22791); 12 Feb 2009 18:06:58 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_13,SPF_PASS 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; Thu, 12 Feb 2009 18:06:48 +0000 Received: (qmail 25338 invoked from network); 12 Feb 2009 18:06:46 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Feb 2009 18:06:46 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: MI solib notification Date: Thu, 12 Feb 2009 19:45:00 -0000 User-Agent: KMail/1.9.10 Cc: Daniel Jacobowitz , Vladimir Prus , Marc Khouzam , gdb-patches@sources.redhat.com, Nick Roberts References: <200901310010.46738.vladimir@codesourcery.com> <200902121801.55254.vladimir@codesourcery.com> <20090212151337.GA9460@caradoc.them.org> In-Reply-To: <20090212151337.GA9460@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200902121806.45822.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-02/txt/msg00290.txt.bz2 Message-ID: <20090212194500.MhR4-nx00JjpCevH5rQeiq_JSLE16Dcji-BJFTPdPqM@z> On Thursday 12 February 2009 15:13:37, Daniel Jacobowitz wrote: > On Thu, Feb 12, 2009 at 06:01:54PM +0300, Vladimir Prus wrote: > > Yes, this runs everywhere except a.out and marks all breakpoints in sol= ibs > > disabled, without printing any messages. *Then* we look over all solibs > > and call observer, but since all breakpoints are already disabled, > > breakpoint.c:disable_breakpoints_in_unloaded_shlib won't do anything, > > and won't say anything either. >=20 > I see. =A0The comment in clear_solibs means that we will break SunOS > a.out shared libraries if we do this; they were previously not > disabled, since they won't ever be re-enabled. =A0So I suggest not > making the observer call on a.out either. =A0Otherwise OK. Sorry to pitch in this late, but, doesn't it sound wrong when we end up conditionally calling observers for the benefit of some specific observer? When we do that, we're likelly to end up adding some new observer in the future, for a different purpose, and realise that it isn't getting called in some situation. I'd prefer in these cases to see us move in the direction where the observer itself has the needed information to decide if it should skip its whatever-action, or, to add a new notification. It seems there's a bit of overloading going on here: - MI wants to know whenever GDB removes a shared library from it's lists. Be that when the inferior unloads the shared library, or after the inferior having exited. Because we currently leave the shared list intact after the inferior having exited, and only clear it on the subsequent re-run, this even means that MI will get an =3Dthread-group-exited notification when the inferior exits, and only when the inferior is re-run, will MI output this new =3Dlibrary-unloaded notification. So, this shows that "unloaded" means unloaded from gdb, not unloaded from the inferior, unless that is fixed to be made consistent. E.g., core files when they're closed do clear the solist. - The breakpoints.c:disable_breakpoints_in_unloaded_shlib observer currently is notified whenever the inferior unloads an solib, but not when we clear the list to start over. If we want it to get the notification also in that case, can't we push the a.out checks down there instead? If needed, we could add a parameter to the notification, or come up with a new notification. --=20 Pedro Alves