From: Jan Vrany <jan.vrany@labware.com>
To: gdb-patches@sourceware.org
Cc: Jan Vrany <jan.vrany@labware.com>
Subject: [PATCH 4/7] gdb: do not set blockvector address map
Date: Thu, 19 Feb 2026 18:56:35 +0000 [thread overview]
Message-ID: <20260219185638.360694-5-jan.vrany@labware.com> (raw)
In-Reply-To: <20260219185638.360694-1-jan.vrany@labware.com>
This commit removes the code that sets blockvector's addrmap in case one
or more blocks are non-contiguous. Following commit will fix GDB to
handle such blocks without use of the addrmap.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33829
---
gdb/buildsym.c | 55 ++------------------------------------------------
1 file changed, 2 insertions(+), 53 deletions(-)
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index aa95889424b..5f47d0d5835 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -316,18 +316,10 @@ buildsym_compunit::make_blockvector ()
std::unique_ptr<struct blockvector> blockvector;
int i;
- /* Count the length of the list of blocks. Also, if any blocks are
- non-contiguous then we need to make use of the addrmap for mapping
- addresses to blocks (PENDING_ADDRMAP_INTERESTING is set to true). If
- all the blocks are contiguous then we can avoid creating the addrmap,
- and perform block look up using the blockvector. */
+ /* Count the length of the list of blocks. */
- bool pending_addrmap_interesting = false;
for (next = m_pending_blocks, i = 0; next; next = next->next, i++)
- {
- if (!next->block->is_contiguous ())
- pending_addrmap_interesting = true;
- }
+ ;
blockvector = std::make_unique<struct blockvector> (i);
@@ -345,49 +337,6 @@ buildsym_compunit::make_blockvector ()
m_pending_block_obstack.clear ();
m_pending_blocks = nullptr;
- /* If we needed an address map for this symtab, record it in the
- blockvector. */
- if (pending_addrmap_interesting)
- {
- struct addrmap_mutable pending_addrmap;
- int num_blocks = blockvector->num_blocks ();
-
- /* If PENDING_ADDRMAP_INTERESTING is true then we must have seen
- an interesting block. If we see one block, then we should at a
- minimum have a global block, and a static block. */
- gdb_assert (num_blocks > 1);
-
- /* Assert our understanding of how the blocks are laid out. */
- gdb_assert (blockvector->block (0)->is_global_block ());
- gdb_assert (blockvector->block (1)->is_static_block ());
-
- /* The 'J > 1' here is so that we don't place the global block into
- the map. For CU with gaps, the static block will reflect the
- gaps, while the global block will just reflect the full extent of
- the range. */
- for (int j = num_blocks; j > 1; )
- {
- --j;
- struct block *b = blockvector->block (j);
-
- gdb_assert (!b->is_global_block ());
-
- if (b->is_contiguous ())
- pending_addrmap.set_empty (b->start (), (b->end () - 1), b);
- else
- {
- for (const auto &br : b->ranges ())
- pending_addrmap.set_empty (br.start (), (br.end () - 1), b);
- }
- }
-
- blockvector->set_map
- (new (&m_objfile->objfile_obstack) addrmap_fixed
- (&m_objfile->objfile_obstack, &pending_addrmap));
- }
- else
- blockvector->set_map (nullptr);
-
/* Some compilers output blocks in the wrong order, but we depend on
their being in the right order so we can binary search. Check the
order and moan about it.
--
2.51.0
next prev parent reply other threads:[~2026-02-19 19:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 18:56 [PATCH 0/7] Remove addrmap from blockvector Jan Vrany
2026-02-19 18:56 ` [PATCH 1/7] gdb: implement readnow_functions::find_pc_sect_compunit_symtab Jan Vrany
2026-02-19 20:01 ` Tom Tromey
2026-02-20 12:36 ` Jan Vraný
2026-02-20 14:25 ` Tom Tromey
2026-02-20 15:57 ` Jan Vraný
2026-02-19 18:56 ` [PATCH 2/7] gdb: update expanded_symbols_functions::find_pc_sect_compunit_symtab Jan Vrany
2026-02-19 20:02 ` Tom Tromey
2026-02-19 18:56 ` [PATCH 3/7] gdb: simplify find_compunit_symtab_for_pc_sect Jan Vrany
2026-02-19 20:02 ` Tom Tromey
2026-02-20 12:40 ` Jan Vraný
2026-02-20 14:25 ` Tom Tromey
2026-02-26 15:00 ` Jan Vraný
2026-02-19 18:56 ` Jan Vrany [this message]
2026-02-19 20:03 ` [PATCH 4/7] gdb: do not set blockvector address map Tom Tromey
2026-02-20 12:42 ` Jan Vraný
2026-02-19 18:56 ` [PATCH 5/7] gdb: update blockvector::lookup to handle non-contiguous blocks Jan Vrany
2026-02-19 20:06 ` Tom Tromey
2026-02-19 20:20 ` Tom Tromey
2026-02-20 13:03 ` Jan Vraný
2026-02-20 16:38 ` Tom Tromey
2026-03-03 11:06 ` Jan Vraný
2026-03-09 15:52 ` Jan Vraný
2026-02-19 18:56 ` [PATCH 6/7] gdb: remove address map from struct blockvector Jan Vrany
2026-02-19 18:56 ` [PATCH 7/7] gdb: add unit test for blockvector::lookup of non-contiguous blocks Jan Vrany
2026-02-19 20:12 ` 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=20260219185638.360694-5-jan.vrany@labware.com \
--to=jan.vrany@labware.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