From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24193 invoked by alias); 7 Oct 2011 15:02:17 -0000 Received: (qmail 23836 invoked by uid 22791); 7 Oct 2011 15:02:15 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_SUB_IMPROVE X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Oct 2011 15:02:01 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RCBw0-0005Uu-DP from pedro_alves@mentor.com ; Fri, 07 Oct 2011 08:02:00 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 7 Oct 2011 16:01:58 +0100 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: PING: [RFA] Improve performance with lots of shared libraries Date: Fri, 07 Oct 2011 15:02:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: Gary Benson References: <20110922171206.GB5874@redhat.com> <20111004102517.GA2679@redhat.com> In-Reply-To: <20111004102517.GA2679@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201110071601.57025.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: 2011-10/txt/msg00201.txt.bz2 Hi Gary, On Tuesday 04 October 2011 11:25:18, Gary Benson wrote: > 2011-09-22 Gary Benson > > * infrun.c (stopped_at_solib_event_breakpoint): New function. > (stopped_at_solib_event_breakpoint_helper): Likewise. > (handle_inferior_event): Avoid calling skip_inline_frames > when at the solib event breakpoint. > > diff --git a/gdb/infrun.c b/gdb/infrun.c > index 225034c..2e49470 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -3102,6 +3102,39 @@ fill_in_stop_func (struct gdbarch *gdbarch, > } > } > > +/* Helper for stopped_at_solib_event_breakpoint. */ > + > +static int > +stopped_at_solib_event_breakpoint_helper (struct breakpoint *b, void *arg) As I mentioned before, better would for this to be a property/function of the breakpoint itself (and its locations) -- meaning "I am / am not an inlined location". There's no reason to limit this just to the solib event breakpoint. An obvious example without even that generalization is the thread event breakpoint. Even if you don't do that, please add this new function (that checks whether we stopped at an address that can't be inlined) to breakpoint.c instead, and call it `stopped_at_non_inline_function' or something along those lines. We can later rework its internals keeping its interface. > +{ > + struct execution_control_state *ecs > + = (struct execution_control_state *) arg; > + You need to check that the breakpoint is enabled and installed. > + if (b->type == bp_shlib_event) > + { > + CORE_ADDR prev_pc = ecs->event_thread->prev_pc; > + struct bp_location *loc; > + > + for (loc = b->loc; loc; loc = loc->next) > + { > + if (loc->pspace == current_program_space > + && (loc->address == stop_pc || loc->address == prev_pc)) I don't follow the prev_pc check. What does that intend to do? When working in the direction of matching from an event back to our tables and symbolic info, you start from the address_space instead. Get at the address space of the current PC using `get_regcache_aspace (get_thread_regcache (ecs->ptid))'. But better yet, since you'd end up rewritting bkpt_breakpoint_hit, it's better instead to reuse bpstat_check_location (despite the name, it doesn't work with a bpstat). See bpstop_status->bpstat_check_location->bkpt_breakpoint_hit, and factor out the necessary bits. -- Pedro Alves