From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 1/4] Fix oddity in write_gdbindex
Date: Sat, 29 May 2021 07:54:40 -0600 [thread overview]
Message-ID: <20210529135443.1446279-2-tom@tromey.com> (raw)
In-Reply-To: <20210529135443.1446279-1-tom@tromey.com>
My recent patch to unify CUs and TUs introduced an oddity in
write_gdbindex. Here, we pass 'i' to recursively_write_psymbols, but
we must instead pass 'counter', to handle the situation where a TU is
mixed in with the CUs.
I am not sure a test case for this is possible. I think it can only
happen when using DWARF 5, where a TU appears in .debug_info.
However, this situation is already not handled correctly by
.gdb_index. I filed a bug about this.
gdb/ChangeLog
2021-05-28 Tom Tromey <tom@tromey.com>
* dwarf2/index-write.c (write_gdbindex): Pass 'counter' to
recursively_write_psymbols.
---
gdb/ChangeLog | 5 +++++
gdb/dwarf2/index-write.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index 4b78add0a5a..ffc49e8ba82 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -1446,7 +1446,7 @@ write_gdbindex (dwarf2_per_objfile *per_objfile, FILE *out_file,
{
if (psymtab->user == NULL)
recursively_write_psymbols (objfile, psymtab, &symtab,
- psyms_seen, i);
+ psyms_seen, counter);
const auto insertpair = cu_index_htab.emplace (psymtab, counter);
gdb_assert (insertpair.second);
--
2.26.3
next prev parent reply other threads:[~2021-05-29 13:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-29 13:54 [PATCH 0/4] Some small debug index writer cleanups Tom Tromey
2021-05-29 13:54 ` Tom Tromey [this message]
2021-05-29 13:54 ` [PATCH 2/4] Minor cleanup to addrmap_index_data::previous_valid Tom Tromey
2021-06-13 16:48 ` Lancelot SIX via Gdb-patches
2021-06-14 20:14 ` Tom Tromey
2021-05-29 13:54 ` [PATCH 3/4] Simplify gdb_index writing Tom Tromey
2021-05-29 13:54 ` [PATCH 4/4] Simplify debug_names index writing Tom Tromey
2021-07-05 17:56 ` [PATCH 0/4] Some small debug index writer cleanups 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=20210529135443.1446279-2-tom@tromey.com \
--to=tom@tromey.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