aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-11-25 00:33:05 +0000
committerPedro Alves <palves@redhat.com>2017-11-25 00:33:05 +0000
commitdeeeba559bd0c18e06dba19f44571ee8a218fcdb (patch)
tree5b93948a041dad34f0fee70953d017481359a4bd /gdb/minsyms.c
parentFix completing an empty string (diff)
downloadbinutils-gdb-deeeba559bd0c18e06dba19f44571ee8a218fcdb.tar.gz
binutils-gdb-deeeba559bd0c18e06dba19f44571ee8a218fcdb.tar.bz2
binutils-gdb-deeeba559bd0c18e06dba19f44571ee8a218fcdb.zip
Use TOLOWER in SYMBOL_HASH_NEXT
The support for setting breakpoint in functions with ABI tags patch will add a use of SYMBOL_HASH_NEXT in cp-support.c, which fails to compile with: src/gdb/cp-support.c:38:0: src/gdb/cp-support.c: In function ‘unsigned int cp_search_name_hash(const char*)’: src/gdb/../include/safe-ctype.h:148:20: error: ‘do_not_use_tolower_with_safe_ctype’ was not declared in this scope #define tolower(c) do_not_use_tolower_with_safe_ctype ^ src/gdb/minsyms.h:174:18: note: in expansion of macro ‘tolower’ ((hash) * 67 + tolower ((unsigned char) (c)) - 113) ^ src/gdb/cp-support.c:1677:14: note: in expansion of macro ‘SYMBOL_HASH_NEXT’ hash = SYMBOL_HASH_NEXT (hash, *string); ^ This fixes the problem before it happens. I was somewhat worried about whether this might have an impact with languages that are case insensitive, but I convinced myself that it doesn't. As bonus, this improves GDB's minsym interning performance a bit (3%-10%). See <https://sourceware.org/ml/gdb/2017-11/msg00021.html>. gdb/ChangeLog: 2017-11-25 Pedro Alves <palves@redhat.com> * dictionary.c: Include "safe-ctype.h". * minsyms.c: Include "safe-ctype.h". * minsyms.c (SYMBOL_HASH_NEXT): Use TOLOWER instead of tolower.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index a0d3bd5a717..4898da17aa7 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -52,6 +52,7 @@
#include "cli/cli-utils.h"
#include "symbol.h"
#include <algorithm>
+#include "safe-ctype.h"
/* See minsyms.h. */