From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 1AFD03858425; Thu, 10 Nov 2022 16:34:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AFD03858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668098056; bh=zBPGshNNYmQ21FivyD2Vl/04A4HEyaHmbtlgUblK7z8=; h=From:To:Subject:Date:From; b=YW5WCFeObZR057qrECYXEUYlDZQeCEzljw2P5IrZK5WHy9uSaEP/dNM6gQs20ZOcI vabFEIET6AdXqP7C/AKhlTBXPvkzlJlRDIq6ti2z/hUlNv3mZwTLL21dXd7N7e/r50 lvSfzOcTrKXW4S1g8LdrdYmj+rwKBoFhtMEjKg14= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: add missing prepare_reinflate call in print_frame_info X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 45eca9d9f36985672cb2303b4ea0b3c855961c1d X-Git-Newrev: aeba2026b58a8abfc35c390f07bcdaf42728e7b5 Message-Id: <20221110163416.1AFD03858425@sourceware.org> Date: Thu, 10 Nov 2022 16:34:16 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Daeba2026b58a= 8abfc35c390f07bcdaf42728e7b5 commit aeba2026b58a8abfc35c390f07bcdaf42728e7b5 Author: Simon Marchi Date: Fri Oct 21 11:49:44 2022 -0400 gdb: add missing prepare_reinflate call in print_frame_info =20 print_frame_info calls frame_info_ptr::reinflate, but not frame_info_ptr::prepare_reinflate, add the call to prepare_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. =20 Change-Id: Ie332b2d5479aef46f83fdc1120c7c83f4e84d1b0 Reviewed-By: Bruno Larsen Diff: --- gdb/stack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdb/stack.c b/gdb/stack.c index 5f29566fcfe..4ad51c2eb50 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 =3D current_uiout; =20 + frame.prepare_reinflate (); + if (!current_uiout->is_mi_like_p () && fp_opts.print_frame_info !=3D print_frame_info_auto) {