diff options
author | David S. Miller <davem@redhat.com> | 2002-04-24 08:00:54 +0000 |
---|---|---|
committer | David S. Miller <davem@redhat.com> | 2002-04-24 08:00:54 +0000 |
commit | 94badd08d880b9a9e0f2c11b285438d1dd169cb6 (patch) | |
tree | a800a2d12020a66cdad5870847fd815ba1b289b3 /gdb/dbxread.c | |
parent | 519242b8c55e6340d249428f36de35f59e4c213a (diff) | |
download | gdb-94badd08d880b9a9e0f2c11b285438d1dd169cb6.tar.gz |
2002-04-24 David S. Miller <davem@redhat.com>
* symtab.h (find_stab_function_addr): Kill extern.
* minsyms.c (find_stab_function_addr): Remove from here...
* dbxread.c: ... to here, and mark it static.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r-- | gdb/dbxread.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 16d00434e28..9b2b73b042f 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1230,6 +1230,52 @@ read_dbx_dynamic_symtab (struct objfile *objfile) do_cleanups (back_to); } +#ifdef SOFUN_ADDRESS_MAYBE_MISSING +CORE_ADDR +find_stab_function_addr (char *namestring, char *filename, + struct objfile *objfile) +{ + struct minimal_symbol *msym; + char *p; + int n; + + p = strchr (namestring, ':'); + if (p == NULL) + p = namestring; + n = p - namestring; + p = alloca (n + 2); + strncpy (p, namestring, n); + p[n] = 0; + + msym = lookup_minimal_symbol (p, filename, objfile); + if (msym == NULL) + { + /* Sun Fortran appends an underscore to the minimal symbol name, + try again with an appended underscore if the minimal symbol + was not found. */ + p[n] = '_'; + p[n + 1] = 0; + msym = lookup_minimal_symbol (p, filename, objfile); + } + + if (msym == NULL && filename != NULL) + { + /* Try again without the filename. */ + p[n] = 0; + msym = lookup_minimal_symbol (p, NULL, objfile); + } + if (msym == NULL && filename != NULL) + { + /* And try again for Sun Fortran, but without the filename. */ + p[n] = '_'; + p[n + 1] = 0; + msym = lookup_minimal_symbol (p, NULL, objfile); + } + + return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym); +} +#endif /* SOFUN_ADDRESS_MAYBE_MISSING */ + /* Setup partial_symtab's describing each source file for which debugging information is available. */ |