diff options
author | Tom Tromey <tromey@adacore.com> | 2021-03-15 08:59:17 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-03-15 11:30:51 -0600 |
commit | 675da9a57e0ab1c384e0dfd20ddf715a83c18673 (patch) | |
tree | 6de259cf85f6c945919c93b079a5b04a6675f631 /gdb/stap-probe.c | |
parent | 4800761a71cf4eb1024ab586385be4832d62aabb (diff) | |
download | gdb-675da9a57e0ab1c384e0dfd20ddf715a83c18673.zip gdb-675da9a57e0ab1c384e0dfd20ddf715a83c18673.tar.gz gdb-675da9a57e0ab1c384e0dfd20ddf715a83c18673.tar.bz2 |
Fix GDB build with GCC 4.8.2
PR build/27579 points out that the expression rewrite series
introduced a build failure with GCC 4.8.2. The bug is that there's no
std::hash specialization for enum exp_opcode. This patch fixes the
problem by using gdb::hash_enum.
2021-03-15 Tom Tromey <tromey@adacore.com>
PR build/27579:
* rust-exp.y (maker_map): Use gdb::hash_enum.
* stap-probe.c (stap_maker_map): Use gdb::hash_enum.
Diffstat (limited to 'gdb/stap-probe.c')
-rw-r--r-- | gdb/stap-probe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index 5995c28..7f6d98a 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -38,6 +38,7 @@ #include "elf-bfd.h" #include "expop.h" #include <unordered_map> +#include "gdbsupport/hash_enum.h" #include <ctype.h> @@ -436,7 +437,8 @@ typedef expr::operation_up binop_maker_ftype (expr::operation_up &&, expr::operation_up &&); /* Map from an expression opcode to a function that can create a binary operation of that type. */ -static std::unordered_map<exp_opcode, binop_maker_ftype *> stap_maker_map; +static std::unordered_map<exp_opcode, binop_maker_ftype *, + gdb::hash_enum<exp_opcode>> stap_maker_map; /* Helper function to create a binary operation. */ static expr::operation_up |