From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ffWgIZy+s2aNYD8AWB0awg (envelope-from ) for ; Wed, 07 Aug 2024 14:36:12 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=eb+0Rxjo; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=eb+0Rxjo; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 73FBF1E0D0; Wed, 7 Aug 2024 14:36:12 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 1E6DB1E0AC for ; Wed, 7 Aug 2024 14:36:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F2163858283 for ; Wed, 7 Aug 2024 18:36:09 +0000 (GMT) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:260d::600]) by sourceware.org (Postfix) with ESMTPS id BDD8F3858C41 for ; Wed, 7 Aug 2024 18:35:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDD8F3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BDD8F3858C41 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:260d::600 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1723055742; cv=pass; b=qPaLC5C3H/x0Kv7ha5kyivclKSIe5ZNm1490SyYc93BZ1KMrogmitR6kS+sg9ClOe3bXE6R7QLZNUr2IAgbTZhUy6lA2Q37uTTacDfuKpg/gdD+iNd7O6it5cqgPr0BLEApmsaiQ4AOorAVdNGeY58CkoP7IcXywpZ60DgPWLPQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1723055742; c=relaxed/simple; bh=oB3FRQE7EZJvQm06KcioPraY/diUcH8SaBrasyY1A7k=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=pMxqEoSG1641PVDSSA84PFea/a8gMQtSpS0GILT70ubv3eFE/pPW5MUI2bph/T99CH4hcVaiYmHhUhMVbga3ybKITC3NweekwfKcWdCpDfAsq8dGcfc8gv3ftXO2qFEop3/GiD6WrziQZrzULWIlLk+u1zAH0OHpDiYuBqH5TqQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=hJx6pfWGbGr9gUvLaDKawBacH3IkUuQucTUEX54/SYDkfjmznrasxtcg1Yh9FhA4tYJ989HmNyvfQM/m1c8Z+erPppsEbz9UPq3m28067xlVFRD13jGeYkI6skDxOO6tARibZbX95ocjUQ6e5tk/47sjI88iVHOD8EO7g3mOVlQML7VY3ev6PWIdULjsQxSiwk5LDOORAt+nKHo6t7hZfvDNatI0jnf9DD0z5zByO74Py6WMdR3pDJmahHqM07s9uFmobGebctntBWRbRpY4fhTNG62I8x884bR5fyuwRMlreVVcUGzfSQlVRYtb0FQ9r3fsycpwTwi8b0qcrv2unQ== ARC-Message-Signature: i=2; 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=cKNa7vAYogwMA+Qw9yO4FkimDQdmtssYnrmloV7w5sE=; b=GuiI8DN8Rp+8zEwzBWUBpXC9e6U7RUPbGnwdJvPKmdaLfD3MFtvYn7UGikSy6XrUBQo4Gbs93o1tah17MlzgaE51qdHYsDdCPttwGHg0AgkdnHrG2V2f2jn0PSBYtGvuK4nwOiIjiJOGsvv46eZax/vvL8ZV/WL8iXJKdgOuPf1PuV240Vq4ubPnajp2ruZl/snuhjrWzRFLcufocRsu+YvNlKnb88RVg1H9Km6y6rX6xdldNEiCFzqIL6E+90EGvMx5Ds7H6Tb+DwcIi08T3bVPVIRwhIoY34fFCClvqxc2McWGuM0Ap7t7fiCbKmYbk7wanhCQDoXFt5yggZeQ+Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cKNa7vAYogwMA+Qw9yO4FkimDQdmtssYnrmloV7w5sE=; b=eb+0RxjoPRkhmJiIT0s8fdHLTylnYyY1cy+jA2ZhhraIu+i2qF/UPFtL2+Xq9mOQAAxnMoF6Pc634X/d/gRyTtDZKyxAoW0QC3lWyDMS92ytCB7Io70as3zh5RwsYwspq0lBRLBqzYy3VUxWaHXAK8nro00sevxQuNOnuOzAtwo= Received: from DUZPR01CA0178.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::20) by PAVPR08MB9724.eurprd08.prod.outlook.com (2603:10a6:102:31f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13; Wed, 7 Aug 2024 18:35:35 +0000 Received: from DU2PEPF00028D07.eurprd03.prod.outlook.com (2603:10a6:10:4b3:cafe::63) by DUZPR01CA0178.outlook.office365.com (2603:10a6:10:4b3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13 via Frontend Transport; Wed, 7 Aug 2024 18:35:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DU2PEPF00028D07.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 7 Aug 2024 18:35:34 +0000 Received: ("Tessian outbound 6ceac6be275b:v365"); Wed, 07 Aug 2024 18:35:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 14d7513ad2bbb3d5 X-CR-MTA-TID: 64aa7808 Received: from L9e9960be1b2d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BD50F2B3-729C-4ADF-A3CF-495B8E35E726.1; Wed, 07 Aug 2024 18:35:27 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L9e9960be1b2d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 07 Aug 2024 18:35:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wshDaAfyrtpU3v2KC+Yo1d9AUti59rTszkwSATzIOMAa+QTx5UdnZm5B/8+d5ShspE1u1cgGwrrJ7YOyRHicJx7bk0cPAGhzvCtWqHVe3z++udthmEJj37i36y2HlrQR7mQxe5DSoiVN/cTTzeJbFDp/2WvkAYutHrGsw45PAYR3KeR5T65FJnu9UfmL1BCBYq+am2VR0qjcQGP3JXvf5m+6WzXhGCfNu4Wgk2QA2zptM/ZGq7szOMfjr7dCnxktDDqKB5RZ0HNx5VpYf+Ak0rG1IzK9NBy8VLS88saRhuUk0WUiHBkCvLChBIx3F5UkQVimLn/aXyopHtxG39ZO5w== 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=cKNa7vAYogwMA+Qw9yO4FkimDQdmtssYnrmloV7w5sE=; b=DvkXxjv4zxjf0gMPSqTR/3/IhueXTU34aY8keAyFhYGcHrHEjUmYhyTeqcoWYTKbIYv7GI+c7DYy6uZ40PfwAy6Yz07plVH+ctLfFodp2N5w6xTWFNVRGggAc6WyZbBonRr6e0V3GAGnwK12kNHUNQxHHAzMdRZIAJsxXPC8RFSX383qk3hNxtVbvtQlmqlvJ7w6fMkeNe4WOPXTSd9oRaEUgvgHYYa/bCmT4wpJ5C/JSgcD+//VWyUd3tznIb8aNh4MJDf3QfeeYd68hycU+s6OA8TvNG9LtAmkyWXO/6jYI3U04Qp4/ZF06Sav/MPJIl3GVTRFcoxtAx5v9nXe+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cKNa7vAYogwMA+Qw9yO4FkimDQdmtssYnrmloV7w5sE=; b=eb+0RxjoPRkhmJiIT0s8fdHLTylnYyY1cy+jA2ZhhraIu+i2qF/UPFtL2+Xq9mOQAAxnMoF6Pc634X/d/gRyTtDZKyxAoW0QC3lWyDMS92ytCB7Io70as3zh5RwsYwspq0lBRLBqzYy3VUxWaHXAK8nro00sevxQuNOnuOzAtwo= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) by AM8PR08MB6548.eurprd08.prod.outlook.com (2603:10a6:20b:314::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13; Wed, 7 Aug 2024 18:35:23 +0000 Received: from PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d]) by PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d%3]) with mapi id 15.20.7828.023; Wed, 7 Aug 2024 18:35:23 +0000 Message-ID: <38f772fb-6745-4745-ac68-f346331e7d3c@arm.com> Date: Wed, 7 Aug 2024 19:35:19 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] gdb/testsuite: track if a caching proc calls gdb_exit or not Content-Language: en-US To: Andrew Burgess , gdb-patches@sourceware.org References: <5dc846ffb6cd8f76ba2769ee7679f5d1b01fae0a.1717438458.git.aburgess@redhat.com> <97973506-79f4-4216-9c0b-57401b3933f5@arm.com> <878qx8z9nt.fsf@redhat.com> From: Luis Machado In-Reply-To: <878qx8z9nt.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0009.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ad::12) To PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PR3PR08MB5852:EE_|AM8PR08MB6548:EE_|DU2PEPF00028D07:EE_|PAVPR08MB9724:EE_ X-MS-Office365-Filtering-Correlation-Id: 7399c16f-d5fb-49f8-6f10-08dcb70fb94f x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?aW03ZHE4RGN6ZW90U29RVEJvYVVRVE1VOCtOTWhsbW13Y3FtYi9xeUlYUDFH?= =?utf-8?B?Vmd3aEF2R3hNZ1VRbzh3SmY3T2ZYbUYrUG5RaGtvQkliRXE3YkdZdVVNeno5?= =?utf-8?B?Sy9IZGZyLy9FeUtuS2N0STVtK3VxRndPaXBXOVdiUjBrd3VsZVo0czBPSXpM?= =?utf-8?B?RnNRQ3JCVUk4bXNqejdVM2xWc1p6N09rL3gzbitOYWtSL083RTN0aThoSDhH?= =?utf-8?B?QUNzN2crbCtDem05NzJyYm85RUtqK0owOTRmeWJFQytWclRGd1RMcnoxcmxh?= =?utf-8?B?dFkvMGNxUktJd29saTI0bDc4bDl6dHIrNUU2MTFaY093dnFoV3RiNUw3akxU?= =?utf-8?B?S3BrNm81cThkSGhyODBUZGJPRktoT2E1VGt6K0wrNGdOVTR4VlM2d09XQmpT?= =?utf-8?B?c0pleUErYnBMeEhySkh6YWtJK0tKNWpYbWgwa1A5ZlVSb2xFZHJwRWtiNEhE?= =?utf-8?B?SldKNiswK2hCQU5HdnVoN3FVLzFVUjNvVjRmbkhLTGYyb3ZCMTNSUDM2aDB0?= =?utf-8?B?S2V3YjBNYU52OXgzQ2o3MDdtdFZmT2Y5Qm5HNUZhalBoQVNIcXdXQVB6Q001?= =?utf-8?B?SnZaaENqTjcrc2lGSjNzazY1OEFwc2N0VHc5TEVvT1J0dUlJRS9TME1aUHVW?= =?utf-8?B?V3N3Z21iY3RoRDh5NVAwRmpOaUdCanVpUVIvajVXcHZLSi9OQklnN0VKVDFF?= =?utf-8?B?Q211MGtUNnpCQm8wellKSysyQkxqbmFiZ0dTTVU0bC9uUUN0M2h1bE5CVzNY?= =?utf-8?B?dUVEQ3NicFNzWE1IR0t2d3pHa1o5cEg0dzM2V3JwWXM5YXJlQmhHZEszTk45?= =?utf-8?B?eURINjZmRUZDYi8vSTJPb2puMVRYa2xyc3lKL28vUGZhbFBRYjNLQ0QyZ2gx?= =?utf-8?B?aXYyODh5R3U4aUpUMTNFQ1RYRk8vQXVPaUNSVEV2cXkrUC9BbGxSYVRuYkMy?= =?utf-8?B?Nmk2ODJ5VytEZWlPd0tzRVFZdk9nUlZBb0lnUU9PSzJkbnZzczN4QTZhY0NV?= =?utf-8?B?bSs2MjhZdW9WSjh6dm11UnlyS3JEU0hGOFNFZ3JkcXc1bWxycFZoL0FUdmRR?= =?utf-8?B?dGt0T2RIOFBUTVVlaFMwN20rZzZTclBmd2dYQ3JDOEhBRmdDMHpPNWIzSi9o?= =?utf-8?B?YnVFZ01QTjgxYlAxRXdQOWxmcGs1OSsyL1MxZWp1bWhoOFc5RDNUSUdScHpk?= =?utf-8?B?T3FXaXdYM1F2OW9XcVZPRFJNSkdzc3pVVW11elB0cjZLdDdiTm01NFNxUUdD?= =?utf-8?B?VGdnNTZ1VXA0dWFZNk1EajFXZlY1WWNFb0pvZWhjZUVzWWdmS2tuRFVoa2k1?= =?utf-8?B?RUhaRHVmaldKakdDMnVRdEQ5VUxwVHc4eTBqUllVWlFmZjBsN0c4Zm4vV2hw?= =?utf-8?B?Wi9oWWNCVXpkZU11cERrWUxUZEJHQ0pObWV0TmUxa3ZsNmFnYXJXcjkwMFcr?= =?utf-8?B?R2lBRXp6L3NoU2JlWWdmNzM5bVdmd09FQ0dYMXJIOEJCKzhvMWlFdG5aNkhH?= =?utf-8?B?bWYrUmpKWnlYRE16TlpqVG1sbnRadFA4R2pMVzFrN0lDRGQxUzAvbEt2V1BK?= =?utf-8?B?RFY2Q3E3RnY3WFJ2RkNjQ1Y3OUsvdFc2cTkwaWlzRE4rMm0wMWwvOElFTVZT?= =?utf-8?B?dTFWT2ZOMzRNV0RiV0ZodGxvN1FhaEFVSVN5ejVQV1dUckFkdnIyLzdaVnVu?= =?utf-8?B?SnlqOU1zK2UyVkRpb1BHRkN1cDdIZmJkbDBZOGFiekgyaGVweHBwc2NFbTFV?= =?utf-8?Q?vAc/j8IxXJlg15e5Ew=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR08MB5852.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6548 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:102:8e::21]; domain=PR3PR08MB5852.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D07.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 07c75f50-7497-4f1f-a45b-08dcb70fb2c9 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|35042699022|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?eFZ1T3NzancwYU4yVVlGSjQzL2t2MW1UbEdBM3hFb3lnWng2TXJiVjV1dkg1?= =?utf-8?B?SFFBeFJUVnp1SHpuYnZ0TWR4M1FVSzRoMlFoMVdNejIxUG1oL2lvTjB5YXcx?= =?utf-8?B?ZmFaV0QrMEdwSFRjSThJcUxYWUdoUGVUT2l1V2VLZVdLeDYwd2YzNlo5R01h?= =?utf-8?B?dXg5TXpFdytpOFkwSW9PTVVpUTFPeGZNdEp2c3Y4WjR5RU9aRFYxeTlXU3VR?= =?utf-8?B?aDdyQnFuNHBzaGdiMmdwZkpFSUdUMVhxVm1Rd2J1ZmprRVJTbThOMWFqUWIz?= =?utf-8?B?NnJrZlkrRVczZEFvRHFkbTlweUluemJhMzdvMVlDWlVEVWVhVzcrZXFtL2xz?= =?utf-8?B?YTN5b1QzaVd2aHhnRXpLRXNGNjYzdUp0bXNqYmRRMi9SSU9hU1BHbElpWTJE?= =?utf-8?B?OENtYzBPMS94OEJWdnhhZVYrWi9XdVVDSVZDNFdBNlZhYXpCRWlRQ09lK3la?= =?utf-8?B?MXJpU0dnZzdaNzRDSVRhS1R6enJRSUFDbmtIandZWFZwSnRyVlVnc1hUMmFJ?= =?utf-8?B?YzhSNzFsWFlBenJJNDNKT3RRUlFmSXM2akpkUUFtT0dBbTljcDBkSEdUQzVP?= =?utf-8?B?d0Q4dkphc1RrSCtxdlFLbzVMbHV5Y01Ld0hhTVZSK3FIb1RybUsxdnV3T0hQ?= =?utf-8?B?VENxWjZ4VCtub0NFMCtraC9zRkVUdWx6QTYyVzFNekdHU0UwTEdSMkNLOE92?= =?utf-8?B?OXptS0NNM0Y0V2R5ZmpFR3RRTE5wNmpXVWlEMFpQZlh5MWxVQzJURzFvNWJu?= =?utf-8?B?VGhkRjd4bDdEYnNueHFSbytVWHpvcDFqUi9GQUF4ZTV3bG9PQTBrWjJnOG1o?= =?utf-8?B?TnpoajZISkxnbGJ4a2NGVmdCcXhPY3FsdkJ5NExodzByU0lkclFzcjdkZWlQ?= =?utf-8?B?SFgzenNONzVhZEJyUlYvSVMzNGpDQzM5WHBPbXJ3MDR4YmxFTmQ0dW0rMERt?= =?utf-8?B?VG42K2lESjFaM1N5SytGUkprd0M5VlR3WjUzaHBuL2k5M2xtNXVoQUptK2RZ?= =?utf-8?B?ZGIyaUEyZklCR1RxQnBmRCtxdmlHbXc1QS9td2FJOFhoVkRoa0xzNFQxV1ll?= =?utf-8?B?ZEl6VUJBS2dyc2FVWmErbkpXYUNjVyt2Z0ZsbndRcmFQeENLZWd6dlpDM1pJ?= =?utf-8?B?V21oRUpWNDgzNHovdXgzcUJsMXkwSU1IanhaRUFUSDczYkdpVDd0b01HWFZT?= =?utf-8?B?SUowWXJTaUhFZTg2NG4zVDFlMXZXcVpJWm5pUks2QUhmQ2oyYlZxTkQ2T0FT?= =?utf-8?B?WnpSRlJqcGVDeXJ0QzlpSElTbzhacEs0K1Q5aDJ2NVJ5dlNBWEdGU1VkcDcz?= =?utf-8?B?OHhpZWp1bWhZVHpnTzhIYTJSOG9jMzFORjBWaEI4YXJsTkNMclFZc3J4aVNG?= =?utf-8?B?MjhCKzVTT2dRYzZLOTFhT25aTmtrbkdGNnNrZVFMQ2tYZFhQZG02WStraUkz?= =?utf-8?B?V1NUSGFGdE1KRDdnLzBWZktSdHZjTXV2YjBUV2dDOWoyZURBakhadExDUXRj?= =?utf-8?B?T2FXbjF6RWloOS9BUmdiSEdVbWdmZ2dEWVpsMDhZWjdVNmxXaGpJMVBneXRv?= =?utf-8?B?Z3V1OGRiYWExTzlMWm9WNUNsZHBkM3kramV2NU5WU0RkMVpqUk5lMzZtblVs?= =?utf-8?B?T1E2T2lzOWJsUlJWZEJVbjdoYWo3dkJRc0FSSTFBYkNUdkpEaXBSMXNlTGE2?= =?utf-8?B?c0dqZE1WR1ZJR3VHakNYbjFleDNGWkNnZmhpV053b3J2akFWWHVOTHRLL0lQ?= =?utf-8?B?elM0ck5TYkw2ZnE3aFVaS1VXMDAwa21Jek9uakRHeGNxWWNXbVVMMGF6cE5M?= =?utf-8?B?cVJOU2VUSFp2SFpEQmxMSGhZdld6QmlaSTRTSDhtZzB1YjNoanVrcEV6NnhN?= =?utf-8?Q?peIxuBJC3xZQr?= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(36860700013)(35042699022)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 18:35:34.0994 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7399c16f-d5fb-49f8-6f10-08dcb70fb94f X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D07.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9724 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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.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 Hi Andrew, On 8/7/24 15:31, Andrew Burgess wrote: > Luis Machado writes: > >> Hi Andrew, >> >> On 6/3/24 19:16, Andrew Burgess wrote: >>> After a recent patch review I asked myself why can_spawn_for_attach >>> exists. This proc currently does some checks, and then calls >>> can_spawn_for_attach_1 which is an actual caching proc. >>> >>> The answer is that can_spawn_for_attach exists in order to call >>> gdb_exit the first time can_spawn_for_attach is called within any test >>> script. >>> >>> The reason this is useful is that can_spawn_for_attach_1 calls >>> gdb_exit. If imagine the user calling can_spawn_for_attach_1 directly >>> then a problem might exist. Imagine a test written like this: >>> >>> gdb_start >>> >>> if { [can_spawn_for_attach_1] } { >>> ... do stuff that assumes GDB is running ... >>> } >>> >>> If this test is NOT the first test run, and if an earlier test calls >>> can_spawn_for_attach_1, then when the above test is run the >>> can_spawn_for_attach_1 call will return the cached value and gdb_exit >>> will not be called. >>> >>> But, if the above test IS the first test run then >>> can_spawn_for_attach_1 will not returned the cached value, but will >>> instead compute the cached value, a process that ends up calling >>> gdb_exit. When the body of the if is executed GDB would no longer be >>> running and the test would fail! >>> >>> So can_spawn_for_attach was added which ensures that we _always_ call >>> gdb_exit the first time can_spawn_for_attach is called within a single >>> test script, this ensures that in the above case, even if the above is >>> not the first test run, gdb_exit will still be called. This avoids >>> some hidden bugs in the testsuite. >>> >>> However, what I observe is that can_spawn_for_attach is not the only >>> caching proc that calls gdb_exit. Why does can_spawn_for_attach get >>> special treatment when surely the same issue exists for any other >>> caching proc that calls gdb_exit? >>> >>> I think a better solution is to move the logic from >>> can_spawn_for_attach into cache.exp and generalise it so that it >>> applies to all caching procs. >>> >>> This commit does this by: >>> >>> 1. When the underlying caching proc is executed we wrap gdb_exit. >>> This wrapper sets a global to true if gdb_exit is called. The >>> value of this global is stored in gdb_data_cache (using a ',exit' >>> suffix), and also written to the cache file if appropriate. >>> >>> 2. When a cached value is returned from gdb_do_cache, if the >>> underlying proc would have called gdb_exit, and if this is the >>> first use of the caching proc in this test script, then we call >>> gdb_exit. >>> >>> When storing the ',exit' value into the on-disk cache file, the flag >>> value is stored on a second line. Currently every cached value only >>> occupies a single line, and a check is added to ensure this remains >>> true in the future. >>> >>> One issue did come up in testing, a FAIL in gdb.base/break-interp.exp, >>> this was caused by can_spawn_for_attach_1 calling gdb_start without >>> first calling gdb_exit. Under the old way of doing things >>> can_spawn_for_attach would call gdb_exit _before_ possibly calling the >>> actual caching proc. Under the new scheme gdb_exit is called _after_ >>> calling the actual caching proc. What was happening was that >>> break-interp.exp would leave GDB running then call >>> can_spawn_for_attach, when the test in can_spawn_for_attach_1 tried to >>> attach to the inferior, state left in the running GDB would cause some >>> unexpected behaviour. Fixed by having can_spawn_for_attach_1 call >>> gdb_exit before calling gdb_start, this ensures we have a fresh GDB. >>> >>> With this done can_spawn_for_attach_1 can be renamed to >>> can_spawn_for_attach, and the existing can_spawn_for_attach can be >>> deleted. >>> --- >>> gdb/testsuite/lib/cache.exp | 86 +++++++++++++++++++++++++++++++------ >>> gdb/testsuite/lib/gdb.exp | 83 +++++++++-------------------------- >>> 2 files changed, 93 insertions(+), 76 deletions(-) >>> >>> diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp >>> index e7b9114058b..fef065ec8b0 100644 >>> --- a/gdb/testsuite/lib/cache.exp >>> +++ b/gdb/testsuite/lib/cache.exp >>> @@ -46,6 +46,40 @@ proc gdb_do_cache_wrap {real_name args} { >>> return $result >>> } >>> >>> +# Global written to by wrap_gdb_exit. Set to true if wrap_gdb_exit is >>> +# called. >>> + >>> +set gdb_exit_called false >>> + >>> +# Wrapper around gdb_exit. Use with_override to replace gdb_exit with >>> +# wrap_gdb_exit, the original gdb_exit is renamed to orig_gdb_exit. >>> + >>> +proc wrap_gdb_exit {} { >>> + set ::gdb_exit_called true >>> + orig_gdb_exit >>> +} >>> + >>> +# If DO_EXIT is false then this proc does nothing. If DO_EXIT is true >>> +# then call gdb_exit the first time this proc is called for each >>> +# unique value of NAME within a single test. Every subsequent time >>> +# this proc is called within a single test (for a given value of >>> +# NAME), don't call gdb_exit. >>> + >>> +proc gdb_cache_maybe_gdb_exit { name do_exit } { >>> + if { !$do_exit } { >>> + return >>> + } >>> + >>> + # To track if this proc has been called for NAME we create a >>> + # global variable. In gdb_cleanup_globals (see gdb.exp) this >>> + # global will be deleted when the test has finished. >>> + set global_name __${name}__cached_gdb_exit_called >>> + if { ![info exists ::${global_name}] } { >>> + gdb_exit >>> + set ::${global_name} true >>> + } >>> +} >>> + >>> # A helper for gdb_caching_proc that handles the caching. >>> >>> proc gdb_do_cache {name args} { >>> @@ -71,10 +105,12 @@ proc gdb_do_cache {name args} { >>> >>> set is_cached 0 >>> if {[info exists gdb_data_cache(${cache_name},value)]} { >>> - set cached $gdb_data_cache(${cache_name},value) >>> - verbose "$name: returning '$cached' from cache" 2 >>> + set cached_value $gdb_data_cache(${cache_name},value) >>> + set cached_exit $gdb_data_cache(${cache_name},exit) >>> + verbose "$name: returning '$cached_value' from cache" 2 >>> if { $cache_verify == 0 } { >>> - return $cached >>> + gdb_cache_maybe_gdb_exit $name $cached_exit >>> + return $cached_value >>> } >>> set is_cached 1 >>> } >>> @@ -83,24 +119,46 @@ proc gdb_do_cache {name args} { >>> set cache_filename [make_gdb_parallel_path cache $cache_name] >>> if {[file exists $cache_filename]} { >>> set fd [open $cache_filename] >>> - set gdb_data_cache(${cache_name},value) [read -nonewline $fd] >>> + set content [split [read -nonewline $fd] \n] >>> close $fd >>> - set cached $gdb_data_cache(${cache_name},value) >>> - verbose "$name: returning '$cached' from file cache" 2 >>> + set gdb_data_cache(${cache_name},value) [lindex $content 0] >>> + set gdb_data_cache(${cache_name},exit) [lindex $content 1] >>> + set cached_value $gdb_data_cache(${cache_name},value) >>> + set cached_exit $gdb_data_cache(${cache_name},exit) >>> + verbose "$name: returning '$cached_value' from file cache" 2 >>> if { $cache_verify == 0 } { >>> - return $cached >>> + gdb_cache_maybe_gdb_exit $name $cached_exit >>> + return $cached_value >>> } >>> set is_cached 1 >>> } >>> } >>> >>> - set real_name gdb_real__$name >>> - set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] >>> + set ::gdb_exit_called false >>> + with_override gdb_exit wrap_gdb_exit orig_gdb_exit { >>> + set real_name gdb_real__$name >>> + set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] >>> + } >>> + set gdb_data_cache(${cache_name},exit) $::gdb_exit_called >>> + >>> + # If a value being stored in the cache contains a newline then >>> + # when we try to read the value back from an on-disk cache file >>> + # we'll interpret the second line of the value as the ',exit' value. >>> + if { [regexp "\[\r\n\]" $gdb_data_cache(${cache_name},value)] } { >>> + set computed_value $gdb_data_cache(${cache_name},value) >>> + error "Newline found in value for $cache_name: $computed_value" >>> + } >>> + >>> if { $cache_verify == 1 && $is_cached == 1 } { >>> - set computed $gdb_data_cache(${cache_name},value) >>> - if { $cached != $computed } { >>> - error [join [list "Inconsistent results for $cache_name:" >>> - "cached: $cached vs. computed: $computed"]] >>> + set computed_value $gdb_data_cache(${cache_name},value) >>> + set computed_exit $gdb_data_cache(${cache_name},exit) >>> + if { $cached_value != $computed_value } { >>> + error [join [list "Inconsistent value results for $cache_name:" >>> + "cached: $cached_value vs. computed: $computed_value"]] >>> + } >>> + if { $cached_exit != $computed_exit } { >>> + error [join [list "Inconsistent exit results for $cache_name:" >>> + "cached: $cached_exit vs. computed: $computed_exit"]] >>> } >>> } >>> >>> @@ -110,9 +168,11 @@ proc gdb_do_cache {name args} { >>> # Make sure to write the results file atomically. >>> set fd [open $cache_filename.[pid] w] >>> puts $fd $gdb_data_cache(${cache_name},value) >>> + puts $fd $gdb_data_cache(${cache_name},exit) >>> close $fd >>> file rename -force -- $cache_filename.[pid] $cache_filename >>> } >>> + gdb_cache_maybe_gdb_exit $name $gdb_data_cache(${cache_name},exit) >>> return $gdb_data_cache(${cache_name},value) >>> } >>> >>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >>> index 8235d4f28eb..d29fd740f91 100644 >>> --- a/gdb/testsuite/lib/gdb.exp >>> +++ b/gdb/testsuite/lib/gdb.exp >>> @@ -6186,14 +6186,23 @@ proc gdb_exit { } { >>> catch default_gdb_exit >>> } >>> >>> -# Helper function for can_spawn_for_attach. Try to spawn and attach, and >>> -# return 0 only if we cannot attach because it's unsupported. >>> - >>> -gdb_caching_proc can_spawn_for_attach_1 {} { >>> - # For the benefit of gdb-caching-proc-consistency.exp, which >>> - # calls can_spawn_for_attach_1 directly. Keep in sync with >>> - # can_spawn_for_attach. >>> - if { [is_remote target] || [target_info exists use_gdb_stub] } { >>> +# Return true if we can spawn a program on the target and attach to >>> +# it. >>> + >>> +gdb_caching_proc can_spawn_for_attach {} { >>> + # We use exp_pid to get the inferior's pid, assuming that gives >>> + # back the pid of the program. On remote boards, that would give >>> + # us instead the PID of e.g., the ssh client, etc. >>> + if {[is_remote target]} { >>> + verbose -log "can't spawn for attach (target is remote)" >>> + return 0 >>> + } >>> + >>> + # The "attach" command doesn't make sense when the target is >>> + # stub-like, where GDB finds the program already started on >>> + # initial connection. >>> + if {[target_info exists use_gdb_stub]} { >>> + verbose -log "can't spawn for attach (target is stub)" >>> return 0 >>> } >>> >>> @@ -6218,6 +6227,9 @@ gdb_caching_proc can_spawn_for_attach_1 {} { >>> set test_spawn_id [spawn_wait_for_attach_1 $obj] >>> remote_file build delete $obj >>> >>> + # In case GDB is already running. >>> + gdb_exit >>> + >>> gdb_start >>> >>> set test_pid [spawn_id_get_pid $test_spawn_id] >>> @@ -6239,61 +6251,6 @@ gdb_caching_proc can_spawn_for_attach_1 {} { >>> return $res >>> } >>> >>> -# Return true if we can spawn a program on the target and attach to >>> -# it. Calls gdb_exit for the first call in a test-case. >>> - >>> -proc can_spawn_for_attach { } { >>> - # We use exp_pid to get the inferior's pid, assuming that gives >>> - # back the pid of the program. On remote boards, that would give >>> - # us instead the PID of e.g., the ssh client, etc. >>> - if {[is_remote target]} { >>> - verbose -log "can't spawn for attach (target is remote)" >>> - return 0 >>> - } >>> - >>> - # The "attach" command doesn't make sense when the target is >>> - # stub-like, where GDB finds the program already started on >>> - # initial connection. >>> - if {[target_info exists use_gdb_stub]} { >>> - verbose -log "can't spawn for attach (target is stub)" >>> - return 0 >>> - } >>> - >>> - # The normal sequence to use for a runtime test like >>> - # can_spawn_for_attach_1 is: >>> - # - gdb_exit (don't use a running gdb, we don't know what state it is in), >>> - # - gdb_start (start a new gdb), and >>> - # - gdb_exit (cleanup). >>> - # >>> - # By making can_spawn_for_attach_1 a gdb_caching_proc, we make it >>> - # unpredictable which test-case will call it first, and consequently a >>> - # test-case may pass in say a full test run, but fail when run >>> - # individually, due to a can_spawn_for_attach call in a location where a >>> - # gdb_exit (as can_spawn_for_attach_1 does) breaks things. >>> - # To avoid this, we move the initial gdb_exit out of >>> - # can_spawn_for_attach_1, guaranteeing that we end up in the same state >>> - # regardless of whether can_spawn_for_attach_1 is called. However, that >>> - # is only necessary for the first call in a test-case, so cache the result >>> - # in a global (which should be reset after each test-case) to keep track >>> - # of that. >>> - # >>> - # In summary, we distinguish between three cases: >>> - # - first call in first test-case. Executes can_spawn_for_attach_1. >>> - # Calls gdb_exit, gdb_start, gdb_exit. >>> - # - first call in following test-cases. Uses cached result of >>> - # can_spawn_for_attach_1. Calls gdb_exit. >>> - # - rest. Use cached result in cache_can_spawn_for_attach_1. Calls no >>> - # gdb_start or gdb_exit. >>> - global cache_can_spawn_for_attach_1 >>> - if { [info exists cache_can_spawn_for_attach_1] } { >>> - return $cache_can_spawn_for_attach_1 >>> - } >>> - gdb_exit >>> - >>> - set cache_can_spawn_for_attach_1 [can_spawn_for_attach_1] >>> - return $cache_can_spawn_for_attach_1 >>> -} >>> - >>> # Centralize the failure checking of "attach" command. >>> # Return 0 if attach failed, otherwise return 1. >>> >> >> This is a bit after the fact, but I tracked down some aarch64 sme test regressions >> to this particular patch. I'm still investigating exactly why it stopped working, but I >> can tell it only happens if we run 2 or more tests in the same run. It is not >> clear if making things parallel has an impact, or if it is just the fact we >> run 2+ tests in the same run. >> >> I suspect we may be calling gdb_exit when we shouldn't, and then things just >> stop working. >> >> --- >> >> Running target unix >> Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. >> Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. >> Using repos/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file. >> Running repos/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-sme-core-0.exp ... >> Running repos/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-3.exp ... >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> FAIL: gdb.arch/aarch64-sme-regs-unavailable-3.exp: prctl, vl=32 svl=256: check_regs: incorrect ZA state >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> ERROR: no fileid for ubuntu >> FAIL: gdb.arch/aarch64-sme-regs-unavailable-3.exp: gdb, vl=32 svl=256: check_regs: incorrect ZA state > > Luis, > > Could you please test the patch below to see if this fixes the issues > you are seeing. This is also running through local testing at my side, > but I thought I'd get your feedback early. > > Thanks, > Andrew > > --- > > commit 27d8be90b65e0b18ff9ca8e356f0b4e95352f446 > Author: Andrew Burgess > Date: Wed Aug 7 14:51:06 2024 +0100 > > gdb/testsuite: track nested caching proc calls > > It was pointed out in this email: > > https://inbox.sourceware.org/gdb-patches/97973506-79f4-4216-9c0b-57401b3933f5@arm.com > > that this commit: > > commit 0726729d344fecf98f8d138e688e77201cc3cece > Date: Mon Jun 3 13:56:54 2024 +0100 > > gdb/testsuite: track if a caching proc calls gdb_exit or not > > had broken some AArch64 tests. > > What is going on is that there are two caching procs: > > allow_aarch64_sme_tests > aarch64_initialize_sme_information > > the allow_aarch64_sme_tests proc makes a call to > aarch64_initialize_sme_information, but > aarch64_initialize_sme_information is also called from other > non-caching procs, like aarch64_supports_sme_svl. > > Both of the caching procs mentioned above compile and run a helper > program, and both of them call gdb_exit. > > After the above commit, the first call to any caching proc, the body > of which calls gdb_exit, will result in a gdb_exit call even if the > body is not executed and the result is fetched from the cache. > > What was observed is that in the first test script > allow_aarch64_sme_tests is called, the body of this caching proc is > run which calls gdb_exit. Then allow_aarch64_sme_tests calls > aarch64_initialize_sme_information, the body of which is run and > gdb_exit is called again. The results from both procs are added to > the cache. > > In the next test script allow_aarch64_sme_tests is called. This > results in a cache hit, but gdb_exit is also called as this is the > first call in this second test script. > > Later in the test script aarch64_supports_sme_svl is called which > calls aarch64_initialize_sme_information. As this is the first call > to aarch64_initialize_sme_information in this second test > script (remember the body of allow_aarch64_sme_tests was never run) > then gdb_exit is called. This call to gdb_exit is new after the above > commit and is unexpected. > > I think the idea behind the above commit is still sound though. If > the call to allow_aarch64_sme_tests was removed from the second test > script then we would want the extra gdb_exit call as this would expose > a real bug in the test. The problem is that after the above commit > the nested nature of the caching proc calls becomes important: a call > to allow_aarch64_sme_tests should mean that we've also called > aarch64_initialize_sme_information, and that relationship isn't > currently captured. > > So in this commit I'm adding another field to the global > gdb_data_cache (in lib/cache.exp). This new field is 'also_called'. > For every caching proc we'll populate this field with a list of names, > these are the names of any nested caching procs that are called when > the body of a caching proc is executed. > > Now when we get a cache hit in gdb_data_cache we mark every proc in > the 'also_called' list as having been called. This means that further > calls to these procs will no longer trigger a gdb_exit call. > > diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp > index 092b7f136e8..7e1eae9259e 100644 > --- a/gdb/testsuite/lib/cache.exp > +++ b/gdb/testsuite/lib/cache.exp > @@ -59,24 +59,48 @@ proc gdb_exit_called { args } { > set ::gdb_exit_called true > } > > -# If DO_EXIT is false then this proc does nothing. If DO_EXIT is true > -# then call gdb_exit the first time this proc is called for each > -# unique value of NAME within a single test. Every subsequent time > -# this proc is called within a single test (for a given value of > -# NAME), don't call gdb_exit. > - > -proc gdb_cache_maybe_gdb_exit { name do_exit } { > - if { !$do_exit } { > +# While calling the implementation of a caching proc, that > +# implementation might itself call additional caching procs. We need > +# to track all of the nested caching procs that are called and we do > +# that in this list which is a list containing the names of any nested > +# caching procs that are called. > + > +set gdb_nested_caching_proc_calls {} > + > +# Called before returning from gdb_do_cache. PROC_NAME is the name of > +# the caching proc that was called and CACHE_NAME is that name used to > +# store information in the global gdb_data_cache for PROC_NAME. > +# > +# If CACHE_NAME's 'exit' flag is true in gdb_data_cache then we call > +# gdb_exit and then set a global flag to indicate that gdb_exit should > +# not be called again for either PROC_NAME or for any caching proc's > +# that PROC_NAME itself calls. The list of nested caching procs that > +# need to be marked is obtained from the 'also_called' key in the > +# gdb_data_cache for CACHE_NAME. > + > +proc gdb_cache_maybe_gdb_exit { proc_name cache_name } { > + global gdb_data_cache > + > + # The cache 'exit' entry will be true if this caching proc, or any > + # caching proc that is recursively called from this caching proc, > + # called exit. > + if { !$gdb_data_cache(${cache_name},exit) } { > return > } > > # To track if this proc has been called for NAME we create a > # global variable. In gdb_cleanup_globals (see gdb.exp) this > # global will be deleted when the test has finished. > - set global_name __${name}__cached_gdb_exit_called > + set global_name __${proc_name}__cached_gdb_exit_called > if { ![info exists ::${global_name}] } { > gdb_exit > + verbose -log "gdb_caching_proc $proc_name caused gdb_exit to be called" > set ::${global_name} true > + > + foreach other_name $gdb_data_cache(${cache_name},also_called) { > + set global_name __${other_name}__cached_gdb_exit_called > + set ::${global_name} true > + } > } > } > > @@ -107,9 +131,10 @@ proc gdb_do_cache {name args} { > if {[info exists gdb_data_cache(${cache_name},value)]} { > set cached_value $gdb_data_cache(${cache_name},value) > set cached_exit $gdb_data_cache(${cache_name},exit) > + set cached_also_called $gdb_data_cache(${cache_name},also_called) > verbose "$name: returning '$cached_value' from cache" 2 > if { $cache_verify == 0 } { > - gdb_cache_maybe_gdb_exit $name $cached_exit > + gdb_cache_maybe_gdb_exit $name $cache_name > return $cached_value > } > set is_cached 1 > @@ -123,11 +148,13 @@ proc gdb_do_cache {name args} { > close $fd > set gdb_data_cache(${cache_name},value) [lindex $content 0] > set gdb_data_cache(${cache_name},exit) [lindex $content 1] > + set gdb_data_cache(${cache_name},also_called) [lindex $content 2] > set cached_value $gdb_data_cache(${cache_name},value) > set cached_exit $gdb_data_cache(${cache_name},exit) > + set cached_also_called $gdb_data_cache(${cache_name},also_called) > verbose "$name: returning '$cached_value' from file cache" 2 > if { $cache_verify == 0 } { > - gdb_cache_maybe_gdb_exit $name $cached_exit > + gdb_cache_maybe_gdb_exit $name $cache_name > return $cached_value > } > set is_cached 1 > @@ -144,10 +171,16 @@ proc gdb_do_cache {name args} { > trace add execution gdb_exit enter gdb_exit_called > set ::gdb_exit_trace_in_place true > set gdb_exit_trace_created true > + set gdb_current_nested_proc_calls {} > } else { > set gdb_exit_trace_created false > + set gdb_current_nested_proc_calls $::gdb_nested_caching_proc_calls > } > > + # Reset the global list of nested caching procs, this means that > + # we are only gathering results for the current call. > + set ::gdb_nested_caching_proc_calls {} > + > # As above, we need to consider recursive calls into gdb_do_cache. > # Store the old value of gdb_exit_called global and then set the > # flag to false. Initially gdb_exit_called is always false, but > @@ -167,6 +200,15 @@ proc gdb_do_cache {name args} { > set real_name gdb_real__$name > set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] > set gdb_data_cache(${cache_name},exit) $::gdb_exit_called > + set gdb_data_cache(${cache_name},also_called) $::gdb_nested_caching_proc_calls > + > + # We have recorded the list of nested caching procs into the cache > + # (above) for CACHE_NAME. Now we add back the previous value and > + # also append the current caching proc's name, this means that if > + # this is a nested call then out caller will see the complete list > + # of nested caching procs so far. > + append ::gdb_nested_caching_proc_calls $gdb_current_nested_proc_calls > + lappend ::gdb_nested_caching_proc_calls $name > > # See comment above where OLD_GDB_EXIT_CALLED is set: if > # GDB_EXIT_CALLED was previously true then this is a recursive > @@ -183,6 +225,7 @@ proc gdb_do_cache {name args} { > trace remove execution gdb_exit enter gdb_exit_called > unset ::gdb_exit_trace_in_place > set ::gdb_exit_called false > + set ::gdb_nested_caching_proc_calls {} > } > > # If a value being stored in the cache contains a newline then > @@ -196,6 +239,7 @@ proc gdb_do_cache {name args} { > if { $cache_verify == 1 && $is_cached == 1 } { > set computed_value $gdb_data_cache(${cache_name},value) > set computed_exit $gdb_data_cache(${cache_name},exit) > + set computed_also_called $gdb_data_cache(${cache_name},also_called) > if { $cached_value != $computed_value } { > error [join [list "Inconsistent value results for $cache_name:" > "cached: $cached_value vs. computed: $computed_value"]] > @@ -204,6 +248,10 @@ proc gdb_do_cache {name args} { > error [join [list "Inconsistent exit results for $cache_name:" > "cached: $cached_exit vs. computed: $computed_exit"]] > } > + if { $cached_also_called != $computed_also_called } { > + error [join [list "Inconsistent also_called results for $cache_name:" > + "cached: $cached_also_called vs. computed: $computed_also_called"]] > + } > } > > if {[info exists GDB_PARALLEL]} { > @@ -213,10 +261,11 @@ proc gdb_do_cache {name args} { > set fd [open $cache_filename.[pid] w] > puts $fd $gdb_data_cache(${cache_name},value) > puts $fd $gdb_data_cache(${cache_name},exit) > + puts $fd $gdb_data_cache(${cache_name},also_called) > close $fd > file rename -force -- $cache_filename.[pid] $cache_filename > } > - gdb_cache_maybe_gdb_exit $name $gdb_data_cache(${cache_name},exit) > + gdb_cache_maybe_gdb_exit $name $cache_name > return $gdb_data_cache(${cache_name},value) > } > > Thanks for the patch. On a first try (parallel run), I still see the errors with gdb_exit being called, but I'm trying to see if they go away in a serialized run, as it seemed to work. I'll report back when the tests are done running. Reading through the code, things make sense overall. But there are a few levels to it and it can get a bit complicated. So I'm taking my time to understand it.