Fix handling of variable specifications.

In the case of variables that refer to static members of compound types,
the specification will be a reference to a DIEMember rather than a
DIEVariable in DWARF3. Relax our restrictions accordingly.
This commit is contained in:
Rene Gollent
2011-12-08 16:31:04 -05:00
parent a5c5479710
commit 6066a80794
2 changed files with 8 additions and 1 deletions
@@ -1,5 +1,6 @@
/* /*
* Copyright 2009, Ingo Weinhold, [email protected]. * Copyright 2009, Ingo Weinhold, [email protected].
* Copyright 2011, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -2169,6 +2170,12 @@ DIEVariable::AddAttribute_specification(uint16 attributeName,
const AttributeValue& value) const AttributeValue& value)
{ {
fSpecification = dynamic_cast<DIEVariable*>(value.reference); fSpecification = dynamic_cast<DIEVariable*>(value.reference);
// in the case of static variables declared within a compound type,
// the specification may point to a member entry rather than
// a variable entry
if (fSpecification == NULL)
fSpecification = dynamic_cast<DIEMember*>(value.reference);
return fSpecification != NULL ? B_OK : B_BAD_DATA; return fSpecification != NULL ? B_OK : B_BAD_DATA;
} }
+1 -1
View File
@@ -1413,7 +1413,7 @@ private:
LocationDescription fLocationDescription; LocationDescription fLocationDescription;
ConstantAttributeValue fValue; ConstantAttributeValue fValue;
DIEType* fType; DIEType* fType;
DIEVariable* fSpecification; DebugInfoEntry* fSpecification;
DIEVariable* fAbstractOrigin; DIEVariable* fAbstractOrigin;
uint64 fStartScope; uint64 fStartScope;
}; };