public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: use gdb:hash_enum as hash function in offset_map_type
@ 2020-04-28 13:50 Simon Marchi
0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2020-04-28 13:50 UTC (permalink / raw)
To: gdb-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2306 bytes --]
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1b95cdb76caca1b7a9ecf9324acf23139f11f7d1
commit 1b95cdb76caca1b7a9ecf9324acf23139f11f7d1
Author: Simon Marchi <simon.marchi@efficios.com>
Date: Tue Apr 28 09:49:58 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:
---
gdb/ChangeLog | 6 ++++++
gdb/dwarf2/read.c | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 76f6cf78961..f7931c23c60 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 82564edd7b2..c5528887faf 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-04-28 13:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 13:50 [binutils-gdb] gdb: use gdb:hash_enum as hash function in offset_map_type Simon Marchi
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).