From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kgVKJl80p2ZsODUAWB0awg (envelope-from ) for ; Mon, 29 Jul 2024 02:19:11 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=HOTMAIL.DE header.i=@HOTMAIL.DE header.a=rsa-sha256 header.s=selector1 header.b=jEzpE4EL; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 88BAA1E0D0; Mon, 29 Jul 2024 02:19:11 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0A21F1E030 for ; Mon, 29 Jul 2024 02:19:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 462F4385840F for ; Mon, 29 Jul 2024 06:19:08 +0000 (GMT) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn20800.outbound.protection.outlook.com [IPv6:2a01:111:f403:2e13::800]) by sourceware.org (Postfix) with ESMTPS id A44293858CDB for ; Mon, 29 Jul 2024 06:18:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A44293858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A44293858CDB Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2e13::800 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722233919; cv=pass; b=PRo6WPVtiI9Eiwuj2Covhx0JFVuHjf0D63CFduovHvJnGnZY/GHax5VscP/XI4kQP9cOFFDLTWjoiGWRj5Z/rBDAqH6suFyYjRyfmwmWfNw0AwTuKrykp49BynjGbdWX9HxqBWhIZAl5qYLuFygQu6WX+dlYs8UN62Mv+j+Xn1U= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722233919; c=relaxed/simple; bh=jTJxmLOee2aSnXAinGzL171eaWMV0cKOrbKU0TsCUsE=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=SHsiJCOFtCcVmK406TjYBGXCOyaOkqvprOnRDqa5scm9BeqGDvD6AgT4HhsKmfCuucmUBL+AJwDGUfanGNWy0JF9WwgRzcg809y7hhNaS1SXR7MoFywsGDwjcYSMO1rWrUoYx5KSZfM2ufXklhlzy3GLB4arRWj6YQTlOsWqGZI= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TpR6FSzBm+gvgt76KnHlfaFwA8epLYyy7/PLgI/o/YaPdxuDr4AVawwebkqyYEQGn6fPL6NGog2JxSkp6/jyAK88ts1RcfKeHaa49WPkq/QQYlNLHRUhWRR7C7bBlkfVR0Pp8Fs+oAebneqxGgH+g6pWdhZi5pnN19+g8V9V/gl6BXsfe8n6LUllirJtwjGp2Wttkt5PMwPqJnZhGJlSmnLZSeUKemd/tbOMpC5ULBtSYXOsMIOS+QG7M1O6Jx879XxxZ8FNIdg13RU+DaQ3F616LArAyjjbWJ9uMeNrpZo6Cb0Hp/J/CT/aPLIAgb6reBxLgCaEctJa/9/kfZ3O0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ac5c1AwHZfpkiK5vybUhkqyF7Cl4PRbh2gKsz79fWYk=; b=obHUlLISo4c/wa7SlaItIbsRJfQrRGiY6tRyhdXkMT6nh/CH4NG0boZsmtMubRJsd5amBUZjOcb3Z0wnuOG9FAJjgcPTHwc55AAaInBv8YrZk42TTS9x45ZyacQpo1Rehr55v9JWVrcCvXUrgZXjFJYLwJuoMwzW+iDj4nITlYqw55zr05h70OgjzFCh5Lqt9oXKUCvzTUlUUn6eVFExeo81/eQ1aDdAg8mmH5xteWgSe1t/oTb+EuHseeJBNAfjv77ixs3XX++9QN1L/F+CIUqDsgLvvVf+C+YND8GhCnMOBXh7EClUoVzOnKODVGWGlzV/IajhT0HUh0QjSiLtTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=HOTMAIL.DE; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ac5c1AwHZfpkiK5vybUhkqyF7Cl4PRbh2gKsz79fWYk=; b=jEzpE4EL1Beu33m+ECkdHx40NZ4LG4Zuo/ZQ2NKNApSKYUtnRbyPKGgbTOTOaVPdPzJQM10s/UTm3bFQ/fU/TbpRz3GpLxKyCvxOicZybUa9U1C4Ras8AysMdhGhRC1ex6NjB4SQNMeMbuPtiNdxUcqRle4iAlXgFySTTLAimmjR4D2t8WQERSw0EEjBsL/3La5QqrPWWXO1ozKHKWMxpuv+r0Ai14jRRdHHwc7a01UTpIkDbmv8wdZx62qDa0NrFsjBPFVWiNhhNDRojuSfYhCxULD2wZ1HCHEhol6NHSLbN9+3QOyrmozua12eGwD1fWBxYT/KiHJEINKCnB/agw== Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) by DB8P193MB0535.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:151::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Mon, 29 Jul 2024 06:18:35 +0000 Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM ([fe80::e65d:5dd2:5662:c61f]) by AS8P193MB1285.EURP193.PROD.OUTLOOK.COM ([fe80::e65d:5dd2:5662:c61f%6]) with mapi id 15.20.7807.026; Mon, 29 Jul 2024 06:18:35 +0000 Message-ID: Date: Mon, 29 Jul 2024 08:18:21 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/3] Fix range end handling of inlined subroutines To: Guinevere Larsen , "gdb-patches@sourceware.org" References: <7ee0cb7d-c142-4a16-9c00-a95d66f5c12f@redhat.com> Content-Language: en-US From: Bernd Edlinger In-Reply-To: <7ee0cb7d-c142-4a16-9c00-a95d66f5c12f@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TMN: [DzqqOzTBMIB48dt26Z+08BV5NAfxOm/6Pxxwx8y68fvDDRDAhtiZoAhejLFO43D/] X-ClientProxiedBy: ZR2P278CA0058.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:53::18) To AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) X-Microsoft-Original-Message-ID: <66571338-1913-4de6-9422-3f3e2b936cd0@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P193MB1285:EE_|DB8P193MB0535:EE_ X-MS-Office365-Filtering-Correlation-Id: f8b25aa9-ad73-490c-d2ca-08dcaf964673 X-Microsoft-Antispam: BCL:0; ARA:14566002|19110799003|5072599006|8060799006|461199028|440099028|3412199025; X-Microsoft-Antispam-Message-Info: Sp9/oW9P5GrUwbJzRpmc4qr4Yxby0kmw3jRDRzGpDI4KzkUlG3NyqAkwm8CTcJWRFzg4gqZfIsuY4pBLBKbnNljYoXbwJIGaWJCE1+Rhn/anGEjK8tPi9nlvSIsFM99whN1CBzsH1FkVHf4NokM8saV4J1TOuyCh8UE0oitp+2ODBxuhfpHEpr4PAoBY5/I81BOsqS30c9I9K1imlCCo3BkpjVF0JqX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B?WEM3Y3Q1NUdNSXNqSVpBRlp3ak5XYUcwU1l2YW9vdUlMZGVvSU16UGhRMlND?= =?utf-8?B?bGgvWVEyZ1ZJY1hhY3pHaDE2ZnJhSHVRWFFCenZsY05DYVhKaTFGYkswVjdq?= =?utf-8?B?ZmFPcy93ZjFETFhHelVpeUs4TVR1K2U0Uzc1TkFwV3lCTE5Cdy9RZHFLM3dH?= =?utf-8?B?YWFPTFQyeks2OWJpUXNmcGNKWVJEQmdndzdZVWdLaThEQVVqSnk2RE90MHU1?= =?utf-8?B?L3dPY1RqdkxzL1pIUTFScGQ1NWVRbU1KSzEvOHBRTjJkeVVtbUZ6RW5BeDh3?= =?utf-8?B?UDl0MHdIWklyeHMrYzBNWFBGNmFFaTlzK25NN0IycVhmQVoxamlJTkRnd0xw?= =?utf-8?B?cnpRR3VhL0dWM2pJaFp6OENDTlpFaUt2MUFFQ1lYWlFtSms3ZkFuNldlM0tw?= =?utf-8?Q?U28+OOx8+CUjyg4qAOBVAOfAtQedn1MIm/SYCL2?= X-OriginatorOrg: sct-15-20-7741-18-msonline-outlook-01732.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: f8b25aa9-ad73-490c-d2ca-08dcaf964673 X-MS-Exchange-CrossTenant-AuthSource: AS8P193MB1285.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2024 06:18:35.0286 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8P193MB0535 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Oops, sorry. I've missed some comments in my last reply. On 7/19/24 20:48, Guinevere Larsen wrote: > On 7/5/24 6:18 AM, Bernd Edlinger wrote: >>   diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c >> index 60fd8b45eb5..e40679611fe 100644 >> --- a/gdb/dwarf2/read.c >> +++ b/gdb/dwarf2/read.c >> @@ -10733,10 +10733,6 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu, >>         return false; >>       } >>   -      /* Empty range entries have no effect.  */ >> -      if (range_beginning == range_end) >> -    continue; >> - >>         /* Only DW_RLE_offset_pair needs the base address added.  */ >>         if (rlet == DW_RLE_offset_pair) >>       { >> @@ -10855,10 +10851,6 @@ dwarf2_ranges_process (unsigned offset, struct dwarf2_cu *cu, dwarf_tag tag, >>         return 0; >>       } >>   -      /* Empty range entries have no effect.  */ >> -      if (range_beginning == range_end) >> -    continue; >> - >>         range_beginning = (unrelocated_addr) ((CORE_ADDR) range_beginning >>                           + (CORE_ADDR) *base); >>         range_end = (unrelocated_addr) ((CORE_ADDR) range_end >> @@ -11080,8 +11072,8 @@ dwarf2_get_pc_bounds (struct die_info *die, unrelocated_addr *lowpc, >>     if (ret == PC_BOUNDS_NOT_PRESENT || ret == PC_BOUNDS_INVALID) >>       return ret; >>   -  /* partial_die_info::read has also the strict LOW < HIGH requirement.  */ >> -  if (high <= low) >> +  /* partial_die_info::read has also the same low < high requirement.  */ > We use scream case to indicate variable names, so there's no need for this change. Ah, good you mentioned this. Actually the comment can go away completely, since there is no longer any partial_die_info, since this commit apparently removed that function completely: commit 6209cde4ddb85a991ed1dda6f143ef08b75558df Author: Tom Tromey Date: Sun May 30 08:00:19 2021 -0600 Delete DWARF psymtab code This removes the DWARF psymtab reader. >>   @@ -3333,18 +3336,14 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) >>        We used to return alt->line - 1 here, but that could be >>        anywhere; if we don't have line number info for this PC, >>        don't make some up.  */ >> -      val.pc = pc; >> -    } >> -  else if (best->line == 0) >> -    { >> -      /* If our best fit is in a range of PC's for which no line >> -     number info is available (line number is zero) then we didn't >> -     find any valid line information.  */ > Why did you remove the logic handling not finding any line information? Surely it is still possible that we can't find debug information for other reasons. This code is unreachable. The only place where BEST is assigned to non-zero value, is here: if (prev && prev->line && (!best || prev->unrelocated_pc () > best->unrelocated_pc () || (prev->unrelocated_pc () == best->unrelocated_pc () && (best->pc (objfile) == pc ? !best->is_stmt : best->is_weak)))) { best = prev; and here: if (!best->is_stmt) { const linetable_entry *tmp = best; while (tmp > first && (tmp - 1)->unrelocated_pc () == tmp->unrelocated_pc () && (tmp - 1)->line != 0 && !tmp->is_stmt) --tmp; if (tmp->is_stmt && (tmp->pc (objfile) == pc || !tmp->is_weak)) best = tmp; so as you can see, in both places it is ensured that best->line != 0. This is so since in 2003 when this commit commit 083ae9356e21082ea18fc21d91a84bbaa7a76fc7 Author: Daniel Jacobowitz Date: Mon Jan 13 21:59:53 2003 +0000 * symtab.c (find_pc_sect_line): Don't consider end-of-function lines. changed the if condition here: - if (prev && (!best || prev->pc > best->pc)) + if (prev && prev->line && (!best || prev->pc > best->pc)) { best = prev; best_symtab = s; but forgot to remove the now no longer needed else if (best->line == 0) { /* If our best fit is in a range of PC's for which no line number info is available (line number is zero) then we didn't find any valid line information. */ val.pc = pc; } Thanks Bernd.