This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] partial-stab.h patch amendment
- To: Jim Blandy <jimb at cygnus dot com>, gdb-patches at sources dot redhat dot com
- Subject: Re: [PATCH RFA] partial-stab.h patch amendment
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Wed, 5 Sep 2001 15:59:56 -0700
- References: <1010905224331.ZM6026@ocotillo.lan>
On Sep 5, 3:43pm, Kevin Buettner wrote:
> However, there are actually two calls to find_stab_function_addr() in
> partial-stab.h. One is used to determine the address of global
> function symbols (when this information is not provided in the debug
> info) and the other is used to help set textlow for static function
> symbols. I added code to test the return value for the global
> function symbol case.
>
> In a conversation with Jim Blandy earlier today, he made two
> observations:
[...]
> 2) We probably ought to be using the same mechanism to
> set CUR_SYMBOL_VALUE for the static function case as
> well as the global.
The fact that these cases somehow diverged really bothered me. So
I did some CVS digging to try to figure out why and when they diverged.
It turns out that they diverged after the following fix was committed:
1999-09-14 Kevin Buettner <kevinb@cygnus.com>
* symtab.h, minsyms.c (find_stab_function_addr): Changed
type of second parameter from partial_symtab * to char *.
Fixed all callers.
* minsyms.c (find_stab_function_addr): Look for minimal
symbol without filename if filename based search fails.
* dbxread.c (process_one_symbol): Call find_stab_function_addr()
in place of inline code with identical functionality.
* partial-stab.h (case N_FUN, descriptors 'F' and 'f'): Look
up symbol's address from minimal symbol table when N_FUN
address is missing. Also, make sure this value is used for
calculating the value of the texthigh field.
(Yes, the culprit was me.)
Prior to that the code was identical...
2.65 (shebs 07-Jul-99): case 'f':
2.66 (fnf 08-Aug-99): CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
2.8 (gnu 13-Jun-92): #ifdef DBXREAD_ONLY
2.65 (shebs 07-Jul-99): /* Keep track of the start of the last function so we
2.65 (shebs 07-Jul-99): can handle end of function symbols. */
2.65 (shebs 07-Jul-99): last_function_start = CUR_SYMBOL_VALUE;
2.65 (shebs 07-Jul-99): /* Kludges for ELF/STABS with Sun ACC */
2.65 (shebs 07-Jul-99): last_function_name = namestring;
2.42 (kingdon 09-Feb-95): #ifdef SOFUN_ADDRESS_MAYBE_MISSING
2.65 (shebs 07-Jul-99): /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
2.65 (shebs 07-Jul-99): value for the bottom of the text seg in those cases. */
2.65 (shebs 07-Jul-99): if (pst && textlow_not_set)
2.65 (shebs 07-Jul-99): {
2.65 (shebs 07-Jul-99): pst->textlow =
2.65 (shebs 07-Jul-99): find_stab_function_addr (namestring, pst, objfile);
2.65 (shebs 07-Jul-99): textlow_not_set = 0;
2.65 (shebs 07-Jul-99): }
2.42 (kingdon 09-Feb-95): #endif
....
2.65 (shebs 07-Jul-99): case 'F':
2.66 (fnf 08-Aug-99): CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
2.8 (gnu 13-Jun-92): #ifdef DBXREAD_ONLY
2.65 (shebs 07-Jul-99): /* Keep track of the start of the last function so we
2.65 (shebs 07-Jul-99): can handle end of function symbols. */
2.65 (shebs 07-Jul-99): last_function_start = CUR_SYMBOL_VALUE;
2.65 (shebs 07-Jul-99): /* Kludges for ELF/STABS with Sun ACC */
2.65 (shebs 07-Jul-99): last_function_name = namestring;
2.42 (kingdon 09-Feb-95): #ifdef SOFUN_ADDRESS_MAYBE_MISSING
2.65 (shebs 07-Jul-99): /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
2.65 (shebs 07-Jul-99): value for the bottom of the text seg in those cases. */
2.65 (shebs 07-Jul-99): if (pst && textlow_not_set)
2.65 (shebs 07-Jul-99): {
2.65 (shebs 07-Jul-99): pst->textlow =
2.65 (shebs 07-Jul-99): find_stab_function_addr (namestring, pst, objfile);
2.65 (shebs 07-Jul-99): textlow_not_set = 0;
2.65 (shebs 07-Jul-99): }
2.8 (gnu 13-Jun-92): #endif
Anyway, since I can't remember any good reason for making these cases
diverge, I'm not bothered anymore about making them the same again.
Kevin