This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: fix crashes in partial-stab.h for BP programs


Programs built with bounded pointers
(see http://gcc.gnu.org/projects/bp/main.html)
cause indigestion for gdb because these code paths
are exercised with pst==NULL.

I don't claim to understand anything about this code, or the
implications of pst==NULL, but I do notice that many other places in
this file guard uses of pst with a check for NULL.

Greg

Index: gdb/partial-stab.h
===================================================================
RCS file: /cvs/src/src/gdb/partial-stab.h,v
retrieving revision 1.3
diff -u -p -r1.3 partial-stab.h
--- partial-stab.h	2000/05/04 16:52:33	1.3
+++ partial-stab.h	2000/08/04 19:42:04
@@ -401,7 +401,7 @@ switch (CUR_SYMBOL_TYPE)
 	   function relative stabs, or the address of the function's
 	   end for old style stabs.  */
 	valu = CUR_SYMBOL_VALUE + last_function_start;
-	if (pst->texthigh == 0 || valu > pst->texthigh)
+	if (pst && (pst->texthigh == 0 || valu > pst->texthigh))
 	  pst->texthigh = valu;
 	break;
       }
@@ -647,7 +647,7 @@ switch (CUR_SYMBOL_TYPE)
 	   use the address of this function as the low bound for
 	   the partial symbol table.  */
 	if (textlow_not_set
-	    || (CUR_SYMBOL_VALUE < pst->textlow
+	    || (pst && CUR_SYMBOL_VALUE < pst->textlow
 		&& CUR_SYMBOL_VALUE
 		!= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))))
 	  {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]