From patchwork Fri Jul 5 09:17:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 93410 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A50F382E6BA for ; Fri, 5 Jul 2024 09:18:26 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn20828.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::828]) by sourceware.org (Postfix) with ESMTPS id C06D83844033 for ; Fri, 5 Jul 2024 09:17:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C06D83844033 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 C06D83844033 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f400:7e1a::828 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720171076; cv=pass; b=xuuKov7zIXl7DUTtBdTSdD6OD7cO8WKg4ujAfAMOhJpHm5AdrdaEA92xyfrvml9hTnOwxcz3JaI5aQ4ISidY1G1+ciNC8ASTPDIj5ptuclBW5s4iHHco7Bgh/FoMJMJVPE5EsNgBjuDqhVGrCBVnNnoNaWa4IFU771nxf2XfSDY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720171076; c=relaxed/simple; bh=Lo6eXghjM18rt07OHp/luuP9jajCVBpJAtNwqEg3DJo=; h=DKIM-Signature:Message-ID:Date:To:From:Subject:MIME-Version; b=xfxdQuUKsxVu+zg0SdGqChLRlmOdAXL+kbdwC28A+QM7ehBZV66CZwi4ebSqVld5gUaEbVHiTLI2kfYn+ZppbZuk+qnTcvC70iqOWLQeu3kgsi9K7c1Yv8hSCt9GKlsh98PxZ6tlARt+xN6YndvlbxeVOiIleafjv4fkkshkEBg= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E/7o80TwY2j0K+HeCZs3/r0yWfmrhALEUut8zH3+bMWKgnKVYfkquM67oExNIt3J/pAmnO/ylk1rGT0ON92THcXVNcE21GTekq0W8NEDyLsnhgfzKaS85svuzqxj+YbIKrFvuI0RZBVOKvc8EuYIuOkIXgsA2ZARx5VFjB/vQZ0Cqk/jEvZv0w8gg5AF9ze8jQR959e72fkVH3+uV+BybTR+b7JURQV68+yqsAHHZQNaI1yXGHE8j87eiH8z2vD9dwGxPm6rEXB+II2icteDuOImB9ITBoBDkCOY8YMJHB56v6cqhGPOyVsYWRIcm/OzFFN0vyo47q/B5rETIlO4qA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x/lJsaahhURzbGlqUUATlDk13jSIjv/FbDbUFYdzies=; b=LNGypk9tcU3hOOKrzCpgeMt/BBLXywumM93LGRSlYx7ZtLiBmjMdZiWwN/mi7TfIpdAFICkBHUUhxyt42wRaPkkdng9PJV6dB4VTi+v3PETeXTF7TQ7vdH9ls5pf3m1ctDJT6GiwHrJrMtVqr0Z0Bz4bHhuxhnq9o6wWpvxnV0rC/OGuFJYS8kQ/tdla65vsnzlop/I5D650tOZF/iL5LET1CINIvMg8AIaqQ5uwhxGq9RjdyeOFdO2BuI/l6KFgE5XCpUpPhSRIjKd0+8ZuwwQbAlwTiEQUCbOZDh3wB0FZCfRD+MK7ywGpd1SV/0kCnIbyRucTqtGaF/vu6DeytA== 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=x/lJsaahhURzbGlqUUATlDk13jSIjv/FbDbUFYdzies=; b=Y8VkfLPVt7pDIm0S24bU38tkPWfXML+xLD47TNWu2DsiCZ5k/Ri5KVEMHX+xny5dBmm9mfQpYsjttaxEWi4ezDJsD6VK4jKCGck6T9gyB0QQ33twn6aKIH4fh9LrL2MtRMyPE8TVF+XBp2fMIpZrFahSAUbFucfERvowo86RMrHEU++xZzAaXSIssUb6+QxIb79KXmIBviiUlRae1A+t/hnfNyWVvk0p83W/GB0TcwHakvZFtPt1NbGd8xtVKQEZDS/ZjAmI8ILMTY+QDSkmT7ITKNGT5v/I4p673DfHcjRFP3f/JP0ReHhquvsrARlZrk9RQCCVubmmX6bXLQ24Gg== Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) by GV1P193MB2344.EURP193.PROD.OUTLOOK.COM (2603:10a6:150:2c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.29; Fri, 5 Jul 2024 09:17:43 +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.7741.029; Fri, 5 Jul 2024 09:17:43 +0000 Message-ID: Date: Fri, 5 Jul 2024 11:17:15 +0200 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "gdb-patches@sourceware.org" From: Bernd Edlinger Subject: [PATCH v3 2/3] Introduce a new line table flag is_weak X-TMN: [9kOVKVARCf/G/E40Jj7VrlARjYu9okBwzVeVzCXLSxRL7tVzYiBZ85c9RZH6VJA4] X-ClientProxiedBy: FR5P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f3::6) To AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) X-Microsoft-Original-Message-ID: <30bb326d-c955-4d14-88a1-08f486567aa0@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P193MB1285:EE_|GV1P193MB2344:EE_ X-MS-Office365-Filtering-Correlation-Id: f6ac8748-196e-4210-f81d-08dc9cd35366 X-Microsoft-Antispam: BCL:0; ARA:14566002|19110799003|8060799006|461199028|3412199025|440099028; X-Microsoft-Antispam-Message-Info: 384msQ0nElxbe2vCNkCG85lVYs3SPCpeTHgtuqkOl2WR27xubIAjZDC4sLCFo75b+ocQDmYI9aRBQmkiH1Xd/OwmyVzZZlb26cJH90zAVrlO3eybL3VHWudyhZ7BxlKok9kbxr5+b1wicaQ8j7Bu1UT3l10NuZfMbovrB1UL8HUB5clCmZCoDje2GOdMaHYpLVl5mJC2VhpP9lI+eo4b6hTEMVtpixy2qsZc/K6TSRY9CnDVdh9a1MvGb0HHC4OLoXfqbU9o3CgN76OcbkZrifx2gCnGysjJ+LO1K+CqOj8NxxTmaKkcmkHNJUZp/UQQ12D7ATQRklu3PZq4PkT9uC3mP9EvOHKDh4aZxx6xGUN360NGcMS2YsTCNHQRKZHw2kcIRbWFoi6o43VjKyWBP1lR3nUb8nySuSK5w0cy+zHs1dPLLM+kjXbTj0oTGnY3hnLra3WFJ8V8jmC3GfuQj4STthS62eQ1IaDpffKhSlCD1f3FJywmNMlih8dN77OkBY669xXM63so7fmcIX7u9VMwE476rWeLdf+q/caSFgfEz11sA6kqMED2M4RWjhSHgbzzb/waWX6x53MnmIyQ2Ex1rid88aLDf6+v0xxXh3uHnBaA9Z9c/TZG0FYpejl4jBfGN2R1/07hsYcW4/rlbw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gsPSwmbeQhyM3Jk2fII9zBpDTxwe?= =?utf-8?q?qdjHT8tkAYMYt6ug65MAtfkBnKHCBVizFBZx8vMb3HUGWAA8eHCj6weKkcpkLjL3U?= =?utf-8?q?MM4AEYMJ26yQ4IEMc4HHqhK/KkU82GOkPlNaVX67b5LKzFZ+V/OoFUGV3mOvl6pxb?= =?utf-8?q?fBYnvYFaVR6VuNRPDjsRloUFisDxWankw09aQFDsQKDVumfWc03BD6qIfr2CxRv6P?= =?utf-8?q?q5hr2EHTZruSGpBNLuhv8gLZjBhPPmd5DqJ5Dp2aNfHviXsLRQ2k89mHn7M2joCR7?= =?utf-8?q?yK983Pub9lOomQmJMeltyHQGNuE8TzLlM2MB5B0SZCfMEJK6l8I1qbsg5AcAS1uja?= =?utf-8?q?6LYKSlfYUMpd1O0qRZ+jsU5KUJpY+GSYbP3Mdequa/8lSQ3SrwcQcqGMLAJ11JxB6?= =?utf-8?q?1dPRsuznGpyZ7vgj6ce3Kw8LBRLfIDHJI26EBjI3VWqWmUMVuluRI1ZjNaMrwp1HH?= =?utf-8?q?2/Vs0Fcv71r/1/81l+eX475BBviB46yRtUkcl9twVfyZBYvGIoXlenQPEoG6TOAPl?= =?utf-8?q?lYQEePoBWswn6uy1GNUPyGGK2Kn6Gfhf4/4O3zdNbWSCUkct9eSFoZsTpfqfGZ16h?= =?utf-8?q?C7+L4YJto04ajYFHV1U/RsF4fRhXmO8DILfL6Ij3WKC70temgc9G598zKIWCUnXbK?= =?utf-8?q?cQ3iekL1TI2c9Oj93Z3vxaq104yKgtA8NXinLWAm636geqoXclFRGW0vHHq6gt/5U?= =?utf-8?q?+jCLwK3cbV5Z9JE9eBpiiYSDhliih8SnBGvhTNathAo4uQAKwviNY6eftqgRfLpRB?= =?utf-8?q?YQfoDsps59ql4dF9QzyppSxClY0hMqvm07PV0ipuHNZ9xODoiQnoCKj+eM7hsmWiH?= =?utf-8?q?c1/oMfaJXCEZVy62mbR2Y0wiKl0ElNONCPB52RWL1rwT4g4ufhSRoDaCqww5jZKui?= =?utf-8?q?nq+vlb3rJpn2tRmLhjegB/OZHq/492yhaK/DZLEXl79QT7qUY8OBPE2p4R+xC8/3G?= =?utf-8?q?A+iI5d2L4MXFL+HvbS/DJzZxwAT1YyKlYLY35NFscJMs5RaEx9nLQHFJ6GTdWP1kt?= =?utf-8?q?PZEvzNmzyk8GN8XxqbM2YA6F7PC+p+A7x1owrmQSlhorotW0tEElZFN+NdHGEQX+y?= =?utf-8?q?gTuXy5ZmKwHJr2iiAVLs1GY+KCHsrG/O94Xh5y7WwI4aIVpwUmCoN+0txm5qkQBOX?= =?utf-8?q?3DmkJoFlD7dHGwi8hbTVcO4W5RNl5lBP7hNEJqZDf4lVhi0rHdNL6YFil4KZisZ9a?= =?utf-8?q?P9tySz4/ltrrhJTC1EcFCQGQ48iKgcXMtUfPSSK6WmWRv4yHBuf9g2Blug+VdjGxd?= =?utf-8?q?mSdQm+VMiWbhE6aY?= X-OriginatorOrg: sct-15-20-7741-18-msonline-outlook-01732.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: f6ac8748-196e-4210-f81d-08dc9cd35366 X-MS-Exchange-CrossTenant-AuthSource: AS8P193MB1285.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:17:43.3156 (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: GV1P193MB2344 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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~patchwork=sourceware.org@sourceware.org This introduces a new line table flag is_weak. The line entries at the end of a subroutine range, use this to indicate that they may possibly be part of the previous subroutine. When there is a sequence of line entries at the same address where an inline range ends, and the last item has is_stmt = 0, we force all previous items to have is_weak = 1. Additionally this adds a "fake" end sequence to the record_line function, that is line number -1. That will be used in the next patch. Finally this adds a handling for empty ranges to record_block_range. Currently this function is not called with empty ranges, but that will be used in the next patch. There should be no functional changes after this commit. --- gdb/buildsym.c | 106 ++++++++++++++++--- gdb/buildsym.h | 3 + gdb/jit.c | 1 + gdb/symmisc.c | 6 +- gdb/symtab.h | 5 + gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp | 2 +- gdb/xcoffread.c | 1 + 7 files changed, 109 insertions(+), 15 deletions(-) diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 1c762ad81bf..9bf2fff6e29 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -413,6 +413,16 @@ buildsym_compunit::record_block_range (struct block *block, || end_inclusive + 1 != block->end ()) m_pending_addrmap_interesting = true; + if (block->inlined_p ()) + { + m_inline_end_vector.push_back (end_inclusive + 1); + if (end_inclusive + 1 == start) + { + end_inclusive = start; + m_pending_addrmap_interesting = true; + } + } + m_pending_addrmap.set_empty (start, end_inclusive, block); } @@ -627,19 +637,16 @@ buildsym_compunit::record_line (struct subfile *subfile, int line, { m_have_line_numbers = true; - /* Normally, we treat lines as unsorted. But the end of sequence - marker is special. We sort line markers at the same PC by line - number, so end of sequence markers (which have line == 0) appear - first. This is right if the marker ends the previous function, - and there is no padding before the next function. But it is - wrong if the previous line was empty and we are now marking a - switch to a different subfile. We must leave the end of sequence - marker at the end of this group of lines, not sort the empty line - to after the marker. The easiest way to accomplish this is to - delete any empty lines from our table, if they are followed by - end of sequence markers. All we lose is the ability to set - breakpoints at some lines which contain no instructions - anyway. */ + /* The end of sequence marker is special. We need to delete any + previous lines at the same PC, otherwise these lines may cause + problems since they might be at the same address as the following + function. For instance suppose a function calls abort there is no + reason to emit a ret after that point (no joke). + So the label may be at the same address where the following + function begins. There is also a fake end of sequence marker (-1) + that we emit internally when switching between different CUs + In this case, duplicate line table entries shall not be deleted. + We simply set the is_weak marker in this case. */ if (line == 0) { std::optional last_line; @@ -659,15 +666,84 @@ buildsym_compunit::record_line (struct subfile *subfile, int line, if (!last_line.has_value () || *last_line == 0) return; } + else if (line == -1) + { + line = 0; + auto e = subfile->line_vector_entries.end (); + while (e > subfile->line_vector_entries.begin ()) + { + e--; + if (e->unrelocated_pc () != pc) + break; + e->is_weak = 1; + } + } linetable_entry &e = subfile->line_vector_entries.emplace_back (); e.line = line; e.is_stmt = (flags & LEF_IS_STMT) != 0; + e.is_weak = false; e.set_unrelocated_pc (pc); e.prologue_end = (flags & LEF_PROLOGUE_END) != 0; e.epilogue_begin = (flags & LEF_EPILOGUE_BEGIN) != 0; } + +/* Patch the is_stmt bits at the given inline end address. + The line table has to be already sorted. */ + +static void +patch_inline_end_pos (struct subfile *subfile, struct objfile *objfile, + CORE_ADDR end) +{ + std::vector &items = subfile->line_vector_entries; + int a = 2, b = items.size () - 1; + + /* We need at least two items with pc = end in the table. + The lowest usable items are at pos 0 and 1, the highest + usable items are at pos b - 2 and b - 1. */ + if (a > b + || end < items[1].pc (objfile) + || end > items[b - 2].pc (objfile)) + return; + + /* Look for the first item with pc > end in the range [a,b]. + The previous element has pc = end or there is no match. + We set a = 2, since we need at least two consecutive elements + with pc = end to do anything useful. + We set b = items.size () - 1, since we are not interested + in the last element which should be an end of sequence + marker with line = 0 and is_stmt = true. */ + while (a < b) + { + int c = (a + b) / 2; + + if (end < items[c].pc (objfile)) + b = c; + else + a = c + 1; + } + + a--; + if (items[a].pc (objfile) != end || items[a].is_stmt) + return; + + /* When there is a sequence of line entries at the same address + where an inline range ends, and the last item has is_stmt = 0, + we force all previous items to have is_weak = true as well. */ + do + { + /* We stop at the first line entry with a different address, + or when we see an end of sequence marker. */ + a--; + if (items[a].pc (objfile) != end || items[a].line == 0) + break; + + items[a].is_weak = true; + } + while (a > 0); +} + /* Subroutine of end_compunit_symtab to simplify it. Look for a subfile that matches the main source file's basename. If there is only one, and @@ -892,6 +968,10 @@ buildsym_compunit::end_compunit_symtab_with_blockvector relationships, this is why std::stable_sort is used. */ std::stable_sort (subfile->line_vector_entries.begin (), subfile->line_vector_entries.end ()); + + for (int i = 0; i < m_inline_end_vector.size (); i++) + patch_inline_end_pos (subfile, m_objfile, + m_inline_end_vector[i]); } /* Allocate a symbol table if necessary. */ diff --git a/gdb/buildsym.h b/gdb/buildsym.h index c1eed247d25..edf76c8b17c 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -446,6 +446,9 @@ struct buildsym_compunit /* Pending symbols that are local to the lexical context. */ struct pending *m_local_symbols = nullptr; + + /* Pending inline end range addresses. */ + std::vector m_inline_end_vector; }; diff --git a/gdb/jit.c b/gdb/jit.c index 797be95a8da..2f714268920 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -495,6 +495,7 @@ jit_symtab_line_mapping_add_impl (struct gdb_symbol_callbacks *cb, (unrelocated_addr (map[i].pc)); stab->linetable->item[i].line = map[i].line; stab->linetable->item[i].is_stmt = true; + stab->linetable->item[i].is_weak = false; } } diff --git a/gdb/symmisc.c b/gdb/symmisc.c index b4e0360041e..567ec270f3c 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -265,6 +265,8 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile) gdb_puts (paddress (gdbarch, l->item[i].pc (objfile)), outfile); if (l->item[i].is_stmt) gdb_printf (outfile, "\t(stmt)"); + if (l->item[i].is_weak) + gdb_printf (outfile, "\t(weak)"); gdb_printf (outfile, "\n"); } } @@ -973,12 +975,13 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data) /* Leave space for 6 digits of index and line number. After that the tables will just not format as well. */ struct ui_out *uiout = current_uiout; - ui_out_emit_table table_emitter (uiout, 7, -1, "line-table"); + ui_out_emit_table table_emitter (uiout, 8, -1, "line-table"); uiout->table_header (6, ui_left, "index", _("INDEX")); uiout->table_header (6, ui_left, "line", _("LINE")); uiout->table_header (18, ui_left, "rel-address", _("REL-ADDRESS")); uiout->table_header (18, ui_left, "unrel-address", _("UNREL-ADDRESS")); uiout->table_header (7, ui_left, "is-stmt", _("IS-STMT")); + uiout->table_header (7, ui_left, "is-weak", _("IS-WEAK")); uiout->table_header (12, ui_left, "prologue-end", _("PROLOGUE-END")); uiout->table_header (14, ui_left, "epilogue-begin", _("EPILOGUE-BEGIN")); uiout->table_body (); @@ -999,6 +1002,7 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data) uiout->field_core_addr ("unrel-address", objfile->arch (), CORE_ADDR (item->unrelocated_pc ())); uiout->field_string ("is-stmt", item->is_stmt ? "Y" : ""); + uiout->field_string ("is-weak", item->is_weak ? "Y" : ""); uiout->field_string ("prologue-end", item->prologue_end ? "Y" : ""); uiout->field_string ("epilogue-begin", item->epilogue_begin ? "Y" : ""); uiout->text ("\n"); diff --git a/gdb/symtab.h b/gdb/symtab.h index a5631a27b5e..9b2b297fb3a 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1656,6 +1656,9 @@ struct linetable_entry /* True if this PC is a good location to place a breakpoint for LINE. */ bool is_stmt : 1; + /* True if this PC is at a subroutine range end. */ + bool is_weak : 1; + /* True if this location is a good location to place a breakpoint after a function prologue. */ bool prologue_end : 1; @@ -2412,6 +2415,8 @@ struct symtab_and_line /* If the line number information is valid, then this indicates if this line table entry had the is-stmt flag set or not. */ bool is_stmt = false; + /* True if this PC is at a subroutine range end. */ + bool is_weak = false; /* The probe associated with this symtab_and_line. */ probe *prob = NULL; diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp index 1a3d53c2116..403bc6b3f72 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp @@ -168,7 +168,7 @@ gdb_test_multiple "maint info line-table gdb.dwarf2/dw2-ranges-base.c" \ -re ".*linetable: \\(\\(struct linetable \\*\\) 0x0\\):\r\nNo line table.\r\n" { exp_continue } - -re ".*linetable: \\(\\(struct linetable \\*\\) $hex\\):\r\nINDEX\[ \t\]+LINE\[ \t\]+REL-ADDRESS\[ \t\]+UNREL-ADDRESS\[ \t\]+IS-STMT\[ \t\]PROLOGUE-END\[ \t\]EPILOGUE-BEGIN *\r\n" { + -re ".*linetable: \\(\\(struct linetable \\*\\) $hex\\):\r\nINDEX\[ \t\]+LINE\[ \t\]+REL-ADDRESS\[ \t\]+UNREL-ADDRESS\[ \t\]+IS-STMT\[ \t\]IS-WEAK\[ \t\]PROLOGUE-END\[ \t\]EPILOGUE-BEGIN *\r\n" { exp_continue } } diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 639dd5b8adc..1642bc12dfb 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -431,6 +431,7 @@ arrange_linetable (std::vector &old_linetable) linetable_entry &e = fentries.emplace_back (); e.line = ii; e.is_stmt = true; + e.is_weak = false; e.set_unrelocated_pc (old_linetable[ii].unrelocated_pc ()); } }