Message ID | 20221107155310.2590069-6-simon.marchi@polymtl.ca |
---|---|
State | Committed |
Commit | aeba2026b58a8abfc35c390f07bcdaf42728e7b5 |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 <patchwork@sourceware.org>; 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 <gdb-patches@sourceware.org>; 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 <simon.marchi@polymtl.ca> 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 Content-Transfer-Encoding: 8bit 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Simon Marchi <simon.marchi@polymtl.ca> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
[1/7] gdb: clear other.m_cached_id in frame_info_ptr's move ctor
|
|
Commit Message
Simon Marchi
Nov. 7, 2022, 3:53 p.m. UTC
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 --- gdb/stack.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
On 07/11/2022 16:53, Simon Marchi via Gdb-patches wrote: > 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. oops, my bad. Looks simple enough: Reviewed-By: Bruno Larsen <blarsen@redhat.com>
On Mon, Nov 07, 2022 at 10:53:09AM -0500, Simon Marchi via Gdb-patches wrote: > print_frame_info calls frame_info_ptr::reinflate, but not > frame_info_ptr::prepare_reinflate, add the call to reinflate. It works Did you mean "add the call to prepare_reinflate" instead? Best, Lancelot. > 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 > --- > 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) > { > -- > 2.38.1 >
On 11/8/22 06:31, Lancelot SIX wrote: > On Mon, Nov 07, 2022 at 10:53:09AM -0500, Simon Marchi via Gdb-patches wrote: >> print_frame_info calls frame_info_ptr::reinflate, but not >> frame_info_ptr::prepare_reinflate, add the call to reinflate. It works > > Did you mean "add the call to prepare_reinflate" instead? Indeed, thanks. Simon
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) {