public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/28159] [gdb/symtab] gdb generates .gdb_index with only empty hashtable entries, then fails to recognize it as empty
Date: Mon, 30 Aug 2021 14:10:00 +0000	[thread overview]
Message-ID: <bug-28159-4717-MFb5vDrnMg@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28159-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28159

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
Committed:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=34daac4b169da3cb9df3e8bac6347cae630a99dd
:

[gdb/symtab] Don't write .gdb_index symbol table with empty entries
author  Tom de Vries <tdevries@suse.de> 
        Fri, 27 Aug 2021 15:14:49 +0000 (17:14 +0200)
committer       Tom de Vries <tdevries@suse.de> 
        Fri, 27 Aug 2021 15:14:49 +0000 (17:14 +0200)
commit  34daac4b169da3cb9df3e8bac6347cae630a99dd
tree    f3ce338b4bd3c8cf74e39c5376a0d20399a96ca8        tree
parent  426f7bbfd4179a5b81f87fa324a854c370e4b07a        commit | diff
[gdb/symtab] Don't write .gdb_index symbol table with empty entries

When comparing the sizes of the index files generated for shlib
outputs/gdb.dwarf2/dw2-zero-range/shr1.sl, I noticed a large difference
between .debug_names:
...
$ gdb -q -batch $shlib -ex "save gdb-index -dwarf-5 ."
$ du -b -h shr1.sl.debug_names shr1.sl.debug_str
61      shr1.sl.debug_names
0       shr1.sl.debug_str
...
and .gdb_index:
...
$ gdb -q -batch $shlib -ex "save gdb-index ."
$ du -b -h shr1.sl.gdb-index
8.2K    shr1.sl.gdb-index
...

The problem is that the .gdb_index contains a non-empty symbol table with only
empty entries.

Fix this by making the symbol table empty, such that we have instead:
...
$ du -b -h shr1.sl.gdb-index
184     shr1.sl.gdb-index
...

Tested on x86_64-linux.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-08-30 14:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01 11:26 [Bug symtab/28159] New: " vries at gcc dot gnu.org
2021-08-06 19:52 ` [Bug symtab/28159] " cvs-commit at gcc dot gnu.org
2021-08-06 22:23 ` vries at gcc dot gnu.org
2021-08-14 21:35 ` tromey at sourceware dot org
2021-08-24 12:18 ` vries at gcc dot gnu.org
2021-08-26 12:39 ` vries at gcc dot gnu.org
2021-08-30 14:10 ` vries at gcc dot gnu.org [this message]
2021-08-30 14:11 ` vries at gcc dot gnu.org

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=bug-28159-4717-MFb5vDrnMg@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).