From d100f5b98d0ab409b8d1866472580421f5d5243e Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 3 Nov 2014 19:31:14 -0500 Subject: [PATCH] Debugger: Handle DW_AT_external for DIEVariable. - This attribute flag indicates if a variable is visible outside of its compilation unit. Needed in order to handle global variable lookups. --- src/apps/debugger/dwarf/DebugInfoEntries.cpp | 9 +++++++++ src/apps/debugger/dwarf/DebugInfoEntries.h | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp b/src/apps/debugger/dwarf/DebugInfoEntries.cpp index 874392063b..64c8eadd96 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp @@ -2307,6 +2307,15 @@ DIEVariable::AddAttribute_start_scope(uint16 attributeName, } +status_t +DIEVariable::AddAttribute_external(uint16 attributeName, + const AttributeValue& value) +{ + fIsExternal = value.flag; + return B_OK; +} + + // #pragma mark - DIEVolatileType diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.h b/src/apps/debugger/dwarf/DebugInfoEntries.h index 76a9855a04..71170e0530 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.h +++ b/src/apps/debugger/dwarf/DebugInfoEntries.h @@ -1449,6 +1449,8 @@ public: uint64 StartScope() const { return fStartScope; } + bool IsExternal() const { return fIsExternal; } + virtual status_t AddAttribute_const_value(uint16 attributeName, const AttributeValue& value); virtual status_t AddAttribute_type(uint16 attributeName, @@ -1461,10 +1463,12 @@ public: virtual status_t AddAttribute_start_scope( uint16 attributeName, const AttributeValue& value); + virtual status_t AddAttribute_external( + uint16 attributeName, + const AttributeValue& value); // TODO: // DW_AT_endianity -// DW_AT_external // DW_AT_segment private: @@ -1474,6 +1478,7 @@ private: DebugInfoEntry* fSpecification; DIEVariable* fAbstractOrigin; uint64 fStartScope; + bool fIsExternal; };