From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113264 invoked by alias); 1 Mar 2019 18:30:35 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 112241 invoked by uid 89); 1 Mar 2019 18:30:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=obscure, Hx-languages-length:2006, experiment, personally X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Mar 2019 18:30:27 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 5548D87673A for ; Fri, 1 Mar 2019 12:30:24 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id zmvPgak9wYTGMzmvPgrCOg; Fri, 01 Mar 2019 12:30:24 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JMTepU0zEE3+crKGnN/iCwXnVN3pIr3z7yPjGU+LgJc=; b=Rg/KnqaQJmPRVD+ySz43tVa5b9 ax4eka9aPYttin0h9VsiZTg0XH8xkZKLVCaIg+4AXcQrVhxeIYfj4yC+ohtwf3ktlFQU2FCJT4tq7 sE0j/xmkKnPGW4wDdEOdQvk/F; Received: from 75-166-85-218.hlrn.qwest.net ([75.166.85.218]:33504 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gzmvP-001YZC-0A; Fri, 01 Mar 2019 12:30:23 -0600 From: Tom Tromey To: Cc: Hannes Domani Subject: Re: question about expand_symtabs_matching() References: <183519794.10360727.1551304006549.ref@mail.yahoo.com> <183519794.10360727.1551304006549@mail.yahoo.com> <87h8copz0d.fsf@tromey.com> <1428427467.10799860.1551353565332@mail.yahoo.com> Date: Fri, 01 Mar 2019 18:30:00 -0000 In-Reply-To: <1428427467.10799860.1551353565332@mail.yahoo.com> (Hannes Domani via gdb's message of "Thu, 28 Feb 2019 11:32:45 +0000 (UTC)") Message-ID: <87lg1yh2gx.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-03/txt/msg00001.txt.bz2 Tom> Nope, but then again it isn't called in this scenario; at least not if Tom> "some-file.c" exists. Hannes> I should have clarified that I'm currently investigating why Hannes> *pending* breakpoints slow down gdb so much. Ok. It's been a while, but IIRC in some cases linespec can't decide how to parse a given string until it has seen some match. So, sometimes re-setting pending breakpoint can be more expensive. For example I think gdb can't tell the difference between "break filename:function" and "break function:label". This is addressed by the "explicit locations" work, though I don't think this work extends all the way to fine-grained breakpoint re-setting. Personally I'd be fine with changing the syntax of the more obscure linespecs ("function:label" is probably not used much in practice) in order to make the parsing more sane, if it had a performance benefit here. But that's just me. Also, a negative result is still a parse result; so if a linespec understood which objfiles had been searched, it could still easily skip this work on dlopen or dlclose. Hannes> Similar, for the case of a simple function name as pending breakpoint, Hannes> it's cp_canonicalize_string_no_typedefs() called by find_linespec_symbols(), Hannes> that's taking most of the time. Hannes> And I'm wondering if this call is necessary if you only use the function name Hannes> without arguments (like 'function' or Class::member_function). I doubt it's needed but on the other hand it may not really save much. Maybe one way to do the experiment is check the string for non-identifier characters before trying to canonicalize it. Hannes> If you are interested, I could also send you the profiling flamegraphs. It's an area I'm interested in but I'm not actively working there right now. If you're interested at all in gdb development ... on the one hand tackling linespec caching is maybe a difficult project, but on the other hand it seems fun :-) Tom