binutils-gdb/gdb/common
Pedro Alves e5fa6583a7 Add gdb::hash_enum
The DWARF-5 .debug_names consumer patch will want to use an
std::unordered_map with an enum as key type, like:

	std::unordered_map<sect_offset, dwarf2_per_cu_data*>

That doesn't work in C++11 in non-recent compilers due to a language
defect:

 http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148

~~~
  In file included from /usr/include/c++/5.3.1/bits/hashtable.h:35:0,
		   from /usr/include/c++/5.3.1/unordered_set:47,
		   from src/gdb/dwarf2read.c:79:
  /usr/include/c++/5.3.1/bits/hashtable_policy.h: In instantiation of ‘struct std::__detail::__is_noexcept_hash<sect_offset, std::hash<sect_offset> >’:
  /usr/include/c++/5.3.1/type_traits:137:12:   required from ‘struct std::__and_<std::__is_fast_hash<std::hash<sect_offset> >, std::__detail::__is_noexcept_hash<sect_offset, std::hash<sect_offset> > >’
  /usr/include/c++/5.3.1/type_traits:148:38:   required from ‘struct std::__not_<std::__and_<std::__is_fast_hash<std::hash<sect_offset> >, std::__detail::__is_noexcept_hash<sect_offset, std::hash<sect_offset> > > >’
  /usr/include/c++/5.3.1/bits/unordered_map.h💯66:   required from ‘class std::unordered_map<sect_offset, dwarf2_per_cu_data*>’
  src/gdb/dwarf2read.c:3260:30:   required from here
  /usr/include/c++/5.3.1/bits/hashtable_policy.h:85:34: error: no match for call to ‘(const std::hash<sect_offset>) (const sect_offset&)’
    noexcept(declval<const _Hash&>()(declval<const _Key&>()))>
				    ^
  In file included from /usr/include/c++/5.3.1/bits/move.h:57:0,
		   from /usr/include/c++/5.3.1/bits/stl_pair.h:59,
		   from /usr/include/c++/5.3.1/bits/stl_algobase.h:64,
		   from /usr/include/c++/5.3.1/bits/char_traits.h:39,
		   from /usr/include/c++/5.3.1/string:40,
		   from /home/pedro/gdb/mygit/src/gdb/common/common-utils.h:23,
		   from /home/pedro/gdb/mygit/src/gdb/common/common-defs.h:78,
		   from /home/pedro/gdb/mygit/src/gdb/defs.h:28,
		   from /home/pedro/gdb/mygit/src/gdb/dwarf2read.c:31:
~~~

This commits adds a helper replacement.

gdb/ChangeLog:
2017-12-08  Pedro Alves  <palves@redhat.com>

	* common/hash_enum.h: New file.
