diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp b/src/apps/debugger/dwarf/DebugInfoEntries.cpp index 34ac9d47cf..874392063b 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp @@ -314,6 +314,7 @@ DIEDeclaredType::DIEDeclaredType() : fDescription(NULL), fAbstractOrigin(NULL), + fSignatureType(NULL), fAccessibility(0), fDeclaration(false) { @@ -334,6 +335,13 @@ DIEDeclaredType::AbstractOrigin() const } +DebugInfoEntry* +DIEDeclaredType::SignatureType() const +{ + return fSignatureType; +} + + bool 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* DIEDeclaredType::GetDeclarationLocation() { diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.h b/src/apps/debugger/dwarf/DebugInfoEntries.h index 88de47ac12..76a9855a04 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.h +++ b/src/apps/debugger/dwarf/DebugInfoEntries.h @@ -281,6 +281,8 @@ public: virtual const char* Description() const; virtual DebugInfoEntry* AbstractOrigin() const; + virtual DebugInfoEntry* SignatureType() const; + virtual bool IsDeclaration() const; virtual status_t AddAttribute_accessibility(uint16 attributeName, @@ -296,6 +298,8 @@ public: uint16 attributeName, const AttributeValue& value); // TODO: !interface + virtual status_t AddAttribute_signature(uint16 attributeName, + const AttributeValue& value); // TODO: // DW_AT_visibility // !interface @@ -307,6 +311,7 @@ protected: const char* fDescription; DeclarationLocation fDeclarationLocation; DebugInfoEntry* fAbstractOrigin; + DebugInfoEntry* fSignatureType; uint8 fAccessibility; bool fDeclaration; }; diff --git a/src/apps/debugger/dwarf/DebugInfoEntry.cpp b/src/apps/debugger/dwarf/DebugInfoEntry.cpp index 4938e8ab67..0ec4a777aa 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntry.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntry.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2014, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -95,6 +95,13 @@ DebugInfoEntry::AbstractOrigin() const } +DebugInfoEntry* +DebugInfoEntry::SignatureType() const +{ + return NULL; +} + + LocationDescription* DebugInfoEntry::GetLocationDescription() { diff --git a/src/apps/debugger/dwarf/DebugInfoEntry.h b/src/apps/debugger/dwarf/DebugInfoEntry.h index 11e7865035..7bab698f83 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntry.h +++ b/src/apps/debugger/dwarf/DebugInfoEntry.h @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2014, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ #ifndef DEBUG_INFO_ENTRY_H @@ -61,6 +61,7 @@ public: virtual const char* Description() const; virtual DebugInfoEntry* Specification() const; virtual DebugInfoEntry* AbstractOrigin() const; + virtual DebugInfoEntry* SignatureType() const; virtual LocationDescription* GetLocationDescription(); bool GetDeclarationFile(uint32& _file) const; diff --git a/src/apps/debugger/dwarf/DwarfUtils.h b/src/apps/debugger/dwarf/DwarfUtils.h index 1bedfd0802..bdc41c0490 100644 --- a/src/apps/debugger/dwarf/DwarfUtils.h +++ b/src/apps/debugger/dwarf/DwarfUtils.h @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2013, Rene Gollent, rene@gollent.com. + * Copyright 2013-2014, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ #ifndef DWARF_UTILS_H @@ -61,6 +61,14 @@ DwarfUtils::GetDIEByPredicate(EntryType* entry, const Predicate& predicate) return entry; } + // try the type unit signature + if (EntryType* signature = dynamic_cast( + entry->SignatureType())) { + entry = signature; + if (predicate(entry)) + return entry; + } + return NULL; }