aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-05-07 09:18:18 -0600
committerTom Tromey <tom@tromey.com>2021-05-07 09:18:18 -0600
commit2698f5ead62298979e44a212023027ebb582f3d1 (patch)
tree860ea79a3e5a70c56ec2fb16b0c7d4a7e2d62dcb
parent13123da89a2c7e06a5312ca6b4b24c68ba1c6c2d (diff)
downloadbinutils-2698f5ead62298979e44a212023027ebb582f3d1.zip
binutils-2698f5ead62298979e44a212023027ebb582f3d1.tar.gz
binutils-2698f5ead62298979e44a212023027ebb582f3d1.tar.bz2
Remove streq_hash in favor of htab_eq_string
Now that libiberty includes htab_eq_string, we can remove the identical function from gdb. gdb/ChangeLog 2021-05-07 Tom Tromey <tom@tromey.com> * breakpoint.c (ambiguous_names_p): Use htab_eq_string. * utils.c (streq_hash): Remove. * utils.h (streq_hash): Don't declare. * completer.c (completion_tracker::discard_completions): Update comment. * ada-lang.c (_initialize_ada_language): Use htab_eq_string.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/ada-lang.c3
-rw-r--r--gdb/breakpoint.c2
-rw-r--r--gdb/completer.c2
-rw-r--r--gdb/utils.c8
-rw-r--r--gdb/utils.h5
6 files changed, 13 insertions, 16 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 45b048d..76ccb6b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2021-05-07 Tom Tromey <tom@tromey.com>
+
+ * breakpoint.c (ambiguous_names_p): Use htab_eq_string.
+ * utils.c (streq_hash): Remove.
+ * utils.h (streq_hash): Don't declare.
+ * completer.c (completion_tracker::discard_completions): Update
+ comment.
+ * ada-lang.c (_initialize_ada_language): Use htab_eq_string.
+
2021-05-07 Simon Marchi <simon.marchi@polymtl.ca>
* Re-format all Python files using black.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index e15e583..34b0e92 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -13490,7 +13490,8 @@ When enabled, the debugger will stop using the DW_AT_GNAT_descriptive_type\n\
DWARF attribute."),
NULL, NULL, &maint_set_ada_cmdlist, &maint_show_ada_cmdlist);
- decoded_names_store = htab_create_alloc (256, htab_hash_string, streq_hash,
+ decoded_names_store = htab_create_alloc (256, htab_hash_string,
+ htab_eq_string,
NULL, xcalloc, xfree);
/* The ada-lang observers. */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 35a891b..38406b4 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -13471,7 +13471,7 @@ static int
ambiguous_names_p (struct bp_location *loc)
{
struct bp_location *l;
- htab_up htab (htab_create_alloc (13, htab_hash_string, streq_hash, NULL,
+ htab_up htab (htab_create_alloc (13, htab_hash_string, htab_eq_string, NULL,
xcalloc, xfree));
for (l = loc; l != NULL; l = l->next)
diff --git a/gdb/completer.c b/gdb/completer.c
index 2330ad4..80e8c7b 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -1593,7 +1593,7 @@ completion_tracker::discard_completions ()
m_entries_hash.reset (nullptr);
/* A callback used by the hash table to compare new entries with existing
- entries. We can't use the standard streq_hash function here as the
+ entries. We can't use the standard htab_eq_string function here as the
key to our hash is just a single string, while the values we store in
the hash are a struct containing multiple strings. */
static auto entry_eq_func
diff --git a/gdb/utils.c b/gdb/utils.c
index b9f8997..1f48a5a 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -2818,14 +2818,6 @@ streq (const char *lhs, const char *rhs)
return !strcmp (lhs, rhs);
}
-/* See utils.h. */
-
-int
-streq_hash (const void *lhs, const void *rhs)
-{
- return streq ((const char *) lhs, (const char *) rhs);
-}
-
/*
diff --git a/gdb/utils.h b/gdb/utils.h
index b91e0d1..94d37c5 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -99,11 +99,6 @@ extern int strcmp_iw_ordered (const char *, const char *);
extern bool streq (const char *, const char *);
-/* A variant of streq that is suitable for use as an htab
- callback. */
-
-extern int streq_hash (const void *, const void *);
-
extern int subset_compare (const char *, const char *);
/* Compare C strings for std::sort. */