From: Kevin Buettner Date: Thu, 6 Sep 2001 20:50:48 +0000 (+0000) Subject: Don't use error result from find_stab_function_addr(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a058a09a9fadaf701938094ae83aa58f2207d58;p=binutils-gdb.git Don't use error result from find_stab_function_addr(). --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b23e1f69259..f04958f56a8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2001-09-06 Kevin Buettner + + * dbxread.c (process_one_symbol): Don't use error result from + find_stab_function_addr(). + * partial-stab.h (case 'F'): Likewise. + + * partial-stab.h (case 'f'): Make SOFUN_ADDRESS_MAYBE_MISSING + code match that used for case 'F'. This fixes the divergence + that was introduced by my 1999-09-14 changes to partial-stab.h. + 2001-09-05 Elena Zannoni * gdbarch.sh: Move include of dis-asm.h so it is generated earlier diff --git a/gdb/dbxread.c b/gdb/dbxread.c index da55dde3723..04acd4ebc5d 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2266,8 +2266,18 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, from N_FUN symbols. */ if (type == N_FUN && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile))) - valu = - find_stab_function_addr (name, last_source_file, objfile); + { + CORE_ADDR minsym_valu = + find_stab_function_addr (name, last_source_file, objfile); + + /* find_stab_function_addr will return 0 if the minimal + symbol wasn't found. (Unfortunately, this might also + be a valid address.) Anyway, if it *does* return 0, + it is likely that the value was set correctly to begin + with... */ + if (minsym_valu != 0) + valu = minsym_valu; + } #endif #ifdef SUN_FIXED_LBRAC_BUG diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h index fe772ba588a..e18cabbba09 100644 --- a/gdb/partial-stab.h +++ b/gdb/partial-stab.h @@ -595,10 +595,22 @@ switch (CUR_SYMBOL_TYPE) #ifdef SOFUN_ADDRESS_MAYBE_MISSING /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit value for the bottom of the text seg in those cases. */ - if (pst && textlow_not_set) + if (CUR_SYMBOL_VALUE == ANOFFSET (objfile->section_offsets, + SECT_OFF_TEXT (objfile))) { - pst->textlow = + CORE_ADDR minsym_valu = find_stab_function_addr (namestring, pst->filename, objfile); + /* find_stab_function_addr will return 0 if the minimal + symbol wasn't found. (Unfortunately, this might also + be a valid address.) Anyway, if it *does* return 0, + it is likely that the value was set correctly to begin + with... */ + if (minsym_valu != 0) + CUR_SYMBOL_VALUE = minsym_valu; + } + if (pst && textlow_not_set) + { + pst->textlow = CUR_SYMBOL_VALUE; textlow_not_set = 0; } #endif @@ -652,8 +664,17 @@ switch (CUR_SYMBOL_TYPE) value for the bottom of the text seg in those cases. */ if (CUR_SYMBOL_VALUE == ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))) - CUR_SYMBOL_VALUE = - find_stab_function_addr (namestring, pst->filename, objfile); + { + CORE_ADDR minsym_valu = + find_stab_function_addr (namestring, pst->filename, objfile); + /* find_stab_function_addr will return 0 if the minimal + symbol wasn't found. (Unfortunately, this might also + be a valid address.) Anyway, if it *does* return 0, + it is likely that the value was set correctly to begin + with... */ + if (minsym_valu != 0) + CUR_SYMBOL_VALUE = minsym_valu; + } if (pst && textlow_not_set) { pst->textlow = CUR_SYMBOL_VALUE;