From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2070.outbound.protection.outlook.com [40.107.93.70]) by sourceware.org (Postfix) with ESMTPS id A67FA385800E for ; Fri, 29 Jan 2021 10:13:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A67FA385800E ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nm7kZkpJ2oUpsA4Zs/jIdoeDlehWTQRdNvuDuaI0mtGx3xYo18o9UOlq6AFzlsh7Foz+fPJEE93bczwPd8k0l+fZMiF5/FrnIxnEVYzY8cg45Q33hsBwCHUTbKDHUoaBjX/pKXRtuhJqBthxPCM5evT5+v3xgtqO9s8+ZcIM/TjCYNx2N5VVj5GaVaoZ7rkc4TmwVd8pngdNp+9ckSOq9BQgZvPVPyR7QYYs99+jCNlIJbltgPo6Ik7uox7Fj9CXc6qT4Mhom74tmskWJXKJkc1/5L/zFic3kcND8CMHD1nis+48Fl1d+NRoMTLKAEx7Apw8SeAQ/5XiPpVLBCfcjg== 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-SenderADCheck; bh=qNnUr4fXebAYfaorx+JRz3DWkkcedS8Ud7aRzDGOWqw=; b=leB2l4zRDp6YWBXRNdUuBXF8V4KhE7IYPmFC9u+ye7BAdwTQLl/yt9+BBSfeR46dx68bDJzAYCIho69nBX02N7JrIfLVq0hF5MJFe3Oa6F2Gdpu2kwijUFVQ26T0Z8q4FWHAunHUz29bsey2RK53Dmw8ePtluX6JOdu8veCVkttHKazLNn8t1yHIfiWeFqfMkaqBcwNnuIJ2UEdRvN3Ho/L2uO4ZSQOy9NS6EML1Q0PYwXbE+droz+/Kg2hkDNL+18AGMJot11Yv/4jyoIRYvPCV1SfKBMrimqtN+3EEsjbmhbU1v4SARKTUT4UK2AHHmGKTQKJKmVkp73AnNVM1vA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none Received: from DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) by DM5PR1201MB0235.namprd12.prod.outlook.com (2603:10b6:4:4f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.17; Fri, 29 Jan 2021 10:13:28 +0000 Received: from DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::31d8:f503:f7b2:f44]) by DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::31d8:f503:f7b2:f44%3]) with mapi id 15.20.3763.019; Fri, 29 Jan 2021 10:13:28 +0000 Subject: Re: [PATCH 10/13] gdb/testsuite: add .debug_loclists tests To: Simon Marchi , gdb-patches@sourceware.org Cc: Simon Marchi References: <20210120053925.142862-1-simon.marchi@polymtl.ca> <20210120053925.142862-11-simon.marchi@polymtl.ca> <6fe96ff5-3f11-585c-0331-62d1fe234bd2@amd.com> <56f87bf1-a43a-a710-005a-502101412d35@polymtl.ca> From: Zoran Zaric Message-ID: <491bdd1e-4ea5-eefc-0cc9-173e1fd8efc0@amd.com> Date: Fri, 29 Jan 2021 10:13:23 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 In-Reply-To: <56f87bf1-a43a-a710-005a-502101412d35@polymtl.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2a00:23c7:5a85:6801:cf:c92a:a445:6f68] X-ClientProxiedBy: AM0PR10CA0109.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::26) To DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2a00:23c7:5a85:6801:cf:c92a:a445:6f68] (2a00:23c7:5a85:6801:cf:c92a:a445:6f68) by AM0PR10CA0109.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.16 via Frontend Transport; Fri, 29 Jan 2021 10:13:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e801f1c8-ca05-4ca0-58d2-08d8c43e85c3 X-MS-TrafficTypeDiagnostic: DM5PR1201MB0235: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PapCbsDJdQrD8bx2FAkq7d+IB50c5b0JMUK3GUY3csVkx94j1B6WLyvqSIDCqHqPi+EZUEOsjZLMwquj7UO7dynPeR/maGYJvDMrGs149H0zj9tmlEQ9ZYnfplYcGTTOvhmMCL1TlZBrvZOwxNjD+ATEVn/tW0sw2Muy2xAPtlSC8K7CW0gUL9aFoJV63z1UgSKF6CuONnsUlQ/kpx9xDi/sz39pmW89iUVBvkpQedNH/0qCKdj7pzNK2npdGMOjZGzFSvRqtpmYPTw5jxVCPzfvNRYgyzG6Mdj811SL8+olZ8eyGvni08vUWIAnnjtBcFbvhpTT9/yu82HIKMwFMzwvW/kh9iTzSQ6teK02P3cVw2M38MdqhvXJWjwBLc5q8Hij0a/HLNSvWfjhNYs3Hwu17NUSqIYdnqpMNThwk6Ch7ZdKtx+psG1vGJyPUnSriRNauA20ugVqBA0EGrCy630uJEvhIb4rBXUfFAQ/uds5Oc4KdYYpzw279KY9U82JWGmj2bdhaZjCYA6ZtEBDpfCfb0NuyUlh+Yadway0zyqUmKVZoXwdVb/fCDXTMtRNWtz6uSc7txypkv+Sq9IBm9zlEKLLohTWXa8Sy27HyyiseXE40wkwUIIJq21sEHdGSalgHCC0Yala3R9HN+9CIVelB32WBOsBi+INxu9MxMm+PmnCLFKjM2ivDwMDiu+mBjLMUGI/+1juL0lEflQoLw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2762.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(346002)(396003)(39860400002)(376002)(966005)(36756003)(478600001)(31696002)(4326008)(8936002)(8676002)(6486002)(2906002)(316002)(16526019)(52116002)(2616005)(186003)(5660300002)(6666004)(66556008)(66476007)(31686004)(66946007)(86362001)(142923001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?U29IRmxLWGN3ekt3OXdrN25VVHVvNytSSjJ6Z3BFZDBFUlBFbjhZcVUwSlRh?= =?utf-8?B?aTZsNSsvN2p6V2dmMVVxQVlvRHdCQkZXMzRld0xxOEM5NzFDNEEydmdaaDFt?= =?utf-8?B?eklkMFZnQmxmZmNBVEFKN1lJcU5iZjlrZTFUcmQwMVdPL244MVVrS2tPaVhC?= =?utf-8?B?TkFnTUFJRXYyN1h3VkZJc2F1d0pwcC81RGtBV1VEYVJvZWppZW0vNmlreEYv?= =?utf-8?B?Z3I2MERDdFFXRC92Z2FxWlFnSSs1UU44LzBEdUY1RlQ1M2h4dkJVZ056Z0Fa?= =?utf-8?B?ejU2QWlYRmFEZklGZGE1UEV1eTVTYzRCbVFKUE5ZMlFOTDB2akQ0ck56VERm?= =?utf-8?B?M3oyQWNGNnMwV29GY3kwTk4zdll4WGpYcHNIKzJNV2szbUZJN0pYV04yaDFL?= =?utf-8?B?cUZFcjhyd2xRalBVY2FRK2Q3UFp2TnJMMDYwYThpaGE4VlVWTzlLSjNvVmdr?= =?utf-8?B?UXBBU1hnYzZuYlRhZ25LeW4xMWxmTnRhVDF6Vi9uZjZKVmpkUFRk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FV1QnI5RUlLU0xi?= =?utf-8?B?RVBWakpVZ285TG5tTVZKMXIwSWYvUVpGaHhEVWlacUVSTWNGdVRFT3J4MGty?= =?utf-8?Q?OTvwvVwYP2EudPEY9xaQmOF2wmT?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e801f1c8-ca05-4ca0-58d2-08d8c43e85c3 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2762.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2021 10:13:28.7981 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: smtaxO8nGwF/UWCSPxubsomdycb6qYaQ+ulOh8sWE2lmtLf03bGOMnIWHGUn2WOyLh6PS+yCgNfzJTXT62nzFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0235 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 10:13:34 -0000 >>> >>> Add tests for the various issues fixed in the previous patches. >>> >>> Add a new "loclists" procedure to the DWARF assembler, to allow >>> generating .debug_loclists sections. >>> >> >> Thank you for this contribution. >> >> Having a loclists support in DWARF assembler gives us so considerable testing flexibility and decouples the gdb testing even more from what compiler is expected to generate. >> >> The only thing missing now (at least in my mind) is the CFI support but that is a big project for the future. > > Given that: > > - the actual assembler (GNU as or other) already has support for > specifying and generating CFI, and > - a test case that wants to use specific CFI would contain some > assembly code already, to control exactly which instructions are > generated This is not exactly true, you can always define a CFI that doesn't need any assembly code considering that register values can be set from the the test itself or if only CFI register rules that target a memory locations are used. With the new extensions that I've contributed (and are currently under the review) the register rules mechanism now supports any location description to be part of the DWARF expression. With this extension, you can imagine that a very complex DWARF expression that doesn't use any potentially ABI sensitive resource, can still be written and tested in the same way as any variable location. Another option is to only hand write a CFI table for the top level function (frame 0) and design a way to merge the original CFI generated by the compiler for other functions with the hand written one. Also, with a potential new operation DW_OP_LLVM_call_frame_entry_reg described at length here: https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html This would allow us to test any CFI expression of the frame we are currently stopped in. > > I don't think our assembler needs to know how to generate CFI, you'd > just write it in platform-specific assembly. > But, isn't this the case for any part of the DWARF assembler functionality? Writing any complex DWARF expression fast in any assembly is hard and time consuming. I agree that adding a CFI support requires more thought and effort and better understanding about how the CFI works and what is safe to use from a test writer perspective, but I can definitely see the benefit of adding that support in the future. Zoran