Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH RFA] partial-stab.h patch amendment
@ 2001-09-05 15:43 Kevin Buettner
  2001-09-05 16:00 ` Kevin Buettner
  2001-09-06 10:35 ` Jim Blandy
  0 siblings, 2 replies; 11+ messages in thread
From: Kevin Buettner @ 2001-09-05 15:43 UTC (permalink / raw)
  To: Jim Blandy, gdb-patches

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-10-03 18:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-05 15:43 [PATCH RFA] partial-stab.h patch amendment Kevin Buettner
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox