This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 38/40] Use TOLOWER in SYMBOL_HASH_NEXT
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 2 Jun 2017 13:22:36 +0100
- Subject: [PATCH 38/40] Use TOLOWER in SYMBOL_HASH_NEXT
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C9E48C04B93B
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C9E48C04B93B
- References: <1496406158-12663-1-git-send-email-palves@redhat.com>
The 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.
gdb/ChangeLog:
yyyy-mm-dd 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.
---
gdb/dictionary.c | 1 +
gdb/minsyms.c | 1 +
gdb/minsyms.h | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 87e05d6..079bb04 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -26,6 +26,7 @@
#include "symtab.h"
#include "buildsym.h"
#include "dictionary.h"
+#include "safe-ctype.h"
/* This file implements dictionaries, which are tables that associate
symbols to names. They are represented by an opaque type 'struct
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 842ae07..9751321 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"
/* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
At the end, copy them all into one newly allocated location on an objfile's
diff --git a/gdb/minsyms.h b/gdb/minsyms.h
index c4a1d21..faff881 100644
--- a/gdb/minsyms.h
+++ b/gdb/minsyms.h
@@ -171,7 +171,7 @@ unsigned int msymbol_hash_iw (const char *);
requirements. */
#define SYMBOL_HASH_NEXT(hash, c) \
- ((hash) * 67 + tolower ((unsigned char) (c)) - 113)
+ ((hash) * 67 + TOLOWER ((unsigned char) (c)) - 113)
--
2.5.5