From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id hAJNAnZONWruag8AWB0awg (envelope-from ) for ; Fri, 19 Jun 2026 10:13:10 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=k0J6ufBa; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DFAF81E0A6; Fri, 19 Jun 2026 10:13:09 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 688331E024 for ; Fri, 19 Jun 2026 10:13:08 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D1234BAE7F2 for ; Fri, 19 Jun 2026 14:13:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D1234BAE7F2 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=k0J6ufBa Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by sourceware.org (Postfix) with ESMTPS id A47914BAE7E4 for ; Fri, 19 Jun 2026 14:12:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A47914BAE7E4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A47914BAE7E4 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781878330; cv=none; b=TdfcnHsN4gA3VbbPrGw0/DM2ES0wtRjrlPdv6X67ycdBtnkD06s66QdGGPRxGlzGEHyAo09KUb8zYAuylrX7wpIf2LaxogWAkgVLiQRfmW6hVb4HSLCw8IXohJYG62D0d7nGBa0dL/8bgoE8vZPAFlvNOFqh8ptnP/KEi8Ui5vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781878330; c=relaxed/simple; bh=7ROlkxoD6TdH/aDJJxgBivGAW1IWZUqxHZLeHEj41VE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tks71c/fPA0N9nUUo6YoyWO76m9cduMwoMEEcMyojXk+/oCqL4i7tlzLQoqPoiVaQppefZOHEEWe/aUOKc6+DXCUcqfjyLxME6fazyvGyMGn7iVmHTIONuMBTXroWSfTK+XvWrCAv0q+LbIGY0FEmX+bGvSfzcvea5tGwqdZPko= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=k0J6ufBa DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A47914BAE7E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781878331; x=1813414331; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=7ROlkxoD6TdH/aDJJxgBivGAW1IWZUqxHZLeHEj41VE=; b=k0J6ufBa6iMYj2xsisk+GCJbqNzz/EWBhLogJgI+dTzytkSyyZ+dUv2f EWXb+BHwrWS1mq9FGu2p2pC0A/KzsNmulMcCD76EOWEpDMG1OTZhYL7f5 arv+uLOcWXcLU9dhDwlK1EMnHNlx+fU9FAbV18t80UTZZ9VyACR5nHrL0 6K8xmDLB/ppDLQeVjVOI240iAu3GwFkF3eLGKyklPfFCLhZrxOAljkiGT i1S9IG0rVVeTZR1/Q1IhUV71q6wT4hBEk7QsdRGCNaKL2kVitUMB7Y6lz TJCK80O2pXKW2Wl2X5jjTNnrmpo4TouixWWG+08jtr3LUi2HWHEb8uwnu w==; X-CSE-ConnectionGUID: L7/50qfPQNqfpbr6NXxxDA== X-CSE-MsgGUID: fcQ07VzwRUOcSotftZFR3g== X-IronPort-AV: E=McAfee;i="6800,10657,11821"; a="100156752" X-IronPort-AV: E=Sophos;i="6.24,213,1774335600"; d="scan'208";a="100156752" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2026 07:12:10 -0700 X-CSE-ConnectionGUID: w2w9aN7HTveSN/7xpIoUZw== X-CSE-MsgGUID: N0xy1OSNTTu1pgNLX8HEIA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,213,1774335600"; d="scan'208";a="248692127" Received: from dut1049pvc.igk.intel.com (HELO localhost) ([10.211.177.244]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2026 07:12:09 -0700 From: Stephan Rohr To: gdb-patches@sourceware.org Subject: [PATCH 0/1] gdb: discard saved state on error in recursive infcall Date: Fri, 19 Jun 2026 14:11:59 +0000 Message-ID: <20260619141200.97232-1-stephan.rohr@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: "Rohr, Stephan" Hi all, I came across an issue when we hit a breakpoint in the copy constructor during an infcall. GDB runs a nested 'call_function_by_hand (copy_ctor, ...)' that creates the dummy frame. If we hit a breakpoint inside the ctor, that call raises an error. The parent 'call_function_by_hand_dummy' restores the caller's registers. This works fine until the frame cache is reinitialized, e.g., when switching inferiors. In that case, the unwinder cannot reach the dummy frame anymore and the backtrace command doesn't show the correct frames. I fixed this by not restoring the caller's state and the inferior status on errors inside the nested ctor call. I extended the 'gdb.cp/pass-by-ref-2.exp' testcase to ensure GDB is able to finish the abandoned infcall. Regression tested on Ubuntu 24 with the native target. I appreciate your feedback. Thanks Stephan Rohr, Stephan (1): gdb: discard saved state on error in recursive infcall gdb/infcall.c | 23 +++++++++++++++++++++-- gdb/testsuite/gdb.cp/pass-by-ref-2.exp | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) -- 2.43.0 Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht Muenchen HRB 186928