From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4165 invoked by alias); 7 Jan 2015 08:55:10 -0000 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 Received: (qmail 4146 invoked by uid 89); 7 Jan 2015 08:55:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f178.google.com Received: from mail-we0-f178.google.com (HELO mail-we0-f178.google.com) (74.125.82.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 07 Jan 2015 08:55:07 +0000 Received: by mail-we0-f178.google.com with SMTP id p10so760461wes.9 for ; Wed, 07 Jan 2015 00:55:04 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.60.19 with SMTP id d19mr3945818wjr.48.1420620903949; Wed, 07 Jan 2015 00:55:03 -0800 (PST) Received: by 10.27.39.198 with HTTP; Wed, 7 Jan 2015 00:55:03 -0800 (PST) In-Reply-To: References: <20150105030431.GE5445@adacore.com> Date: Wed, 07 Jan 2015 08:55:00 -0000 Message-ID: Subject: Re: [RFC] Empty result of "info types inner": Is this a bug? From: Doug Evans To: Joel Brobecker , Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00097.txt.bz2 On Tue, Jan 6, 2015 at 1:44 AM, Doug Evans wrote: > On Sun, Jan 4, 2015 at 7:04 PM, Joel Brobecker wrote: >>> Technically, it's a bug that the first "info types inner" didn't >>> print anything, but is this a bug we're willing to accept for >>> performance reasons? I want to make the case that the answer is "No." >> >> My inclination as well, and you'll probably see in dwarf2read.c >> a few added blocks of code that say "if (ada an some other langs), >> add children into global scope. That was for things such as putting >> a breakpoint on a nested subprogram, for instance. > > For completeness sake, > another way to solve this particular bug is to traverse all the debug > info but not expand every (matching) symtab. > Yeah, it'll be slower, but info var/fun/types doesn't scale, > plus regexp matching means we have to make "o::b" find "foo::bar", > and is it better to try to make that scale, or provide the user with > something else that does scale for the common case(s)? > IOW, what are the common uses > of info var/fun/types and can we require a different argument besides > a simple regex such that the implementation can scale? > [We'd still keep info/var/types, but the implementation, while fixing > the bug under discussion, would not be intended to be fast for > large programs, and nor would it result in significantly increased > memory usage by gdb. I can imagine it just walking all the DWARF > info but not expanding any symtabs.] Heh. I have a sandbox where I've been playing with ways of lazily demangling minsyms (in the background, or just for lookup, or whatever ... it's just a set of experiments, and at least some of which has been looked at before). One thing I found is that even with dwarf debug info there's another scenario where we require minsyms. m-static.exp has this: print 'gnu_obj_1::method()::sintvar'. It's a static local var of method(). That doesn't work without minsyms, even with debug info, because the variable is a static local to a function and thus goes in the function's symtab and not STATIC_BLOCK (as it should, though one could I think instead put in STATIC_BLOCK, not that I'm advocating actually doing that). My current patch to look up a component of a symbol name at a time doesn't handle this case, but it could, it's a straightforward extension, and thus I can make "print 'gnu_obj_1::method()::sintvar'" from m-static.exp work without requiring minsyms - which I like: with debug info we should be falling back to minsyms only when we actually need to. We could instead put function/method static locals in the index(/psyms), but now we're getting into needing to do more detailed reading of function DIEs (and thus now building psyms is getting measurably more expensive), and I didn't plan to go down that road (though I still plan to collect some data on it). Thus even with a more complete index(/psyms table) it'd be useful to have some form of my current patch (I'll submit it sometime soon, pending what the data says). Whether to solve "info types inner" by having it appear in psyms/index then becomes an open question. [The bug in this thread is a proxy for a general class of problems, but it doesn't cover everything. E.g., one could extend "info var" to find/print function static locals. E.g., by traversing the debug info at the time the user invokes info var/fun/types, maybe as an option.]