aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2001-10-12 19:07:07 +0000
committerDaniel Jacobowitz <drow@false.org>2001-10-12 19:07:07 +0000
commit375f3d864b1293ba56cd79980ac618e26c862246 (patch)
tree4c5c098dde8fac488379f0e516fe5072407a2fc3
parent6e9a3f4d034f998ffbf6128aae3a26d6745832a5 (diff)
downloadgdb-375f3d864b1293ba56cd79980ac618e26c862246.zip
gdb-375f3d864b1293ba56cd79980ac618e26c862246.tar.gz
gdb-375f3d864b1293ba56cd79980ac618e26c862246.tar.bz2
* minsyms.c (msymbol_hash): Use better hash function.
(msymbol_hash_iw): Likewise. Terminate loop at '(' properly. * objfiles.h: Increase MINIMAL_SYMBOL_HASH_SIZE to match modern binaries.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/minsyms.c8
-rw-r--r--gdb/objfiles.h2
3 files changed, 14 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 922d8e2..5675302 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2001-10-12 Daniel Jacobowitz <drow@mvista.com>
+ * minsyms.c (msymbol_hash): Use better hash function.
+ (msymbol_hash_iw): Likewise. Terminate loop at '(' properly.
+
+ * objfiles.h: Increase MINIMAL_SYMBOL_HASH_SIZE to match modern
+ binaries.
+
+2001-10-12 Daniel Jacobowitz <drow@mvista.com>
+
* printcmd.c (print_frame_args): Move symbol iteration explicitly
inside the func != NULL block.
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 9481747..b20074b 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -96,8 +96,10 @@ msymbol_hash_iw (const char *string)
while (isspace (*string))
++string;
if (*string && *string != '(')
- hash = (31 * hash) + *string;
- ++string;
+ {
+ hash = hash * 67 + *string - 113;
+ ++string;
+ }
}
return hash % MINIMAL_SYMBOL_HASH_SIZE;
}
@@ -109,7 +111,7 @@ msymbol_hash (const char *string)
{
unsigned int hash = 0;
for (; *string; ++string)
- hash = (31 * hash) + *string;
+ hash = hash * 67 + *string - 113;
return hash % MINIMAL_SYMBOL_HASH_SIZE;
}
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index d3f669e..992ae71 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -202,7 +202,7 @@ extern void print_objfile_statistics (void);
extern void print_symbol_bcache_statistics (void);
/* Number of entries in the minimal symbol hash table. */
-#define MINIMAL_SYMBOL_HASH_SIZE 349
+#define MINIMAL_SYMBOL_HASH_SIZE 2039
/* Master structure for keeping track of each file from which
gdb reads symbols. There are several ways these get allocated: 1.