From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28682 invoked by alias); 5 Apr 2012 18:37:12 -0000 Received: (qmail 28673 invoked by uid 22791); 5 Apr 2012 18:37:11 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Apr 2012 18:36:57 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q35IauCi004078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Apr 2012 14:36:56 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q35IatDO017470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 5 Apr 2012 14:36:55 -0400 From: Tom Tromey To: Siva Chandra Cc: Doug Evans , gdb-patches@sourceware.org Subject: Re: [RFC - Python Scripting] New method Objfile.symtabs () - docs included References: Date: Thu, 05 Apr 2012 18:37:00 -0000 In-Reply-To: (Siva Chandra's message of "Tue, 3 Apr 2012 11:24:34 +0530") Message-ID: <87limaf2k8.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2012-04/txt/msg00078.txt.bz2 >>>>> "Siva" == Siva Chandra writes: Siva> For the memory problem you point out, do you think something like Siva> Objfile.symtabs (regex, [symbol_type]) would be good? REGEX is a file Siva> name matcher to specify that only those symtabs whose source file Siva> names match the REGEX should be loaded, and SYMBOL_TYPE is to specify Siva> that only symbols of this kind should be loaded. This can still be Siva> abused to match everything and load everything, but it is at the Siva> user's own peril. I think this proposed API mixes symtab- and symbol-level operations. The file name is a property of a symtab, but the symbol type is a property of the symbol. There's presently no way in gdb to load just part of a symtab. CUs are always fully instantiated. This could be changed -- I think it is a good idea with more than one concrete benefit -- but it doesn't exist now. How about just the plain Objfile.iterator(REGEX)? It would return an iterator that lazily instantiates symtabs. (Or, at least conceptually lazily instantiates them, as it isn't clear that this is efficiently implementable with the current quick_symbol_functions API.) Tom