From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/3] Use addrmap_fixed in a few spots
Date: Tue, 27 Feb 2024 14:42:17 -0700 [thread overview]
Message-ID: <20240227-obstac-alloc-v1-1-bd079aad35cd@adacore.com> (raw)
In-Reply-To: <20240227-obstac-alloc-v1-0-bd079aad35cd@adacore.com>
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<gdb::unique_xmalloc_ptr<char>> 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
--
2.43.0
next prev parent reply other threads:[~2024-02-27 21:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 21:42 [PATCH 0/3] Make allocate_on_obstack a bit safer Tom Tromey
2024-02-27 21:42 ` Tom Tromey [this message]
2024-02-28 12:27 ` [PATCH 1/3] Use addrmap_fixed in a few spots Alexandra Petlanova Hajkova
2024-02-27 21:42 ` [PATCH 2/3] Don't use virtual destructor in addrmap Tom Tromey
2024-02-28 15:16 ` Alexandra Petlanova Hajkova
2024-02-27 21:42 ` [PATCH 3/3] Require trivial destructor in allocate_on_obstack Tom Tromey
2024-02-28 16:55 ` Alexandra Petlanova Hajkova
2024-03-21 18:20 ` [PATCH 0/3] Make allocate_on_obstack a bit safer Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240227-obstac-alloc-v1-1-bd079aad35cd@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).