From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60079.outbound.protection.outlook.com [40.107.6.79]) by sourceware.org (Postfix) with ESMTPS id 79F1D382FAC5 for ; Wed, 16 Nov 2022 19:05:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79F1D382FAC5 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-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ZMkmA4THmbLXnIz2WaZ9vl54fnZ833bCij9lG1oEl6EXaXbxqZ8Q8f3lHxlR+ziXjGO3+vXYUNELkQGExe03Z1GbDdnyzeyWISLjWqKu3XCA+aT4ilGng2vpZ7uiGljuZY4xDi4UsuidfYWRopsWOsI4GbGxiFDme8XZgxpdopbxDOux6hIU8AIPMBn/vTzcRkF4Gt7W8tupV+A8t3if9EeDP4uofgWIvER05FNogT7prSGSjDoOUTMzmyZu2JXYjBA885+gvHAUHpfH5Esyg1bLcJ87l+HdaXGzpCKbNr16mspe4ahSjaF1IhTdKR3OsGd3bluIeHI46XO9Jjat8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Oy2t+3RZkVZ86pqTOJ1W480hA2b978LMmFpKNSWROuE=; b=I9Um2hT3xC0HerIZAxuzVLy45ibrtj47tc7IP2M+mXfpuCLIBCliQyhXMw6PzAW4ABj3Wdx7bg8qb+zRUVhe8QgLLgUi+QrZB+AOllxWiJEMNe6lTTOQEyW9mPKl6Ypl7FN9vFwHvKOiAGC0pgHKP7JW6d0ZEms4XqhCEp4hH8acwkabyZLorD67aAOrCjpMmHjYjkrg3cyLhGwHJwTFFsiKfQmUr3elUMr7UskpoTxD5o5poUtMZ4fJIG4r/ukdGdN/3iBvF5MfMJ1i5uKGerQu+cKpMvSvskArv7FQ9JAdBBW5jJ4WEJo7nDCvi9BIwgNFxggfM8EJfUbPS5uNUw== 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oy2t+3RZkVZ86pqTOJ1W480hA2b978LMmFpKNSWROuE=; b=LhMhJXny9iZgRDw12biTvb4HS6IYrMsxugAEjHTn1uWpZdE95zabt718zCYzwuJ+gx6CBF+nCFVhLm7J/p64o0FWBHMYbmGVkAKXxPbc4t+J8ORXxN316BZHqbFVB0DgFk9iDJbrimnkWd+71+7/Ba76TpMge29d6MVScQtPBCc= Received: from DB6PR1001CA0028.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::14) by AM0PR08MB5299.eurprd08.prod.outlook.com (2603:10a6:208:18d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.6; Wed, 16 Nov 2022 19:05:12 +0000 Received: from DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::c4) by DB6PR1001CA0028.outlook.office365.com (2603:10a6:4:55::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.18 via Frontend Transport; Wed, 16 Nov 2022 19:05:11 +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=armh.onmicrosoft.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 DBAEUR03FT044.mail.protection.outlook.com (100.127.142.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8 via Frontend Transport; Wed, 16 Nov 2022 19:05:11 +0000 Received: ("Tessian outbound 73ab5f36653e:v130"); Wed, 16 Nov 2022 19:05:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f75de92f8514ffd7 X-CR-MTA-TID: 64aa7808 Received: from bd53f2327e73.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7BDFBECB-FB0F-4269-A557-194C651423AE.1; Wed, 16 Nov 2022 19:05:05 +0000 Received: from EUR03-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bd53f2327e73.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 16 Nov 2022 19:05:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ufyh9xrEV6NNbT/B6UE3j8zlVQbjZmss/NxLoYkxkO501TOCf9m+50IYzbUO+uz4igfgC/pxHdKkR9AitawokVprlshhnvRYfycAM5ef3irPN+yr4KHxIAV+kzVZna8VtDelr2Nul08NZ3DIP9d6zqVbgnoBhwKDHed1OD90lvJPcBmMfHrwOredVNS/F7uRM30mtVIDrtWe3dBsg3+Y6TuF7RXQ593jFt9rKz2osH/CXdUCpuG23RILobnKpUNbReM4pkFIT9yFwDNoScAvstD9z0O0UQgyPTlLVsQPrg4ms1CgrbYekK3wQnzb42PeH/20AoezvSz4UJVYKBAnCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Oy2t+3RZkVZ86pqTOJ1W480hA2b978LMmFpKNSWROuE=; b=KU8hDk32vizSzEcthUDCN7aEwAS/jJs7y35y3gQmKMkMH5SfSfCAEpMWCwAMhjCxcwslnD7ApOJE143luoMRQNvRl/opLyJL7WdIMGQdSVj9zNFNmD52gvIDnBuIhWtmFsq8wHKvcFrZ/Cl/e9cZutnvZOJbxOM4KIBbmIgq1vDNgoZISCTe24CUkB3aKX4VY23hT1Bq8wr0fjhjFtKK+tad7RQ3NA9xoESQP7uY4I4poulpN1bYZbj5RvwNw64u6ZEr7XTYgM2Q/FeGg0s8yo3RpiGrUD41p8T/6qAOcj9C52BpmSspsqvikhRDh6vdQoXygp8xpp90tJ/fpcAZiA== 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oy2t+3RZkVZ86pqTOJ1W480hA2b978LMmFpKNSWROuE=; b=LhMhJXny9iZgRDw12biTvb4HS6IYrMsxugAEjHTn1uWpZdE95zabt718zCYzwuJ+gx6CBF+nCFVhLm7J/p64o0FWBHMYbmGVkAKXxPbc4t+J8ORXxN316BZHqbFVB0DgFk9iDJbrimnkWd+71+7/Ba76TpMge29d6MVScQtPBCc= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by GV2PR08MB8098.eurprd08.prod.outlook.com (2603:10a6:150:76::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.6; Wed, 16 Nov 2022 19:05:03 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::f9e6:599b:e673:801]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::f9e6:599b:e673:801%5]) with mapi id 15.20.5834.008; Wed, 16 Nov 2022 19:05:03 +0000 Message-ID: <65dc9aec-b868-5988-e9b5-5f460d38f6d2@arm.com> Date: Wed, 16 Nov 2022 19:04:55 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] Fix various procfs.c compilation errors Content-Language: en-US To: Rainer Orth , gdb-patches@sourceware.org References: From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SA9PR11CA0028.namprd11.prod.outlook.com (2603:10b6:806:6e::33) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|GV2PR08MB8098:EE_|DBAEUR03FT044:EE_|AM0PR08MB5299:EE_ X-MS-Office365-Filtering-Correlation-Id: b737d221-7752-4d24-e961-08dac8057cb2 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ctvEq9/GqoIKNhPtF3kkEPDqMkQf0advZEHXe+3VLo1LCO9vUZ24ZNGqsu7hAEBqGnrAht2fHSSDFtWV0DhpIJNxWvF0wGVz0MvDNlE0WOVVCL0qBBh93HBh02wvZaN1Mqjl05QkuHRuAx/es8troUixhR1WybxCd0G/aIUN1s4Rbpw7JZHoRJ2uutknvVI3//k38LiWbvf3C68zGyWvpXOgW58mXaCwdRrc2VT2gPYn2uPLKQKvbkmIILUR8936Un/aT7qc1Q3Pn0GilLpAlWwErFwL2LkBuGHGA01VjTNOErBrIoMr52z1ungJS0RXkEhuNt1sllx0Tf+5tz9fpJYvxeSSrqgavDwOy2zYlJWK92Ef18t5phDcneDQaGmk8cVe+mXN/ps8n2D/4xBW0/dwKAoLraI3pKKVGmDxc/Aymgo1wH1d4zb+7zT9muo5y4Kafk8Sn0V9O3ecspqOtQS/+tDXj5ROGPK1AL+libu9TkKb0JfpT7y5I7ak+k7gDGXWiYN/6m08BMLNDmhXwWl1aVw3qrkVU3j+rQO28G6uEVOnPqeqWp1eY2SzwPkEEDWxxM/w6c+maukVKUlKW4Zfnge3JQWS54KojU5RxsSCv6n9rqF4jjFu51iZb/TdQSnRblYcr5PxhVcP3ha9Cx9IP0dkar0+cnr4XMWMUD9mDCKx5kfXCLkOGIzAuOs7MULC+PlzGNd/uPvli5B8Nbyr+vLAifh9HVm6qL/JC83jRVygods3P/+yRObySrDDHktVWFrXsb/lHHy3/5DChVcqBZKSE4WAMIqorTruDrw= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(39860400002)(376002)(366004)(396003)(451199015)(36756003)(66556008)(66476007)(66946007)(38100700002)(8676002)(8936002)(2906002)(44832011)(41300700001)(83380400001)(5660300002)(478600001)(53546011)(6506007)(31686004)(6666004)(6512007)(26005)(316002)(186003)(86362001)(6486002)(2616005)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8098 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-Transport-CrossTenantHeadersStripped: DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b66715a0-efcf-4e4b-7d7a-08dac80576ff X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +RI2Ds4qug3qsn18ebiJ0YI0I3Nf+Hd4NwPNhINND1S9bCWqcRf9LSmWtGoQJPLalafoM+GORNaKxtnh+dHxsajPMs9rx68ZWEJhzUaHGDJAeJUgjs/7N55fp7nSUqlq17PVy3Zl5APt7BW6cfs/3bFOOdQlNeDQRr+33tEj30T6wOyUMaxa/nehQPF674Dqs6QoT5eqN8kkrd8nOoPFSjw+8V07FAIz7vbdp8QPFwbW9RCMckzBZMRlF+RSy5PP1cm3Kl+QVN0c4tAWRmkhuFcAx/KWh2rvRc3v4BnsF3Zdc/pyU1cnD7UhBXnegjwCTpZdPwB8HJYpV2Bhq8ZWLp8YqPj9wWGZfYcxRGcFiXSTlyIIK7wGrsKbQTErWDvPGJjbdl7MA1DY96BC7Oqpj0fjECTjR5Pih5SF0DWW+M/O8f1QLOtB3r1DbAvQeeeKnmVXhMVQ3HOXf+yHXZbz39i6J3uIoitpoBgfJj0+fXL3gNVRDuQDf03u5zbXKd0qF/24cnzZH0Tb9injvswN2kPI9eGG3PGJkeXinJnWUgNhPJTJ2v1rITSHtHNHWMDOR4vQxMwX32YVj0PbvHlFNykgxxBR1wgF6eUQMqzZsOeEHim75PHXnnbXk2GXyCuNEbB6kJjTvMyNkaAHj/BVlkRq2RQxiI3y54hJhNKoqzYaocuBXHNFTj4cWOvdqNay54o1/2h/7l8OQfsLSDbVAhUSwrorWIhcs81EqHP3M5aADZKEuOHLBcIqx+NeYZq4bN6xTim7WrRXBiInSTPxsYG+RjcwdqDRv0mF+8V5mI1QWEVqrQB0Ko0FtvXHIPmw 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:(13230022)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199015)(36840700001)(46966006)(40470700004)(70586007)(36860700001)(44832011)(70206006)(83380400001)(8676002)(40460700003)(2906002)(31696002)(82310400005)(8936002)(5660300002)(40480700001)(86362001)(82740400003)(36756003)(81166007)(356005)(478600001)(6486002)(41300700001)(6512007)(53546011)(26005)(316002)(6506007)(31686004)(47076005)(6666004)(336012)(2616005)(186003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2022 19:05:11.8681 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b737d221-7752-4d24-e961-08dac8057cb2 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: DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5299 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_ASCII_DIVIDERS,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/16/22 15:02, Rainer Orth wrote: > procfs.c has accumulated several compilation errors lately (some of them > new with GCC 12), which are fixed by this patch: > > * auxv_parse gets: > > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:144:7: error: ‘int procfs_target::auxv_parse(gdb_byte**, gdb_byte*, CORE_ADDR*, CORE_ADDR*)’ marked ‘override’, but does not override > 144 | int auxv_parse (gdb_byte **readptr, > | ^~~~~~~~~~ > > Obviouly, procfs.c was missed in the auxv_parse constification. > > * dead_procinfo has: > > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In function ‘void dead_procinfo(procinfo*, const char*, int)’: > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:563:11: warning: the address of ‘procinfo::pathname’ will never be NULL [-Waddress] > 563 | if (pi->pathname) > | ~~~~^~~~~~~~ > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:238:8: note: ‘procinfo::pathname’ declared here > 238 | char pathname[MAX_PROC_NAME_SIZE]; /* Pathname to /proc entry */ > | ^~~~~~~~ > > The warning is correct, so the code can lose support for the NULL > pathname case. > > * create_inferior has this ugly warning: > > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In member function ‘virtual void procfs_target::create_inferior(const char*, const std::string&, char**, int)’: > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:2815:19: warning: ‘char* std::strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] > 2815 | strncpy (tryname, p, len); > | ~~~~~~~~^~~~~~~~~~~~~~~~~ > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:2814:26: note: length computed here > 2814 | len = strlen (p); > | ~~~~~~~^~~ > > It seems that this is another case of GCC PR middle-end/88059, which > Martin Sebor refuses to fix. So I'm using the hack suggested in the > PR to use memcpy instead of strncpy. > > * find_memory_regions_callback fails with > > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In function ‘int find_memory_regions_callback(prmap*, find_memory_region_ftype, void*)’: > /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:3167:18: error: too few arguments to function > 3167 | return (*func) ((CORE_ADDR) map->pr_vaddr, > | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ > 3168 | map->pr_size, > | ~~~~~~~~~~~~~ > 3169 | (map->pr_mflags & MA_READ) != 0, > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 3170 | (map->pr_mflags & MA_WRITE) != 0, > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 3171 | (map->pr_mflags & MA_EXEC) != 0, > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 3172 | 1, /* MODIFIED is unknown, pass it as true. */ > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 3173 | data); > | ~~~~~ > > Again, procfs.c was overlooked when adding the new memory_tagged arg. > Unfortunately, it wasn't even documented in gdb/defs.h when it was > added in > Sorry, that was an oversight. I failed to updated all the hooks. I think there was a BSD one that got fixed after the following commit was pushed. > commit 68cffbbd4406b4efe1aa6e18460b1d7ca02549f1 > Author: Luis Machado > Date: Thu Mar 31 11:42:35 2022 +0100 > > [AArch64] MTE corefile support > > With those changes, procfs.c compiles again. Together with the hack > from the Solaris gdbsupport breakage reported in PR build/29791, I was > able to build and test gdb on both amd64-pc-solaris2.11 and > sparcv9-sun-solaris2.11. > > Will commit the patch soon. > > Rainer >