From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24456 invoked by alias); 12 Jan 2012 04:30:29 -0000 Received: (qmail 24218 invoked by uid 22791); 12 Jan 2012 04:30:25 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,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; Thu, 12 Jan 2012 04:30:10 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3F2D22BB265; Wed, 11 Jan 2012 23:30:10 -0500 (EST) 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 QDxiCgEv3lGl; Wed, 11 Jan 2012 23:30:10 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C457B2BB263; Wed, 11 Jan 2012 23:30:09 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A49D9145615; Thu, 12 Jan 2012 08:29:46 +0400 (RET) Date: Thu, 12 Jan 2012 05:59:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: hacky fix for PR 12406 Message-ID: <20120112042946.GM31383@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 2012-01/txt/msg00394.txt.bz2 > This patch changes the output to: > > (gdb) set stop-on-solib-events 1 > (gdb) r > Starting program: /tmp/q > [Inferior loaded library /lib64/ld-linux-x86-64.so.2] > Stopped due to shared library event > > I could not find a good way to get the information about what library > was loaded from the library-loading code to the bpstat_print code. This > approach seems like a hack to me -- so I was wondering if anyone has a > better suggestion. Yeah, it doesn't look super great, but it is better than nothing, IMO. It looks a lot easier to implement this on platforms that use TARGET_WAITKIND_LOADED events, because we could associate the library name to the target_waitstatus value. For other platforms where this is based on a breakpoint rather than a kernel event, on the other hand... I'm not even convinced that we'll get one breakpoint per shared library being mapped. Particularly at startup time, I can see us hitting one breakpoint once all SOs have been mapped, and not before. If it were the case, attaching one shared-library event per breakpoint event does not seem to make sense. An idea that crossed my mind: Add a flag to each entry in our SO list. Everytime we stop, we use that flag to determine which entries are new. We can probably use something like the normal-stop hook to set the flag just before giving the prompt back to the user. Would that work? It would support the situation I mentioned above where we get one breakpoint event for multiple shared libraries... -- Joel