From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2058.outbound.protection.outlook.com [40.107.94.58]) by sourceware.org (Postfix) with ESMTPS id DB45539AC872 for ; Thu, 28 Jan 2021 15:30:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DB45539AC872 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F/6CIKd9zUSipbtapjFykrwbp5hd5u8g6FYU2fJ7QDTT9+EpsDlJUikow0Sc25XhgTEfPqE9ozAZtD/fsidGIZY5foe3bCgWTWhoatumuCKE0ma0G7uof8uM1omWzeb92Lgfy72EYuiOXzaa9wcJM4n9HmyKTvhksyFrjgUXcnkoE3FQOF6vuw1qkYrfgHmpMtZcd7vyRSX5EEL2JeX0mNXTi8wf2SP9OPiswtVnamjhhynkuUiAhKjvX7N7PgCbSgG5GgJWGdJSWH5aLYvsgAJ6TTnH1bIevTpULd8mlY+L1wfG7e+uytpQi1jxtBB1PYazp0Ov+3ueDXEMEHplQg== 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=SXBfYsyWIE9bRL5elFdkDKVJ9BMPzphQwOJ/z97Xuo8=; b=dlSV2nsveZp42nyTkkIjWDM+OR2IYmD0Ama+Q2Awky5ZlUa3a5cmgNpWTP9LsVz4FFYQXFDfcKovkyYTCBYSn7G9f8K43qwHzEKI9UYqWlWD91/FFHiumZ77I9eaPiyJXQkxvwe0Pyq1jP/pvq1ANT7Ez5qn9ieFtapgpFSu3yC3x6cDmzp+A/hYBQzJlLyHl6J0lpcr/BRMpjxg7nkwRmOa05ZMDgYXib2gluM8HwXe56ws65B2Nlk2/diCv3qvztP/EHC00hAd/BIiO2yOtrOlRqvo1fo5AsXyLHX1Fmp4Q91MIQDB04xKI99tfhVXz1Q6HAKbnwAndUlu0XKKvQ== 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 DM5PR12MB2533.namprd12.prod.outlook.com (2603:10b6:4:b0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.15; Thu, 28 Jan 2021 15:30:34 +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; Thu, 28 Jan 2021 15:30:34 +0000 Subject: Re: [PATCH 05/13] gdb/dwarf: few fixes for handling DW_FORM_{rng,loc}listx To: Simon Marchi , gdb-patches@sourceware.org Cc: Simon Marchi References: <20210120053925.142862-1-simon.marchi@polymtl.ca> <20210120053925.142862-6-simon.marchi@polymtl.ca> From: Zoran Zaric Message-ID: <33417afd-2642-cde5-12a7-00faac00bdd1@amd.com> Date: Thu, 28 Jan 2021 15:30:28 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 In-Reply-To: <20210120053925.142862-6-simon.marchi@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: AM0PR01CA0110.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::15) 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 AM0PR01CA0110.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.16 via Frontend Transport; Thu, 28 Jan 2021 15:30:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 82f5b568-fb7e-4231-29e0-08d8c3a1a75a X-MS-TrafficTypeDiagnostic: DM5PR12MB2533: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GSbKb883BPH2T8P08TLuKH2vnmpGKZ2C8y04OW8YD6kX0HfXEXbn0amqgBmVrJNfsvwEbbVlnEl5sdty+3mkr/mwfpKZoB2oLtKiytkPReYDKw7hnCBfFQtGYJFDdJNf1VGQBkFFE0aUu8lAal6lnUDiKwj4nYI5mgIOFmUk8B527TtstrqiIS+V3VjGa9+d4YqSSazfxh6WG0xEAGlOBWlCE2XtCDx50VZSk9z1VbQ2lSN8cOT3G9GfFLH5xeRNfn2cC8qj0mVh0D6dMkCPW3E9syKIypPkw0ZZOPBNBj7s4UIGBdv9ARIqgIQP/ErXGNrrb2JygSup/iq1aHH6sIZ8qBUBEuch3BFLduCaZIAPXOpadKgeVFxysaUA7RWgKXDkerAUdFfNN4BooXTyXhxWKTGGpYn6u2DbDRYWw4OSGLyQjsQaA5gTZoELUddC66zDEVB9NQvs2uU49HhLGVRk/A1LvnH5m2nsJs75fkOtPCvDcISSH6J46nW3Kc/UPEGeDb+YMItnta5TSq19vRzbGar+ud3LtNxpYl+Kt2JLcpqwGYNw2nsItR40F/aMOceqjVtKfVwwQbY6io8n5Q== 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)(396003)(366004)(346002)(376002)(39860400002)(136003)(6486002)(31686004)(31696002)(86362001)(4326008)(186003)(8936002)(16526019)(2616005)(36756003)(6666004)(66556008)(2906002)(316002)(66946007)(66476007)(8676002)(52116002)(5660300002)(478600001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?Nzd6a3dnUm43UXUyVStOZXczZDQrVXVmWkdydkRRdzZKbXFabFR4cEQ3VExQ?= =?utf-8?B?OE02RDljd2RHdk5iN0NtRVdXUnBYOURJNkRKYmU4QWFBc2NNenY1RXA2em1t?= =?utf-8?B?SXo1VjJpSTQ3cWFYZXZFTG1KbjJXK1Vya0VmeDE4LzN4M0JuMm5zNFgxMjZN?= =?utf-8?B?aVZQbFl5TjRCOGh4eklJeTVUcjN0dFN2QVVGeUtVMEFLM2VyY2t0NDhNa1ds?= =?utf-8?B?YVY5bEZOUEdDZXYxeFd5R0d6RDJsdGRQRGtJNCtHb2t0VnF2dVU3WlZrZVgw?= =?utf-8?B?NXBaVm90aUVHUjdaeUk5ZU0wN0pBQ3ZTc2JMbGMwNVlyVzM5YkNPWnFxcTdS?= =?utf-8?B?eFZZbzJkeDJMM1FrR1Z5RU95T0NPTVZaQ1RtdnJpbEVRczladGRJYjA5a1d3?= =?utf-8?B?N2Y4UU1RVkJlM0F2VW90dEdEODFXMXZFN1BFTzRWTDlqV3FBOXZVZk5Pdng2?= =?utf-8?B?WU1uK0VIa01aMVcrUGdPeWFPK2Z4UlVOVFJNcldweEV0NWJ4RWNXeDQxWjdT?= =?utf-8?B?bmpOaW51bWRLUmtIcEZmSWxLclNBaElSd2xlUndvaSttVGEwVnNZSDZKTEh5?= =?utf-8?B?RFRaZFFiK2xuL2VIZHgrMnk5aWRMbytORXQvOXdTV24wS1FiMG5zQ1MrT0d1?= =?utf-8?B?Z1kyTEQ3Njl1QWJBdnJXNGFMZk8wWGVUZmJDdEFyaU1UMkE1emI3MGl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CrossTenant-AuthSource: DM6PR12MB2762.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2021 15:30:33.9119 (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: 207/AEEWH31V/TlG9OjJy87okXcsq6/TaIbEmrwBIljNjC0KncThtUY+6CWI5D31C1hgLj/aOKJ3NgiCSwkfmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2533 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Thu, 28 Jan 2021 15:30:37 -0000 > From: Simon Marchi > > We hit an assertion when loading the binary from PR 26813. When fixing > it, execution goes a up bit further but then hits another assert, and > another, and another. With these fours fixes, I am able to load the > binary and get to the prompt. An error is shown (index pointing outside > of the section), because the DW_FORM_rnglistx attribute is not read > correctly, but that one is taken care of by the next patch. > > The four fixes are: > > - attribute::form_requires_reprocessing needs to handle forms > DW_FORM_rnglistx and DW_FORM_loclistx, because set_unsigned_reprocess > is called for them in read_attribute_value. > > - read_attribute_reprocess must call set_unsigned for them, not > set_address. The parameter of set_address is a CORE_ADDR, meaning > it's for program addresses. Post-reprocess, DW_FORM_rnglistx and > DW_FORM_loclistx are offsets into their respective sections > (.debug_rnglists and .debug_loclists). set_unsigned is the current > attribute value setter that fits the best. But perhaps we should have > a setter that takes a sect_offset? > > - read_attribute_process must call as_unsigned_reprocess instead of > as_unsigned to get the pre-reprocess value, otherwise we hit the > assert inside as_unsigned that makes sure the attribute doesn't need > reprocessing. > > - attribute::set_unsigned needs to clear the requires_reprocessing flag, > otherwise it stays set when reprocessing DW_FORM_rnglistx and > DW_FORM_loclistx attributes. > > There's another assert that we hit once the next patch is applied, but > since it's in the same vein as the changes in this patch, I included it > in this patch: > > - attribute::form_is_unsigned must handle form DW_FORM_loclistx, > otherwise we hit the assert when trying to call set_unsigned for an > attribute of this form. DW_FORM_rnglistx is already handled. > Agreed. I came to the same conclusion while investigating this issue, but unfortunately, didn't have the time to figure out how to fix the following asserts. Zoran