#include <ctype.h>
#include "event-top.h"
#include "exceptions.h"
-#include "hashtab.h"
+#include "gdbsupport/unordered_set.h"
#include "symtab.h"
#include "frame.h"
#include "breakpoint.h"
static bool
ambiguous_names_p (const bp_location_range &locs)
{
- htab_up htab (htab_create_alloc (13, htab_hash_string, htab_eq_string, NULL,
- xcalloc, xfree));
+ gdb::unordered_set<std::string_view> htab;
for (const bp_location &l : locs)
{
- const char **slot;
const char *name = l.function_name.get ();
/* Allow for some names to be NULL, ignore them. */
if (name == NULL)
continue;
- slot = (const char **) htab_find_slot (htab.get (), (const void *) name,
- INSERT);
- /* NOTE: We can assume slot != NULL here because xcalloc never
- returns NULL. */
- if (*slot != NULL)
+ if (!htab.insert (name).second)
return true;
- *slot = name;
}
return false;