From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 4DE3D3858D28 for ; Wed, 3 Nov 2021 20:35:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4DE3D3858D28 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miMyS-0002ev-FH for gdb@sourceware.org; Wed, 03 Nov 2021 16:35:08 -0400 Received: from ip5f5a8d68.dynamic.kabel-deutschland.de ([95.90.141.104]:61165 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miMyS-00047i-7G for gdb@sourceware.org; Wed, 03 Nov 2021 16:35:08 -0400 Subject: Re: How to get the full source location of a frame via python To: gdb@sourceware.org References: <60c53fa8bf160533a2eddf1da280eb50c7461a6a.camel@fit.cvut.cz> <6c506574eb7c0464d70421e4ec23c499b5c6a41e.camel@fit.cvut.cz> From: Simon Sobisch Message-ID: Date: Wed, 3 Nov 2021 21:35:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <6c506574eb7c0464d70421e4ec23c499b5c6a41e.camel@fit.cvut.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2021 20:35:10 -0000 Am 03.11.2021 um 21:07 schrieb Jan Vrany: > On Wed, 2021-11-03 at 17:31 +0100, Simon Sobisch via Gdb wrote: >> [...] >> Questions: >> Is there a direct way to get the full source location for a frame? > > By glancing at the code, it seems to me that using > > st.fullname() # instead of st.filename > > should return the path printed by `info source`. Both return > fullname member from struct symtab* IIUC. > > Did you try `fullname()`? > > Jan No, I overlooked this and feel a bit embarrassed as it is in the documentation. Works perfectly fine, both with old GDB 7.6+Python2.7 and with current GDB + Python - thank you Jan!