From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28976 invoked by alias); 12 Oct 2011 16:16:05 -0000 Received: (qmail 28964 invoked by uid 22791); 12 Oct 2011 16:16:02 -0000 X-SWARE-Spam-Status: No, hits=-1.4 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; Wed, 12 Oct 2011 16:15:49 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RE1T8-0005Xh-NS from pedro_alves@mentor.com ; Wed, 12 Oct 2011 09:15:46 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 12 Oct 2011 17:15:44 +0100 From: Pedro Alves To: Gary Benson Subject: Re: [commit] Improve performance with lots of shared libraries Date: Wed, 12 Oct 2011 16:16:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <20110922171206.GB5874@redhat.com> <201110111753.27321.pedro@codesourcery.com> <20111012155918.GA4216@redhat.com> In-Reply-To: <20111012155918.GA4216@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201110121715.42088.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/msg00363.txt.bz2 On Wednesday 12 October 2011 16:59:18, Gary Benson wrote: > Pedro Alves wrote: > > To make this generic for all breakpoints/stops, what I have in mind > > would be: > > > > - at breakpoint creation or re-set time, check if the locations > > we've created point at inlined code, and set a flag in the > > breakpoint's locations. We know the location is inlined or not > > from the debug info. Breakpoint creation is the slow path, so > > that's okay. > > > > - given that we need to single-step over those breakpoints, we also > > need to know whether the PC after stepping over those breakpoints > > points at inlined code. I think we can still do that at > > breakpoint creation or re-set time. We'd need to reuse the > > software single-step machinery to know where the single-step > > would take us, and record somewhere that those locations point to > > inline code or not. We'd also check this list in > > stopped_at_non_inline_function. The software single-step > > machinery would need some cleaning up to make this possible. > > It's interface, gdbarch_software_single_step, isn't fit for this. > > The gdbarch hook should return a list of locations where to put > > the breakpoint, instead of implementations planting the > > breakpoints themselves, which would be a nice cleanup for other > > things too. We'd also need to implement this hook for x86. It's > > not implemented currently because x86 can do hardware > > single-stepping. > > Ah, nice! Would it be appropriate to file a bug containing this > information? So it doesn't get lost before I have a chance to work > on it? Sure! What I haven't thought about much is whether this optimization would be indeed a general win. :-) It'd make a difference if you tend to have planted breakpoints that don't cause a stop often (e.g., some python breakpoint), and maybe it'd make a difference on software single-step targets, and a tiny bit on handling step-resume breakpoints on hardware step targets? I don't have a clear picture where time is being spent (other than roundtripping to the target). Thread event breakpoints sound like low hang fruit though. -- Pedro Alves