From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12877 invoked by alias); 1 Jul 2011 17:57:14 -0000 Received: (qmail 12867 invoked by uid 22791); 1 Jul 2011 17:57:13 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SARE_SUB_IMPROVE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 17:56:59 +0000 Received: (qmail 16913 invoked from network); 1 Jul 2011 17:56:58 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Jul 2011 17:56:58 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] Improve performance with lots of shared libraries Date: Fri, 01 Jul 2011 17:57:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.2; x86_64; ; ) Cc: Gary Benson References: <20110701165109.GA3399@redhat.com> <201107011845.01404.pedro@codesourcery.com> In-Reply-To: <201107011845.01404.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201107011856.56157.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-07/txt/msg00033.txt.bz2 On Friday 01 July 2011 18:45:01, Pedro Alves wrote: > I'd rather a split in two different chunks/concepts, as per > your description of the problem: > > 1 - find_pc_partial_function is expensive, and as such we should > only call it when necessary. Can we somehow only do this: > > > /* Don't care about return value; stop_func_start and stop_func_name > > will both be 0 if it doesn't work. */ > > find_pc_partial_function (stop_pc, &ecs->stop_func_name, > > &ecs->stop_func_start, &ecs->stop_func_end); > > ecs->stop_func_start > > += gdbarch_deprecated_function_start_offset (gdbarch); > > bit when necessary, rather than listing some special > cases when it is not necessary? That is, make that bit > a bit more lazy. E.g, it looks like stops for > BPSTAT_WHAT_STOP* never need that info. (beware of places > that pass the ecs down as argument to some function that > ends up using those fields). Reading back, I may have not been clear --- I'm not asking to come up with conditions to whitelist these call under, but rather to move that bit to a new function, like: static void stop_func_info (struct execution_control_state *ecs) { /* Don't care about return value; stop_func_start and stop_func_name will both be 0 if it doesn't work. */ find_pc_partial_function (stop_pc, &ecs->stop_func_name, &ecs->stop_func_start, &ecs->stop_func_end); ecs->stop_func_start += gdbarch_deprecated_function_start_offset (gdbarch); } and then call that function a bit further down, e.g., in the BPSTAT_WHAT_STEP_RESUME case; where it reads: /* When stepping backward, stop at beginning of line range (unless it's the function entry point, in which case keep going back to the call point). */ where it reads "Check for subroutine calls.", etc. -- Pedro Alves