From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GefkGPI8lGDXKwAAWB0awg (envelope-from ) for ; Thu, 06 May 2021 15:01:06 -0400 Received: by simark.ca (Postfix, from userid 112) id 53E9C1F11C; Thu, 6 May 2021 15:01:06 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A86ED1E54D for ; Thu, 6 May 2021 15:01:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 03911388F030; Thu, 6 May 2021 19:01:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03911388F030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620327665; bh=2iPLtizOpN3SYRQasSoBMvMNnFxVHrVGAn5ZABiLOJ0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=D499jdq1mBIRRvl0nmGorVjsOGFxDwmyYQI4fAOaRlTaqCX/Zm57ExCSNmb3Lb+TF kJbhCz1u6gJjp7U9+4eYV3IYA8W5Vlh+WOKtF5YLwGGs4jaAZ6wBKLBJDIEZ5VbFLi fAEUckWUaO6BkG3A+jppJY1J09Kcd08ymZDvQi/w= 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 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-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: , From: Simon Sobisch via Gdb Reply-To: Simon Sobisch Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" 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