From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fUu9MvsEAGtXRSMAWB0awg (envelope-from ) for ; Fri, 20 Nov 2026 03:29:47 -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=BNq93Ji7; 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=If55Xo+h; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id ACB4E1E087; Fri, 20 Nov 2026 03:29:47 -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 [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 390961E087 for ; Fri, 20 Nov 2026 03:29:42 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8AB144AB0F78 for ; Fri, 20 Nov 2026 08:29:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AB144AB0F78 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=BNq93Ji7; 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=If55Xo+h Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by sourceware.org (Postfix) with ESMTPS id 40A524AB0F86 for ; Fri, 20 Nov 2026 08:29:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40A524AB0F86 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 40A524AB0F86 Authentication-Results: sourceware.org; arc=fail smtp.remote-ip=198.175.65.17 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1795163346; cv=fail; b=U1w+OM930UEQy8eOemWWxXGfU/zO7wFhmx8E2Y41UcjRWF0tjNIZ2eE51YDjiyAqYEW1Vyk5/+ssdWoI5zzjvtuQ6JqbQECrL8HLvIvFtnJvdIuODSQLtmrHV8OrxzUsZV+v66ifNqXqlbwOOA/0MgohrgBbSq/WstKCkQEF1+o= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1795163346; c=relaxed/simple; bh=VVse84/S02colbAYt7Vo7f5fPee8U6MdXiTliSyOSBs=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=aoIHdfLr8ASxoYoAyBea1svb+rYgMN+xckup0pvB8JPRputNj98IQ0hzVolpOyhlTfkxLpcp7F5UjIgKjT5l/6Xlf6LdMB+XZMFv1DdMMoTfSxQlZ+rlC0dwX9Km793MeWApEggwYM85rDLbB/8KgzVbsWoz+maDIh0lSYJyEA4= 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=BNq93Ji7; dkim=fail (1024-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=selector1 header.b=If55Xo+h reason="signature verification failed" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 40A524AB0F86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1795163347; x=1826699347; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=VVse84/S02colbAYt7Vo7f5fPee8U6MdXiTliSyOSBs=; b=BNq93Ji7pvss6vrTx3KkYZ8UYvV2uP4i1X7U04YAPUIdtjIm0wPGqkPl o5tXkZLkcpnXB6BxHaqdMXzCyHYXgPa9PsKA6GWnyHeAkbsOrW/nTNeMt cKcINgqgyBz32l6qhE9gsN646E8dfyYQ69A7Wh7WYftlytS5/q+M3Hond bSW+mEzDG2yX7KTbU/uxQ6YveOK7pwJnS4BvrUlvdBgH5tYUrxnjwIWgn lFK2d9GcGMwDmEOwSr8k9RJe4cMvurVK5Jfp0Tm6Yf7ttgxBLWv3AMXE1 PdNHuZPrntd0y/fwOhogzjVtnem+zWq4cqGuXb+pj27THVOz6p0ljF32f g==; X-CSE-ConnectionGUID: WITsNNs/Tzyc+KAUOArwxg== X-CSE-MsgGUID: demsyCH3Q5ixY78E5d0Bdw== X-IronPort-AV: E=McAfee;i="6800,10657,11971"; a="4045033" X-IronPort-AV: E=Sophos;i="6.27,222,1787036400"; d="scan'208,217";a="4045033" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2026 00:29:06 -0800 X-CSE-ConnectionGUID: IiJa1I0bRli1FoKOOvud3Q== X-CSE-MsgGUID: feOrVeUfTTWsQ4VeROXHBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,222,1787036400"; d="scan'208,217";a="11079896" Received: from orsmsx901.amr.corp.intel.com ([10.22.229.23]) by fmviesa001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2026 00:29:05 -0800 Received: from ORSMSX903.amr.corp.intel.com (10.22.229.25) 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 00:29:04 -0800 Received: from ORSEDG903.ED.cps.intel.com (10.7.248.13) by ORSMSX903.amr.corp.intel.com (10.22.229.25) 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 00:29:04 -0800 Received: from SA9PR02CU001.outbound.protection.outlook.com (40.93.196.5) 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 00:29:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wwS1vWkgMxkvmvZck5p3p0BdFH8j5inCG7tcBgFQ04znhlUhmK24Jco6F2PLH3CxSm0Hyr1WriSyBcsWJZHBuEYnJ4ZaUtsE7benynVT0uuh9AuBQDzFA3CkuQRODnCdl0rB+dt1cwleS1GvX2pEeUoqZr/f0VSSJ/ECb9ZoygnkamsKj5/txSMeZug9KkVwS6RZmhiaMwwhxyD/o/lRsjn5WwH2TXgo4ioX26ARPStj+a5hxOnOTXRHo5o3mO7SQYlRK4AO9nI/a9bq8qHUgotO2YRzT+LDs5SB6BlrqYb6U8Js4/YIWMTmZHZiwaNrbP+jO/NqGR3ffJmv1aQugg== 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=eaQNp+ocnmz7ioJ+Agr2gLp5zsMcebKnqfks98/xhkM=; b=tCgEf0NimSqEMqwNgRdAekILyfNf03n96fVbp3z3ce2BtSo0kIzmfCPKnen4+FjrhDzPESwScXSsZGQtXShD2griwyYAB5vW8gWRK9X+5KWJpcGMOGj90sxBksa/q/2ktAvnQv8Rt+7PFuyYU9Rf2zM2Hs3zmoeLqz/R3t4JphWetDJUXa1kTmo+6YvRczQ6c0i00A5Z8gk2gF2xkWJisDelH284iZMXnA1d6JSpbgjyIT/TUakWDtCKvNe1y1qWMhwtD2lhO+DikVpXbPdkMeTLHZiTvK6s6Bb6awgYXxdO86KhG4quK4nFHUFfkq21nt/Vy2DbdOichv/LPIA8rg== 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=eaQNp+ocnmz7ioJ+Agr2gLp5zsMcebKnqfks98/xhkM=; b=If55Xo+h2oAnY2K+nfoDbyS6iZ+uwWSmDwTowepNojR4NEII0//bEsw/RDSeP3ff4fE31XttGhZwf9VOTcApJ/uqfmnE7FNyHUp6T7JlNqQW0rlvpHVQIveFC8eDB3zvNcte/G4yfwhOlwM1xHr4GjhnaYSfWioWNo0akymkzfU= Received: from CH8PR11MB403433.namprd11.prod.outlook.com (2603:10b6:610:32f::10) by IA4PR11MB8989.namprd11.prod.outlook.com (2603:10b6:208:56c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.639.12; Fri, 20 Nov 2026 08:29:00 +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 08:28:58 +0000 From: "Bouhaouel, Mohamed" To: Kevin Buettner , "gdb-patches@sourceware.org" CC: "Ijaz, Abdul B" 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+qzjxzUezJYo0m4itcbcyAMEAgATpbTQ= Date: Fri, 20 Nov 2026 08:28:58 +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_|IA4PR11MB8989:EE_ x-ms-office365-filtering-correlation-id: f8a0ca95-2839-4bbb-22fc-08df46e052a4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|23010399003|376014|1800799024|6133799003|18002099003|22082099003|8096899003|4143699003|261022105027099003|11063799006|56012099006|261026140227099003|261026121527099003|261022075727099003|261022113327099003|261021135927099003|261009223027099003|261102123227099003|38070700021|10067099003|261021121427099003|261028144727099003; x-microsoft-antispam-message-info: XQ50dxr7kvqHvDJxwJ5IrZ2OLd+14eZ8WtS1omC7MZG0h8tWKgEZ1K+sq+kLewUunU3AmylcK6wSbvaWI99bs+uxDIkdAhEHNN7eX0dEeO6BLFDVxeNC0KJRzgWSzs2zDek4uUqNd/pFJ9Z/SvQeRwjqAN4gQUhAV9cak0czuyggv7SefX2VN08ceWzHmiE5edKj3xnQEbVxttxw5vbmJPHhedt2KQfjs8wAVGUYvzBTCdaFas2tmxnC536i27uGNTxC0d80bjNp8qbXaWeaZIFmaLsS6teP9Qo7a0H4yhlz1+74/+eG1Pkaxgjr+XRVCCBd0NKOJ/MKfBbgSeybl5RZlNj+3CIpn69CCcya2Tf8M3MSo9dsk5OTHBBCIWvZmnU1b6jtaPqmHrdbM822Jj/3vPQ6MPcShN+Mm8VGAENkxNPR5nHxupLu007XECulWGt1B/Q5C1vAHdebBbaKwknflCAjYgZHh8De1g51sgw+nfcpKS2N3FemGW80xkg8pz+/i0YyWZ8WwmiuczlDchQNkD0v56W8W8BJ3GL4all68sNaZOUUkMP2Z58QKwwzNZXIWGt8pKnf+wRSTG/ZuGBrGgjZC+mlfO+zrp9TbhYAHZhy3rd2gRzhHzduF/mggVEn2hWpa2O+0Qk2bmUqs6jV50mggwIB9fMcJpsxPS+eJv6TPS0xKGY2M1UU79rn 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)(366016)(23010399003)(376014)(1800799024)(6133799003)(18002099003)(22082099003)(8096899003)(4143699003)(261022105027099003)(11063799006)(56012099006)(261026140227099003)(261026121527099003)(261022075727099003)(261022113327099003)(261021135927099003)(261009223027099003)(261102123227099003)(38070700021)(10067099003)(261021121427099003)(261028144727099003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?87Q7IJr9Gvv/W8AO4xjHxsZ3oPdTIPTNzB3u2XeX6hnrBZ8xIm3gURridXou?= =?us-ascii?Q?UHT3qB2Gd2thqc8Bm79Tv3kYwOq+bsDF6BMHUbloLNXS5klaKIwBJeD1QeeC?= =?us-ascii?Q?aIy9Z2s1v493Na3WAgreAr/kqlvAjI7KOBI7sRap9+7dH7zogEVOEh6L2cSM?= =?us-ascii?Q?RMDyJrMXkwliVVp1GRZlcK/Nx4bHBWQpaORSn4W2W/O5E5UKo++IdvM9dYlu?= =?us-ascii?Q?sk+63YlfsoIWmzuprwXerbYD6Ck+grODK9gLUQM/YSFqJ5eKf6gZTem+m3Iw?= =?us-ascii?Q?30vZvFw/BER4U3OzO0th1G2B+IMFGXwwKlRNwN6ZP+ElfN9ZyKBfolXjdb4h?= =?us-ascii?Q?oMXPrFjAUFJELTkBCxXFFo+Cgv6qopn73p0iqREYmCacJEvvXyK882en/zIP?= =?us-ascii?Q?7jF+LG4rDldfcIU1JPrx04aAaI8J8StaIST1+4HRlj1DR0gFBlW1Yavwj136?= =?us-ascii?Q?QQmCiFeMTWuSQmu5Q/y1lUzjhAGe+dPLdilk9emXcZApg5w00FuMmBKiDFx5?= =?us-ascii?Q?RUL1vbswycCbhGjHeOBEH4s+KphLJdU9lmc4vO96Y2Tvni9PlRcR32lWPVhv?= =?us-ascii?Q?2v1NydYcFF1IAyviyiezhpyA+9pgH/moL0sJ8fMZT/4UxK5hTMQS6yRe4Wk7?= =?us-ascii?Q?4dLUbbC3kMe84XGlU9XbYUS8eOe7j0xK5AvNNuKDPFQSPcKtWjqyYjP3Ocb4?= =?us-ascii?Q?U7HeDOyoCu7wex3YCckzmc3buMqA8JjwFJ3NKa3yxPykuYmdxDT4djRdvweE?= =?us-ascii?Q?SaBhoHxwq6jjMkojonmCDz6Ry1LWL8oyrYUDqetJEYarNEEOGXMFVUof5Fgf?= =?us-ascii?Q?y8eUpArwQY8FzkHJDx0Axc0RNGQAseL48MDxJC1DDfnKHhyE60OlqNQrDoR4?= =?us-ascii?Q?YA3EvyYa3qUo5hWxrJu46yQo0+M9NqZjiCKJM7ydYNbEg+kRdJfbi0KiK4Xv?= =?us-ascii?Q?XvikaHnilCVTAH6uKaXTknmjMl22n+urr5PCElLeUQ/jE4lMdW3ho1QetPY4?= =?us-ascii?Q?OqiJJzAd+JhEco6yBcyIjjHxHEei0PzRB9mGxidikTSQoBed1aGDUGo5oXnf?= =?us-ascii?Q?1KyMK+St++F4UsfHlq9kQ9Z4MqbsCiYg1QthAAZWYBSVroH7RXwJaZGOVbVJ?= =?us-ascii?Q?77xHuPfjGgbitYhJXnnec0P1yAKaaqlF/abp5HLSGm2BWATeDVRMtpJPGeoZ?= =?us-ascii?Q?sZP5wGF1YveZCvvPPzl+IEEjF9Gxla/obvf0PyzQey2/e0k9oXoDUF2U444b?= =?us-ascii?Q?Nwn+0mHlAiO1Cqg3bCw8vtqe96oB5/7r7MNcVT/8kNnCO1O4O1aV1QCR1X28?= =?us-ascii?Q?tdeeKih9gGqlKO8qhf72Yr7JAUuxUFP1qorrmUAkuitAkRnBliq3iTrGTkqs?= =?us-ascii?Q?PvPyBv+TYyrNzZGj1JdLfOTzDpSP+OBUBfw/J9/zbDrt7PDRcqNssNcZV8Es?= =?us-ascii?Q?+Y546Em9YWlsI9Y/ZxOnbgiORbxtgxl0QzO2xKixornb4EvFK4f6NW+KQZjH?= =?us-ascii?Q?yOtCGCeDaqaOeT9n/02fsvf9xp1zx3yBmmKOFaTKJuzyllLTeizEtZAl8/xe?= =?us-ascii?Q?shcmAliRCW1yZWKHwYNewAYDdP/N4w7Se/fZ3XWoh4BqJvxXcwKDrXER0s4Q?= =?us-ascii?Q?YyevqH0vksKP2fRqTrpQvvHDMWl4wUZH8fp3HjmyFpdAjewJevPgqw880dLT?= =?us-ascii?Q?IRoPuCPHn0wY2guTn+zGfz017PYRBffEi8mX2rljU7HRVkSef+jVBwz5SvVP?= =?us-ascii?Q?8iU2SuvAjw=3D=3D?= Content-Type: multipart/alternative; boundary="_000_CH8PR11MB4034338F1D8A72B1E1BFC25091E4782CH8PR11MB403433_" MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: xQ6wnmuEqCx8D6CWWHPIzstFpTZqilhvE1Whj8r2rlGY7VxYExbIoz3Gnw2345HdxQJCSGYjmN0yLHm+4ENG/iol5V3qV3KVgNcYdBzmOpCORpGcv7ZnPMpMgrOE9tQGwUkCPiqccbIL0nDiyA6FhcyOnU613PqwzctAY1YXcnEDWJsbr5WLnDuiE2WtqEOhe4V9tbP+DFJhYxlPPsYVvz77bMGqELsc3trQ8j57DYusVvJef7hqMIqA74wEl+r9/FRXChKk3Gt+CMnMXMvp9SEHDCXnFv493QGgpLnEW+R64SQ6C5y47T/1r66Ss2otnDgkLqseU3vE2GTu5MPLVQ== X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH8PR11MB403433.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8a0ca95-2839-4bbb-22fc-08df46e052a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2026 08:28:58.2857 (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: MOtOInfMoC8OSgfo6GUS8xhuCZYla0uJB5yucSryoSYn+nRVi6bsQsBsn66JX4YKbYw/P+yjl8HMmtgPH30+/b6yMUooPiXy3v61a8p2g0A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA4PR11MB8989 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_CH8PR11MB4034338F1D8A72B1E1BFC25091E4782CH8PR11MB403433_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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_CH8PR11MB4034338F1D8A72B1E1BFC25091E4782CH8PR11MB403433_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
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,

--Mohame= d

 


From: Kevin Buettner <ke= vinb@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_CH8PR11MB4034338F1D8A72B1E1BFC25091E4782CH8PR11MB403433_--