The gdb/stabsread.h and .c files define 2 things that, while originally
intended only for stabs reading, actually end up being used for coff,
ecoff and maybe more debuginfo formats. That is the function "hashname",
and the macro HASHSIZE. Both are used for small hashtables when reading
some symbols with incomplete information.
With the upcoming removal of stabs code, this code should be moved
somewhere, and the location that looked most reasonable was
gdb/buildsym-legacy. No change in behavior is expected after this
commit.
Approved-By: Tom Tromey <tom@tromey.com>
#include "buildsym.h"
+/* Legacy hash for symbol names used for several debuginfo formats. */
+
+#define HASHSIZE 127
+
+static inline int
+hashname (const char *name)
+{
+ return fast_hash (name, strlen (name)) % HASHSIZE;
+}
+
/* This module provides definitions used for creating and adding to
the symbol table. These routines are called from various symbol-
file-reading routines. This file holds the legacy API, which
}
}
-/* See stabsread.h. */
-
-int
-hashname (const char *name)
-{
- return fast_hash (name, strlen (name)) % HASHSIZE;
-}
-
/* Initializer for this module. */
INIT_GDB_FILE (stabsread)
#ifndef GDB_STABSREAD_H
#define GDB_STABSREAD_H
+#include "buildsym-legacy.h"
+
struct objfile;
struct legacy_psymtab;
enum language;
/* Definitions, prototypes, etc for stabs debugging format support
functions. */
-#define HASHSIZE 127 /* Size of things hashed via
- hashname(). */
-
-/* Compute a small integer hash code for the given name. */
-
-extern int hashname (const char *name);
-
/* Count symbols as they are processed, for error messages. */
extern unsigned int symnum;