This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] dbxread.c, partial-stab.h patch
- To: gdb-patches at sources dot redhat dot com
- Subject: Re: [PATCH RFA] dbxread.c, partial-stab.h patch
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Mon, 15 Oct 2001 13:42:46 -0700
- References: <1010903225550.ZM1791@ocotillo.lan>
I've just committed the following patch to the 5.1 branch. (This is
the same as the one that went into the development sources a while
back, but I decided to repost it since it's been a while.)
2001-10-15 Kevin Buettner <kevinb@redhat.com>
* 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.
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.19.2.1
diff -u -p -r1.19.2.1 dbxread.c
--- dbxread.c 2001/08/16 22:25:20 1.19.2.1
+++ dbxread.c 2001/10/15 20:28:06
@@ -2270,8 +2270,18 @@ process_one_symbol (int type, int desc,
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
Index: partial-stab.h
===================================================================
RCS file: /cvs/src/src/gdb/partial-stab.h,v
retrieving revision 1.11.4.1
diff -u -p -r1.11.4.1 partial-stab.h
--- partial-stab.h 2001/08/16 22:25:20 1.11.4.1
+++ partial-stab.h 2001/10/15 20:28:07
@@ -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;