From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ccJpCRAHSGrbGCQAWB0awg (envelope-from ) for ; Fri, 03 Jul 2026 15:01:36 -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=IcjJaUNB; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=IcjJaUNB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 21A4F1E098; Fri, 03 Jul 2026 15:01:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [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 526231E024 for ; Fri, 03 Jul 2026 15:01:35 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB5D94BA2E3B for ; Fri, 3 Jul 2026 19:01:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB5D94BA2E3B Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=IcjJaUNB; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=IcjJaUNB Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::1]) by sourceware.org (Postfix) with ESMTPS id 1DFB54BA2E13 for ; Fri, 3 Jul 2026 19:00:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1DFB54BA2E13 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 1DFB54BA2E13 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c201::1 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1783105225; cv=pass; b=TZdjTd8ccNHY2uDbBPKr6oAnsYFcRm23XNQtgoSuU8zJh3WZ2pP5MqsFtZeRFKsm9KNMRf0IchO91vdpOC2XaX/2iNKCBOnKRm/0gWUw6RKcqR6AwtpR7665rtCd6AvsASbDg7woP4iXxJNcf4E3YgPqmNXVo6Bn5vEnBNh99Oo= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1783105225; c=relaxed/simple; bh=VQyHj3Gugqog+zfHTMKtYLLJyFiGNaR5k/ETiCnKaD0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=SR4uUi8vP8R0S2Av95mImio5ntx1E1x0zD9QHmn1IANS89OREYyG+RTJBbJ4RQ1BZpOSpNFF9QPTAm9vERAkA9GamlWtS0pLrLwrlGzpj6EJU83H31mnRozv3eET9zKRrG+qe6OUP4hSGaQB3LBjN+wkWYc/hmfOfGbkDdU/DOM= ARC-Authentication-Results: i=3; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=IcjJaUNB; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=IcjJaUNB DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DFB54BA2E13 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=RuuzMhtqJwLVutsqJpWqwm093Cu9A2aGQLbRnZPtUEEh6fyyd3jZoi9tN7rsxgQmWQRouX7EoyuBWsrrSPnNcy2mp8T0h/qopTIcmK3l5g4nbiTl6hhru651byEfT0rbq25B7U5LpF7hSgqGTRf1AsMDtZanaGqvukk8WeAoK8SAPXQyJXc+JgnTPwmcKjVkPYSq7Fp7NHIRXlIcmiGeQ2Fgbi97eVatUK0DomOjH47ISnivfj1c2sQhUR+c0S0U7FE7pJdd/aPlEerD9XVBfwqrgNzriizC9AiT3+ADbgSjjSHv4Su+EYk7XxVLkxFPiNfkQhuIW6l0jcMLLSoxhg== 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=cLAc7ldvbecTBSeYy5GkyQ3tdqwT/wP8G7ZtbgziBmE=; b=e7rf/A18jRxSxWNq/DfSM7wkBPDU3s4mgEZRE0UGe4JETRoYABdZ4IGDZV7WnrvNZJmDFFNwl9uhj7pOknxvPMXEeFTiv94ZpbVqwPDawSYZvywwH1tBcjEQhE+VgHN17bT1OlJT4G/yv+4I+JfWliNYoGQtWJfF9r95jqwfKn/ZGYrUpjAPfVfP+6DTEbtZa1MlImzFw9+YUwxrcIxacABKyrnL0LSfENLj8lCB4NmstKGAPaxoxwFs6yw3KLuzPcw9u/lRSEgVczj7827mn0cYTKyoRYjToAqigZeI7A55/TOC/4DwLvfAZpns4fy64gWKdKMZg9CcRG+Nlsi2aA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) 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] 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=cLAc7ldvbecTBSeYy5GkyQ3tdqwT/wP8G7ZtbgziBmE=; b=IcjJaUNBZfANSkGyTlP0YEsMfGf+LVXY0ws7kTqPkZBLgqiG6yyy69T6Rg6pXL/JfvfP73WxiZqO02jtP8CJGaWD0k5OyjO8dIBtqYJZp5Enhv+fKZnqp0wjCzaUg/KLVh0E9fnjkyyS62zsqMXE+tjmvZxGzD5VbwkGKWb5cOs= Received: from AS4P191CA0033.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:657::20) by VI0PR08MB10942.eurprd08.prod.outlook.com (2603:10a6:800:253::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Fri, 3 Jul 2026 19:00:19 +0000 Received: from AM1PEPF000252DC.eurprd07.prod.outlook.com (2603:10a6:20b:657:cafe::33) by AS4P191CA0033.outlook.office365.com (2603:10a6:20b:657::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.11 via Frontend Transport; Fri, 3 Jul 2026 19:00:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) 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 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM1PEPF000252DC.mail.protection.outlook.com (10.167.16.54) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Fri, 3 Jul 2026 19:00:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fnUGyhqC42pk2NwTclPvVaPfMq4GaPSrV7RUXs7g/p6/fGNiXxfCwMGG8JkfXFUUwc2McH0GPpyjLLqe8IV1CvOL+nmOb0nZRYdeJQbWx4ZFFiMADda/EjK1k1E3FIyZqE6k8wFRGmpkbvuRFJqB+nfNe1I9RgduDkqXi87k6wHhdNZfBmqZMp04OQDIG4UONcLpe5G5HmZRpec3z5s3gGxtu9xsHJABsy5p0GuDcBRbOEhsUf3ce5mjLONuXO8phn55UcztbL4/FPO+z7Jq77nY/mC2XuGDDTDN/eT4sIDY77NYz+VNy3TjrIPfKEu/NKk5Mfd7ZjFTFV+XSWWB+A== 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=cLAc7ldvbecTBSeYy5GkyQ3tdqwT/wP8G7ZtbgziBmE=; b=qLNBVnaVEhK0ZwNdHhBRkyy2ZvSFbcIoSDrnLvLbXRPOzSTdO+u6iglVDt/a2+dYvZ55K/ibHxxj3mw7e/hOphieO8CaZBfF/Ma9Ebom/3HxryZPjK8bZbrt2QKcpiH//RKYYxxzcbsysoJxROtVWRVMTfNT3skEuyBCBq1R6uOuTTopI3ppE58xORpw7WK3atPHz99YTeSpmebWffHJBhvFkkn/7DyEstXmC81+emwpqiKLPUWvQ/ZjYDL3Nj9iFwpfjABhL/AJs/QWG6Lb8L0CrfDETV1cjIGQNLminD00kJgEBfBCGIazormGXbhi5g3JRfDT4zGf+HOyZQOIhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) 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=cLAc7ldvbecTBSeYy5GkyQ3tdqwT/wP8G7ZtbgziBmE=; b=IcjJaUNBZfANSkGyTlP0YEsMfGf+LVXY0ws7kTqPkZBLgqiG6yyy69T6Rg6pXL/JfvfP73WxiZqO02jtP8CJGaWD0k5OyjO8dIBtqYJZp5Enhv+fKZnqp0wjCzaUg/KLVh0E9fnjkyyS62zsqMXE+tjmvZxGzD5VbwkGKWb5cOs= Received: from DU7P251CA0028.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:551::12) by AS2PR08MB9788.eurprd08.prod.outlook.com (2603:10a6:20b:603::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Fri, 3 Jul 2026 18:59:14 +0000 Received: from DB5PEPF00014B9E.eurprd02.prod.outlook.com (2603:10a6:10:551:cafe::64) by DU7P251CA0028.outlook.office365.com (2603:10a6:10:551::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.11 via Frontend Transport; Fri, 3 Jul 2026 18:59:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by DB5PEPF00014B9E.mail.protection.outlook.com (10.167.8.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Fri, 3 Jul 2026 18:59:14 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EX03.Arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Fri, 3 Jul 2026 18:59:11 +0000 Received: from PF4S4363.arm.com (10.1.37.19) by mail.arm.com (10.240.25.138) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Fri, 3 Jul 2026 18:59:11 +0000 From: Matthieu Longo To: CC: Luis Machado , Luis Machado , Andrew Burgess , "Matthieu Longo" Subject: [PATCH v1 1/8] gdb/linux-tdep: use pid_t consistently for process IDs Date: Fri, 3 Jul 2026 19:58:46 +0100 Message-ID: <20260703185853.450440-2-matthieu.longo@arm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260703185853.450440-1-matthieu.longo@arm.com> References: <20260703185853.450440-1-matthieu.longo@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB5PEPF00014B9E:EE_|AS2PR08MB9788:EE_|AM1PEPF000252DC:EE_|VI0PR08MB10942:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c07db7a-ee31-4334-25fa-08ded9355301 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700016|23010399003|11063799006|56012099006|6133799003|18002099003|22082099003|3023799007; X-Microsoft-Antispam-Message-Info-Original: KYQdyjNpmlD8ySz3MIGXQOJNq+g1tL0q42oTAcY4oaRcsal8KQVqh5K6lEXtJh4MLo5UNF2XzRMoyuATy8JeHx/1SEwuA8m+j63dO7Mp6ByaTFpLbJ7wDk3KYHAYQMEAgg+tOy69jCbDKNQ01wT8cOzt6BFVm28fD5JzTxSMpku+dxcl2H/PmU3MP+L9AyPoaNGgCyzZ6Lpzqf6BQb7F8/jvuAM8xzDp5NOLCpzKsctud0fu5mAhV6wqpDNqPsBUKGUJ8aNJohJjIjBqHGopaUUKYWE9+ZdEdZXHGE5UmAyNlob9oyhL7HMlXXTxSdk29TKWaXB4cj4FASqU+6uiVMMp8CaVwPoremEp7ijj73WZUTS4lzVIcn4ZSh+G0NaeN9goAY8agaNraYO0NwyyZeB+3p4yF8m3o07eGY16B+VSiCO5aHCs1ibqgSJBPi46oJZKISoRV6PaNUGGPmuAV2BL+b9+xgMzZMi3M+gWcKwUztJL8IcLgP4j0okVLadO1iA+Iz3TmvWkaLPKflJNnH8OQ/0FibNAbi9g/it73lR4Tpp9gysX8kfe/oMLy///fx0/ikLtbS/0PUlLLPgYvgLS7zJKcJMwBpJmEcek7jX0kX3IDpPWN3qTojDvzX88CScMN7I0IEmc4k/wf081hIwYUh0pjfXzNVAA3UqSjolLWZ/ORIZjucY2QilAYmi8s4OoyvkIZ3c1XFM7+HjwOw== X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(82310400026)(36860700016)(23010399003)(11063799006)(56012099006)(6133799003)(18002099003)(22082099003)(3023799007); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: T44iNkb7OhWF+9vH8Mu8NW7E9L57frIbCljQAdTtEHmGLHcYEpArBvsVf9bIGcPO81wgL/C+VC8zAwp+xFaneQP8YCPpJz12ZFdxudleuRRCC/e/lU8c8XpovorK+u496D/5IfrKzCllHt4sPWnWDJbsT2kDkQaXFDXmygcSVijf2BQvOhz83Imlc0hZNAu9Vbw4N8oEd4W1YN4/XOZFDG8PWfN6y84nChq+MxT6oPv+LGyr6GQ5L1eSTbvV59KJHPS4OH+6dSKLW7eIOb3J6G4SlcTdyffH85SJiEoRh4p0PO7vK2njq8E9fy57C9yG8tLt+yCHCD5EMYRpes1Czw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9788 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM1PEPF000252DC.eurprd07.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 97d9054d-4cf1-46cc-777e-08ded9352d40 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|14060799003|35042699022|376014|82310400026|1800799024|23010399003|3023799007|6133799003|56012099006|18002099003|22082099003|11063799006; X-Microsoft-Antispam-Message-Info: I2JS3QGL/6DmZQEFPDSRgeYA7Wtrm19509TrL+thRxPEyWO2r9rZZ8PX685ZdThRQGy9qR8k0oTX9lIk52z1thLuc41QujIJdGRUNB+fOWh26Sh4Wm3Z9E61XCok97CJ+saQanibb6Yz+A+hKf+GxJymF6iIsCbvKN8ow/Vcl5Q2VhkIB5AQ5rZlF7w1KRc5Xcrz2uuIdlQzXmztw99YCr92RX00DNxsVz+dn6gFNovdjWO4BFwPhPKSm7NlvRIhhAlOyEYD6ur82huKl9Sq3VNNTTBb6WUsC5sH9fNhHS8KmNC1PjHLtL1xeSJBi3KAap805MMGrxdgtjcvoOp9PO9WjdcGm4CJkza91GJ9OwKIU34ckZDTZcc7mlFM5f26Lxhvuw7JqhIPq01o5YpMToPsk8uHJ8eh4TYwwK1I5YYgvL02zggLLU/tmF/cFyFyE4Hu5hcy1MzOXhRynZKW2PqdKxcAbXLFeXsarhITFmr79dftXKaZF8ofXYPbmvRA5TQPv8in/Ki34yana9MPaJ0mF3MSH23pzdM8212PuslgHi/ezkfvpKCN2gZsSCboGmcx5So5ESeT0f4XW9xTCQXnl5aVkPi9k7AlaGF40nh1hhHR8rYHhiiqdgSbFQ8uWXYyfYKnsvw9iqJ76MdX2DQMAfh0Hu6rtvd4yX+QIIN4RWdPN0BqeDhcc4pwO4XIPnOZyRgAPYnpaO8EvUJQXA== X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700016)(14060799003)(35042699022)(376014)(82310400026)(1800799024)(23010399003)(3023799007)(6133799003)(56012099006)(18002099003)(22082099003)(11063799006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: blGjCOEqNvYGWeFdM7Y9kEHledi1tn4Urcsp8i+NqUU7AqdIfrw00wXKCeG0F93aUa3DG4ttiOEqwcDauwjbB5EN3cKfQJApmWIXZNqNSDLS5+jSyHZrUf+/n02qAMRAIl/fjZpD57uh9pfwXSkBfxB4WL2pGoO0rDte0/PVMpe24bECvS7eM2XbD4sDzHRg22oBFVcyAAb0hNKAN4FTc1z1/vdKnB2XB8fxBQd4pWXfMeV0VnivIaT6iaDATlsO4thae8bIiq6C5fXOOp8SiA7ka2Zk+4jWoqS871USDpC8zxP8c3I8c/J8qMehZvBdbp6I/XOg9nFyb++1SsoutMPyEkS8qJDTlRjmuYtjRfvJWDsQYQw2geBPIATtkknkuWkDPirEXxGXAyctDCx9ogN1MJ4ZjairAoZZQI+JPjupFl412CA7noYN6PD4b/0o X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2026 19:00:18.1352 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c07db7a-ee31-4334-25fa-08ded9355301 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AM1PEPF000252DC.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR08MB10942 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 Use `pid_t' consistently instead of a mix of `pid_t', `int', and `long' when representing process IDs in gdb/linux-tdep.c. Also change inferior::pid to `pid_t' so that the inferior's process ID uses the appropriate type throughout GDB. Finally, factor out path templates "/proc/%d/{maps,smaps}" into named constants. --- gdb/inferior.h | 2 +- gdb/linux-tdep.c | 41 ++++++++++++++++++++--------------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/gdb/inferior.h b/gdb/inferior.h index 9c031035a23..dc71cbdb264 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -590,7 +590,7 @@ class inferior : public refcounted_object, /* Actual target inferior id, usually, a process id. This matches the ptid_t.pid member of threads of this inferior. */ - int pid = 0; + pid_t pid = 0; /* True if the PID was actually faked by GDB. */ bool fake_pid_p = false; diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index d5b0e6e7011..9f8f9f1af5e 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -48,6 +48,9 @@ #include +constexpr const char *PROC_PID_SMAPS = "/proc/%d/smaps"; +constexpr const char *PROC_PID_MAPS = "/proc/%d/maps"; + /* This enum represents the values that the user can choose when informing the Linux kernel about which memory mappings will be dumped in a corefile. They are described in the file @@ -842,9 +845,7 @@ static void linux_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what) { - /* A long is used for pid instead of an int to avoid a loss of precision - compiler warning from the output of strtoul. */ - long pid; + pid_t pid; int cmdline_f = (what == IP_MINIMAL || what == IP_CMDLINE || what == IP_ALL); int cwd_f = (what == IP_MINIMAL || what == IP_CWD || what == IP_ALL); int environ_f = (what == IP_ENVIRON || what == IP_ALL); @@ -876,10 +877,10 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, if (args && args[0]) error (_("Too many parameters: %s"), args); - gdb_printf (_("process %ld\n"), pid); + gdb_printf (_("process %d\n"), pid); if (cmdline_f) { - xsnprintf (filename, sizeof filename, "/proc/%ld/cmdline", pid); + xsnprintf (filename, sizeof filename, "/proc/%d/cmdline", pid); gdb_byte *buffer; LONGEST len = target_fileio_read_alloc (nullptr, filename, &buffer); @@ -901,7 +902,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, } if (cwd_f) { - xsnprintf (filename, sizeof filename, "/proc/%ld/cwd", pid); + xsnprintf (filename, sizeof filename, "/proc/%d/cwd", pid); std::optional contents = target_fileio_readlink (NULL, filename, &target_errno); if (contents.has_value ()) @@ -911,7 +912,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, } if (environ_f) { - xsnprintf (filename, sizeof filename, "/proc/%ld/environ", pid); + xsnprintf (filename, sizeof filename, "/proc/%d/environ", pid); gdb_byte *buffer; LONGEST len = target_fileio_read_alloc (nullptr, filename, &buffer); @@ -935,7 +936,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, } if (exe_f) { - xsnprintf (filename, sizeof filename, "/proc/%ld/exe", pid); + xsnprintf (filename, sizeof filename, "/proc/%d/exe", pid); std::optional contents = target_fileio_readlink (NULL, filename, &target_errno); if (contents.has_value ()) @@ -945,7 +946,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, } if (mappings_f) { - xsnprintf (filename, sizeof filename, "/proc/%ld/maps", pid); + xsnprintf (filename, sizeof filename, "/proc/%d/maps", pid); gdb::unique_xmalloc_ptr map = target_fileio_read_stralloc (NULL, filename); if (map != NULL) @@ -990,7 +991,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, } if (status_f) { - xsnprintf (filename, sizeof filename, "/proc/%ld/status", pid); + xsnprintf (filename, sizeof filename, "/proc/%d/status", pid); gdb::unique_xmalloc_ptr status = target_fileio_read_stralloc (NULL, filename); if (status) @@ -1000,7 +1001,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, } if (stat_f) { - xsnprintf (filename, sizeof filename, "/proc/%ld/stat", pid); + xsnprintf (filename, sizeof filename, "/proc/%d/stat", pid); gdb::unique_xmalloc_ptr statstr = target_fileio_read_stralloc (NULL, filename); if (statstr) @@ -1673,7 +1674,7 @@ linux_process_address_in_memtag_page (CORE_ADDR address) pid_t pid = current_inferior ()->pid; - std::string smaps_file = string_printf ("/proc/%d/smaps", pid); + std::string smaps_file = string_printf (PROC_PID_SMAPS, pid); gdb::unique_xmalloc_ptr data = target_fileio_read_stralloc (NULL, smaps_file.c_str ()); @@ -1731,7 +1732,6 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, linux_dump_mapping_p_ftype *should_dump_mapping_p, linux_find_memory_region_ftype func) { - pid_t pid; /* Default dump behavior of coredump_filter (0x33), according to Documentation/filesystems/proc.txt from the Linux kernel tree. */ @@ -1744,7 +1744,7 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, if (current_inferior ()->fake_pid_p) return false; - pid = current_inferior ()->pid; + pid_t pid = current_inferior ()->pid; if (use_coredump_filter) { @@ -1763,7 +1763,7 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, } } - std::string maps_filename = string_printf ("/proc/%d/smaps", pid); + std::string maps_filename = string_printf (PROC_PID_SMAPS, pid); gdb::unique_xmalloc_ptr data = target_fileio_read_stralloc (NULL, maps_filename.c_str ()); @@ -1771,7 +1771,7 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, if (data == NULL) { /* Older Linux kernels did not support /proc/PID/smaps. */ - maps_filename = string_printf ("/proc/%d/maps", pid); + maps_filename = string_printf (PROC_PID_MAPS, pid); data = target_fileio_read_stralloc (NULL, maps_filename.c_str ()); if (data == nullptr) @@ -2805,7 +2805,6 @@ static bool linux_vsyscall_range_raw (struct gdbarch *gdbarch, struct mem_range *range) { char filename[100]; - long pid; if (target_auxv_search (AT_SYSINFO_EHDR, &range->start) <= 0) return false; @@ -2844,7 +2843,7 @@ linux_vsyscall_range_raw (struct gdbarch *gdbarch, struct mem_range *range) if (current_inferior ()->fake_pid_p) return false; - pid = current_inferior ()->pid; + pid_t pid = current_inferior ()->pid; /* Note that reading /proc/PID/task/PID/maps (1) is much faster than reading /proc/PID/maps (2). The later identifies thread stacks @@ -2854,7 +2853,7 @@ linux_vsyscall_range_raw (struct gdbarch *gdbarch, struct mem_range *range) a few thousand threads, (1) takes a few milliseconds, while (2) takes several seconds. Also note that "smaps", what we read for determining core dump mappings, is even slower than "maps". */ - xsnprintf (filename, sizeof filename, "/proc/%ld/task/%ld/maps", pid, pid); + xsnprintf (filename, sizeof filename, "/proc/%d/task/%d/maps", pid, pid); gdb::unique_xmalloc_ptr data = target_fileio_read_stralloc (NULL, filename); if (data != NULL) @@ -3168,9 +3167,9 @@ linux_address_in_shadow_stack_mem_range if (!target_has_execution () || current_inferior ()->fake_pid_p) return false; - const int pid = current_inferior ()->pid; + pid_t pid = current_inferior ()->pid; - std::string smaps_file = string_printf ("/proc/%d/smaps", pid); + std::string smaps_file = string_printf (PROC_PID_SMAPS, pid); gdb::unique_xmalloc_ptr data = target_fileio_read_stralloc (nullptr, smaps_file.c_str ()); -- 2.55.0