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: [PATCH RFA] partial-stab.h patch amendment
Date: Wed, 05 Sep 2001 15:43:00 -0000	[thread overview]
Message-ID: <1010905224331.ZM6026@ocotillo.lan> (raw)

The patch below is an amendment to the partial-stab.h patch that I
submitted earlier in the week:

    http://sources.redhat.com/ml/gdb-patches/2001-09/msg00003.html

In the above patch, I added some code which tests the return value of
find_stab_function_addr() to make sure that we're not attempting to
use a result which indicates an error condition.

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:

    1) The call to find_stab_function_addr() should be error
       checked in both cases.

    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 patch below addresses both of these points.

	* partial-stab.h (case 'f'): Make SOFUN_ADDRESS_MAYBE_MISSING
	code match that used for case 'F'.

diff -u -p -r1.12 partial-stab.h
--- partial-stab.h	2001/08/15 05:02:28	1.12
+++ partial-stab.h	2001/09/05 21:35:30
@@ -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


             reply	other threads:[~2001-09-05 15:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-05 15:43 Kevin Buettner [this message]
2001-09-05 16:00 ` Kevin Buettner
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=1010905224331.ZM6026@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