From: Simon Marchi <simark@simark.ca>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 6/6] gdb: extend .gdb_index tests to skip all data blocks
Date: Tue, 20 Oct 2026 15:32:31 -0400 [thread overview]
Message-ID: <26ecbe46-5f92-4226-a7cd-8cb6b0665219@simark.ca> (raw)
In-Reply-To: <03e5fe9a7996d105cde0aef714392776acf2dcae.1792356284.git.aburgess@redhat.com>
On 10/18/26 4:50 PM, Andrew Burgess wrote:
> diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
> index 5959b0ba6bc..d624ba1779c 100644
> --- a/gdb/dwarf2/read-gdb-index.c
> +++ b/gdb/dwarf2/read-gdb-index.c
> @@ -606,10 +606,12 @@ read_gdb_index_from_buffer (const char *filename,
>
> map->constant_pool = buffer.slice (metadata[i]);
>
> - if (map->constant_pool.empty () && !map->symbol_table.empty ())
> + if ((map->constant_pool.empty () || *cu_list_elements == 0)
> + && !map->symbol_table.empty ())
Is an index with no CUs necessarily invalid? What if there are some
TUs, or some CUs in the dwz file?
It seems to me like we could let those go through, and if the index is
really invalid in some way, then one of the checks you added in the
previous patches will trigger and reject the index.
> {
> - /* An empty constant pool implies that all symbol table entries are
> - empty. Make map->symbol_table.empty () == true. */
> + /* An empty constant pool or an empty CU list implies that all symbol
> + table entries are empty. Recreate the symbol table as empty so
> + this index will be ignored. */
> map->symbol_table
> = offset_view (gdb::array_view<const gdb_byte> (symbol_table,
> symbol_table));
I wonder why this rejects the index by clearing symbol_table, instead of
just returning false.
Simon
prev parent reply other threads:[~2026-10-20 19:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 20:50 [PATCH 0/6] Improved error handling for .gdb_index parsing Andrew Burgess
2026-10-18 20:50 ` [PATCH 1/6] gdb: a number of fixes " Andrew Burgess
2026-10-20 18:39 ` Simon Marchi
2026-10-18 20:50 ` [PATCH 2/6] gdb: handle incorrect CU size in .gdb_index Andrew Burgess
2026-10-20 18:50 ` Simon Marchi
2026-10-18 20:50 ` [PATCH 3/6] gdb: validate the CU vector offset when loading the .gdb_index Andrew Burgess
2026-10-20 19:00 ` Simon Marchi
2026-10-18 20:50 ` [PATCH 4/6] gdb: address table parsing fixes and tests for .gdb_index Andrew Burgess
2026-10-20 19:09 ` Simon Marchi
2026-10-18 20:50 ` [PATCH 5/6] gdb: handle corrupted .gdb_index header offsets Andrew Burgess
2026-10-20 19:23 ` Simon Marchi
2026-10-18 20:50 ` [PATCH 6/6] gdb: extend .gdb_index tests to skip all data blocks Andrew Burgess
2026-10-20 19:32 ` Simon Marchi [this message]
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=26ecbe46-5f92-4226-a7cd-8cb6b0665219@simark.ca \
--to=simark@simark.ca \
--cc=aburgess@redhat.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