From patchwork Tue Feb 27 21:42:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 86483 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 3EB9E385840B for ; Tue, 27 Feb 2024 21:42:53 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by sourceware.org (Postfix) with ESMTPS id A67D13858D37 for ; Tue, 27 Feb 2024 21:42:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A67D13858D37 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A67D13858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d2c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709070142; cv=none; b=j3Xjs2jMWIr9Iszm8hoYKhJaHD/8XuYwUiX8qrDAB5luqG84X5EHXpw6HEmyKBAGsWj804vK3NQwztGGbYoiJTpFQsOUeHHbkFNCbHJA3OFlNiMDxJVhduUHqwvejNh9vinuXUQlvemg4UwXLgQpgPGzCwRXNgbIu8Eitlr1qok= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709070142; c=relaxed/simple; bh=DuMsqP5MTlKBRrHpXgL9gii2oeXws2wOkbKbVg9ysxQ=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=YEINsPovy5yyr/fbzbtFyzGeeVlmhMM+3rLOvryv5w0yqia92nmk7M3vvOv4YylSsApxC23fpU86vUR3SUBg0mKUXJWk30ckQE9sdFFz08u+x6xgC4nOgdUSHnNxOJ2LgK6dt7MOV7d8r6SbX9Cx6RtWCZM72qFd+attzpRTHFI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7c7476a11e0so267749439f.3 for ; Tue, 27 Feb 2024 13:42:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1709070140; x=1709674940; darn=sourceware.org; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ni9XezHSZahNmWgqIdD5f2wKaKYT8/o5ySjZ7hSs4m0=; b=BsES4YCATzw7xlVY1vn4d35/hbPSVtEQw5ArHOIo99qRMCLJQpzuPFdSwO9X/pychQ itJYyd1Klj97L0Su7qvxf6ffkEteXW4MoJfjZWuwe1E14FCsXisceU4ndBm4zR/LuEMb LBTPpD+JIuMfSNiiVtp5EFbYi9HFgHj2eEj42m3RQ/ZYg0xagLXOQJBhZ1OqszwMktbW wNF6/AV3xvGz+kHwMb3AYpsa0KYxwFpDC1YDHXbK0FfXXHEhXJN+3yWZ6iChFDvF3Ld4 4odPEp+o4kumnjsgfxPx19lirxMQisD7jySHHiNDOzCP8JEwNcx0Qm6BX0JHXJSdrEXV tACw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709070140; x=1709674940; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ni9XezHSZahNmWgqIdD5f2wKaKYT8/o5ySjZ7hSs4m0=; b=j3XAe2HZAxXXkHruwlQLtlX1Evx8mQJwO5d5NRD51mS/EAs0y9H+ouXzxlEuv8MT8g fj5+Crf9QFn3FgiG96X491MklCTFal5hqhoKj50Yfpvx7y+Kf71qfVJCt3pJRNae/5tS YnHNekI0xzrt3sLts4IZsOzY6syUc8qijMEpGH2GrdrIUOB7AT9tVYenAuvbSiClbw7M MwTEF+UPNrYPjXPLw3+EKfCYffaJ80QjCX1qkosozRBPx4R5egyM8UQ7+CY9BMtPNGMk brLFUBywMDmbUgV+ISbXCuA4P2xLfeCtn4FTemRy+H6JNRAqiiWyuPPxjae1ipmVKjpS NX8A== X-Gm-Message-State: AOJu0Yx35KW3DbdRlEiMpqBTJBlVahJVn21XllZ2ZxcjyhB/wvBzgYvT RfumudGTLo/5dd3uVtO8BDE/zMYouyk1ukWpYiiZ3HYC+fHZFO/xThfVGY4IYSU7BxP/6S84sHs = X-Google-Smtp-Source: AGHT+IFb6NkZof+UA5SwNvLl6+SrKVI7aZL82JMPIIjngZqu9fIAVUN4CXN/YR0tUFlXngVW0gltQA== X-Received: by 2002:a6b:ea04:0:b0:7c7:ee05:7fa with SMTP id m4-20020a6bea04000000b007c7ee0507famr2270856ioc.14.1709070139800; Tue, 27 Feb 2024 13:42:19 -0800 (PST) Received: from localhost.localdomain (71-211-170-195.hlrn.qwest.net. [71.211.170.195]) by smtp.gmail.com with ESMTPSA id gh4-20020a056638698400b0047438454db4sm1983600jab.9.2024.02.27.13.42.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:42:19 -0800 (PST) From: Tom Tromey Date: Tue, 27 Feb 2024 14:42:17 -0700 Subject: [PATCH 1/3] Use addrmap_fixed in a few spots MIME-Version: 1.0 Message-Id: <20240227-obstac-alloc-v1-1-bd079aad35cd@adacore.com> References: <20240227-obstac-alloc-v1-0-bd079aad35cd@adacore.com> In-Reply-To: <20240227-obstac-alloc-v1-0-bd079aad35cd@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 There are a few spots in the tree that use 'addrmap' where only an addrmap_fixed will ever really be seen. This patch changes this code to use the more specific type. --- gdb/block.h | 10 +++++----- gdb/dwarf2/cooked-index.h | 2 +- gdb/dwarf2/read.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/block.h b/gdb/block.h index 00630123120..4c29f6599ef 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -30,7 +30,7 @@ struct compunit_symtab; struct block_namespace_info; struct using_direct; struct obstack; -struct addrmap; +struct addrmap_fixed; /* Blocks can occupy non-contiguous address ranges. When this occurs, startaddr and endaddr within struct block (still) specify the lowest @@ -410,22 +410,22 @@ struct blockvector { return this->block (STATIC_BLOCK); } /* Return the address -> block map of this blockvector. */ - addrmap *map () + addrmap_fixed *map () { return m_map; } /* Const version of the above. */ - const addrmap *map () const + const addrmap_fixed *map () const { return m_map; } /* Set this blockvector's address -> block map. */ - void set_map (addrmap *map) + void set_map (addrmap_fixed *map) { m_map = map; } private: /* An address map mapping addresses to blocks in this blockvector. This pointer is zero if the blocks' start and end addresses are enough. */ - struct addrmap *m_map; + addrmap_fixed *m_map; /* Number of blocks in the list. */ int m_num_blocks; diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index 629a5b6b9ee..928c4ef655c 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -362,7 +362,7 @@ class cooked_index_shard cooked_index_entry *m_main = nullptr; /* The addrmap. This maps address ranges to dwarf2_per_cu_data objects. */ - addrmap *m_addrmap = nullptr; + addrmap_fixed *m_addrmap = nullptr; /* Storage for canonical names. */ std::vector> m_names; }; diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 5ee7e09a743..73def88c4c0 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -536,7 +536,7 @@ struct dwarf2_per_bfd abstract_to_concrete; /* The address map that is used by the DWARF index code. */ - struct addrmap *index_addrmap = nullptr; + addrmap_fixed *index_addrmap = nullptr; }; /* An iterator for all_units that is based on index. This