From patchwork Mon Nov 7 15:53:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 60116 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C4BF385841E for ; Mon, 7 Nov 2022 16:03:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C4BF385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667836983; bh=QZCtB6Y2wJflJJwIlMc2nOYrSx4IhOFBBw43yAk5Xjk=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=I8ge2BdwObhuLJxtSwl9xYqjZybpiThxDLKEnyuLOZLQeARWjBedhNtyJ84OSp3Ru BENNP4oPAttGAnUoy0Xz47izW9MvedlcquTxQXjnKC7mm5wdevRMjgqk7hqhn/A1eN +pxQi7QFtkEoVK1qJy6WbNlu6v7MIazoLZBp5Qbg= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 28F163858C33 for ; Mon, 7 Nov 2022 16:02:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28F163858C33 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 2A7G2CMU028380 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 7 Nov 2022 11:02:17 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 2A7G2CMU028380 Received: from simark.localdomain (unknown [217.28.27.60]) (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 ESMTPSA id 463591E129; Mon, 7 Nov 2022 10:53:12 -0500 (EST) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 6/7] gdb: add missing prepare_reinflate call in print_frame_info Date: Mon, 7 Nov 2022 10:53:09 -0500 Message-Id: <20221107155310.2590069-6-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221107155310.2590069-1-simon.marchi@polymtl.ca> References: <20221107155310.2590069-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 7 Nov 2022 16:02:12 +0000 X-Spam-Status: No, score=-3189.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" print_frame_info calls frame_info_ptr::reinflate, but not frame_info_ptr::prepare_reinflate, add the call to reinflate. It works right now, because all callers of print_frame_info that could possibly lead to the pretty printers being called, and the frame_info objects being invalidated, do call prepare_reinflate themselves. And since the cached frame id is copied when passing a frame_info_ptr by value, print_frame_info does have a cached frame id on entry. So technically, this change isn't needed. But I don't think it's good for a function to rely on its callers to have called prepare_reinflate, if it intends to call reinflate. Change-Id: Ie332b2d5479aef46f83fdc1120c7c83f4e84d1b0 Reviewed-By: Bruno Larsen --- gdb/stack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdb/stack.c b/gdb/stack.c index 5f29566fcfe9..4ad51c2eb50e 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1047,6 +1047,8 @@ print_frame_info (const frame_print_options &fp_opts, int location_print; struct ui_out *uiout = current_uiout; + frame.prepare_reinflate (); + if (!current_uiout->is_mi_like_p () && fp_opts.print_frame_info != print_frame_info_auto) {