diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-12-27 16:31:56 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-12-27 16:31:56 +0000 |
commit | 404f69a80b818c6d4a29fbb56f535b65d9d59b50 (patch) | |
tree | a0cf80474bef468996ada3bb498ab6b31d12df49 /gdb/minsyms.c | |
parent | e7386e322551fd94efdfbf228bf7db3efa0d9d56 (diff) | |
download | gdb-404f69a80b818c6d4a29fbb56f535b65d9d59b50.zip gdb-404f69a80b818c6d4a29fbb56f535b65d9d59b50.tar.gz gdb-404f69a80b818c6d4a29fbb56f535b65d9d59b50.tar.bz2 |
* dbxread.c: Move default definition of GCC_COMPILED_FLAG_SYMBOL
from here . . .
* symtab.h: . . . to here.
* dbxread.c (record_minimal_symbol): Move check for gcc{,2}_compiled.
and __gnu_compiled* from here . . .
* minsyms.c (prim_record_minimal_symbol_and_info): . . . to here.
* minsyms.c (prim_record_minimal_symbol): Call
prim_record_minimal_symbol_and_info rather than duplicating code.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r-- | gdb/minsyms.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c index dbb4e79..b45b4f4 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -297,31 +297,9 @@ prim_record_minimal_symbol (name, address, ms_type) CORE_ADDR address; enum minimal_symbol_type ms_type; { - register struct msym_bunch *new; - register struct minimal_symbol *msymbol; - - if (msym_bunch_index == BUNCH_SIZE) - { - new = (struct msym_bunch *) xmalloc (sizeof (struct msym_bunch)); - msym_bunch_index = 0; - new -> next = msym_bunch; - msym_bunch = new; - } - msymbol = &msym_bunch -> contents[msym_bunch_index]; - SYMBOL_NAME (msymbol) = (char *) name; - SYMBOL_INIT_LANGUAGE_SPECIFIC (msymbol, language_unknown); - SYMBOL_VALUE_ADDRESS (msymbol) = address; - SYMBOL_SECTION (msymbol) = -1; - MSYMBOL_TYPE (msymbol) = ms_type; - /* FIXME: This info, if it remains, needs its own field. */ - MSYMBOL_INFO (msymbol) = NULL; /* FIXME! */ - msym_bunch_index++; - msym_count++; + prim_record_minimal_symbol (name, address, ms_type, NULL, -1); } -/* FIXME: Why don't we just combine this function with the one above - and pass it a NULL info pointer value if info is not needed? */ - void prim_record_minimal_symbol_and_info (name, address, ms_type, info, section) const char *name; @@ -333,6 +311,27 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section) register struct msym_bunch *new; register struct minimal_symbol *msymbol; + if (ms_type == mst_file_text) + { + /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into + the minimal symbols, because if there is also another symbol + at the same address (e.g. the first function of the file), + lookup_minimal_symbol_by_pc would have no way of getting the + right one. */ + if (name[0] == 'g' + && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0 + || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)) + return; + + { + char *tempstring = name; + if (tempstring[0] == bfd_get_symbol_leading_char (objfile->obfd)) + ++tempstring; + if (STREQN (tempstring, "__gnu_compiled", 14)) + return; + } + } + if (msym_bunch_index == BUNCH_SIZE) { new = (struct msym_bunch *) xmalloc (sizeof (struct msym_bunch)); |