Debugger: Handle DW_AT_signature.
- Per DWARF4's specification, if a type's complete definition is contained in a .debug_types unit, it should be referenced via the DW_AT_signature attribute. 4.8 now actually does this rather than setting e.g. DW_AT_attribute_origin to a signature ref, and consequently we weren't finding said reference any more. Gets .debug_types section support working again.
This commit is contained in:
@@ -314,6 +314,7 @@ DIEDeclaredType::DIEDeclaredType()
|
|||||||
:
|
:
|
||||||
fDescription(NULL),
|
fDescription(NULL),
|
||||||
fAbstractOrigin(NULL),
|
fAbstractOrigin(NULL),
|
||||||
|
fSignatureType(NULL),
|
||||||
fAccessibility(0),
|
fAccessibility(0),
|
||||||
fDeclaration(false)
|
fDeclaration(false)
|
||||||
{
|
{
|
||||||
@@ -334,6 +335,13 @@ DIEDeclaredType::AbstractOrigin() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DebugInfoEntry*
|
||||||
|
DIEDeclaredType::SignatureType() const
|
||||||
|
{
|
||||||
|
return fSignatureType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DIEDeclaredType::IsDeclaration() const
|
DIEDeclaredType::IsDeclaration() const
|
||||||
{
|
{
|
||||||
@@ -377,6 +385,15 @@ DIEDeclaredType::AddAttribute_abstract_origin(uint16 attributeName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
DIEDeclaredType::AddAttribute_signature(uint16 attributeName,
|
||||||
|
const AttributeValue& value)
|
||||||
|
{
|
||||||
|
fSignatureType = value.reference;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DeclarationLocation*
|
DeclarationLocation*
|
||||||
DIEDeclaredType::GetDeclarationLocation()
|
DIEDeclaredType::GetDeclarationLocation()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -281,6 +281,8 @@ public:
|
|||||||
virtual const char* Description() const;
|
virtual const char* Description() const;
|
||||||
virtual DebugInfoEntry* AbstractOrigin() const;
|
virtual DebugInfoEntry* AbstractOrigin() const;
|
||||||
|
|
||||||
|
virtual DebugInfoEntry* SignatureType() const;
|
||||||
|
|
||||||
virtual bool IsDeclaration() const;
|
virtual bool IsDeclaration() const;
|
||||||
|
|
||||||
virtual status_t AddAttribute_accessibility(uint16 attributeName,
|
virtual status_t AddAttribute_accessibility(uint16 attributeName,
|
||||||
@@ -296,6 +298,8 @@ public:
|
|||||||
uint16 attributeName,
|
uint16 attributeName,
|
||||||
const AttributeValue& value);
|
const AttributeValue& value);
|
||||||
// TODO: !interface
|
// TODO: !interface
|
||||||
|
virtual status_t AddAttribute_signature(uint16 attributeName,
|
||||||
|
const AttributeValue& value);
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// DW_AT_visibility // !interface
|
// DW_AT_visibility // !interface
|
||||||
@@ -307,6 +311,7 @@ protected:
|
|||||||
const char* fDescription;
|
const char* fDescription;
|
||||||
DeclarationLocation fDeclarationLocation;
|
DeclarationLocation fDeclarationLocation;
|
||||||
DebugInfoEntry* fAbstractOrigin;
|
DebugInfoEntry* fAbstractOrigin;
|
||||||
|
DebugInfoEntry* fSignatureType;
|
||||||
uint8 fAccessibility;
|
uint8 fAccessibility;
|
||||||
bool fDeclaration;
|
bool fDeclaration;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2013, Rene Gollent, [email protected].
|
* Copyright 2013-2014, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -95,6 +95,13 @@ DebugInfoEntry::AbstractOrigin() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DebugInfoEntry*
|
||||||
|
DebugInfoEntry::SignatureType() const
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LocationDescription*
|
LocationDescription*
|
||||||
DebugInfoEntry::GetLocationDescription()
|
DebugInfoEntry::GetLocationDescription()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2013, Rene Gollent, [email protected].
|
* Copyright 2013-2014, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef DEBUG_INFO_ENTRY_H
|
#ifndef DEBUG_INFO_ENTRY_H
|
||||||
@@ -61,6 +61,7 @@ public:
|
|||||||
virtual const char* Description() const;
|
virtual const char* Description() const;
|
||||||
virtual DebugInfoEntry* Specification() const;
|
virtual DebugInfoEntry* Specification() const;
|
||||||
virtual DebugInfoEntry* AbstractOrigin() const;
|
virtual DebugInfoEntry* AbstractOrigin() const;
|
||||||
|
virtual DebugInfoEntry* SignatureType() const;
|
||||||
virtual LocationDescription* GetLocationDescription();
|
virtual LocationDescription* GetLocationDescription();
|
||||||
|
|
||||||
bool GetDeclarationFile(uint32& _file) const;
|
bool GetDeclarationFile(uint32& _file) const;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2013, Rene Gollent, [email protected].
|
* Copyright 2013-2014, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef DWARF_UTILS_H
|
#ifndef DWARF_UTILS_H
|
||||||
@@ -61,6 +61,14 @@ DwarfUtils::GetDIEByPredicate(EntryType* entry, const Predicate& predicate)
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// try the type unit signature
|
||||||
|
if (EntryType* signature = dynamic_cast<EntryType*>(
|
||||||
|
entry->SignatureType())) {
|
||||||
|
entry = signature;
|
||||||
|
if (predicate(entry))
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user