fp->name = obsavestring (fieldname, strlen (fieldname), &objfile->objfile_obstack);
fp->name = fieldname;
dwarf2_add_field (struct field_info *fip, struct die_info *die,		  struct dwarf2_cu *cu){   struct objfile *objfile = cu->objfile;  struct nextfield *new_field;  struct attribute *attr;  struct field *fp;  char *fieldname = "";  /* Allocate a new field list entry and link it in.  */  new_field = (struct nextfield *) xmalloc (sizeof (struct nextfield));  make_cleanup (xfree, new_field);  memset (new_field, 0, sizeof (struct nextfield));  new_field->next = fip->fields;  fip->fields = new_field;  fip->nfields++;  /* Handle accessibility and virtuality of field.     The default accessibility for members is public, the default     accessibility for inheritance is private.  */  if (die->tag != DW_TAG_inheritance)    new_field->accessibility = DW_ACCESS_public;  else    new_field->accessibility = DW_ACCESS_private;  new_field->virtuality = DW_VIRTUALITY_none;  attr = dwarf2_attr (die, DW_AT_accessibility, cu);  if (attr)    new_field->accessibility = DW_UNSND (attr);  if (new_field->accessibility != DW_ACCESS_public)    fip->non_public_fields = 1;  attr = dwarf2_attr (die, DW_AT_virtuality, cu);  if (attr)    new_field->virtuality = DW_UNSND (attr);  fp = &new_field->field;  if (die->tag == DW_TAG_member && ! die_is_declaration (die, cu))    {      /* Data member other than a C++ static data member.  */            /* Get type of field.  */      fp->type = die_type (die, cu);      FIELD_STATIC_KIND (*fp) = 0;      /* Get bit size of field (zero if none).  */      attr = dwarf2_attr (die, DW_AT_bit_size, cu);      if (attr)	{	  FIELD_BITSIZE (*fp) = DW_UNSND (attr);	}      else	{	  FIELD_BITSIZE (*fp) = 0;	}      /* Get bit offset of field.  */      attr = dwarf2_attr (die, DW_AT_data_member_location, cu);      if (attr)	{	  FIELD_BITPOS (*fp) =	    decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte;	}      else	FIELD_BITPOS (*fp) = 0;      attr = dwarf2_attr (die, DW_AT_bit_offset, cu);      if (attr)	{	  if (BITS_BIG_ENDIAN)	    {	      /* For big endian bits, the DW_AT_bit_offset gives the	         additional bit offset from the MSB of the containing	         anonymous object to the MSB of the field.  We don't	         have to do anything special since we don't need to	         know the size of the anonymous object.  */	      FIELD_BITPOS (*fp) += DW_UNSND (attr);	    }	  else	    {	      /* For little endian bits, compute the bit offset to the	         MSB of the anonymous object, subtract off the number of	         bits from the MSB of the field to the MSB of the	         object, and then subtract off the number of bits of	         the field itself.  The result is the bit offset of	         the LSB of the field.  */	      int anonymous_size;	      int bit_offset = DW_UNSND (attr);	      attr = dwarf2_attr (die, DW_AT_byte_size, cu);	      if (attr)		{		  /* The size of the anonymous object containing		     the bit field is explicit, so use the		     indicated size (in bytes).  */		  anonymous_size = DW_UNSND (attr);		}	      else		{		  /* The size of the anonymous object containing		     the bit field must be inferred from the type		     attribute of the data member containing the		     bit field.  */		  anonymous_size = TYPE_LENGTH (fp->type);		}	      FIELD_BITPOS (*fp) += anonymous_size * bits_per_byte		- bit_offset - FIELD_BITSIZE (*fp);	    }	}      /* Get name of field.  */      attr = dwarf2_attr (die, DW_AT_name, cu);      if (attr && DW_STRING (attr))	fieldname = DW_STRING (attr);      fp->name = obsavestring (fieldname, strlen (fieldname),			       &objfile->objfile_obstack);      /* Change accessibility for artificial fields (e.g. virtual table         pointer or virtual base class pointer) to private.  */      if (dwarf2_attr (die, DW_AT_artificial, cu))	{	  new_field->accessibility = DW_ACCESS_private;	  fip->non_public_fields = 1;	}    }  else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable)    {      /* C++ static member.  */      /* NOTE: carlton/2002-11-05: It should be a DW_TAG_member that	 is a declaration, but all versions of G++ as of this writing	 (so through at least 3.2.1) incorrectly generate	 DW_TAG_variable tags.  */            char *physname;      /* Get name of field.  */      attr = dwarf2_attr (die, DW_AT_name, cu);      if (attr && DW_STRING (attr))	fieldname = DW_STRING (attr);      else	return;      /* Get physical name.  */      physname = dwarf2_linkage_name (die, cu);      SET_FIELD_PHYSNAME (*fp, obsavestring (physname, strlen (physname),					     &objfile->objfile_obstack));      FIELD_TYPE (*fp) = die_type (die, cu);      FIELD_NAME (*fp) = obsavestring (fieldname, strlen (fieldname),				       &objfile->objfile_obstack);    }  else if (die->tag == DW_TAG_inheritance)    {      /* C++ base class field.  */      attr = dwarf2_attr (die, DW_AT_data_member_location, cu);      if (attr)	FIELD_BITPOS (*fp) = (decode_locdesc (DW_BLOCK (attr), cu)			      * bits_per_byte);      FIELD_BITSIZE (*fp) = 0;      FIELD_STATIC_KIND (*fp) = 0;      FIELD_TYPE (*fp) = die_type (die, cu);      FIELD_NAME (*fp) = type_name_no_tag (fp->type);      fip->nbaseclasses++;    }}