From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12939 invoked by alias); 27 Oct 2008 17:07:29 -0000 Received: (qmail 12681 invoked by uid 22791); 27 Oct 2008 17:07:25 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 27 Oct 2008 17:06:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E44552A9610 for ; Mon, 27 Oct 2008 13:06:36 -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 C0eIQkzwpFYx for ; Mon, 27 Oct 2008 13:06:36 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A8F3D2A95E7 for ; Mon, 27 Oct 2008 13:06:36 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 773B1E7ACD; Mon, 27 Oct 2008 10:06:34 -0700 (PDT) Date: Mon, 27 Oct 2008 17:45:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: catch load/unload not implemented on any target (remove?) Message-ID: <20081027170634.GA4294@adacore.com> References: <20081027004044.GA3907@adacore.com> <20081027141906.GA5009@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081027141906.GA5009@caradoc.them.org> User-Agent: Mutt/1.4.2.2i 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: 2008-10/txt/msg00664.txt.bz2 > I think it should be even higher level than that. The core solib > machinery knows how to stop on load/unload (set stop-on-solib-events). > And it knows how to update the list of loaded libraries based on > current_sos. All that's missing is a 'diff' operation: report which > libraries have been added or removed, so that the common code can > report them sensibly to the user. I'd love if I could replace "set > stop-on-solib-events 1" with "catch load" and have GDB say "Stopped at > load of libfoo.so.1" or "Stopped at load of 6 libraries". The latter > is not as important, since (on svr4 targets) it happens only during > program startup, when the dynamic loader initializes. > > IOW I don't think we need any new breakpoint that we don't already > have. I thought about that too. This would work very well with targets that receive an event (either a breakpoint or a specific notification like on Windows) immediately when a shared library is loaded or unloaded. But I wonder if we might have some targets where this is not the case. It it were the case, the notications would arrive late for these targets. I looked at all the solib-* files, and the only target where that might be the case is Tru64 - init_inferior_hook isn't turning on any event or inserting any shlib breakpoint, and procfs doesn't seem to provide handling for shlib notifications. Perhaps what we could do is error-out if the user tries to insert a catchpoint on load/unload events, then. In any case, looks like there a general agreement to remove the current code... I will do that after I have submitted the changes I made to get rid of bp_catch_exec. -- Joel