From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.148.2]) by sourceware.org (Postfix) with ESMTPS id 97426385740D for ; Mon, 10 May 2021 16:38:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 97426385740D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 08B562C411 for ; Mon, 10 May 2021 11:38:36 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id g8vTlrDUiAEP6g8vTlsEm0; Mon, 10 May 2021 11:38:36 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zESF1/m2wXRqse8ZxNRVQ0msQ4nOptGGlC3DeOElOe0=; b=b4b0OP8enqVQjM3y4FbqEm4ilW W7RnQIpH5JQN6x8l5VVVwneHXKx4S4cyhOrBGO5500nNqyzWkZk75MIoxwB/Lcnb5/GC08e12nPYm pMEwJk4KXwnyI4WuTOZ8KZn0X; Received: from 75-166-134-27.hlrn.qwest.net ([75.166.134.27]:40064 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lg8vT-0024QW-Ka; Mon, 10 May 2021 10:38:35 -0600 From: Tom Tromey To: Simon Sobisch via Gdb Cc: Simon Sobisch Subject: Re: debugging coredumps with the help of libraries (for example to pretty-print) References: X-Attribution: Tom Date: Mon, 10 May 2021 10:38:34 -0600 In-Reply-To: (Simon Sobisch via Gdb's message of "Thu, 6 May 2021 21:00:58 +0200") Message-ID: <877dk68rxx.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.134.27 X-Source-L: No X-Exim-ID: 1lg8vT-0024QW-Ka X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-134-27.hlrn.qwest.net (murgatroyd) [75.166.134.27]:40064 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3023.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=no 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: Mon, 10 May 2021 16:38:40 -0000 >>>>> "Simon" == Simon Sobisch via Gdb writes: Simon> But when I now create a core-dump (gcore dumpfile) and then start gdb Simon> with to debug that I see the full state and local variables - but none Simon> of those pretty printers work, resulting in "You can't do that without Simon> a process to debug." messages. These are also somewhat dangerous to use. I think there have been reports of gdb crashes when calling inferior functions from pretty-printers. So, normally I recommend against doing this kind of thing; though if it works for you, great. It's possible some code in the Python layer isn't careful about using frame-ids instead of frames. That would cause bugs. Also inferior calls can cause other threads to run, which can be super confusing. Simon> Is it possible to let GDB itself load the libraries and pass resolve Simon> the string values that way (or somehow start a "new" process along Simon> with the coredump only for letting it print the values from the Simon> coredump data)? There was a old wish list item to resurrect a core file and turn it into a running process. Maybe this is possible, maybe not. As far as I know, nobody has ever really tried. Anyway, it doesn't exist, so the current answer is 'no'. Simon> If not then it is either "disable the pretty printing when a coredump Simon> is processed" [what is the best check for that in a python extension Simon> btw?] or try to re-implement the string function completely in python. I would normally just reimplement it in Python. Tom