aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-20 11:13:12 -0600
committerTom Tromey <tom@tromey.com>2018-07-16 08:55:17 -0600
commit2150c3ef045a525b1d74c06eb8b0811621f264e3 (patch)
tree3d1608f5efcf47922f1ae3a1e4f72d1b1cc0a411 /gdb/stabsread.c
parent0ec44fc067ca71f968a4fedda1c17cba2e5ad0ca (diff)
downloadgdb-2150c3ef045a525b1d74c06eb8b0811621f264e3.zip
gdb-2150c3ef045a525b1d74c06eb8b0811621f264e3.tar.gz
gdb-2150c3ef045a525b1d74c06eb8b0811621f264e3.tar.bz2
Move some code from buildsym to stabsread
A few things that currently reside in buildsym.c turn out to be specific to the stabs reader. This patch moves these from buildsym.[ch] to stabsread.[ch]. gdb/ChangeLog 2018-07-16 Tom Tromey <tom@tromey.com> * stabsread.h (HASHSIZE, hashname, symnum, next_symbol_text) (next_symbol_text_func): Move from buildsym.h. * stabsread.c (hashname): Move from buildsym.c. * buildsym.h (HASHSIZE, symnum, next_symbol_text) (next_symbol_text_func, hashname): Move to stabsread.h. * buildsym.c: Don't include bcache.h (hashname): Move to stasbread.c.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index ed4a3d3..e4513c6 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -44,6 +44,7 @@
#include "target-float.h"
#include "cp-abi.h"
#include "cp-support.h"
+#include "bcache.h"
#include <ctype.h>
/* Ask stabsread.h to define the vars it normally declares `extern'. */
@@ -4814,6 +4815,14 @@ find_name_end (const char *name)
}
}
+/* See stabsread.h. */
+
+int
+hashname (const char *name)
+{
+ return hash (name, strlen (name)) % HASHSIZE;
+}
+
/* Initializer for this module. */
void