From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83467 invoked by alias); 21 Dec 2017 22:24:38 -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 77650 invoked by uid 89); 21 Dec 2017 22:24:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_05,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=0x405ece, sk:gdb-pyt, 47916564, test_procs X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Dec 2017 22:24:25 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id vBLMOFdw022702 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 21 Dec 2017 17:24:20 -0500 Received: by simark.ca (Postfix, from userid 112) id A5D081E59F; Thu, 21 Dec 2017 17:24:15 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 512551E037; Thu, 21 Dec 2017 17:24:04 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 21 Dec 2017 22:24:00 -0000 From: Simon Marchi To: Roman Popov Cc: gdb@sourceware.org Subject: Re: Python API: Getting symbol by address In-Reply-To: References: Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 21 Dec 2017 22:24:15 +0000 X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00014.txt.bz2 On 2017-12-21 13:20, Roman Popov wrote: > Hello, > I have collection in C++ that stores pointers to functions and methods. > I > want to pretty-print pointed method and functions names. > > It is possible using GDB shell, for example: > > (gdb) info symbol 0x405ece > > top::test_thread() in section .text of test_procs > > > However I found no way to do the same using Python API. Why such > limitation? > > P/S Same question on stackoverflow : > https://stackoverflow.com/questions/47916564/gdb-python-api-getting-symbol-name-from-address > > Thanks, > Roman Hi Roman, As most things in the Python API (and GDB in general), it's likely because no one took the time to do it. I don't see any technical reason not to have it. If you take a shot at writing a patch for this, feel free to ask if you are blocked. Thanks, Simon