From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2064.outbound.protection.outlook.com [40.107.236.64]) by sourceware.org (Postfix) with ESMTPS id A29883858D35 for ; Mon, 4 May 2020 06:13:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A29883858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=Nitika.Achra@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iz2jWm+AzKIHvcU8pCBXsJ2uaXVxCwUiJREihmll/cNlL8vfuSQpd/CG95mTLI1Vdquff7KA8NQ58uy+3G4OhT0aMnMkgjsoTzK73n/GjA0QnTSLG+pqsbm2luHoQ3O0CZydKMNHhjsk4A3OH3AEXSxtx+225p6YlkM533F4SdqJP0GWOgkaiDfyoMLQGptmrjWLn/klR3CUtmqTPic/5Q3ZRyYM8Sa9WCR7EzHdwqGRS3WFB4SaefQ2o8/pXXC+EpCtYNUEZOq6k1Vlc0jfaXMkhyNwbM8pCIhoH80kGFs2C484W/EHandRhwAAYYELFJQfBiE9vmD198BXvjdfrQ== 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=FtEGwZq1+2xlSQaQIcgyutGFaMgTOEJKgVxambp5Uyg=; b=TrYN0jEmoOO0F5meUGUeZKun8UZxkCeRQC3zF1p+nW3sc3es/YHsi5nH+/NjU/ZcPunZY8LDyUUNRFYPFT3VG16xZKwzFT8ppviHJs2nhl0Tadk9Z+cuxOBwJ9XQsHKRyolY85iqP5DTFCC2emkBbrpKTHGy2sqVLPOPFT3wAPD79jpS2PYxQSIoKpmT2y5/YAEbHPLGQPMaAGqRB1gNjLEgNyW9cIGMOY+cIm4ivd4BpujVZ1yA4JQD2fOTmAZ72abjoI9NsphLZGUMJFY+qJOXrpg96enRI2z3ZfhL3tIvB9KSoVNxPUxoujPb1+DO6eskxbSdHVdfAaB030Mq+A== 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=FtEGwZq1+2xlSQaQIcgyutGFaMgTOEJKgVxambp5Uyg=; b=mj7j8A2qZ6+GDxBq7rSx1mlnac1iMn2iI+Ob2XLiqp5ZXxn2J/PPLJf0T0GBEM/625Enj6ys2CcFpakX9YIybHfGfst9bc2tBh72wg9TG6oJZ8Z4QzEOLK3HfxNkwnpYmV9PDfzXOrNx8j3kc+b4Z/5xIyOn2Vl0o08lVMKHHBI= Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2736.namprd12.prod.outlook.com (2603:10b6:805:75::30) by SN6PR12MB2685.namprd12.prod.outlook.com (2603:10b6:805:67::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Mon, 4 May 2020 06:13:49 +0000 Received: from SN6PR12MB2736.namprd12.prod.outlook.com ([fe80::3cdb:5c47:4de4:9bc2]) by SN6PR12MB2736.namprd12.prod.outlook.com ([fe80::3cdb:5c47:4de4:9bc2%2]) with mapi id 15.20.2958.029; Mon, 4 May 2020 06:13:49 +0000 From: nitachra To: gdb-patches@sourceware.org Cc: JiniSusan.George@amd.com, nitachra Subject: [PATCH] Fix for the complaint observed when symbol reading due to unsupported .debug_names form. Date: Mon, 4 May 2020 11:43:19 +0530 Message-Id: <20200504061319.3699-1-Nitika.Achra@amd.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: MAXPR0101CA0037.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::23) To SN6PR12MB2736.namprd12.prod.outlook.com (2603:10b6:805:75::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from bglcomp-haswell-105.amd.com (165.204.156.251) by MAXPR0101CA0037.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 06:13:47 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.156.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dc84e92d-4c1a-47ad-c55a-08d7eff24f7d X-MS-TrafficTypeDiagnostic: SN6PR12MB2685:|SN6PR12MB2685: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1417; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2b4oaTGYdYdbjbiOYYp2ZTYNQe6YhEoXXYH4hzpqAZg0t+nTD8JpIpuaNVcJ4yCTm8BN+bHtX1F3AnGwsVg1MKIC+eCn+CEIX376d5mjWof3nJxdNzw/gk8ghwTut/cyEy9phbn1j4M5mibOZ/tq6nhfpcHmxn9ez5xKsT7t+lU8dVC+k7gIfNwWVO1he2aiJeMJ/0b41Z/bpFwrWNYj/8Zy4870uHCf6fPl0hy5rtadC1nMgRpiv8pK2D6ucTpVvTfPSXWuOfehtlfnijEbGZ6DJl+f/bacuJbizJExwe9zM98oTOxGuLyAquiV7eDuFG+tcPz74x97mEladIHewn0EgUi60GdXxRDlSr9IWx/HnICT34mJycO5NO6IenfC5O7LlC732hxLDO/uv/+jCgx9+Z5qSHYWnOeveNiizdXPzKrYr+uOYhg9fuA0HH92Lvlx7eG1YSaCmBy50iBIUPBI33/02JynvYnYnxQLNeEJcjYysUu54dVzHNAw6JJBg3nOwKqdKuhuogt1s7G/og== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR12MB2736.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(39860400002)(396003)(366004)(346002)(376002)(316002)(6916009)(6666004)(52116002)(7696005)(478600001)(4326008)(2906002)(186003)(2616005)(956004)(26005)(16526019)(86362001)(6486002)(1076003)(66946007)(8676002)(36756003)(8936002)(66476007)(5660300002)(66556008)(43062003)(142923001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mQMWOHN4Pr+D+I+1LgNJiUXXp7s3DhOV6AAOYFZrR/82Jrk9NHK9Py3EnvZduANniD8ATMtlQapht1fNemhs5s/ps/e3uw6XO77h6NJLLvtrvokDMTKh4gYic2hWaGj13HBXYBsI5MkCiyYp33+QMg/tJSXgrKD3Q8AmF1JAKPFUuIA2qJ5m6GlBIzrwNsMeZI4eyJzkXM1dG2kJYm1aBpAo9ntX98p92SEtq3Ybu00nxIXR2qYa7b4+7o3dIZtaE3nlTemtGErywhUcgmWM57m1LCQeAYj86zi1SiipdTpvj1WGGpQ8eIA2F4NJ4cV6ZEzbr4QMx0MQ0GrT1SctZqQnM0swahSMfl+0H4h6etpW8OZ7axOQNWbughN9dXtQzEkwoqksa9ycZVdds2lLKo4QfECny25FOx/d0EjsWCoMrkkey6gGD0x1kOvtvp88UqXXg5/2ZGxqBlCx/kIluQQ0rF068X0rmXzA+IHbr+8auXaNT+1/Hq+oU4LRnxnUS8mPV8XtctpJxrgFqRW51DMfc1Axeihog/rAmNu7imQNXZdjOTtV78uOWvZfdJV3rws59w/GYZL5+NCrOpZLIj0f5Vr96nJPzUUsOmPi8rnjj1nmkU548hmJNVnzgH9mfUKWMw5g3W4vtdJ2UoXOQP2QiJXbwf1ID2+vk3YO7cqB3IFWhomlr9+n8mrRuAvo7/dRn2tgLvAC19Dv65fflr8vNcQnXkTy+cmq239C69sldsbjW1bSwz3b8FlPmAQYd9toqk9PDYYIHcFNv2Nx7Ml923EIdRR1HRnUfX2G99ygoSFDXAbr96gbU+z3ZyOz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc84e92d-4c1a-47ad-c55a-08d7eff24f7d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 06:13:49.2660 (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: piJRWeq56a8NhpqVgtfi7UjkeijK5uGWoA1teomnfLUKI49HhjtJ3YotyXrjczqtkh9KfgJ0GiEMWkiryfjXwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2685 X-Spam-Status: No, score=-28.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, 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: Mon, 04 May 2020 06:13:54 -0000 Requesting review for the patch. Regards, Nitika Following complaint is observed with the executable compiled with -gdwarf-5 and -gpubnames flags- "During symbol reading: Unsupported .debug_names form DW_FORM_ref4". This is the form corresponding to DW_IDX_die_offset attribute. This patch fixes this complaint. Tested with clang 10.0.0. Test case used- int main() { int sum,a,b; sum = a + b; return sum; } clang -gdwarf-5 -gpubnames test.c -o test.out gdb -q test.out -ex "set complaints 1" -ex "start" Reading symbols from test.out... During symbol reading: Unsupported .debug_names form DW_FORM_ref4 [in module /home/nitika/workspace/test.out] Temporary breakpoint 1 at 0x400484 Starting program: /home/nitika/workspace/test.out During symbol reading: Unsupported .debug_names form DW_FORM_ref4 [in module /home/nitika/workspace/test.out] During symbol reading: Unsupported .debug_names form DW_FORM_ref4 [in module /home/nitika/workspace/test.out] During symbol reading: Unsupported .debug_names form DW_FORM_ref4 [in module /home/nitika/workspace/test.out] gdb/dwarf2/ChangeLog: *read.c (dw2_debug_names_iterator::next): Handle DW_FORM_ref* and DW_IDX_die_offset. If there is no compilation unit attribute in the index entry, then there is a single CU. Return the CU at O index of compilation unit vector. --- gdb/dwarf2/read.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 1813085d0d..0bb8135e09 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -5352,6 +5352,18 @@ dw2_debug_names_iterator::next () ull = read_unsigned_leb128 (abfd, m_addr, &bytes_read); m_addr += bytes_read; break; + case DW_FORM_ref4: + ull = read_4_bytes (abfd, m_addr); + m_addr += 4; + break; + case DW_FORM_ref8: + ull = read_8_bytes (abfd, m_addr); + m_addr += 8; + break; + case DW_FORM_ref_sig8: + ull = read_8_bytes (abfd, m_addr); + m_addr += 8; + break; default: complaint (_("Unsupported .debug_names form %s [in module %s]"), dwarf_form_name (attr.form), @@ -5384,6 +5396,12 @@ dw2_debug_names_iterator::next () } per_cu = &dwarf2_per_objfile->get_tu (ull)->per_cu; break; + case DW_IDX_die_offset: + /* In a per_cu index, index entries without CU attribute implicitly refer to the + single CU. */ + if (per_cu == NULL) + per_cu = dwarf2_per_objfile->get_cu (0); + break; case DW_IDX_GNU_internal: if (!m_map.augmentation_is_gdb) break; -- 2.17.1