From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH][gdb/symtab] Recognize .gdb_index symbol table with empty entries as empty
Date: Mon, 2 Aug 2021 09:29:47 -0400 [thread overview]
Message-ID: <5c1bb8ec-e2f7-468a-8035-d6279167f7f4@polymtl.ca> (raw)
In-Reply-To: <20210801180400.GA9164@delia>
On 2021-08-01 2:04 p.m., Tom de Vries wrote:
> Hi,
>
> When reading a .gdb_index that contains a non-empty symbol table with only
> empty entries, gdb doesn't recognize it as empty.
>
> Fix this by recognizing that the constant pool is empty, and then setting the
> symbol table to empty.
>
> Tested on x86_64-linux.
>
> Any comments?
>
> I don't see the need to propagate to gdb-11-branch, but perhaps I'm wrong there?
>
> Thanks,
> - Tom
>
> [gdb/symtab] Recognize .gdb_index symbol table with empty entries as empty
>
> gdb/ChangeLog:
>
> 2021-08-01 Tom de Vries <tdevries@suse.de>
>
> PR symtab/28159
> * dwarf2/read.c (read_gdb_index_from_buffer): Handle symbol table
> filled with empty entries.
>
> gdb/testsuite/ChangeLog:
>
> 2021-08-01 Tom de Vries <tdevries@suse.de>
>
> PR symtab/28159
> * gdb.dwarf2/dw2-zero-range.exp: Remove kfail.
>
> ---
> gdb/dwarf2/read.c | 7 +++++++
> gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp | 22 ++--------------------
> 2 files changed, 9 insertions(+), 20 deletions(-)
>
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index de84c47b626..a937fbef1cc 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -2777,6 +2777,13 @@ to use the section anyway."),
> ++i;
> map->constant_pool = buffer.slice (metadata[i]);
>
> + if (map->constant_pool.empty () && !map->symbol_table.empty ())
> + {
> + map->symbol_table
> + = offset_view (gdb::array_view<const gdb_byte> (symbol_table,
> + symbol_table));
> + }
That probably warrants a little comment.
Otherwise, LGTM.
Simon
next prev parent reply other threads:[~2021-08-02 13:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-01 18:04 Tom de Vries
2021-08-02 13:29 ` Simon Marchi via Gdb-patches [this message]
2021-08-02 14:15 ` 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=5c1bb8ec-e2f7-468a-8035-d6279167f7f4@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=tdevries@suse.de \
--cc=tom@tromey.com \
/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