2017-12-08 23:37:30 +00:00
..
agent.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
agent.h Add STRINGIFY to gdb/common/preprocessor.h 2017-06-22 10:59:42 +01:00
array-view.h Introduce gdb::array_view 2017-09-04 17:10:12 +01:00
ax.def update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
break-common.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
btrace-common.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
btrace-common.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
buffer.c Make xml_escape_text return an std::string 2017-09-16 14:19:31 +02:00
buffer.h buffer.h: Fix spelling mistakes 2017-07-03 13:59:00 +02:00
byte-vector.h Introduce gdb::byte_vector, add allocator that default-initializes 2017-06-14 11:08:52 +01:00
cleanups.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cleanups.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-debug.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-debug.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-defs.h Poison non-POD memset & non-trivially-copyable memcpy/memmove 2017-04-25 01:46:19 +01:00
common-exceptions.c Eliminate catch_errors 2017-10-10 16:45:50 +01:00
common-exceptions.h Eliminate catch_exceptions/catch_exceptions_with_msg 2017-10-10 17:01:25 +01:00
common-gdbthread.h Share parts of gdb/gdbthread.h with gdbserver 2017-06-07 19:56:01 -04:00
common-inferior.h Extend "set cwd" to work on gdbserver 2017-10-04 02:01:45 -04:00
common-regcache.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-regcache.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-types.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-utils.c Poison XNEW and friends for types that should use new/delete 2017-11-24 10:42:25 -05:00
common-utils.h Poison XNEW and friends for types that should use new/delete 2017-11-24 10:42:25 -05:00
common.host update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common.m4 Remove ioctl-based procfs support on Solaris 2017-11-30 16:05:30 +01:00
create-version.sh update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
def-vector.h Introduce gdb::byte_vector, add allocator that default-initializes 2017-06-14 11:08:52 +01:00
default-init-alloc.h Introduce gdb::byte_vector, add allocator that default-initializes 2017-06-14 11:08:52 +01:00
diagnostics.h vec: Silence -Wunused-function warnings on clang 2017-06-26 16:51:17 +02:00
enum-flags.h Don't memcpy non-trivially-copyable types: Make enum_flags triv. copyable 2017-04-25 01:42:03 +01:00
environ.c Implement the ability to set/unset environment variables to GDBserver when starting the inferior 2017-08-31 17:22:10 -04:00
environ.h Implement the ability to set/unset environment variables to GDBserver when starting the inferior 2017-08-31 17:22:10 -04:00
errors.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
errors.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fileio.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fileio.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
filestuff.c Make open_fds an std::vector 2017-11-17 13:03:34 -05:00
filestuff.h Introduce and use gdb_file_up 2017-08-03 07:58:52 -06:00
format.c C++-ify parse_format_string 2017-12-08 10:23:43 -07:00
format.h C++-ify parse_format_string 2017-12-08 10:23:43 -07:00
function-view.h Poison non-POD memset & non-trivially-copyable memcpy/memmove 2017-04-25 01:46:19 +01:00
gdb_assert.h Redefine gdb_static_assert as static_assert 2017-12-05 16:15:09 -05:00
gdb_locale.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_optional.h More gdb::optional features 2017-04-18 23:48:41 +01:00
gdb_ref_ptr.h Use class to manage BFD reference counts 2017-01-10 19:14:10 -07:00
gdb_setjmp.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_signals.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_splay_tree.h Remove free_splay_tree cleanup 2017-10-09 17:39:29 -06:00
gdb_sys_time.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_tilde_expand.c Introduce gdb_tilde_expand 2017-10-04 01:57:29 -04:00
gdb_tilde_expand.h Introduce gdb_tilde_expand 2017-10-04 01:57:29 -04:00
gdb_unique_ptr.h Allow gdb::unique_xmalloc_ptr<T[]> 2017-08-10 14:18:02 +01:00
gdb_unlinker.h gdb: Fix ATTRIBUTE_NONNULL usage 2017-03-08 15:52:16 +00:00
gdb_vecs.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_vecs.h Remove DEF_VEC_I (int) 2017-11-17 13:03:34 -05:00
gdb_wait.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
hash_enum.h Add gdb::hash_enum 2017-12-08 23:37:30 +00:00
host-defs.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
job-control.c Assume termios is available, remove support for termio and sgtty 2017-11-06 15:36:46 +00:00
job-control.h Move parts of inferior job control to common/ 2017-06-07 19:52:56 -04:00
mingw-strerror.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
new-op.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
offset-type.h Make sect_offset and cu_offset strong typedefs instead of structs 2017-04-04 20:03:26 +01:00
poison.h Fix typo in poison.h 2017-12-02 20:28:41 -05:00
posix-strerror.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
preprocessor.h Add STRINGIFY to gdb/common/preprocessor.h 2017-06-22 10:59:42 +01:00
print-utils.c -Wwrite-strings: The Rest 2017-04-05 19:21:37 +01:00
print-utils.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ptid.c Class-ify ptid_t 2017-04-06 23:29:53 -04:00
ptid.h Class-ify ptid_t 2017-04-06 23:29:53 -04:00
queue.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
refcounted-object.h Use DISABLE_COPY_AND_ASSIGN 2017-09-19 10:10:03 +01:00
rsp-low.c remote: C++ify thread_item and threads_listing_context 2017-11-24 10:40:15 -05:00
rsp-low.h remote: C++ify thread_item and threads_listing_context 2017-11-24 10:40:15 -05:00
run-time-clock.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
run-time-clock.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
scoped_restore.h Make inferior::detaching a bool, and introduce scoped_restore::release() 2017-04-19 13:12:23 +01:00
selftest.c Add selftests run filtering 2017-09-16 14:06:03 +02:00
selftest.h Add virtual destructor to selftest 2017-12-07 11:49:01 -05:00
signals-state-save-restore.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signals-state-save-restore.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signals.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
symbol.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
traits.h Fix build on gcc < 5 (std::is_trivially_copyable missing) 2017-04-25 10:58:57 +01:00
underlying.h dwarf2read.c: Make dir_index and file_name_index strong typedefs 2017-04-04 20:03:25 +01:00
valid-expr.h Make sect_offset and cu_offset strong typedefs instead of structs 2017-04-04 20:03:26 +01:00
vec.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
vec.h vec: Silence -Wunused-function warnings on clang 2017-06-26 16:51:17 +02:00
version.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-xstate.h Add support for Intel PKRU register to GDB and GDBserver. 2017-02-17 11:44:48 +01:00
xml-utils.c Make xml_escape_text return an std::string 2017-09-16 14:19:31 +02:00
xml-utils.h Make xml_escape_text return an std::string 2017-09-16 14:19:31 +02:00