From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uT4SBvBKAGtjQSQAWB0awg (envelope-from ) for ; Fri, 20 Nov 2026 08:28:16 -0500 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=D118mJMz; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=selector1 header.b=jGAMq1mT; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 134D51E091; Fri, 20 Nov 2026 08:28:16 -0500 (EST) 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,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 611611E091 for ; Fri, 20 Nov 2026 08:28:14 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E6A94371A33 for ; Fri, 20 Nov 2026 13:28:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E6A94371A33 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=D118mJMz; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=selector1 header.b=jGAMq1mT Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by sourceware.org (Postfix) with ESMTPS id CC9944371A37 for ; Fri, 20 Nov 2026 13:27:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC9944371A37 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 CC9944371A37 Authentication-Results: sourceware.org; arc=fail smtp.remote-ip=198.175.65.15 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1795181259; cv=fail; b=ekmczHh0kDlwbYCVoShEAFXGiuZ31xEEtwPrINafb/a0qoAeI+Pp/gb72x4moIOet6hKB7ooeeofDtTy8aOkjjXE8xuF6t07JpeZxp5wNI8xPAw7GCVWPbCNbp2ER6kCXJQ3pQzskeJSNCf0tfoZlgLHnu7RzSYSifwTQ/UpIDI= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1795181259; c=relaxed/simple; bh=DwsM4I17U6dnkFza4jDTo7lMX0n0G6C3vi6TEAUhFJg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=xbJFJ3HY3Lf2LD5AbIMgArIo+0ycbPLfaAzMvFSpbU2NXdglGyTR0a638otC+GZJSsKfbQj0tn3JkpnMYTpyvV4cDbf7m7uFoipo3L6ZVVFDU/KzRsTLxDYgWaSxXmUU/v+6YNfcxYggIv27bn+tn3RJnuXqxa1tlAX04C8f/hc= ARC-Authentication-Results: i=2; 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=D118mJMz; dkim=fail (1024-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=selector1 header.b=jGAMq1mT reason="signature verification failed" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC9944371A37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1795181259; x=1826717259; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=DwsM4I17U6dnkFza4jDTo7lMX0n0G6C3vi6TEAUhFJg=; b=D118mJMz1qa/15rk7KQ+GyEG+0pumhWo2h0mULldOm/dQEbYcRSZ0vC2 a6zkFpVMhBECpFOydMYP5sXVtEnesP5RvWqLrAXzu9bGp2U48V/IQVv3G +qyWZi8Ne/Mnl+tYdHJaMJzPqwKv8HqlSttprV4xlkVqNRll/BK3rCcgg sk+/eOFe8YedJ6ZG9mlPgbNIrm6PrmEA6ulWWOx0KMBkT05SZzo7orolj Tg01a7FNGeFhtYvTSK5101IP9EYqnGTHlx8es39n8edeF2uo34YiAWQGZ v2z7jXOjPVdk+kGV2Ntrg5KHsfpIO+0xA6zmEGTOLvPkO1vI44wRLzYX7 w==; X-CSE-ConnectionGUID: 6jUzqy5fSt+dkAQ6xh4TZg== X-CSE-MsgGUID: oQxB1u7NSY6PttWqKogLcw== X-IronPort-AV: E=McAfee;i="6800,10657,11971"; a="4062486" X-IronPort-AV: E=Sophos;i="6.27,223,1787036400"; d="scan'208,217";a="4062486" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2026 05:27:38 -0800 X-CSE-ConnectionGUID: opdXw0hXTq+gDWkXDYiUfg== X-CSE-MsgGUID: 7bVkxJe+RLyKghjCCYR+mQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,223,1787036400"; d="scan'208,217";a="10708892" Received: from orsmsx901.amr.corp.intel.com ([10.22.229.23]) by orviesa002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2026 05:27:38 -0800 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Fri, 20 Nov 2026 05:27:37 -0800 Received: from ORSEDG903.ED.cps.intel.com (10.7.248.13) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56 via Frontend Transport; Fri, 20 Nov 2026 05:27:37 -0800 Received: from CH5PR02CU005.outbound.protection.outlook.com (40.107.200.37) by edgegateway.intel.com (134.134.137.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Fri, 20 Nov 2026 05:27:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vjZyk1ccK0VDzBsMaVu/x3yUbalRRYD51Rxd77+x5NuVB6JPY5JPiTMn8wPlqXojSL3Fsw6aQbXU9br0gJNzHxtmN9KHDpjXNeHldilyYv3EcPD/gNsrQgS/h/0Imt9Xey6xP3IgkRUIcILFr0xmDmoQNZQkHyXlbf2qZvps1tEsIpzUkM7U22PMjM61kfFdlKyffm+H9xIQab3IqiSercgR5FrhDQeqaw/oiksBP98CyXajEQSAqiOHmVFdIjBGy5b1Khi4oLxSy49f1wwfvwFRGAD4U3VSKOansiLC5/CDZCjEL15jQRhHVFaL7cHR8ngALB58UoTAcJGyiNjnMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=al2jRNgNW8SK/FfRQXYT7A3apzQawsD6eXmgvazkxFo=; b=d3nhCRUs/MJIDdvk0xss7WeBpbHzS+ONvEyB4a9gzhOCPstWbpTZlDKkn8m0DJxldpLKyLJlU+EKvDIFUg6SmePUnHCW0i49cIIbhD1Jz6XxRUkmgrQtx9GzqvM8sQvJL1r2W+6MifxDTDvbW0lgAPREbV4eWSSu2QmPHSqgQFktft/eLAhdSZnieybjqpVsPnbqP7hv65nFiq56I5ebXNriFUquOpWsP2zlDRG2pW790f3u3ram29++c5cvcQlhyD6eThvp/l+it2Qv/XwI7QKYDmRGU9R3Wk1Ty35/XixjRrxdujaPD6XGxOQonUszHjV1Ze1yYI7tbMna+SEMCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=al2jRNgNW8SK/FfRQXYT7A3apzQawsD6eXmgvazkxFo=; b=jGAMq1mTI0z420UkcRH2WJi/PHMx3kaySw7uNw9SOh5FR0I4vJLWXz4bhQTFR3/gfweMCg/JtGqba3L9smxUh/vX9HohJWaFpwcyKjoRF6gZ0zUWBra6oZLoNzHKnjoo5RH2PV6yTobjCVg9Yea0dULihEqKkZLfB9mkPZ9eBhg= Received: from CH8PR11MB403433.namprd11.prod.outlook.com (2603:10b6:610:32f::10) by PH0PR11MB5047.namprd11.prod.outlook.com (2603:10b6:510:3c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.639.10; Fri, 20 Nov 2026 13:26:33 +0000 Received: from CH8PR11MB403433.namprd11.prod.outlook.com ([fe80::b087:96e4:50ea:b5de]) by CH8PR11MB403433.namprd11.prod.outlook.com ([fe80::b087:96e4:50ea:b5de%4]) with mapi id 15.21.0639.010; Fri, 20 Nov 2026 13:26:33 +0000 From: "Bouhaouel, Mohamed" To: Kevin Buettner , "gdb-patches@sourceware.org" Subject: Re: [PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditional expr evaluation Thread-Topic: [PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditional expr evaluation Thread-Index: AQHdUntJamz+qzjxzUezJYo0m4itcbcyAMEAgATpbTSAAFXEbg== Date: Fri, 20 Nov 2026 13:26:33 +0000 Message-ID: References: <20261002143505.38658-1-mohamed.bouhaouel@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH8PR11MB403433:EE_|PH0PR11MB5047:EE_ x-ms-office365-filtering-correlation-id: 443acec4-a9de-43f3-aff8-08df4709e52d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|23010399003|38070700021|10067099003|4143699003|11063799006|56012099006|261021121427099003|261021135927099003|261009221227099003|261009223027099003|261102123227099003|261026140227099003|261022105027099003|261022075727099003|261026121527099003|261022113327099003|261028144727099003|18002099003|22082099003|6133799003|13003099007|8096899003; x-microsoft-antispam-message-info: v4ZSCFq/Hy7oUJcCEoMs2VBOihlR6whdl5eg8sGA71B0rGLkzwQBKXcfRf0JZn11eQ8ubPINciDYuB/Qphfu8LHPMTQnUf8gUHhfJnFSGyp7zN0uOr1krXhj4Qb3p8eYuS3a+Qg9dckUlmeGaKBqmZakZEHHL197dTh3WUWrOgFa5hKkk41tPcFlf9sBdELvtfnZPzp2HxKCzbQr3KmbVbDGzKEpxnXdokhC8mqqYCeuQnP+9aG1XI3hnrVXnR9s8jA6IWeDPKxOjDsBgTRhrabeHHTaLvqVFC2Qy1goNBoOclo+CNUXBRkr2cHIk92jtsSJe2ZqHFzhyOqOEE2CjOpj7unYvdlRLxfJoY/oS/vr0LIBSmtg9FwWwbWAoOFmggSp5ZgUKzZDjoe9qj3CT7hH5TKaQylceWCkbnihrpioF5LNNomtZuFF9qIGViEG+BE5GLoHX1MuDcOjgCLCbLmTc0jat68Ps2ylmUzwrbY2DKaFzXB6IgqJK24dtCtSqlOWjl05CDvIgSJUf2EEjzrgwXW+9dzh5p/h8dw1lC+yP5DMOinH1yFPTiDccsHQCvGEb9168lx6uh1Se7bTgUmYFGff3lKzgbEaCI0aypVc2Y0+9dG6WJh+muoaPvkfEsSYtLxXf/zC37XiZUl8fnaWK19+zNcLbuAUppIZySY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH8PR11MB403433.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(23010399003)(38070700021)(10067099003)(4143699003)(11063799006)(56012099006)(261021121427099003)(261021135927099003)(261009221227099003)(261009223027099003)(261102123227099003)(261026140227099003)(261022105027099003)(261022075727099003)(261026121527099003)(261022113327099003)(261028144727099003)(18002099003)(22082099003)(6133799003)(13003099007)(8096899003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?QdN6Z1FXYnlKefmalnUuV+CKPVOq8NYjthp5ukpUM3vvE7hz9gcdWIUllbWi?= =?us-ascii?Q?tl721rBk3mTYqwOVlCwDfQmytX0gpslCQvo2npcfntZUq8Ic1c7BoMwOWTDq?= =?us-ascii?Q?767VSreCA9zcvAcmge7U/iEhoc763986t4yzQ+s/jH4EF7jhK2akcAbj6wp4?= =?us-ascii?Q?ghPRLobhO+qn/Vvg87GbyYPXjbJS6Plt8rhcZ7ThuC/HdmD3pk7uF1Up8Ft9?= =?us-ascii?Q?28KpSJcESS5sVriccXtH5OHAU9sZGLFkFyCS2p59ci9Xm6B2ewjUH7WLYZ56?= =?us-ascii?Q?ShxSF3/5ZYzV9BImKRfCdZHsDxGbipXEtzk+ml880NcC8OyzDy7j1TMuvaUo?= =?us-ascii?Q?jLYZH1WfnHFzAD4TtEKT2Bl2dNu0rxW1jrzfNFPj5nllTLOoIvYVNyyvDJMe?= =?us-ascii?Q?uc7mF7QLHlj1OdCG/QqZVVtnxDg0nRETTZDiQbEaZ2Z7O9rKuPPAooMN//qE?= =?us-ascii?Q?yT5MHVpbhfNK+fl7NTy53jlPwnQaK976vQEDUBztW7DLtoenwI1WT8t7QyIl?= =?us-ascii?Q?Uh9ylOIondRLIF9u9fPjtAzetKN2496LOzmwJ431h1xU/ppqzvUUEJ2J8nsS?= =?us-ascii?Q?hz3SPUjjhmHDmcoQu2Vjsz82yN6OF6aa0HNsVOVbAptsyfP+y/FsfzJZGEH5?= =?us-ascii?Q?lUjEimJg+SaQ3O7X9+jwO/tUHQmxX8jaLh4FNFQ2eedgNThkfX5kD7sX87vu?= =?us-ascii?Q?YzCUZFk5svjPqpfpWdUY5VS0zANF7JZtFEiksem24vhs/f4xIWLid3Qf8Q15?= =?us-ascii?Q?cV3Ld45BFQ79xVmqXSBAhRYU9sCIpuQMy5TQKV/KtQjWhPA390XJCINahjia?= =?us-ascii?Q?llJFH5QyHB0xY5SSki8ZcEUWEm2gR6qCcbeKMyTjDwYBLoiJr63OmDw2sgQG?= =?us-ascii?Q?TIFn2qw+dceJnGC2FqdhZGWi7RANAeVe3A3UgPJG2WD3pVmokoKov1k7d+q9?= =?us-ascii?Q?nTNrxqKdEAIeoUCbPfFEWwudlIut2gDynPtZuMC72PqJ6D3hLxnr5BPyPcpX?= =?us-ascii?Q?BN1XTWQBhU3PkKehjLRDe12T4FKIMDrYJGjwiIUhaflCQ0vsXIlhPPdQvdLi?= =?us-ascii?Q?9bEq25oYoWbs4qmwQgToSd+zoqFm1AnhEc7O8AcX3E/WG5NBA2TyGROUNl68?= =?us-ascii?Q?7VYE3rNU1A6g5Nm5iT57Ze/rX/lBELCs76kGODl7wj17GekCR9R4vtXuDxJ3?= =?us-ascii?Q?WktB2iAcQT1pzGjOg+sgXhuv132y5EpKWRZVVLJ0aeINmQpLbGBLPcmNtNlM?= =?us-ascii?Q?WkqwRCNPQaA4ddP0tKCz6eCFoPd3iBlYRPV6aqUNk3umTwDMoyqrWljbFIPT?= =?us-ascii?Q?xc/Gd4lQtOua4X+wM11UnMTEzpMuIbG1M0jmbmmMvXBaYNsXbzTveHjR9MUR?= =?us-ascii?Q?wiYKKVKzMpg22ATVnmYdqJO9TSy+oiCfpJ17T90ETz5LNSvrnYvJUqZx2HLE?= =?us-ascii?Q?ajPB17vOLyZDkxsyjWQwWcYg0TU4zoJPGuA85svCPNICbC0cOHFfQ/aYNQ7d?= =?us-ascii?Q?SjExj3r4WlQGl+F3NXyfCmRmPjGwXmUrUHSweTmBga8hNFhz1nXIgDs5N0Ze?= =?us-ascii?Q?rnSBrL0vGJNSJ0PxP5q4iSBey8j0NbxsLTxCxIxSVePiBRggkNz1Jz4+J3e+?= =?us-ascii?Q?C7E0sU3bWMIr10dKWgyDvt+Et3wHjHmveL+vZWCUkFQ6jVSFaB5N2Sae6Rla?= =?us-ascii?Q?xQW/VcHTdEcwUiRDNm/6VqM/XO+SpRvTEVGCht4uV7NmkI9IX/N3M1iIxuB0?= =?us-ascii?Q?sLSUAHsmeg=3D=3D?= Content-Type: multipart/alternative; boundary="_000_CH8PR11MB403433B5835B5CF29B9D093C6EE4782CH8PR11MB403433_" MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: RT7S+wqVSwFB+4/u3fhJBk11UcBJ7KMq1VTSjgcDD6daeHRVVCtfY1TLd+z8fzZOpb7bP5q0KNftuPioa+btN85rKqVjwVXKYZSaf4Pxhpv9AATwRV0EguvPyD33ivKE5aqp/TtXmDipDKbdivHwPvplS/cfXUDkzCKvv7NjOxMj8zNgwGPU2jxDwaRBPYJA9kRk8z4vfF8TqIwMszu7Q8OkqAJxu0sLoMfO5+ObHMEcmErLSVFMYbkhdx+uoO2iiiPdJ6xFexaD4Tx9Z+/gsmVVeWSZ4GAeKXt5r6RHEl/DXTJMy43ZL+N4X7aW0+uWb8TJ6YvuDBDqgWafR2j+sA== X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH8PR11MB403433.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 443acec4-a9de-43f3-aff8-08df4709e52d X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2026 13:26:33.4803 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eAqhE9Lt6BR7CfWGy6EGKkCa7NahDWfTojNXWzFaGi5UPPWuyYNkOV+fKo6W00AFPvGMT5x2NN/GMA+YBLZRv9oADtTg/NX4gIbQoYBtjag= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5047 X-OriginatorOrg: intel.com 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 --_000_CH8PR11MB403433B5835B5CF29B9D093C6EE4782CH8PR11MB403433_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Kevin, Correction to my previous reply: rather than a depth limit, v2 adds a simple toggle, "set breakpoint condition-cycle-detection on|off" (on by default), as you suggested. V2 is here: https://sourceware.org/pipermail/gdb-patches/2026-November/232061.html Thanks, --Mohamed ________________________________ From: Bouhaouel, Mohamed Sent: Friday, November 20, 2026 9:28 AM To: Kevin Buettner ; gdb-patches@sourceware.org Cc: Ijaz, Abdul B Subject: Re: [PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditi= onal expr evaluation Hi Kevin, Thanks for testing and for the factorial example. You're right that terminating recursion shouldn't be unconditionally rejected! Since a real cycle can't be distinguished from finite recursion in general, I'll replace the check with a depth limit, similar to "max-user-call-depth" (a new "set max-breakpoint-condition-depth" setting, accepting "unlimited"). I'll add your example to the test and reword "bp" to "breakpoint" in the message. Thanks, --Mohamed ________________________________ From: Kevin Buettner Sent: Tuesday, November 17, 2026 6:16 AM To: Bouhaouel, Mohamed ; gdb-patches@sourcewar= e.org Cc: Ijaz, Abdul B Subject: Re: [PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditi= onal expr evaluation On 10/2/26 7:35 AM, Mohamed Bouhaouel wrote: > Take the following scenario: > > (gdb) break foo if foo (1) =3D=3D 2 > (gdb) run > > The program stops at 'foo', then GDB tries to evaluate the condition. > The condition triggers an inferior call of 'foo', which causes a stop at > 'foo' again, and GDB is stuck in this infinite cycle. > > The same issue exists also for indirect cycles, e.g., > > (gdb) break foo if bar (1) > (gdb) break bar if foo (1) > (gdb) run > > To avoid this, check for cycles just before evaluating a breakpoint > condition. If a breakpoint is hit again while its own condition is > being evaluated, the evaluation of that condition is aborted with an > error message. > > With the patch, the behavior becomes: > > (gdb) break foo if foo (1) =3D=3D 2 > Breakpoint 2 at 0x55555555514c: file infcall-from-bp-cond-cycle.c, line= 27. > (gdb) continue > Continuing. > Error in testing condition for breakpoint 2: > Aborting expression evaluation for the conditional bp: > A cycle was detected during the evaluation. > > Breakpoint 2, foo (a=3D1) at infcall-from-bp-cond-cycle.c:27 > 27 return a + add_one (a); > Error in testing condition for breakpoint 2: > The program being debugged stopped while in a function called from GDB. > Evaluation of the expression containing the function > (foo) will be abandoned. > When the function is done executing, GDB will silently stop. > (gdb) backtrace > #0 foo (a=3D1) at infcall-from-bp-cond-cycle.c:27 > #1 > #2 foo (a=3D11) at infcall-from-bp-cond-cycle.c:27 > #3 0x00005555555551af in main () at infcall-from-bp-cond-cycle.c:47 My AI reviewer found a case which probably ought to be allowed. Perhaps a depth setting could be added? Alternately, a setting which disables cycle detection? The example uses factorial from gdb.base/break.c. Using the baseline build (without your patch): $ /home/kevinb-claude/installs/cycles-baseline/bin/gdb \ -q -nx -batch -iex 'set debuginfod enabled off' \ -ex 'break factorial if value > 1 && factorial (value - 1) > 100' \ -ex run -ex bt ./break Breakpoint 1 at 0x40055b: file break.c, line 63. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1, factorial (value=3D6) at break.c:63 63 if (value > 1) { /* set breakpoint 7 here */ #0 factorial (value=3D6) at break.c:63 #1 0x00000000004004f8 in main (argc=3D1, argv=3D0x7fffffffd238, envp=3D0x7fffffffd248) at break.c:47 Note that this worked perfectly well, but... With your patch: $ /home/kevinb-claude/installs/cycles-patched/bin/gdb \ -q -nx -batch -iex 'set debuginfod enabled off' \ -ex 'break factorial if value > 1 && factorial (value - 1) > 100' \ -ex run -ex bt ./break Breakpoint 1 at 0x40055b: file break.c, line 63. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Error in testing condition for breakpoint 1: Aborting expression evaluation for the conditional bp: A cycle was detected during the evaluation. Breakpoint 1, factorial (value=3D5) at break.c:63 63 if (value > 1) { /* set breakpoint 7 here */ Error in testing condition for breakpoint 1: The program being debugged stopped while in a function called from GDB. Evaluation of the expression containing the function (factorial) will be abandoned. When the function is done executing, GDB will silently stop. #0 factorial (value=3D5) at break.c:63 #1 #2 factorial (value=3D6) at break.c:63 #3 0x00000000004004f8 in main (argc=3D1, argv=3D0x7fffffffd238, envp=3D0x7fffffffd248) at break.c:47 In any case, it'd be nice to have a way to run cases like this which terminate naturally. Also, I think that it'd be better if the new error message would use the word "breakpoint" instead of "bp". The AI mentioned that some wording involving "reentry" would be preferable to "cycle", but I find that your wording (with cycle) better conveys the problem to me. Kevin ________________________________________ Intel Deutschland GmbH = Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany = Tel: +49 (89) 99143-0 = www.intel.de = Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitar= aman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. --_000_CH8PR11MB403433B5835B5CF29B9D093C6EE4782CH8PR11MB403433_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
Hi Kevin,

Correction to my previous reply: rather than a depth limit, v2 adds a
simple toggle, "set breakpoint condition-cycle-detection on|off" = (on by
default), as you suggested.

V2 is here:

Thanks,

--Mohame= d

 


From: Bouhaouel, Mohamed &l= t;mohamed.bouhaouel@intel.com>
Sent: Friday, November 20, 2026 9:28 AM
To: Kevin Buettner <kevinb@redhat.com>; gdb-patches@sourceware= .org <gdb-patches@sourceware.org>
Cc: Ijaz, Abdul B <abdul.b.ijaz@intel.com>
Subject: Re: [PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in = conditional expr evaluation
 
Hi Kevin,

Thanks for testing and for the factorial example.

You're right that terminating recursion shouldn't be unconditionally
rejected!

Since a real cycle can't be distinguished from finite recursion in
general, I'll replace the check with a depth limit, similar to
"max-user-call-depth" (a new "set max-breakpoint-condition-d= epth"
setting, accepting "unlimited").

I'll add your example to the test and reword "bp" to "breakp= oint" in
the message.

Thanks,

--Mohamed

 


From: Kevin Buettner <= kevinb@redhat.com>
Sent: Tuesday, November 17, 2026 6:16 AM
To: Bouhaouel, Mohamed <mohamed.bouhaouel@intel.com>; gdb-patc= hes@sourceware.org <gdb-patches@sourceware.org>
Cc: Ijaz, Abdul B <abdul.b.ijaz@intel.com>
Subject: Re: [PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in = conditional expr evaluation
 


On 10/2/26 7:35 AM, Mohamed Bouhaouel wrote:
> Take the following scenario:
>
>   (gdb) break foo if foo (1) =3D=3D 2
>   (gdb) run
>
> The program stops at 'foo', then GDB tries to evaluate the condition.<= br> > The condition triggers an inferior call of 'foo', which causes a stop = at
> 'foo' again, and GDB is stuck in this infinite cycle.
>
> The same issue exists also for indirect cycles, e.g.,
>
>   (gdb) break foo if bar (1)
>   (gdb) break bar if foo (1)
>   (gdb) run
>
> To avoid this, check for cycles just before evaluating a breakpoint
> condition.  If a breakpoint is hit again while its own condition = is
> being evaluated, the evaluation of that condition is aborted with an > error message.
>
> With the patch, the behavior becomes:
>
>   (gdb) break foo if foo (1) =3D=3D 2
>   Breakpoint 2 at 0x55555555514c: file infcall-from-bp-cond-= cycle.c, line 27.
>   (gdb) continue
>   Continuing.
>   Error in testing condition for breakpoint 2:
>   Aborting expression evaluation for the conditional bp:
>   A cycle was detected during the evaluation.
>
>   Breakpoint 2, foo (a=3D1) at infcall-from-bp-cond-cycle.c:= 27
>   27    return a + add_one (a);
>   Error in testing condition for breakpoint 2:
>   The program being debugged stopped while in a function cal= led from GDB.
>   Evaluation of the expression containing the function
>   (foo) will be abandoned.
>   When the function is done executing, GDB will silently sto= p.
>   (gdb) backtrace
>   #0  foo (a=3D1) at infcall-from-bp-cond-cycle.c:27
>   #1  <function called from gdb>
>   #2  foo (a=3D11) at infcall-from-bp-cond-cycle.c:27 >   #3  0x00005555555551af in main () at infcall-from-bp-= cond-cycle.c:47

My AI reviewer found a case which probably ought to be allowed.  Perha= ps
a depth setting could be added?  Alternately, a setting which disables=
cycle detection?

The example uses factorial from gdb.base/break.c.

Using the baseline build (without your patch):

$ /home/kevinb-claude/installs/cycles-baseline/bin/gdb \
  -q -nx -batch -iex 'set debuginfod enabled off' \
  -ex 'break factorial if value > 1 && factorial (value - 1= ) > 100' \
  -ex run -ex bt ./break
Breakpoint 1 at 0x40055b: file break.c, line 63.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, factorial (value=3D6) at break.c:63
63        if (value > 1) {  /* s= et breakpoint 7 here */
#0  factorial (value=3D6) at break.c:63
#1  0x00000000004004f8 in main (argc=3D1, argv=3D0x7fffffffd238,
envp=3D0x7fffffffd248) at break.c:47

Note that this worked perfectly well, but...

With your patch:

$ /home/kevinb-claude/installs/cycles-patched/bin/gdb \
  -q -nx -batch -iex 'set debuginfod enabled off' \
  -ex 'break factorial if value > 1 && factorial (value - 1= ) > 100' \
  -ex run -ex bt ./break
Breakpoint 1 at 0x40055b: file break.c, line 63.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Error in testing condition for breakpoint 1:
Aborting expression evaluation for the conditional bp:
A cycle was detected during the evaluation.

Breakpoint 1, factorial (value=3D5) at break.c:63
63        if (value > 1) {  /* s= et breakpoint 7 here */
Error in testing condition for breakpoint 1:
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(factorial) will be abandoned.
When the function is done executing, GDB will silently stop.
#0  factorial (value=3D5) at break.c:63
#1  <function called from gdb>
#2  factorial (value=3D6) at break.c:63
#3  0x00000000004004f8 in main (argc=3D1, argv=3D0x7fffffffd238,
envp=3D0x7fffffffd248) at break.c:47

In any case, it'd be nice to have a way to run cases like this which
terminate naturally.

Also, I think that it'd be better if the new error message would use the
word "breakpoint" instead of "bp".  The AI mention= ed that some wording
involving "reentry" would be preferable to "cycle", but= I find that your
wording (with cycle) better conveys the problem to me.

Kevin

__________________________= ______________

Intel Deutschland GmbH

Registered Address: Dornacher Strasse 1, 85622 = Feldkirchen, Germany

Tel: +49 (89) 99143-0

www= .intel.de

Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramach= andran Sitaraman

Chairperson of the Supervisory Board: Sonja Pierer

Registered Sea= t: Munich Commercial Register B: Amtsgericht Munich HRB 186928

This e-mail and any attac= hments may contain confidential material for
the sole use of the intende= d recipient(s). Any review or distribution
by others is strictly prohibi= ted. If you are not the intended
recipient, please contact the sender an= d delete all copies.

--_000_CH8PR11MB403433B5835B5CF29B9D093C6EE4782CH8PR11MB403433_--