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 966DD388F030 for ; Thu, 6 May 2021 19:01:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 966DD388F030 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53098) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lejF8-0007WN-5O for gdb@sourceware.org; Thu, 06 May 2021 15:01:02 -0400 Received: from ip5f5a8a3c.dynamic.kabel-deutschland.de ([95.90.138.60]:59237 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lejF5-00064P-R3 for gdb@sourceware.org; Thu, 06 May 2021 15:01:01 -0400 To: gdb@sourceware.org From: Simon Sobisch Subject: debugging coredumps with the help of libraries (for example to pretty-print) Message-ID: Date: Thu, 6 May 2021 21:00:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Thu, 06 May 2021 19:01:03 -0000 I currently think there is no way, but before "giving up" I've wanted to double-check, maybe I've missed something. To pretty-print some data types it seems quite feasible to use whatever library handles the typedefs normally and use its string functions to get the developer-view of the data and let gdb output that. And this actually works quite well, just `gdb.execute("call libfunc(...)") and you're done. But when I now create a core-dump (gcore dumpfile) and then start gdb with to debug that I see the full state and local variables - but none of those pretty printers work, resulting in "You can't do that without a process to debug." messages. Is it possible to let GDB itself load the libraries and pass resolve the string values that way (or somehow start a "new" process along with the coredump only for letting it print the values from the coredump data)? If not then it is either "disable the pretty printing when a coredump is processed" [what is the best check for that in a python extension btw?] or try to re-implement the string function completely in python. Note: I actually can also change the library in question if that helps, but I'd (also) be interested to know the answer of this question in general. Any hints welcome, Simon Sobisch