From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10260 invoked by alias); 27 Feb 2019 21:26:43 -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 10237 invoked by uid 89); 27 Feb 2019 21:26:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=somewhere X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Feb 2019 21:26:41 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway31.websitewelcome.com (Postfix) with ESMTP id BCDDC1ECC10 for ; Wed, 27 Feb 2019 15:25:42 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id z6hyg9rcodnCez6hyg6851; Wed, 27 Feb 2019 15:25:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=zYchsZB7zCXLeGjOdRiqPDE/74vuMvPFsvccVNVW7Bw=; b=UT4HES3KSZcE6VeRJHvH/o/pDt RkBHg0bwHTbUlWDbRHThHTy5AsJ55uIG/ZbAn2dzm4nugbPnuJ1Hthab9O8poxWqRxMnsrpl+GbXy EtzZW35u88qs7zRztZ4KQBY0t; Received: from 75-166-85-218.hlrn.qwest.net ([75.166.85.218]:42242 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gz6hy-0006JD-Hq; Wed, 27 Feb 2019 15:25:42 -0600 From: Tom Tromey To: "Hannes Domani via gdb" Cc: Hannes Domani Subject: Re: question about expand_symtabs_matching() References: <948301287.10289911.1551297622910.ref@mail.yahoo.com> <948301287.10289911.1551297622910@mail.yahoo.com> Date: Wed, 27 Feb 2019 21:26:00 -0000 In-Reply-To: <948301287.10289911.1551297622910@mail.yahoo.com> (Hannes Domani via gdb's message of "Wed, 27 Feb 2019 20:00:22 +0000 (UTC)") Message-ID: <87fts82aay.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 X-SW-Source: 2019-02/txt/msg00079.txt.bz2 SGFubmVzPiBUaGlzIGlzIHByb2JhYmx5IGEgc3R1cGlkIHF1ZXN0aW9uLg0K DQpOb3QgYXQgYWxsLg0KDQpIYW5uZXM+IEluIGdkYi9saW5lc3BlYy5jOjEx NDYgaXMgdGhpcyBjYWxsOg0KSGFubmVzPiDCoMKgwqDCoMKgIGlmIChvYmpm aWxlLT5zZikNCkhhbm5lcz4gwqDCoMKgwqDCoMKgwqAgb2JqZmlsZS0+c2Yt PnFmLT5leHBhbmRfc3ltdGFic19tYXRjaGluZyAob2JqZmlsZSwNCkhhbm5l cz4gwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC oMKgwqDCoMKgwqAgTlVMTCwNCkhhbm5lcz4gwqDCoMKgwqDCoMKgwqDCoMKg wqDCoMKgwqDCoMKgwqDCoMKgwqDCo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FkIGEgbmV3IGxvY2F0aW9uIGZvciBhbiBleGlzdGluZyBi cmVha3BvaW50Lg0KDQpUb20NCg== >From gdb-return-46872-listarch-gdb=sources.redhat.com@sourceware.org Wed Feb 27 21:46:53 2019 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 62722 invoked by alias); 27 Feb 2019 21:46:53 -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 Delivered-To: mailing list gdb@sourceware.org Received: (qmail 62689 invoked by uid 89); 27 Feb 2019 21:46:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=anytime, H*c:PHrt, H*c:alternative, H*x:5.0 X-HELO: sonic307-7.consmr.mail.ir2.yahoo.com Received: from sonic307-7.consmr.mail.ir2.yahoo.com (HELO sonic307-7.consmr.mail.ir2.yahoo.com) (87.248.110.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Feb 2019 21:46:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1551304008; bh=Rt9o9YlN/GUxDk5NZM8ADemsZwjHniRbTp5pGwBEPec=; h=Date:From:To:Subject:References:From:Subject; b=iSZhOk06sw0LjRq5fpO9fjlBHIUsbK0jEz5YFj55p1XWwEsU9uKU8OTeIutjG3w/JgZZ2DvyhqXJjzL0xIncxTpsWIGun6naQ3tOzZ3hm63rodEjzBD0EX7TGQ9TEfo0pcLM9pr9X8wAyO9bbW3RBrUlLJF9PA5PxGIjlSeayGUF6p8/nzdJcX46WHNXdrh7V1P40MblG2ykEK7QI7Lk5pZ1JBpoYUsv89nj0jkAIYKiKqZMImOB3lUfKXRBFjUTMVgLLfbaSsDk5YXPcj8GPSYzQaQELkrvgSj65nymkgx2Jm9vmorebYD3Bf/kReqzmzv6UeYRcUyo2WkeC+NPAA== Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ir2.yahoo.com with HTTP; Wed, 27 Feb 2019 21:46:48 +0000 Date: Wed, 27 Feb 2019 21:46:00 -0000 From: "Hannes Domani via gdb" Reply-To: Hannes Domani To: GDB Development Message-ID: <183519794.10360727.1551304006549@mail.yahoo.com> Subject: Re: question about expand_symtabs_matching() MIME-Version: 1.0 References: <183519794.10360727.1551304006549.ref@mail.yahoo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00080.txt.bz2 Content-length: 3567 Am Mittwoch, 27. Februar 2019, 22:25:52 MEZ hat Tom Tromey = Folgendes geschrieben: > Hannes> This is probably a stupid question. >=20 > Not at all. Thanks for the fast reply. > Hannes> In gdb/linespec.c:1146 is this call: > Hannes>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (objfile->sf) > Hannes>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 objfile->sf->qf->= expand_symtabs_matching (objfile, > Hannes>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 NULL, > Hannes>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 lookup_name, > Hannes>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 NULL, NULL, > Hannes>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 search_domain); > Hannes> What exactly is this call doing, since none of the 3 callback fun= ctions is used? >=20 > gdb first scans debug symbols to create "partial symbol tables" (or in > some cases it uses the "gdb index"). >=20 > These don't contain much information, so in order to actually do much > with the symbols, the relevant psymtabs must be expanded into full > symbol tables. >=20 > This call is expanding all the partial symbol tables that match > lookup_name and search_domain.=C2=A0 The loop that comes after this actua= lly > does the work of the function, by looking only at expanded symbol > tables. >=20 > Hannes> This is slowing gdb down quite a lot if you have pending breakpoi= nts, and are > Hannes> loading/unloading many shared libraries. >=20 > Yeah.=C2=A0 gdb does too much work when re-evaluating breakpoint location= s. >=20 > For example, it seems to me that when re-evaluating a breakpoint > location, there's no reason to search an objfile again -- the results > can't have changed.=C2=A0 There are various ways this could be tackled bu= t I > suppose the basic idea is to cache the results somewhere. Yeah, I was wondering about that too, anytime a library is loaded all is re= done from scratch. And in case a shared library is unloaded, I would have thought that you cou= ld just removeall breakpoints in the address range of the shared library. > Hannes> When I removed it, I couldn't see any different behavior (other t= han being faster). >=20 > I think it would make a difference if the inferior dlopen()d a library > and the library had a new location for an existing breakpoint. I think I understand now basically why this is done. What if I have a simple breakpoint like 'break some-file.c:123', is there e= ven any symbol that can be expanded with expand_symtabs_matching()? RegardsHannes Domani