From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oOdRK/x8WWgt1hoAWB0awg (envelope-from ) for ; Mon, 23 Jun 2025 12:12:44 -0400 Received: by simark.ca (Postfix, from userid 112) id ABE8D1E11C; Mon, 23 Jun 2025 12:12:44 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 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 666ED1E0C2 for ; Mon, 23 Jun 2025 12:12:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB86238697E6 for ; Mon, 23 Jun 2025 16:12:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB86238697E6 Received: from us-smtp-delivery-114.mimecast.com (us-smtp-delivery-114.mimecast.com [170.10.133.114]) by sourceware.org (Postfix) with ESMTP id 9A8963846E75 for ; Mon, 23 Jun 2025 16:10:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A8963846E75 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=labware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=labware.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9A8963846E75 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.114 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750695033; cv=none; b=ImjxlIua2+q1M12BXhbBJ92CHclIozkZJrr8q4MZ8HSSPTeE3/oFeYFSoqmaraIoaz8H7g3RZYls9pw4Qzg06fXN2Nq2vDv0Z6CM+uVHhqZxWWPiqu/cQbOADNlf0P+RzoGvTETIFqqPTm3Q1PbVGYeKR5eMq+vNkAF7SNHJWdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750695033; c=relaxed/simple; bh=PQcOFx5MX4Z/sr3eOZdlPMtMUBt5gICfJnBliSzE8zY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=kj+DU6+0bwsklzNCQBwqCr+h7/xWcjr42Sr8MXT1heGp7Z098FlOZPc5rI6D7xA5rbc3K9qYIehfIJbM2saZlkXZTQeeQz4+FE07BRtIi2nwtLKO1cZOG8fc6G60/98uyau2lHjQhpkKWjsk+VTNOcvM58IWAGKFVZJRgYy6lT0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A8963846E75 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2101.outbound.protection.outlook.com [40.107.237.101]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-220-ScD2DOZTP-qHznNbYB-_Dw-1; Mon, 23 Jun 2025 12:10:32 -0400 X-MC-Unique: ScD2DOZTP-qHznNbYB-_Dw-1 X-Mimecast-MFC-AGG-ID: ScD2DOZTP-qHznNbYB-_Dw_1750695031 Received: from SA1PR17MB5365.namprd17.prod.outlook.com (2603:10b6:806:1d8::11) by PH0PR17MB4637.namprd17.prod.outlook.com (2603:10b6:510:81::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8857.29; Mon, 23 Jun 2025 16:10:29 +0000 Received: from SA1PR17MB5365.namprd17.prod.outlook.com ([fe80::6398:7dc0:7d88:5a4d]) by SA1PR17MB5365.namprd17.prod.outlook.com ([fe80::6398:7dc0:7d88:5a4d%5]) with mapi id 15.20.8857.026; Mon, 23 Jun 2025 16:10:29 +0000 From: Jan Vrany To: gdb-patches@sourceware.org CC: Jan Vrany Subject: [RFC v5 01/18] gdb: introduce expand_symtabs_maybe_overlapping Date: Mon, 23 Jun 2025 17:09:56 +0100 Message-ID: <20250623161013.650814-2-jan.vrany@labware.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250623161013.650814-1-jan.vrany@labware.com> References: <20250623161013.650814-1-jan.vrany@labware.com> X-ClientProxiedBy: LNXP123CA0001.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:d2::13) To SA1PR17MB5365.namprd17.prod.outlook.com (2603:10b6:806:1d8::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR17MB5365:EE_|PH0PR17MB4637:EE_ X-MS-Office365-Filtering-Correlation-Id: a6324a9a-a176-4339-2ea3-08ddb27078f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?U9gBsq4sAH3rtNC2LywYPjP8+WqUKzd3iKFKBnPOGc490rM1ZRFWx5jtdTOa?= =?us-ascii?Q?+6YLnr5gN/GXzunxp96ykfFxE03DPVAZz7s+Z6RTfY21bfS25dv5jcXMg/EU?= =?us-ascii?Q?xkbaVlyqCVeX2pODF5wz1k4WHQO37vpZ9cyG+YK5AiDbtos+0k29TB3dRSzf?= =?us-ascii?Q?IYJFtlqD6CMtpN2d3uvA3OQKE29beSZuFWicILdudHiS8M/q5Ldcm3RQyKMb?= =?us-ascii?Q?s8oUK6jZFzKvhpElFYBoDDbDGWIK941O9aMGwUk3icuCoC5kdvWOFm1s9C8K?= =?us-ascii?Q?Io5SCxF+1gNtoHHIiOzgQzYTdX7+cCtef33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mOiMq8v+IVM78yILStD+wmuW/KcJSPnHL9bqy7lzdZsLmShHnWsHL64C7sc0?= =?us-ascii?Q?HVu5d+UGYCT3DRmTk5haJiXlUkzrhJ9JO/Ah0PtY121MJ+BSi0BR2FPxXF3R?= =?us-ascii?Q?dVvaX+XF1aKPlCRo4wMA6ufdLN8+Wahpg2v6erx7Ny/FdFM0pUeFINA3yP4T?= =?us-ascii?Q?xapz7vxLx55fZcS6qLkhZ+IMFF88Q8n/rs+PqzNSZ/p8KnJNz/naMG+jpvPX?= =?us-ascii?Q?h2f777TxpiU=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR17MB5365.namprd17.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?kwI4fY8G9ZhnSwyR8xhocZeUvNmMCF5/tYG3X4eLvFspVamOCrx+A6NyVgcd?= =?us-ascii?Q?d1tubi7wic692p0XBjEyVilfDcE7a9ez5f1a97ctbXGVv2eMKfEKV4qhHhwN?= =?us-ascii?Q?8yUx8FQEnIw8VENaX7cIPV1IBygO09Y92Yc3fAHP1JWspxarn4hjmy/razGG?= =?us-ascii?Q?x9A/fHPVrtTj5CSZjikxDLwQSSLyZoqEZ+PFxPEFBYDClO9fM8iShhkUMbmv?= =?us-ascii?Q?9OKMGGKQp0RWRPbB0seven7Y2TOmZjwCWH3vJ2nMtN+T2FW3FwEr7E2xo5Ej?= =?us-ascii?Q?mC2Q1iuH1iB2IWcdh8OlTKD+spA0sk8vGEjgI04jw+xD6TsTxwKgnOoqkzxC?= =?us-ascii?Q?jjK3MkbVBpadQtmquNQA2vxro1Lmu03EwEENaKcRtA1jmicCUex5h54hUNgA?= =?us-ascii?Q?+STIDyY5fdhpOW7nZUN9wNZfoSh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R4KyIBloZErjFiHahwMEGgzpTuSZ/bAx/oR7gvZVV0bMqaF39Uvu?= =?us-ascii?Q?uncnSFsPBMchR9IngA7JeHSTndvTEzrW1LN7bmbrKecpMloNTVnJPs9mVLOU?= =?us-ascii?Q?++2qnIW1+KWCO1MgUinwMxPUcfgf/gtqWB8LiX0CvG5rgE+10hAv+qPdM8pz?= =?us-ascii?Q?inlj5rNv92x+FuBBxGil8s2LNXU3ialv9x5jHOE1NTrEbx4JWU53wyY9fApA?= =?us-ascii?Q?fKQivIgLwq/RwHggeRgIrtFr0vFQTUwZuRHiXHSp?= X-OriginatorOrg: labware.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6324a9a-a176-4339-2ea3-08ddb27078f9 X-MS-Exchange-CrossTenant-AuthSource: SA1PR17MB5365.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2025 16:10:29.3304 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b5db0322-1aa0-4c0a-859c-ad0f96966f4c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 63vXvsmZRiz6z5WQOyXpcB7F7ouuaV3DgQQ7L5e714kfG2BjtBG0dJaMsoHBttNbV+s048t2tZtqxXNAv+xH4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR17MB4637 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: dujKG6T4mD0I1Zvt9CF369S9k44bIJc_WLwQB99CtIw_1750695031 X-Mimecast-Originator: labware.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252 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 This commit introduces expand_symtabs_maybe_overlapping, a new "quick symbol function". This will be used later by Python API to create new compunits to ensure to-be-created compunit does not overlap with existing one. For DWARF2 base index functions, all compunits are expanded unconditionally since there seem to be no way to extract unexpanded compunit's conservative address range. --- gdb/dwarf2/cooked-index.h | 11 +++++++++++ gdb/dwarf2/read.c | 11 +++++++++++ gdb/dwarf2/read.h | 3 +++ gdb/objfiles.h | 3 +++ gdb/psymtab.c | 21 +++++++++++++++++++++ gdb/psymtab.h | 3 +++ gdb/quick-symbol.h | 5 +++++ gdb/symfile-debug.c | 16 ++++++++++++++++ gdbsupport/range.h | 35 +++++++++++++++++++++++++++++++++++ 9 files changed, 108 insertions(+) create mode 100644 gdbsupport/range.h diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index 43b27232aec..894f2078e9f 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -237,6 +237,17 @@ struct cooked_index_functions : public dwarf2_base_ind= ex_functions dwarf2_base_index_functions::expand_all_symtabs (objfile); } =20 + /* Cooked index's version of expand_symtabs_maybe_overlapping. See its + definition in the definition of quick_symbol_functions in symfile.h. = */ + + void expand_symtabs_maybe_overlapping (struct objfile *objfile, +=09CORE_ADDR start, CORE_ADDR end) override + { + wait (objfile, true); + dwarf2_base_index_functions::expand_symtabs_maybe_overlapping + (objfile, start, end); + } + bool expand_symtabs_matching (struct objfile *objfile, expand_symtabs_file_matcher file_matcher, diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 2f27b7cff4c..3270ce55c56 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1926,6 +1926,17 @@ dwarf2_base_index_functions::expand_all_symtabs (str= uct objfile *objfile) } } =20 +/* DWARF2 index's version of expand_symtabs_maybe_overlapping. See its de= finition + in the definition of quick_symbol_functions in symfile.h. */ + +void +dwarf2_base_index_functions::expand_symtabs_maybe_overlapping + (struct objfile *objfile, CORE_ADDR start, CORE_ADDR end) +{ + /* Simply expand all symtabs. I do not know how to extract (if at all + possible) conservative address range from dwarf2_per_cu_data. */ + expand_all_symtabs (objfile); +} /* See read.h. */ =20 bool diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index a5cfb3144f7..da55f993123 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -1192,6 +1192,9 @@ struct dwarf2_base_index_functions : public quick_sym= bol_functions =20 void expand_all_symtabs (struct objfile *objfile) override; =20 + virtual void expand_symtabs_maybe_overlapping (struct objfile *objfile, +=09CORE_ADDR start, CORE_ADDR end) override; + struct compunit_symtab *find_pc_sect_compunit_symtab (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin) diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 4a3475862a9..0206b49e00c 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -597,6 +597,9 @@ struct objfile : intrusive_list_node code, e.g., DW_TAG_type_unit for dwarf debug info. */ void expand_symtabs_with_fullname (const char *fullname); =20 + /* See quick_symbol_functions. */ + void expand_symtabs_maybe_overlapping (CORE_ADDR start, CORE_ADDR end); + /* See quick_symbol_functions. */ bool expand_symtabs_matching (expand_symtabs_file_matcher file_matcher, diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 986ef44f6c7..d40afd5877f 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -36,6 +36,7 @@ #include #include #include "gdbsupport/buildargv.h" +#include "gdbsupport/range.h" =20 static const struct partial_symbol *lookup_partial_symbol (struct objfile *, struct partial_symtab *, const lookup_name_info &, @@ -731,6 +732,26 @@ psymbol_functions::expand_all_symtabs (struct objfile = *objfile) psymtab_to_symtab (objfile, psymtab); } =20 +/* Psymtab version of expand_symtabs_maybe_overlapping. See its definitio= n in + the definition of quick_symbol_functions in symfile.h. */ + +void +psymbol_functions::expand_symtabs_maybe_overlapping + (struct objfile *objfile, CORE_ADDR start, CORE_ADDR end) +{ + for (partial_symtab *psymtab : partial_symbols (objfile)) + { + if (psymtab->text_low_valid && psymtab->text_high_valid) +=09{ +=09 CORE_ADDR text_low =3D psymtab->text_low (objfile); +=09 CORE_ADDR text_high =3D psymtab->text_high (objfile); + +=09 if (ranges_overlap (start, end, text_low, text_high)) +=09 psymtab_to_symtab (objfile, psymtab); +=09} + } +} + /* Psymtab version of map_symbol_filenames. See its definition in the definition of quick_symbol_functions in symfile.h. */ =20 diff --git a/gdb/psymtab.h b/gdb/psymtab.h index ad0b2ff4234..8a8ea738bbd 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -626,6 +626,9 @@ struct psymbol_functions : public quick_symbol_function= s =20 void expand_all_symtabs (struct objfile *objfile) override; =20 + virtual void expand_symtabs_maybe_overlapping (struct objfile *objfile, +=09CORE_ADDR start, CORE_ADDR end) override; + bool expand_symtabs_matching (struct objfile *objfile, expand_symtabs_file_matcher file_matcher, diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h index 9db1f1860cb..899f2f22239 100644 --- a/gdb/quick-symbol.h +++ b/gdb/quick-symbol.h @@ -130,6 +130,11 @@ struct quick_symbol_functions /* Read all symbol tables associated with OBJFILE. */ virtual void expand_all_symtabs (struct objfile *objfile) =3D 0; =20 + /* Read all symbol tables associated with OBJFILE which may overlap + with range [START, END). */ + virtual void expand_symtabs_maybe_overlapping (struct objfile *objfile, +=09CORE_ADDR start, CORE_ADDR end) =3D 0; + /* Expand all symbol tables in OBJFILE matching some criteria. =20 If LANG_MATCHER returns false, expansion of the symbol table may be diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 9c5ce85d26e..900d1bf90e2 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -343,6 +343,22 @@ objfile::expand_all_symtabs () iter->expand_all_symtabs (this); } =20 +/* See objfiles.h. */ + +void +objfile::expand_symtabs_maybe_overlapping (CORE_ADDR start, CORE_ADDR end) +{ + if (debug_symfile) + gdb_printf (gdb_stdlog, +=09=09"qf->expand_symtabs_maybe_overlapping (%s, %s, %s)\n", +=09=09objfile_debug_name (this), +=09=09hex_string (start), +=09=09hex_string (end)); + + for (const auto &iter : qf) + iter->expand_symtabs_maybe_overlapping (this, start, end); +} + void objfile::expand_symtabs_with_fullname (const char *fullname) { diff --git a/gdbsupport/range.h b/gdbsupport/range.h new file mode 100644 index 00000000000..b665943cfd3 --- /dev/null +++ b/gdbsupport/range.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2025-2025 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . = */ + +#ifndef GDBSUPPORT_RANGE_H +#define GDBSUPPORT_RANGE_H + +/* Return true if given ranges [AL, AH) and [BL, BH) overlap. Return fals= e + otherwise. */ + +template +bool ranges_overlap (T al, T ah, T bl, T bh) +{ + static_assert (std::is_integral::value, "Integral type required"); + + gdb_assert (al <=3D ah); + gdb_assert (bl <=3D bh); + + return !(ah <=3D bl || bh <=3D al); +} + +#endif /* GDBSUPPORT_RANGE_H */ --=20 2.47.2