diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp b/src/apps/debugger/dwarf/DebugInfoEntries.cpp index dbc7509dc9..34b0b4c890 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp @@ -1,5 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2011, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -2169,6 +2170,12 @@ DIEVariable::AddAttribute_specification(uint16 attributeName, const AttributeValue& value) { fSpecification = dynamic_cast(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(value.reference); + return fSpecification != NULL ? B_OK : B_BAD_DATA; } diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.h b/src/apps/debugger/dwarf/DebugInfoEntries.h index dbbc0b8ff8..6f7d904528 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.h +++ b/src/apps/debugger/dwarf/DebugInfoEntries.h @@ -1413,7 +1413,7 @@ private: LocationDescription fLocationDescription; ConstantAttributeValue fValue; DIEType* fType; - DIEVariable* fSpecification; + DebugInfoEntry* fSpecification; DIEVariable* fAbstractOrigin; uint64 fStartScope; };