Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: Jim Blandy <jimb@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFA] partial-stab.h patch amendment
Date: Wed, 05 Sep 2001 16:00:00 -0000	[thread overview]
Message-ID: <1010905225956.ZM6072@ocotillo.lan> (raw)
In-Reply-To: <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


  reply	other threads:[~2001-09-05 16:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-05 15:43 Kevin Buettner
2001-09-05 16:00 ` Kevin Buettner [this message]
2001-09-06 10:35 ` Jim Blandy
2001-09-06 13:56   ` Kevin Buettner
     [not found]     ` <1010906232048.ZM8395@ocotillo.lan>
2001-09-06 23:00       ` H . J . Lu
2001-09-07  9:53         ` Kevin Buettner
2001-09-07 10:02           ` H . J . Lu
2001-09-07 10:31           ` Andrew Cagney
2001-09-07 10:42             ` Elena Zannoni
2001-09-07 14:16             ` Jim Blandy
2001-10-03 18:21             ` Elena Zannoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1010905225956.ZM6072@ocotillo.lan \
    --to=kevinb@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox