From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112664 invoked by alias); 9 Nov 2019 06:23:43 -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 112650 invoked by uid 89); 9 Nov 2019 06:23:42 -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=personal X-HELO: mail-oi1-f194.google.com Received: from mail-oi1-f194.google.com (HELO mail-oi1-f194.google.com) (209.85.167.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Nov 2019 06:23:41 +0000 Received: by mail-oi1-f194.google.com with SMTP id s71so7248677oih.11 for ; Fri, 08 Nov 2019 22:23:41 -0800 (PST) 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=6EjrCHyvXQUudr+cncCFtAaFJamZ5l2/g5XVPsR8mQk=; b=Xd3Qe1zgrfKadJHlo0CXKD4Qzaprjg4K4y6pNCz7hr/i32aCuh94QKdNXu6oC1xL9H rzezmAp+5R7a/DSyVml0pAPP41srvzuCem/gR5r64R8i04LbecbbnNLumhJtgJo7XLVH jJJEed50kpqR3nFCib3xtjW/73djh6xhkUMtPL+kwQcVo+Np637KRaGLGG/OqvgsPI6N lJBidW2qYp7d3hz4JgvFrQ0REQnZrb5UOf1j3nhnKcrhfACkw0FM7oi8IbbSnLwgxifJ Sah6kSU9v/LDHXc5Loi2Q5XYDheNad1+D3Sp6DwL6S1vSa9FW4lvJ0W3vh4KuQmAQBnD wEkQ== MIME-Version: 1.0 References: <20191015141515.GW4962@embecosm.com> <20191015164647.1837-1-andrew.burgess@embecosm.com> <32eba92d-55a9-5694-cec5-80001d8ff1ae@simark.ca> <20191023191354.GH4962@embecosm.com> <20191101115304.GR4962@embecosm.com> <20191104171204.GB11037@embecosm.com> <20093265-f125-8668-d7ba-0c36b07a53ec@simark.ca> In-Reply-To: <20093265-f125-8668-d7ba-0c36b07a53ec@simark.ca> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Sat, 09 Nov 2019 06:23: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-11/txt/msg00251.txt.bz2 On Mon, Nov 4, 2019 at 12:28 PM Simon Marchi wrote: > > On 2019-11-04 12:12 p.m., Andrew Burgess wrote: > > How about I merged patches #1 and #2, but drop #3 for now? This would > > give: > > > > lookup_static_symbol - returns the global static symbol for the > > current compilation unit, or whatever else GDB can find if > > there's nothing in the current CU. This is basically inline > > with what we get from 'print symbol_name' at the CLI (if we > > limit symbol_name to just global static things). > > > > AND, > > > > lookup_static_symbols - returns the list of all global static > > symbols. > > > > We no longer have a block parameter passed to 'lookup_static_symbol', > > so hopefully and confusion can be avoided. If/when we later add a > > Python wrapper for CU we can _extend_ the API for lookup_static_symbol > > to also take a CU and so provide the "look over there" type behaviour > > in a clearer way. > > > > Would everyone be happy with this? > > I certainly would, I think that brings us back to the same place we were before > it was suggested to add the block parameter, doesn't it? Sorry for the late reply & for confusing things -- yes, after reading through all the discussions I think that's the best way forward. My personal use case was & is still addressed, I just wanted a way to find variables like these: https://cs.chromium.org/chromium/src/content/renderer/render_frame_impl.cc?q=g_frame_map&sq=package:chromium&g=0&l=332 (^ in an anonymous namespace) ideally also: https://cs.chromium.org/chromium/src/ui/accessibility/ax_tree_manager_map.cc?type=cs&sq=package:chromium&g=0&l=17 (static variable in a function) But I do have a fallback to gdb.lookup_symbol, so that one works too, though less efficiently. Even with a CU API, this might be difficult (maybe? depending how easy it is to find a specific function from a CU) Christian