From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id BAC123858C78 for ; Thu, 26 Oct 2023 09:56:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BAC123858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BAC123858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698314211; cv=none; b=mudq5Ey5rHxa7JApR49LZPXKffmNC9u4l69IeXuWimAO71gmQnY7QW5PI+pr5rzOC2XjPzh0paNksx9hDaT1f2GxVytiIOcR1/pwzpa7mzmmOL2KudAU2sCqTFFsHH9Gd+Rwac4qNEjIeSbFi2GlJKqftA0MDQM/WLC8vuVCEDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698314211; c=relaxed/simple; bh=kkEyvQjQmQCm3nisXELF29bxbCMUU3oSe+3pUHKfUYU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=dTSrOWBEwOXrbYeVeJ7CW4E6+CVSWUHbIK0UlRP90umYjDPkdrfMc9k2UpSdX/se6jIRJJfn/EdHzmoYLyCSWO9gtyev2LUgUbhOXARnR+2GtsqiSIt5zCFPL0C13sak/XXrR/53Et38jm0pRgHdl34oETI8oual7AXzhhevapA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698314208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l4YAAQ+/Qcdr0WhLjKEdjpGn5aBuQ7lbXDLDON394TQ=; b=O8MvfTn+xGQn23tBBBUJs3APSysLroHhJdFPNOTERsNXrYVXEZqFY5hGdis7kSRajUwsTf vBfHaZzay6hRjoDQUVtpVvjQrMotpKNe2z2H5o5xk/Sm83/gPKNNTMLNh0rb76fZP27x0Q pLax4H3HWNMtDA0aqwD8rsKMOOXmkds= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-ofVO_1psMGSGiYPsn19RsQ-1; Thu, 26 Oct 2023 05:56:46 -0400 X-MC-Unique: ofVO_1psMGSGiYPsn19RsQ-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-9c75886c044so47620066b.2 for ; Thu, 26 Oct 2023 02:56:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698314205; x=1698919005; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l4YAAQ+/Qcdr0WhLjKEdjpGn5aBuQ7lbXDLDON394TQ=; b=nriaZchO1VWkTXXxkkgsuM4TVhBDi7PlcnJK6GGvQnKwgQS6UDRQMlUqeqjaDmZJdG vC0SHZ2+jlAUwkW0GzA3RkJbqbUqk/O/SzSlxobu0AAs88Y0ow9EJHfqPr+m4PjA48x7 Ck/oReHol3AGwtpjYwxfosUttG1pL+umnxQFK8UNsC1NUG/m0KJPg2Mz9cvoPFu/roqq YRPrd/Jiqxpu9MDueqFypKtb/5FwsO1hoWTo9QvnE20K/1wrTC6bBpS0m/qjGiHLImPo bBMQB58exfU4ByTCsbLdKnZTyOAiyVNUKuUeJelldEDZSuQn+jmguwHuqqJTbps7DYEh 9ZFg== X-Gm-Message-State: AOJu0YwJcG5sV0lJXB7nHylHFAWrsZtvVpc92hAre1B04UEN05ApkGps bGB2j8G4sPpMA9Kx0/jPKcTHl+oBwNs64qgi4rinZ/HwekkGXy2PxKt62FsfPOhelKBQMzGm6hr i7sHUjkucKdc28SP+PeAx1w== X-Received: by 2002:a17:906:311a:b0:9cd:26e9:a8cc with SMTP id 26-20020a170906311a00b009cd26e9a8ccmr3521465ejx.2.1698314205621; Thu, 26 Oct 2023 02:56:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEtvsr5c5XgwhbR4XVR0fEDThP/JXGS77JwWYOpNBJpThRkursGf1xqeJ4KjITioiEl2hjTw== X-Received: by 2002:a17:906:311a:b0:9cd:26e9:a8cc with SMTP id 26-20020a170906311a00b009cd26e9a8ccmr3521447ejx.2.1698314205040; Thu, 26 Oct 2023 02:56:45 -0700 (PDT) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id bu12-20020a170906a14c00b009c758b6cdefsm11457845ejb.128.2023.10.26.02.56.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Oct 2023 02:56:44 -0700 (PDT) Message-ID: Date: Thu, 26 Oct 2023 11:56:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 2/2] Move read_addrmap_from_aranges to new file To: Tom Tromey , gdb-patches@sourceware.org References: <20231014205755.996771-1-tom@tromey.com> <20231014205755.996771-3-tom@tromey.com> From: Guinevere Larsen In-Reply-To: <20231014205755.996771-3-tom@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 14/10/2023 22:56, Tom Tromey wrote: > In the interest of shrinking dwarf2/read.c a little more, this patch > moves the code that deciphers .debug_aranges into a new file. This is a good change, I just have a small question: why you only chose to move read_addrmap_from_aranges and not also move create_addrmap_from_aranges? I know the second function isn't in dwarf2/read.c, but I think it would make aranges.c more consistent. -- Cheers, Guinevere Larsen She/Her/Hers > --- > gdb/Makefile.in | 2 + > gdb/dwarf2/aranges.c | 200 ++++++++++++++++++++++++++++++++++ > gdb/dwarf2/aranges.h | 35 ++++++ > gdb/dwarf2/read-debug-names.c | 1 + > gdb/dwarf2/read.c | 179 +----------------------------- > gdb/dwarf2/read.h | 8 -- > 6 files changed, 239 insertions(+), 186 deletions(-) > create mode 100644 gdb/dwarf2/aranges.c > create mode 100644 gdb/dwarf2/aranges.h > > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 9c0a0bff2cd..52b08692b52 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -1065,6 +1065,7 @@ COMMON_SFILES = \ > dwarf2/abbrev.c \ > dwarf2/abbrev-cache.c \ > dwarf2/ada-imported.c \ > + dwarf2/aranges.c \ > dwarf2/attribute.c \ > dwarf2/comp-unit-head.c \ > dwarf2/cooked-index.c \ > @@ -1321,6 +1322,7 @@ HFILES_NO_SRCDIR = \ > disasm-flags.h \ > disasm.h \ > dummy-frame.h \ > + dwarf2/aranges.h \ > dwarf2/cooked-index.h \ > dwarf2/cu.h \ > dwarf2/frame-tailcall.h \ > diff --git a/gdb/dwarf2/aranges.c b/gdb/dwarf2/aranges.c > new file mode 100644 > index 00000000000..3298d43e486 > --- /dev/null > +++ b/gdb/dwarf2/aranges.c > @@ -0,0 +1,200 @@ > +/* DWARF aranges handling > + > + Copyright (C) 1994-2023 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 . */ > + > +#include "defs.h" > +#include "dwarf2/aranges.h" > +#include "dwarf2/read.h" > + > +/* See aranges.h. */ > + > +bool > +read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, > + dwarf2_section_info *section, > + addrmap *mutable_map) > +{ > + /* Caller must ensure this is read in. */ > + gdb_assert (section->readin); > + if (section->empty ()) > + return false; > + > + struct objfile *objfile = per_objfile->objfile; > + bfd *abfd = objfile->obfd.get (); > + struct gdbarch *gdbarch = objfile->arch (); > + dwarf2_per_bfd *per_bfd = per_objfile->per_bfd; > + > + std::unordered_map + dwarf2_per_cu_data *, > + gdb::hash_enum> > + debug_info_offset_to_per_cu; > + for (const auto &per_cu : per_bfd->all_units) > + { > + /* A TU will not need aranges, and skipping them here is an easy > + way of ignoring .debug_types -- and possibly seeing a > + duplicate section offset -- entirely. The same applies to > + units coming from a dwz file. */ > + if (per_cu->is_debug_types || per_cu->is_dwz) > + continue; > + > + const auto insertpair > + = debug_info_offset_to_per_cu.emplace (per_cu->sect_off, > + per_cu.get ()); > + > + /* Assume no duplicate offsets in all_units. */ > + gdb_assert (insertpair.second); > + } > + > + std::set debug_info_offset_seen; > + const bfd_endian dwarf5_byte_order = gdbarch_byte_order (gdbarch); > + const gdb_byte *addr = section->buffer; > + while (addr < section->buffer + section->size) > + { > + const gdb_byte *const entry_addr = addr; > + unsigned int bytes_read; > + > + const LONGEST entry_length = read_initial_length (abfd, addr, > + &bytes_read); > + addr += bytes_read; > + > + const gdb_byte *const entry_end = addr + entry_length; > + const bool dwarf5_is_dwarf64 = bytes_read != 4; > + const uint8_t offset_size = dwarf5_is_dwarf64 ? 8 : 4; > + if (addr + entry_length > section->buffer + section->size) > + { > + warning (_("Section .debug_aranges in %s entry at offset %s " > + "length %s exceeds section length %s, " > + "ignoring .debug_aranges."), > + objfile_name (objfile), > + plongest (entry_addr - section->buffer), > + plongest (bytes_read + entry_length), > + pulongest (section->size)); > + return false; > + } > + > + /* The version number. */ > + const uint16_t version = read_2_bytes (abfd, addr); > + addr += 2; > + if (version != 2) > + { > + warning (_("Section .debug_aranges in %s entry at offset %s " > + "has unsupported version %d, ignoring .debug_aranges."), > + objfile_name (objfile), > + plongest (entry_addr - section->buffer), version); > + return false; > + } > + > + const uint64_t debug_info_offset > + = extract_unsigned_integer (addr, offset_size, dwarf5_byte_order); > + addr += offset_size; > + const auto per_cu_it > + = debug_info_offset_to_per_cu.find (sect_offset (debug_info_offset)); > + if (per_cu_it == debug_info_offset_to_per_cu.cend ()) > + { > + warning (_("Section .debug_aranges in %s entry at offset %s " > + "debug_info_offset %s does not exists, " > + "ignoring .debug_aranges."), > + objfile_name (objfile), > + plongest (entry_addr - section->buffer), > + pulongest (debug_info_offset)); > + return false; > + } > + const auto insertpair > + = debug_info_offset_seen.insert (sect_offset (debug_info_offset)); > + if (!insertpair.second) > + { > + warning (_("Section .debug_aranges in %s has duplicate " > + "debug_info_offset %s, ignoring .debug_aranges."), > + objfile_name (objfile), > + sect_offset_str (sect_offset (debug_info_offset))); > + return false; > + } > + dwarf2_per_cu_data *const per_cu = per_cu_it->second; > + > + const uint8_t address_size = *addr++; > + if (address_size < 1 || address_size > 8) > + { > + warning (_("Section .debug_aranges in %s entry at offset %s " > + "address_size %u is invalid, ignoring .debug_aranges."), > + objfile_name (objfile), > + plongest (entry_addr - section->buffer), address_size); > + return false; > + } > + > + const uint8_t segment_selector_size = *addr++; > + if (segment_selector_size != 0) > + { > + warning (_("Section .debug_aranges in %s entry at offset %s " > + "segment_selector_size %u is not supported, " > + "ignoring .debug_aranges."), > + objfile_name (objfile), > + plongest (entry_addr - section->buffer), > + segment_selector_size); > + return false; > + } > + > + /* Must pad to an alignment boundary that is twice the address > + size. It is undocumented by the DWARF standard but GCC does > + use it. However, not every compiler does this. We can see > + whether it has happened by looking at the total length of the > + contents of the aranges for this CU -- it if isn't a multiple > + of twice the address size, then we skip any leftover > + bytes. */ > + addr += (entry_end - addr) % (2 * address_size); > + > + while (addr < entry_end) > + { > + if (addr + 2 * address_size > entry_end) > + { > + warning (_("Section .debug_aranges in %s entry at offset %s " > + "address list is not properly terminated, " > + "ignoring .debug_aranges."), > + objfile_name (objfile), > + plongest (entry_addr - section->buffer)); > + return false; > + } > + ULONGEST start = extract_unsigned_integer (addr, address_size, > + dwarf5_byte_order); > + addr += address_size; > + ULONGEST length = extract_unsigned_integer (addr, address_size, > + dwarf5_byte_order); > + addr += address_size; > + if (start == 0 && length == 0) > + { > + /* This can happen on some targets with --gc-sections. > + This pair of values is also used to mark the end of > + the entries for a given CU, but we ignore it and > + instead handle termination using the check at the top > + of the loop. */ > + continue; > + } > + if (start == 0 && !per_bfd->has_section_at_zero) > + { > + /* Symbol was eliminated due to a COMDAT group. */ > + continue; > + } > + ULONGEST end = start + length; > + start = (ULONGEST) per_objfile->adjust ((unrelocated_addr) start); > + end = (ULONGEST) per_objfile->adjust ((unrelocated_addr) end); > + mutable_map->set_empty (start, end - 1, per_cu); > + } > + > + per_cu->addresses_seen = true; > + } > + > + return true; > +} > diff --git a/gdb/dwarf2/aranges.h b/gdb/dwarf2/aranges.h > new file mode 100644 > index 00000000000..43e1cbd0930 > --- /dev/null > +++ b/gdb/dwarf2/aranges.h > @@ -0,0 +1,35 @@ > +/* DWARF aranges handling > + > + Copyright (C) 1994-2023 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 GDB_DWARF2_ARANGES_H > +#define GDB_DWARF2_ARANGES_H > + > +class dwarf2_per_objfile; > +class dwarf2_section_info; > +class addrmap; > + > +/* Read the address map data from DWARF-5 .debug_aranges, and use it > + to populate given addrmap. Returns true on success, false on > + failure. */ > + > +extern bool read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, > + dwarf2_section_info *section, > + addrmap *mutable_map); > + > +#endif /* GDB_DWARF2_ARANGES_H */ > diff --git a/gdb/dwarf2/read-debug-names.c b/gdb/dwarf2/read-debug-names.c > index 89f5df6df90..c1b62b38f93 100644 > --- a/gdb/dwarf2/read-debug-names.c > +++ b/gdb/dwarf2/read-debug-names.c > @@ -19,6 +19,7 @@ > > #include "defs.h" > #include "read-debug-names.h" > +#include "dwarf2/aranges.h" > > #include "complaints.h" > #include "cp-support.h" > diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c > index 13ac83395eb..1ca640df6be 100644 > --- a/gdb/dwarf2/read.c > +++ b/gdb/dwarf2/read.c > @@ -31,6 +31,7 @@ > #include "defs.h" > #include "dwarf2/read.h" > #include "dwarf2/abbrev.h" > +#include "dwarf2/aranges.h" > #include "dwarf2/attribute.h" > #include "dwarf2/comp-unit-head.h" > #include "dwarf2/cu.h" > @@ -1837,184 +1838,6 @@ create_cu_from_index_list (dwarf2_per_bfd *per_bfd, > return the_cu; > } > > -/* See read.h. */ > - > -bool > -read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, > - dwarf2_section_info *section, > - addrmap *mutable_map) > -{ > - /* Caller must ensure this is read in. */ > - gdb_assert (section->readin); > - if (section->empty ()) > - return false; > - > - struct objfile *objfile = per_objfile->objfile; > - bfd *abfd = objfile->obfd.get (); > - struct gdbarch *gdbarch = objfile->arch (); > - dwarf2_per_bfd *per_bfd = per_objfile->per_bfd; > - > - std::unordered_map - dwarf2_per_cu_data *, > - gdb::hash_enum> > - debug_info_offset_to_per_cu; > - for (const auto &per_cu : per_bfd->all_units) > - { > - /* A TU will not need aranges, and skipping them here is an easy > - way of ignoring .debug_types -- and possibly seeing a > - duplicate section offset -- entirely. The same applies to > - units coming from a dwz file. */ > - if (per_cu->is_debug_types || per_cu->is_dwz) > - continue; > - > - const auto insertpair > - = debug_info_offset_to_per_cu.emplace (per_cu->sect_off, > - per_cu.get ()); > - > - /* Assume no duplicate offsets in all_units. */ > - gdb_assert (insertpair.second); > - } > - > - std::set debug_info_offset_seen; > - const bfd_endian dwarf5_byte_order = gdbarch_byte_order (gdbarch); > - const gdb_byte *addr = section->buffer; > - while (addr < section->buffer + section->size) > - { > - const gdb_byte *const entry_addr = addr; > - unsigned int bytes_read; > - > - const LONGEST entry_length = read_initial_length (abfd, addr, > - &bytes_read); > - addr += bytes_read; > - > - const gdb_byte *const entry_end = addr + entry_length; > - const bool dwarf5_is_dwarf64 = bytes_read != 4; > - const uint8_t offset_size = dwarf5_is_dwarf64 ? 8 : 4; > - if (addr + entry_length > section->buffer + section->size) > - { > - warning (_("Section .debug_aranges in %s entry at offset %s " > - "length %s exceeds section length %s, " > - "ignoring .debug_aranges."), > - objfile_name (objfile), > - plongest (entry_addr - section->buffer), > - plongest (bytes_read + entry_length), > - pulongest (section->size)); > - return false; > - } > - > - /* The version number. */ > - const uint16_t version = read_2_bytes (abfd, addr); > - addr += 2; > - if (version != 2) > - { > - warning (_("Section .debug_aranges in %s entry at offset %s " > - "has unsupported version %d, ignoring .debug_aranges."), > - objfile_name (objfile), > - plongest (entry_addr - section->buffer), version); > - return false; > - } > - > - const uint64_t debug_info_offset > - = extract_unsigned_integer (addr, offset_size, dwarf5_byte_order); > - addr += offset_size; > - const auto per_cu_it > - = debug_info_offset_to_per_cu.find (sect_offset (debug_info_offset)); > - if (per_cu_it == debug_info_offset_to_per_cu.cend ()) > - { > - warning (_("Section .debug_aranges in %s entry at offset %s " > - "debug_info_offset %s does not exists, " > - "ignoring .debug_aranges."), > - objfile_name (objfile), > - plongest (entry_addr - section->buffer), > - pulongest (debug_info_offset)); > - return false; > - } > - const auto insertpair > - = debug_info_offset_seen.insert (sect_offset (debug_info_offset)); > - if (!insertpair.second) > - { > - warning (_("Section .debug_aranges in %s has duplicate " > - "debug_info_offset %s, ignoring .debug_aranges."), > - objfile_name (objfile), > - sect_offset_str (sect_offset (debug_info_offset))); > - return false; > - } > - dwarf2_per_cu_data *const per_cu = per_cu_it->second; > - > - const uint8_t address_size = *addr++; > - if (address_size < 1 || address_size > 8) > - { > - warning (_("Section .debug_aranges in %s entry at offset %s " > - "address_size %u is invalid, ignoring .debug_aranges."), > - objfile_name (objfile), > - plongest (entry_addr - section->buffer), address_size); > - return false; > - } > - > - const uint8_t segment_selector_size = *addr++; > - if (segment_selector_size != 0) > - { > - warning (_("Section .debug_aranges in %s entry at offset %s " > - "segment_selector_size %u is not supported, " > - "ignoring .debug_aranges."), > - objfile_name (objfile), > - plongest (entry_addr - section->buffer), > - segment_selector_size); > - return false; > - } > - > - /* Must pad to an alignment boundary that is twice the address > - size. It is undocumented by the DWARF standard but GCC does > - use it. However, not every compiler does this. We can see > - whether it has happened by looking at the total length of the > - contents of the aranges for this CU -- it if isn't a multiple > - of twice the address size, then we skip any leftover > - bytes. */ > - addr += (entry_end - addr) % (2 * address_size); > - > - while (addr < entry_end) > - { > - if (addr + 2 * address_size > entry_end) > - { > - warning (_("Section .debug_aranges in %s entry at offset %s " > - "address list is not properly terminated, " > - "ignoring .debug_aranges."), > - objfile_name (objfile), > - plongest (entry_addr - section->buffer)); > - return false; > - } > - ULONGEST start = extract_unsigned_integer (addr, address_size, > - dwarf5_byte_order); > - addr += address_size; > - ULONGEST length = extract_unsigned_integer (addr, address_size, > - dwarf5_byte_order); > - addr += address_size; > - if (start == 0 && length == 0) > - { > - /* This can happen on some targets with --gc-sections. > - This pair of values is also used to mark the end of > - the entries for a given CU, but we ignore it and > - instead handle termination using the check at the top > - of the loop. */ > - continue; > - } > - if (start == 0 && !per_bfd->has_section_at_zero) > - { > - /* Symbol was eliminated due to a COMDAT group. */ > - continue; > - } > - ULONGEST end = start + length; > - start = (ULONGEST) per_objfile->adjust ((unrelocated_addr) start); > - end = (ULONGEST) per_objfile->adjust ((unrelocated_addr) end); > - mutable_map->set_empty (start, end - 1, per_cu); > - } > - > - per_cu->addresses_seen = true; > - } > - > - return true; > -} > - > /* die_reader_func for dw2_get_file_names. */ > > static void > diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h > index 1d9432c5c11..2cf40a8c2cd 100644 > --- a/gdb/dwarf2/read.h > +++ b/gdb/dwarf2/read.h > @@ -955,12 +955,4 @@ extern void finalize_all_units (dwarf2_per_bfd *per_bfd); > > extern htab_up create_quick_file_names_table (unsigned int nr_initial_entries); > > -/* Read the address map data from DWARF-5 .debug_aranges, and use it > - to populate given addrmap. Returns true on success, false on > - failure. */ > - > -extern bool read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, > - dwarf2_section_info *section, > - addrmap *mutable_map); > - > #endif /* DWARF2READ_H */