From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40752 invoked by alias); 21 Oct 2019 22:37:17 -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 40744 invoked by uid 89); 21 Oct 2019 22:37:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.7 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=H*RU:209.85.210.67, HX-Spam-Relays-External:209.85.210.67 X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2019 22:37:16 +0000 Received: by mail-ot1-f67.google.com with SMTP id 53so870614otv.4 for ; Mon, 21 Oct 2019 15:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L0X1evwa2zXUMawDpyOaWQQwCcOAcmTieuIIUuyKTL0=; b=VcmRrkT88fXvrLHNFApNhOiCtGLev9hKfS8XRXZtnJ8op6dIVw7wCi9RZqm1/v9ygt C85eB8U8TSyfxCHCxlUKTXmRZ1GalyzMMWrygLAvMGg31St9wN91LtDxyi524HC6UJZN HYOTm9lyY2YuMuBlAStHTD+lK0d0ZtOWkFVo/hpT2Ev7UAaNBUm8U09FZSUv45VmBsQj AkI6Xflu9fF4I1jNw1AyQOQzUVjS1wGiTRKhK0DRWz7fxOeFU0Ef3qKC+jSvcaCaSM08 V7WwRkbinE913VY1ZVYnBxWYv2RgdoTXOeQonisoum6roXYYF80MQb4tGWtWVbUzzC+E q0/A== MIME-Version: 1.0 References: <20191015141515.GW4962@embecosm.com> <20191015164647.1837-1-andrew.burgess@embecosm.com> <32eba92d-55a9-5694-cec5-80001d8ff1ae@simark.ca> In-Reply-To: <32eba92d-55a9-5694-cec5-80001d8ff1ae@simark.ca> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Mon, 21 Oct 2019 22:37:00 -0000 Message-ID: Subject: Re: [PATCH] gdb/python: Introduce gdb.lookup_all_static_symbols To: Simon Marchi Cc: Andrew Burgess , gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00759.txt.bz2 On Tue, Oct 15, 2019 at 2:28 PM Simon Marchi wrote: > > On 2019-10-15 12:46 p.m., Andrew Burgess wrote: > > If gdb.lookup_static_symbol is going to return a single symbol then it > > makes sense (I think) for it to return a context sensitive choice of > > symbol, that is the static symbol that would be visible to the program > > at that point. > > I remember discussing this with Christian, and I didn't have a strong option. But > now, I tend to agree with Andrew. > > I see two use cases here: > > 1. I want to get all static symbols named `foo`. In which case, I'd use the > function Andrew proposes in this patch. > 2. I want to get the static symbol named `foo` that's visible from a certain > point, perhaps a given block or where my program is currently stopped at. > Ideally, we would have a "CompilationUnit" object type in Python, such that > I could use > > block.compunit.lookup_static_symbol('foo') > > or > > gdb.current_compunit().lookup_static_symbol('foo') So technically, those don't give you "the static symbol named `foo` that's visible from [this] point", because there could be static variable in the function. Since we already have block objects, should this new function optionally take a block to start the lookup in? Either way, I'm happy with this patch; I've come around to y'all's view. Christian