[Linux-ia64] gdb null ptr

From: Pete Wyckoff <pw_at_osc.edu>
Date: 2000-11-03 06:37:34
This is probably the wrong place to fix the bug, but it keeps gdb
from crashing on codes created using sgif90 (Version 0.01.0-11).

The type structure which causes the problem has null for both name and
tag_name.  I didn't look far enough to figure out why.  Code in question
is tag_type_to_type called from die_type.

Patch against snap-001024 with patches from README.glibc213 and
patch.02[7-9].

How was I using it?  Start the mpi code, attach it with gdb, wait for
the FPE to arrive, "Segmentation fault" without patch.  With patch,

    Program received signal SIGFPE, Arithmetic exception.
    0x400000000002c292 in output (ISTATE=Cannot access memory at address 0x0
    ) at put.F:91
    91                    gf(i,ic) = gf(i,ic) +

istate is an (implicit) integer*4 parameter passed to subroutine output.

		-- Pete


--- src/gdb/dwarf2read.c.orig	Thu Nov  2 14:28:21 2000
+++ src/gdb/dwarf2read.c	Thu Nov  2 14:28:34 2000
@@ -4522,7 +4522,7 @@
 	    {
 	      const char *nameoftype;
 	      nameoftype = TYPE_NAME(dwarf2_cached_types[hashval]) == NULL ? TYPE_TAG_NAME(dwarf2_cached_types[hashval]) : TYPE_NAME(dwarf2_cached_types[hashval]);
-	      if (strcmp(attrname, nameoftype) == 0)
+	      if (nameoftype && strcmp(attrname, nameoftype) == 0)
 		{
 		  die->type=dwarf2_cached_types[hashval];
 		}
Received on Thu Nov 02 11:37:54 2000

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:00 EST