aboutsummaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-12-22 02:34:34 +0000
committerTom Tromey <tromey@redhat.com>2011-12-22 02:34:34 +0000
commitb19686e08b06fc87494cc72e9df6d5993401831a (patch)
tree9c3a0a1c5867dc8f2608c67c46d2f19a35b08274 /gdb/minsyms.c
parentcbbc9a5c83ce8d71fa8f18de2aa72d96f434d831 (diff)
downloadgdb-b19686e08b06fc87494cc72e9df6d5993401831a.zip
gdb-b19686e08b06fc87494cc72e9df6d5993401831a.tar.gz
gdb-b19686e08b06fc87494cc72e9df6d5993401831a.tar.bz2
* minsyms.h: Rearrange. Document header and all functions.
* minsyms.c: Move some comments to minsyms.h.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c63
1 files changed, 20 insertions, 43 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 18cf672..0d2f5de 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -78,7 +78,7 @@ static int msym_bunch_index;
static int msym_count;
-/* Compute a hash code based using the same criteria as `strcmp_iw'. */
+/* See minsyms.h. */
unsigned int
msymbol_hash_iw (const char *string)
@@ -98,7 +98,7 @@ msymbol_hash_iw (const char *string)
return hash;
}
-/* Compute a hash code for a string. */
+/* See minsyms.h. */
unsigned int
msymbol_hash (const char *string)
@@ -141,8 +141,8 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
}
}
+/* See minsyms.h. */
-/* Return OBJFILE where minimal symbol SYM is defined. */
struct objfile *
msymbol_objfile (struct minimal_symbol *sym)
{
@@ -310,13 +310,7 @@ lookup_minimal_symbol (const char *name, const char *sfile,
return NULL;
}
-/* Iterate over all the minimal symbols in the objfile OBJF which
- match NAME. Both the ordinary and demangled names of each symbol
- are considered. The caller is responsible for canonicalizing NAME,
- should that need to be done.
-
- For each matching symbol, CALLBACK is called with the symbol and
- USER_DATA as arguments. */
+/* See minsyms.h. */
void
iterate_over_minimal_symbols (struct objfile *objf, const char *name,
@@ -350,12 +344,7 @@ iterate_over_minimal_symbols (struct objfile *objf, const char *name,
}
}
-/* Look through all the current minimal symbol tables and find the
- first minimal symbol that matches NAME and has text type. If OBJF
- is non-NULL, limit the search to that objfile. Returns a pointer
- to the minimal symbol that matches, or NULL if no match is found.
-
- This function only searches the mangled (linkage) names. */
+/* See minsyms.h. */
struct minimal_symbol *
lookup_minimal_symbol_text (const char *name, struct objfile *objf)
@@ -407,10 +396,7 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf)
return NULL;
}
-/* Look through all the current minimal symbol tables and find the
- first minimal symbol that matches NAME and PC. If OBJF is non-NULL,
- limit the search to that objfile. Returns a pointer to the minimal
- symbol that matches, or NULL if no match is found. */
+/* See minsyms.h. */
struct minimal_symbol *
lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name,
@@ -442,13 +428,7 @@ lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name,
return NULL;
}
-/* Look through all the current minimal symbol tables and find the
- first minimal symbol that matches NAME and is a solib trampoline.
- If OBJF is non-NULL, limit the search to that objfile. Returns a
- pointer to the minimal symbol that matches, or NULL if no match is
- found.
-
- This function only searches the mangled (linkage) names. */
+/* See minsyms.h. */
struct minimal_symbol *
lookup_minimal_symbol_solib_trampoline (const char *name,
@@ -734,8 +714,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, struct obj_section *section)
return lookup_minimal_symbol_by_pc_section_1 (pc, section, 0);
}
-/* Backward compatibility: search through the minimal symbol table
- for a matching PC (no section given). */
+/* See minsyms.h. */
struct minimal_symbol *
lookup_minimal_symbol_by_pc (CORE_ADDR pc)
@@ -806,10 +785,7 @@ static const struct gnu_ifunc_fns stub_gnu_ifunc_fns =
const struct gnu_ifunc_fns *gnu_ifunc_fns_p = &stub_gnu_ifunc_fns;
-/* Find the minimal symbol named NAME, and return both the minsym
- struct and its objfile. This only checks the linkage name. Sets
- *OBJFILE_P and returns the minimal symbol, if it is found. If it
- is not found, returns NULL. */
+/* See minsyms.h. */
struct minimal_symbol *
lookup_minimal_symbol_and_objfile (const char *name,
@@ -853,18 +829,21 @@ get_symbol_leading_char (bfd *abfd)
return 0;
}
-/* Prepare to start collecting minimal symbols. Note that presetting
- msym_bunch_index to BUNCH_SIZE causes the first call to save a minimal
- symbol to allocate the memory for the first bunch. */
+/* See minsyms.h. */
void
init_minimal_symbol_collection (void)
{
msym_count = 0;
msym_bunch = NULL;
+ /* Note that presetting msym_bunch_index to BUNCH_SIZE causes the
+ first call to save a minimal symbol to allocate the memory for
+ the first bunch. */
msym_bunch_index = BUNCH_SIZE;
}
+/* See minsyms.h. */
+
void
prim_record_minimal_symbol (const char *name, CORE_ADDR address,
enum minimal_symbol_type ms_type,
@@ -896,8 +875,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address,
section, NULL, objfile);
}
-/* Record a minimal symbol in the msym bunches. Returns the symbol
- newly created. */
+/* See minsyms.h. */
struct minimal_symbol *
prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
@@ -974,8 +952,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
return msymbol;
}
-/* Record a minimal symbol in the msym bunches. Returns the symbol
- newly created. */
+/* See minsyms.h. */
struct minimal_symbol *
prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
@@ -1048,6 +1025,8 @@ do_discard_minimal_symbols_cleanup (void *arg)
}
}
+/* See minsyms.h. */
+
struct cleanup *
make_cleanup_discard_minimal_symbols (void)
{
@@ -1322,9 +1301,7 @@ msymbols_sort (struct objfile *objfile)
build_minimal_symbol_hash_tables (objfile);
}
-/* Check if PC is in a shared library trampoline code stub.
- Return minimal symbol for the trampoline entry or NULL if PC is not
- in a trampoline code stub. */
+/* See minsyms.h. */
struct minimal_symbol *
lookup_solib_trampoline_symbol_by_pc (CORE_ADDR pc)