summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-03-30 20:14:35 +0000
committerGreg Clayton <gclayton@apple.com>2016-03-30 20:14:35 +0000
commit2f869fe9d27c3364ba778701c84c4ad964770a1b (patch)
treef4bd768ae884307160544a0887fb23bdc487b324 /lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
parenta3cbf2a738042819bb2d7d4fae048e633d2588d2 (diff)
downloadbcm5719-llvm-2f869fe9d27c3364ba778701c84c4ad964770a1b.tar.gz
bcm5719-llvm-2f869fe9d27c3364ba778701c84c4ad964770a1b.zip
When support for DWO files was added, there were two ways to pass lldb::user_id_t out to the rest of LLDB:
1 - DWARF in .o files with debug map in executable: we would place the compile unit index in the upper 32 bits of the 64 bit value and the lower 32 bits would be the DIE offset 2 - DWO: we would place the compile unit offset in the upper 32 bits of the 64 bit value and the lower 32 bits would be the DIE offset There was a mixing and matching of this and it wasn't done consistently. Major changes include: The DIERef constructor that takes a lldb::user_id_t now requires a SymbolFileDWARF: DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf) It is needed so that it can be decoded correctly. If it is DWARF in .o files with debug map in executable, then we get the right compile unit from the SymbolFileDWARFDebugMap, otherwise, we use the compile unit offset and DIE offset for DWO or normal DWARF. The function: lldb::user_id_t DIERef::GetUID() const; Now becomes lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf) const; Again, we need the DWARF file to encode it correctly. This removes the need for "lldb::user_id_t SymbolFileDWARF::MakeUserID() const" and for bool SymbolFileDWARF::UserIDMatches (lldb::user_id_t uid) const". There were also many places were doing things inneficiently like: 1 - encode a dw_offset_t into a lldb::user_id_t 2 - call the public SymbolFile interface to resolve types using the lldb::user_id_t 3 - This would then decode the lldb::user_id_t into a DIERef, and then try to find that type. There are many places that are now doing this more efficiently by storing DW_AT_type form values as DWARFFormValue objects and then making a DIERef from them and directly calling the underlying function to resolve the lldb_private::Type, lldb_private::CompilerType, lldb_private::CompilerDecl, lldb_private::CompilerDeclContext. If there are any regressions in DWARF with DWO, we will need to fix any issues that arise since the original patch wasn't functional for the much more widely used DWARF in .o files with debug map. <rdar://problem/25200976> llvm-svn: 264909
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
index db37a45ad01..2dcd1d7dc43 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
@@ -58,7 +58,7 @@ public:
//----------------------------------------------------------------------
// Tests
//----------------------------------------------------------------------
- operator bool () const
+ explicit operator bool () const
{
return IsValid();
}
@@ -180,9 +180,11 @@ public:
lldb_private::Type *
ResolveType () const;
+ //----------------------------------------------------------------------
// Resolve a type by UID using this DIE's DWARF file
+ //----------------------------------------------------------------------
lldb_private::Type *
- ResolveTypeUID (lldb::user_id_t uid) const;
+ ResolveTypeUID (const DIERef &die_ref) const;
//----------------------------------------------------------------------
// Functions for obtaining DIE relations and references
@@ -245,6 +247,9 @@ public:
uint64_t
GetAttributeValueAsReference (const dw_attr_t attr, uint64_t fail_value) const;
+ DWARFDIE
+ GetAttributeValueAsReferenceDIE (const dw_attr_t attr) const;
+
uint64_t
GetAttributeValueAsAddress (const dw_attr_t attr, uint64_t fail_value) const;
@@ -270,6 +275,15 @@ public:
void
Dump (lldb_private::Stream *s, const uint32_t recurse_depth) const;
+ lldb_private::CompilerDecl
+ GetDecl () const;
+
+ lldb_private::CompilerDeclContext
+ GetDeclContext() const;
+
+ lldb_private::CompilerDeclContext
+ GetContainingDeclContext() const;
+
protected:
DWARFCompileUnit *m_cu;
DWARFDebugInfoEntry *m_die;
OpenPOWER on IntegriCloud