From patchwork Tue Dec 31 09:41:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Achra, Nitika" X-Patchwork-Id: 37133 Received: (qmail 92534 invoked by alias); 31 Dec 2019 09:41:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 92523 invoked by uid 89); 31 Dec 2019 09:41:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=Distribution, H*MI:prod, H*MI:outlook, H*c:alternative X-HELO: NAM02-SN1-obe.outbound.protection.outlook.com Received: from mail-eopbgr770070.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) (40.107.77.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 31 Dec 2019 09:41:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnsUGR7do/FELV3GDclTZudHuNWMsMN39P+aFBPn8S8wIhL5hYufD+dKvEMuWznggYqK57Ureo1m0U+pmvH1jL8VDUqvs5NRZkR5jvQFiqbFFXcCC2KkRnRmEAbCPKRqdZCfgUuWz7nmjj6AXWHIVR/HgXOc7rFl2PHte1r7+X6krdzx0VXdkNa5yz4QmdSu/ZPtoMxce8g69WleNXtLIt5AzFGy7/8z9x/i3wG0+Squf7pBdg+lxcobFlnJJfqcxgtvPZfiLeteHkCqL1gE2n8ddAL+pZQLiCfT/hrkp9JIbShj/vlm8UkT8oZ+6nBMxwF3jjLBbvIY/OpfNAzN3Q== 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=zOGip4pY5LQ3XTIHc5BkC0QQ5WZr1WW2eFxTy0qE/Cc=; b=j1hppzsPuIx5HMwEcL1R0JI9GgkPD/1vZlCcISBd2YyEVFESMXLogHvUpeBgZn2r2HRRc+psUFRGIiCEY4wokcnoBTO+Y80/c6C5pQCqekJOArWZmRRFbzZA7Jr6g0pz2N5a5rLiGaWVYAhdv/AUE9D3xwLWi1rZEdzaq4Fz9Gb30HpSqmd/Bd9kYwmLadxmRk9m9BR3eVfLbG/lKer8fxkDo3dixGw7Z9aUfN78/0FK0ctgTciC3joU3gpwF3z6gKfFphdLbHTkso7iHY4fCVIGInrulVDuo3GwU8bqJ91u/0oT4wnvhWlThIPkXuGaCkMNDK4Znj+Hkiu85RwZvg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zOGip4pY5LQ3XTIHc5BkC0QQ5WZr1WW2eFxTy0qE/Cc=; b=2tvqq2VbrRhxydP0R6s0PrDmdlOzYz9QhP9ixVF90AuBcAtYTaZcOB11bq21mTPsqkuDw7czyGWZmomcUgydQ123B7DIt1eNwcF9eLEZGQFhNOVMYtwajv1G019zh/GEqE27/jLctEGp7YV8kbX68LPzTq3mgzjU98rlLyKEl6A= Received: from MN2PR12MB3744.namprd12.prod.outlook.com (10.255.237.80) by MN2PR12MB3790.namprd12.prod.outlook.com (10.255.236.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11; Tue, 31 Dec 2019 09:41:10 +0000 Received: from MN2PR12MB3744.namprd12.prod.outlook.com ([fe80::c1cb:697d:c30d:718c]) by MN2PR12MB3744.namprd12.prod.outlook.com ([fe80::c1cb:697d:c30d:718c%5]) with mapi id 15.20.2581.007; Tue, 31 Dec 2019 09:41:10 +0000 From: "Achra, Nitika" To: "gdb-patches@sourceware.org" CC: "George, Jini Susan" , Ali Tamur Subject: [PATCH] Support for DWARF5 location lists entries Date: Tue, 31 Dec 2019 09:41:09 +0000 Message-ID: msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_enabled: true msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_setdate: 2019-12-31T09:41:07Z msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_method: Standard msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_name: Internal Use Only - Unrestricted msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_actionid: 2e5cf5f5-0a89-4420-a067-0000d9d7aa9f msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_contentbits: 0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=Nitika.Achra@amd.com; x-ms-exchange-transport-forked: True x-ms-oob-tlc-oobclassifiers: OLM:3383; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZQk54089zjgMNhSfd+lpGYCugF6D8rNDHxBC0IQ23inFLUxmIY1KXshJ6UWtwt6wEaNw2ZC0Wm0tQJUy0RDgyQ== [AMD Official Use Only - Internal Distribution Only] * Handle DW_LLE_base_addressx, DW_LLE_startx_length and DW_LLE_start_length. Tested by running the testsuite before and after the patch and there is no increase in the number of test cases that fails. Tested with both -gdwarf-4 and -gdwarf-5 flags. gdb/ChangeLog: *gdb/dwarf2loc.c (decode_debug_loclists_addresses): Handle DW_LLE_base_addressx, DW_LLE_startx_length, DW_LLE_start_length. *high = u64; *new_ptr = loc_ptr; return DEBUG_LOC_START_END; + case DW_LLE_startx_endx: + case DW_LLE_start_end: + case DW_LLE_default_location: default: return DEBUG_LOC_INVALID_ENTRY; } diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 976d453d3c..0de956ab66 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -173,6 +173,41 @@ decode_debug_loclists_addresses (struct dwarf2_per_cu_data *per_cu, switch (*loc_ptr++) { + case DW_LLE_base_addressx: + *low = 0; + loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64); + if (loc_ptr == NULL) + return DEBUG_LOC_BUFFER_OVERFLOW; + *high = dwarf2_read_addr_index(per_cu, u64); + *new_ptr = loc_ptr; + return DEBUG_LOC_BASE_ADDRESS; + case DW_LLE_startx_length: + loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64); + if (loc_ptr == NULL) + return DEBUG_LOC_BUFFER_OVERFLOW; + *low = dwarf2_read_addr_index(per_cu, u64); + *high = *low; + loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64); + if (loc_ptr == NULL) + return DEBUG_LOC_BUFFER_OVERFLOW; + *high += u64; + *new_ptr = loc_ptr; + return DEBUG_LOC_START_LENGTH; + case DW_LLE_start_length: + if (buf_end - loc_ptr < addr_size) + return DEBUG_LOC_BUFFER_OVERFLOW; + if (signed_addr_p) + *low = extract_signed_integer(loc_ptr, addr_size, byte_order); + else + *low = extract_unsigned_integer(loc_ptr, addr_size, byte_order); + loc_ptr += addr_size; + *high = *low; + loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64); + if (loc_ptr == NULL) + return DEBUG_LOC_BUFFER_OVERFLOW; + *high += u64; + *new_ptr = loc_ptr; + return DEBUG_LOC_START_LENGTH; case DW_LLE_end_of_list: *new_ptr = loc_ptr; return DEBUG_LOC_END_OF_LIST; @@ -197,6 +232,9 @@ decode_debug_loclists_addresses (struct dwarf2_per_cu_data *per_cu,