public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] gdb: use gdb:hash_enum as hash function in offset_map_type
Date: Mon, 11 May 2020 07:40:44 -0400	[thread overview]
Message-ID: <1b95cdb76caca1b7a9ecf9324acf23139f11f7d1@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 1b95cdb76caca1b7a9ecf9324acf23139f11f7d1 ***

commit 1b95cdb76caca1b7a9ecf9324acf23139f11f7d1
Author:     Simon Marchi <simon.marchi@efficios.com>
AuthorDate: Tue Apr 28 09:49:58 2020 -0400
Commit:     Simon Marchi <simon.marchi@efficios.com>
CommitDate: Tue Apr 28 09:50:12 2020 -0400

    gdb: use gdb:hash_enum as hash function in offset_map_type
    
    When building with g++ 4.8, we get this error (just an excerpt, because
    g++ outputs a very long error message):
    
          CXX    dwarf2/read.o
        ...
        /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.c:14616:31:   required from here
        /usr/include/c++/4.8/bits/hashtable_policy.h:1070:12: error: invalid use of incomplete type struct std::hash<sect_offset>
             struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
    
    This is the same problem and fix as in commit f23f598e28ad ("[gdb] Fix
    build breaker with gcc 4.8").  Pass an explicit hash function rather
    than relying on the default std::hash<sect_offset>.
    
    gdb/ChangeLog:
    
            PR gdb/25881
            * dwarf2/read.c (offset_map_type): Use
            gdb:hash_enum<sect_offset> as hash function.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 76f6cf7896..f7931c23c6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-28  Simon Marchi  <simon.marchi@efficios.com>
+
+	PR gdb/25881
+	* dwarf2/read.c (offset_map_type): Use
+	gdb:hash_enum<sect_offset> as hash function.
+
 2020-04-28  Tom de Vries  <tdevries@suse.de>
 
 	* dwarf2/read.c (process_structure_scope): Add symbol for struct decl
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 82564edd7b..c5528887fa 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -14513,7 +14513,8 @@ dwarf2_add_type_defn (struct field_info *fip, struct die_info *die,
 
 /* A convenience typedef that's used when finding the discriminant
    field for a variant part.  */
-typedef std::unordered_map<sect_offset, int> offset_map_type;
+typedef std::unordered_map<sect_offset, int, gdb::hash_enum<sect_offset>>
+  offset_map_type;
 
 /* Compute the discriminant range for a given variant.  OBSTACK is
    where the results will be stored.  VARIANT is the variant to


             reply	other threads:[~2020-05-11 11:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 11:40 gdb-buildbot [this message]
2020-05-11 11:40 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-05-11 12:10 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-05-11 12:13 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-05-11 12:44 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-05-11 12:54 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-05-11 13:30 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-05-12 16:08 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-05-14  4:01 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-05-17 21:16 ` Failures on Ubuntu-Aarch64-m64, " gdb-buildbot

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=1b95cdb76caca1b7a9ecf9324acf23139f11f7d1@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@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).