Improve some comments about msymbol handling
authorChristian Biesinger <cbiesinger@google.com>
Mon, 30 Sep 2019 01:15:38 +0000 (20:15 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Mon, 30 Sep 2019 16:21:46 +0000 (11:21 -0500)
This just clarifies some comments about the hashtables involved
in msymbols.

gdb/ChangeLog:

2019-09-29  Christian Biesinger  <cbiesinger@google.com>

* minsyms.h (msymbol_hash): Document that this is a case-insensitive
hash and why.
* objfiles.h (struct objfile_per_bfd_storage) <demangled_names_hash,
msymbol_hash, msymbol_demangled_hash>: Improve comments.

gdb/ChangeLog
gdb/minsyms.h
gdb/objfiles.h

index 89859ef1dfe5a38f8d67c45254d78c93d0d6f3e3..faac59d2552e00e0f83e874acbdf54180693b38e 100644 (file)
@@ -1,3 +1,10 @@
+2019-09-29  Christian Biesinger  <cbiesinger@google.com>
+
+       * minsyms.h (msymbol_hash): Document that this is a case-insensitive
+       hash and why.
+       * objfiles.h (struct objfile_per_bfd_storage) <demangled_names_hash,
+       msymbol_hash, msymbol_demangled_hash>: Improve comments.
+
 2019-09-30  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * psymtab.c (add_psymbol_to_list): Move comment to psympriv.h.
index bb43165620dff7adcc28bbeb81ad2134b1cfcd30..ce4b83d54480dd5ce98152844bb824d931e5ff8f 100644 (file)
@@ -159,7 +159,8 @@ bool msymbol_is_function (struct objfile *objfile,
                          minimal_symbol *minsym,
                          CORE_ADDR *func_address_p = NULL);
 
-/* Compute a hash code for the string argument.  */
+/* Compute a hash code for the string argument.  Unlike htab_hash_string,
+   this is a case-insensitive hash to support "set case-sensitive off".  */
 
 unsigned int msymbol_hash (const char *);
 
index 68d36d408e1f605692c234ec8d13ff0d738ee67a..dbd06c01e26448dd64d3dfc3aae176a746ed5ba5 100644 (file)
@@ -258,10 +258,10 @@ struct objfile_per_bfd_storage
   struct gdbarch *gdbarch = NULL;
 
   /* Hash table for mapping symbol names to demangled names.  Each
-     entry in the hash table is actually two consecutive strings,
-     both null-terminated; the first one is a mangled or linkage
-     name, and the second is the demangled name or just a zero byte
-     if the name doesn't demangle.  */
+     entry in the hash table is a demangled_name_entry struct, storing the
+     language and two consecutive strings, both null-terminated; the first one
+     is a mangled or linkage name, and the second is the demangled name or just
+     a zero byte if the name doesn't demangle.  */
 
   htab_up demangled_names_hash;
 
@@ -305,12 +305,14 @@ struct objfile_per_bfd_storage
 
   bool minsyms_read : 1;
 
-  /* This is a hash table used to index the minimal symbols by name.  */
+  /* This is a hash table used to index the minimal symbols by (mangled)
+     name.  */
 
   minimal_symbol *msymbol_hash[MINIMAL_SYMBOL_HASH_SIZE] {};
 
   /* This hash table is used to index the minimal symbols by their
-     demangled names.  */
+     demangled names.  Uses a language-specific hash function via
+     search_name_hash.  */
 
   minimal_symbol *msymbol_demangled_hash[MINIMAL_SYMBOL_HASH_SIZE] {};
 
This page took 0.038327 seconds and 4 git commands to generate.