<div dir="ltr"><div>> <span style="font-size:12.8px">May I revert your change in the mean time if it's gonna take a while to fix?</span></div><div><br></div>> <span style="font-size:12.8px">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.</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Okay, just saw that, never mind. :/</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 30, 2016 at 3:48 PM, Chaoren Lin <span dir="ltr"><<a href="mailto:chaorenl@google.com" target="_blank">chaorenl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Greg, I think this change broke expression evaluation on Linux with split dwarf if the variable is located outside of the main translation unit.<div>Could you please look at this?<div>May I revert your change in the mean time if it's gonna take a while to fix?<div><div><br></div><div><div>$ cat a.c</div><div>int foo();</div><div><br></div><div>int main() {</div><div>        return foo();</div><div>}</div><div>$ cat b.c</div><div>int foo() {</div><div>        int i = 0;</div><div>        return i;</div><div>}</div><div>$ clang a.c b.c -gsplit-dwarf</div><div>$ ./build/bin/lldb a.out -o 'b b.c:3' -o r -o 'p i'</div><div>(lldb) target create "a.out"</div><div>Current executable set to 'a.out' (x86_64).</div><div>(lldb) b b.c:3</div><div>Breakpoint 1: where = a.out`foo + 11 at b.c:3, address = 0x000000000040051b</div><div>(lldb) r</div><div>Process 26993 stopped</div><div>* thread #1: tid = 26993, 0x000000000040051b a.out`foo + 11 at b.c:3, name = 'a.out', stop reason = breakpoint 1.1</div><div>    frame #0: 0x000000000040051b a.out`foo + 11 at b.c:3</div><div>   1    int foo() {</div><div>   2            int i = 0;</div><div>-> 3            return i;</div><div>   4    }</div><div><br></div><div>Process 26993 launched: '/path/to/a.out' (x86_64)</div><div>(lldb) p i</div><div>Segmentation fault (core dumped)</div></div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 30, 2016 at 1:14 PM, Greg Clayton via lldb-commits <span dir="ltr"><<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gclayton<br>
Date: Wed Mar 30 15:14:35 2016<br>
New Revision: 264909<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=264909&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=264909&view=rev</a><br>
Log:<br>
When support for DWO files was added, there were two ways to pass lldb::user_id_t out to the rest of LLDB:<br>
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<br>
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<br>
<br>
There was a mixing and matching of this and it wasn't done consistently.<br>
<br>
Major changes include:<br>
<br>
The DIERef constructor that takes a lldb::user_id_t now requires a SymbolFileDWARF:<br>
<br>
DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf)<br>
<br>
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.<br>
<br>
The function:<br>
<br>
lldb::user_id_t DIERef::GetUID() const;<br>
<br>
Now becomes<br>
<br>
lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf) const;<br>
<br>
Again, we need the DWARF file to encode it correctly.<br>
<br>
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:<br>
<br>
1 - encode a dw_offset_t into a lldb::user_id_t<br>
2 - call the public SymbolFile interface to resolve types using the lldb::user_id_t<br>
3 - This would then decode the lldb::user_id_t into a DIERef, and then try to find that type.<br>
<br>
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.<br>
<br>
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.<br>
<br>
<rdar://problem/25200976><br>
<br>
<br>
Modified:<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp Wed Mar 30 15:14:35 2016<br>
@@ -10,26 +10,49 @@<br>
 #include "DIERef.h"<br>
 #include "DWARFCompileUnit.h"<br>
 #include "DWARFFormValue.h"<br>
+#include "DWARFDebugInfo.h"<br>
+#include "SymbolFileDWARF.h"<br>
+#include "SymbolFileDWARFDebugMap.h"<br>
<br>
 DIERef::DIERef() :<br>
     cu_offset(DW_INVALID_OFFSET),<br>
     die_offset(DW_INVALID_OFFSET)<br>
 {}<br>
<br>
-DIERef::DIERef(dw_offset_t d) :<br>
-    cu_offset(DW_INVALID_OFFSET),<br>
-    die_offset(d)<br>
-{}<br>
-<br>
 DIERef::DIERef(dw_offset_t c, dw_offset_t d) :<br>
     cu_offset(c),<br>
     die_offset(d)<br>
 {}<br>
<br>
-DIERef::DIERef(lldb::user_id_t uid) :<br>
-    cu_offset(uid>>32),<br>
+DIERef::DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf) :<br>
+    cu_offset(DW_INVALID_OFFSET),<br>
     die_offset(uid&0xffffffff)<br>
-{}<br>
+{<br>
+    SymbolFileDWARFDebugMap *debug_map = dwarf->GetDebugMapSymfile();<br>
+    if (debug_map)<br>
+    {<br>
+        const uint32_t oso_idx = debug_map->GetOSOIndexFromUserID(uid);<br>
+        SymbolFileDWARF *actual_dwarf = debug_map->GetSymbolFileByOSOIndex(oso_idx);<br>
+        if (actual_dwarf)<br>
+        {<br>
+            DWARFDebugInfo *debug_info = actual_dwarf->DebugInfo();<br>
+            if (debug_info)<br>
+            {<br>
+                DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitContainingDIEOffset(die_offset);<br>
+                if (dwarf_cu)<br>
+                {<br>
+                    cu_offset = dwarf_cu->GetOffset();<br>
+                    return;<br>
+                }<br>
+            }<br>
+        }<br>
+        die_offset = DW_INVALID_OFFSET;<br>
+    }<br>
+    else<br>
+    {<br>
+        cu_offset = uid>>32;<br>
+    }<br>
+}<br>
<br>
 DIERef::DIERef(const DWARFFormValue& form_value) :<br>
     cu_offset(DW_INVALID_OFFSET),<br>
@@ -50,7 +73,19 @@ DIERef::DIERef(const DWARFFormValue& for<br>
 }<br>
<br>
 lldb::user_id_t<br>
-DIERef::GetUID() const<br>
+DIERef::GetUID(SymbolFileDWARF *dwarf) const<br>
 {<br>
-    return ((lldb::user_id_t)cu_offset) << 32 | die_offset;<br>
+    //----------------------------------------------------------------------<br>
+    // Each SymbolFileDWARF will set its ID to what is expected.<br>
+    //<br>
+    // SymbolFileDWARF, when used for DWARF with .o files on MacOSX, has the<br>
+    // ID set to the compile unit index.<br>
+    //<br>
+    // SymbolFileDWARFDwo sets the ID to the compile unit offset.<br>
+    //----------------------------------------------------------------------<br>
+    if (dwarf)<br>
+        return dwarf->GetID() | die_offset;<br>
+    else<br>
+        return LLDB_INVALID_UID;<br>
 }<br>
+<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h Wed Mar 30 15:14:35 2016<br>
@@ -14,24 +14,34 @@<br>
 #include "lldb/lldb-defines.h"<br>
<br>
 class DWARFFormValue;<br>
+class SymbolFileDWARF;<br>
<br>
 struct DIERef<br>
 {<br>
     DIERef();<br>
<br>
-    explicit<br>
-    DIERef(dw_offset_t d);<br>
-<br>
     DIERef(dw_offset_t c, dw_offset_t d);<br>
<br>
+    //----------------------------------------------------------------------<br>
+    // In order to properly decode a lldb::user_id_t back into a DIERef we<br>
+    // need the DWARF file since it knows if DWARF in .o files is being used<br>
+    // (MacOSX) or if DWO files are being used. The encoding of the user ID<br>
+    // differs between the two types of DWARF.<br>
+    //----------------------------------------------------------------------<br>
     explicit<br>
-    DIERef(lldb::user_id_t uid);<br>
+    DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf);<br>
<br>
     explicit<br>
     DIERef(const DWARFFormValue& form_value);<br>
<br>
+    //----------------------------------------------------------------------<br>
+    // In order to properly encode a DIERef unto a lldb::user_id_t we need<br>
+    // the DWARF file since it knows if DWARF in .o files is being used<br>
+    // (MacOSX) or if DWO files are being used. The encoding of the user ID<br>
+    // differs between the two types of DWARF.<br>
+    //----------------------------------------------------------------------<br>
     lldb::user_id_t<br>
-    GetUID() const;<br>
+    GetUID(SymbolFileDWARF *dwarf) const;<br>
<br>
     bool<br>
     operator< (const DIERef &ref) const<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Wed Mar 30 15:14:35 2016<br>
@@ -293,7 +293,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
<br>
                     const size_t num_attributes = die.GetAttributes (attributes);<br>
                     uint32_t encoding = 0;<br>
-                    lldb::user_id_t encoding_uid = LLDB_INVALID_UID;<br>
+                    DWARFFormValue encoding_uid;<br>
<br>
                     if (num_attributes > 0)<br>
                     {<br>
@@ -323,7 +323,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                         break;<br>
                                     case DW_AT_byte_size:   byte_size = form_value.Unsigned(); break;<br>
                                     case DW_AT_encoding:    encoding = form_value.Unsigned(); break;<br>
-                                    case DW_AT_type:        encoding_uid = DIERef(form_value).GetUID(); break;<br>
+                                    case DW_AT_type:        encoding_uid = form_value; break;<br>
                                     default:<br>
                                     case DW_AT_sibling:<br>
                                         break;<br>
@@ -332,7 +332,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                         }<br>
                     }<br>
<br>
-                    DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8lx\n", die.GetID(), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid);<br>
+                    DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8lx\n", die.GetID(), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid.Reference());<br>
<br>
                     switch (tag)<br>
                     {<br>
@@ -388,7 +388,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                                                                          die.GetName());<br>
                                     clang_type = m_ast.GetBasicType(eBasicTypeObjCID);<br>
                                     encoding_data_type = Type::eEncodingIsUID;<br>
-                                    encoding_uid = LLDB_INVALID_UID;<br>
+                                    encoding_uid.Clear();<br>
                                     resolve_state = Type::eResolveStateFull;<br>
<br>
                                 }<br>
@@ -402,7 +402,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                                                                          die.GetName());<br>
                                     clang_type = m_ast.GetBasicType(eBasicTypeObjCClass);<br>
                                     encoding_data_type = Type::eEncodingIsUID;<br>
-                                    encoding_uid = LLDB_INVALID_UID;<br>
+                                    encoding_uid.Clear();<br>
                                     resolve_state = Type::eResolveStateFull;<br>
                                 }<br>
                                 else if (type_name_const_str == g_objc_type_name_selector)<br>
@@ -415,15 +415,15 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                                                                          die.GetName());<br>
                                     clang_type = m_ast.GetBasicType(eBasicTypeObjCSel);<br>
                                     encoding_data_type = Type::eEncodingIsUID;<br>
-                                    encoding_uid = LLDB_INVALID_UID;<br>
+                                    encoding_uid.Clear();<br>
                                     resolve_state = Type::eResolveStateFull;<br>
                                 }<br>
                             }<br>
-                            else if (encoding_data_type == Type::eEncodingIsPointerUID && encoding_uid != LLDB_INVALID_UID)<br>
+                            else if (encoding_data_type == Type::eEncodingIsPointerUID && encoding_uid.IsValid())<br>
                             {<br>
                                 // Clang sometimes erroneously emits id as objc_object*.  In that case we fix up the type to "id".<br>
<br>
-                                const DWARFDIE encoding_die = die.GetDIE(encoding_uid);<br>
+                                const DWARFDIE encoding_die = dwarf->GetDIE(DIERef(encoding_uid));<br>
<br>
                                 if (encoding_die && encoding_die.Tag() == DW_TAG_structure_type)<br>
                                 {<br>
@@ -439,7 +439,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                                                                                  die.GetName());<br>
                                             clang_type = m_ast.GetBasicType(eBasicTypeObjCID);<br>
                                             encoding_data_type = Type::eEncodingIsUID;<br>
-                                            encoding_uid = LLDB_INVALID_UID;<br>
+                                            encoding_uid.Clear();<br>
                                             resolve_state = Type::eResolveStateFull;<br>
                                         }<br>
                                     }<br>
@@ -453,7 +453,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                              type_name_const_str,<br>
                                              byte_size,<br>
                                              NULL,<br>
-                                             encoding_uid,<br>
+                                             DIERef(encoding_uid).GetUID(dwarf),<br>
                                              encoding_data_type,<br>
                                              &decl,<br>
                                              clang_type,<br>
@@ -732,7 +732,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                             // a complete type for this die<br>
                             dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();<br>
                             clang::DeclContext *defn_decl_ctx = GetCachedClangDeclContextForDIE(<br>
-                                dwarf->DebugInfo()->GetDIE(DIERef(type_sp->GetID())));<br>
+                                dwarf->DebugInfo()->GetDIE(DIERef(type_sp->GetID(), dwarf)));<br>
                             if (defn_decl_ctx)<br>
                                 LinkDeclContextToDIE(defn_decl_ctx, die);<br>
                             return type_sp;<br>
@@ -895,8 +895,6 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                    "Type already in the forward declaration map!");<br>
                             // Can't assume m_ast.GetSymbolFile() is actually a SymbolFileDWARF, it can be a<br>
                             // SymbolFileDWARFDebugMap for Apple binaries.<br>
-                            //assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) &&<br>
-                            //       "Adding incorrect type to forward declaration map");<br>
                             dwarf->GetForwardDeclDieToClangType()[die.GetDIE()] = clang_type.GetOpaqueQualType();<br>
                             dwarf->GetForwardDeclClangTypeToDie()[ClangUtil::RemoveFastQualifiers(clang_type)<br>
                                                                       .GetOpaqueQualType()] = die.GetDIERef();<br>
@@ -992,8 +990,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                 // so lets use it and cache the fact that we found<br>
                                 // a complete type for this die<br>
                                 dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();<br>
-                                clang::DeclContext *defn_decl_ctx = GetCachedClangDeclContextForDIE(<br>
-                                                                                                    dwarf->DebugInfo()->GetDIE(DIERef(type_sp->GetID())));<br>
+                                clang::DeclContext *defn_decl_ctx = GetCachedClangDeclContextForDIE(dwarf->DebugInfo()->GetDIE(DIERef(type_sp->GetID(), dwarf)));<br>
                                 if (defn_decl_ctx)<br>
                                     LinkDeclContextToDIE(defn_decl_ctx, die);<br>
                                 return type_sp;<br>
@@ -1008,7 +1005,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                         {<br>
                             if (encoding_form.IsValid())<br>
                             {<br>
-                                Type *enumerator_type = dwarf->ResolveTypeUID(DIERef(encoding_form).GetUID());<br>
+                                Type *enumerator_type = dwarf->ResolveTypeUID(DIERef(encoding_form));<br>
                                 if (enumerator_type)<br>
                                     enumerator_clang_type = enumerator_type->GetFullCompilerType ();<br>
                             }<br>
@@ -1035,7 +1032,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                                  type_name_const_str,<br>
                                                  byte_size,<br>
                                                  NULL,<br>
-                                                 DIERef(encoding_form).GetUID(),<br>
+                                                 DIERef(encoding_form).GetUID(dwarf),<br>
                                                  Type::eEncodingIsUID,<br>
                                                  &decl,<br>
                                                  clang_type,<br>
@@ -1176,7 +1173,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                     Type *func_type = NULL;<br>
<br>
                     if (type_die_form.IsValid())<br>
-                        func_type = dwarf->ResolveTypeUID(DIERef(type_die_form).GetUID());<br>
+                        func_type = dwarf->ResolveTypeUID(DIERef(type_die_form));<br>
<br>
                     if (func_type)<br>
                         return_clang_type = func_type->GetForwardCompilerType ();<br>
@@ -1311,12 +1308,12 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                         if (debug_map_symfile)<br>
                                         {<br>
                                             class_symfile = debug_map_symfile->GetSymbolFileByOSOIndex(SymbolFileDWARFDebugMap::GetOSOIndexFromUserID(class_type->GetID()));<br>
-                                            class_type_die = class_symfile->DebugInfo()->GetDIE (DIERef(class_type->GetID()));<br>
+                                            class_type_die = class_symfile->DebugInfo()->GetDIE (DIERef(class_type->GetID(), dwarf));<br>
                                         }<br>
                                         else<br>
                                         {<br>
                                             class_symfile = dwarf;<br>
-                                            class_type_die = dwarf->DebugInfo()->GetDIE (DIERef(class_type->GetID()));<br>
+                                            class_type_die = dwarf->DebugInfo()->GetDIE (DIERef(class_type->GetID(), dwarf));<br>
                                         }<br>
                                         if (class_type_die)<br>
                                         {<br>
@@ -1659,7 +1656,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
<br>
                         DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", die.GetID(), DW_TAG_value_to_name(tag), type_name_cstr);<br>
<br>
-                        Type *element_type = dwarf->ResolveTypeUID(DIERef(type_die_form).GetUID());<br>
+                        Type *element_type = dwarf->ResolveTypeUID(DIERef(type_die_form));<br>
<br>
                         if (element_type)<br>
                         {<br>
@@ -1696,7 +1693,7 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                                                      empty_name,<br>
                                                      array_element_bit_stride / 8,<br>
                                                      NULL,<br>
-                                                     DIERef(type_die_form).GetUID(),<br>
+                                                     DIERef(type_die_form).GetUID(dwarf),<br>
                                                      Type::eEncodingIsUID,<br>
                                                      &decl,<br>
                                                      clang_type,<br>
@@ -1731,8 +1728,8 @@ DWARFASTParserClang::ParseTypeFromDWARF<br>
                             }<br>
                         }<br>
<br>
-                        Type *pointee_type = dwarf->ResolveTypeUID(DIERef(type_die_form).GetUID());<br>
-                        Type *class_type = dwarf->ResolveTypeUID(DIERef(containing_type_die_form).GetUID());<br>
+                        Type *pointee_type = dwarf->ResolveTypeUID(DIERef(type_die_form));<br>
+                        Type *class_type = dwarf->ResolveTypeUID(DIERef(containing_type_die_form));<br>
<br>
                         CompilerType pointee_clang_type = pointee_type->GetForwardCompilerType ();<br>
                         CompilerType class_clang_type = class_type->GetLayoutCompilerType ();<br>
@@ -1902,7 +1899,7 @@ DWARFASTParserClang::ParseTemplateDIE (c<br>
                         case DW_AT_type:<br>
                             if (attributes.ExtractFormValueAtIndex(i, form_value))<br>
                             {<br>
-                                lldb_type = die.ResolveTypeUID(DIERef(form_value).GetUID());<br>
+                                lldb_type = die.ResolveTypeUID(DIERef(form_value));<br>
                                 if (lldb_type)<br>
                                     clang_type = lldb_type->GetForwardCompilerType ();<br>
                             }<br>
@@ -2803,7 +2800,7 @@ DWARFASTParserClang::ParseChildMembers(c<br>
                     // Handle static members<br>
                     if (is_external && member_byte_offset == UINT32_MAX)<br>
                     {<br>
-                        Type *var_type = die.ResolveTypeUID(DIERef(encoding_form).GetUID());<br>
+                        Type *var_type = die.ResolveTypeUID(DIERef(encoding_form));<br>
<br>
                         if (var_type)<br>
                         {<br>
@@ -2819,7 +2816,7 @@ DWARFASTParserClang::ParseChildMembers(c<br>
<br>
                     if (is_artificial == false)<br>
                     {<br>
-                        Type *member_type = die.ResolveTypeUID(DIERef(encoding_form).GetUID());<br>
+                        Type *member_type = die.ResolveTypeUID(DIERef(encoding_form));<br>
<br>
                         clang::FieldDecl *field_decl = NULL;<br>
                         if (tag == DW_TAG_member)<br>
@@ -3146,7 +3143,7 @@ DWARFASTParserClang::ParseChildMembers(c<br>
                         }<br>
                     }<br>
<br>
-                    Type *base_class_type = die.ResolveTypeUID(DIERef(encoding_form).GetUID());<br>
+                    Type *base_class_type = die.ResolveTypeUID(DIERef(encoding_form));<br>
                     if (base_class_type == NULL)<br>
                     {<br>
                         module_sp->ReportError("0x%8.8x: DW_TAG_inheritance failed to resolve the base class at 0x%8.8" PRIx64 " from enclosing type 0x%8.8x. \nPlease file a bug and attach the file at the start of this error message",<br>
@@ -3292,7 +3289,7 @@ DWARFASTParserClang::ParseChildParameter<br>
                                     // being in the formal parameter DIE...<br>
                                     if (name == NULL || ::strcmp(name, "this")==0)<br>
                                     {<br>
-                                        Type *this_type = die.ResolveTypeUID (DIERef(param_type_die_form).GetUID());<br>
+                                        Type *this_type = die.ResolveTypeUID (DIERef(param_type_die_form));<br>
                                         if (this_type)<br>
                                         {<br>
                                             uint32_t encoding_mask = this_type->GetEncodingMask();<br>
@@ -3335,7 +3332,7 @@ DWARFASTParserClang::ParseChildParameter<br>
<br>
                     if (!skip)<br>
                     {<br>
-                        Type *type = die.ResolveTypeUID(DIERef(param_type_die_form).GetUID());<br>
+                        Type *type = die.ResolveTypeUID(DIERef(param_type_die_form));<br>
                         if (type)<br>
                         {<br>
                             function_param_types.push_back (type->GetForwardCompilerType ());<br>
@@ -3482,7 +3479,7 @@ DWARFASTParserClang::GetTypeForDIE (cons<br>
                 DWARFFormValue form_value;<br>
<br>
                 if (attr == DW_AT_type && attributes.ExtractFormValueAtIndex(i, form_value))<br>
-                    return dwarf->ResolveTypeUID(DIERef(form_value).GetUID());<br>
+                    return dwarf->ResolveTypeUID(dwarf->GetDIE (DIERef(form_value)), true);<br>
             }<br>
         }<br>
     }<br>
@@ -3538,11 +3535,10 @@ DWARFASTParserClang::GetClangDeclForDIE<br>
         case DW_TAG_imported_declaration:<br>
         {<br>
             SymbolFileDWARF *dwarf = die.GetDWARF();<br>
-            lldb::user_id_t imported_uid = die.GetAttributeValueAsReference(DW_AT_import, DW_INVALID_OFFSET);<br>
-<br>
-            if (dwarf->UserIDMatches(imported_uid))<br>
+            DWARFDIE imported_uid = die.GetAttributeValueAsReferenceDIE(DW_AT_import);<br>
+            if (imported_uid)<br>
             {<br>
-                CompilerDecl imported_decl = dwarf->GetDeclForUID(imported_uid);<br>
+                CompilerDecl imported_decl = imported_uid.GetDecl();<br>
                 if (imported_decl)<br>
                 {<br>
                     clang::DeclContext *decl_context = ClangASTContext::DeclContextGetAsDeclContext(dwarf->GetDeclContextContainingUID(die.GetID()));<br>
@@ -3555,15 +3551,15 @@ DWARFASTParserClang::GetClangDeclForDIE<br>
         case DW_TAG_imported_module:<br>
         {<br>
             SymbolFileDWARF *dwarf = die.GetDWARF();<br>
-            lldb::user_id_t imported_uid = die.GetAttributeValueAsReference(DW_AT_import, DW_INVALID_OFFSET);<br>
+            DWARFDIE imported_uid = die.GetAttributeValueAsReferenceDIE(DW_AT_import);<br>
<br>
-            if (dwarf->UserIDMatches(imported_uid))<br>
+            if (imported_uid)<br>
             {<br>
-                CompilerDeclContext imported_decl = dwarf->GetDeclContextForUID(imported_uid);<br>
-                if (imported_decl)<br>
+                CompilerDeclContext imported_decl_ctx = imported_uid.GetDeclContext();<br>
+                if (imported_decl_ctx)<br>
                 {<br>
                     clang::DeclContext *decl_context = ClangASTContext::DeclContextGetAsDeclContext(dwarf->GetDeclContextContainingUID(die.GetID()));<br>
-                    if (clang::NamespaceDecl *ns_decl = ClangASTContext::DeclContextGetAsNamespaceDecl(imported_decl))<br>
+                    if (clang::NamespaceDecl *ns_decl = ClangASTContext::DeclContextGetAsNamespaceDecl(imported_decl_ctx))<br>
                         decl = m_ast.CreateUsingDirectiveDeclaration(decl_context, ns_decl);<br>
                 }<br>
             }<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp Wed Mar 30 15:14:35 2016<br>
@@ -144,7 +144,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                         }<br>
                     }<br>
<br>
-                    DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8lx\n", dwarf->MakeUserID(die.GetOffset()),<br>
+                    DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8lx\n", die.GetID(),<br>
                                  DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid);<br>
<br>
                     switch (tag)<br>
@@ -183,7 +183,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                             break;<br>
                     }<br>
<br>
-                    type_sp.reset(new Type(dwarf->MakeUserID(die.GetOffset()), dwarf, type_name_const_str, byte_size,<br>
+                    type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str, byte_size,<br>
                                            NULL, encoding_uid, encoding_data_type, &decl, compiler_type, resolve_state));<br>
<br>
                     dwarf->m_die_to_type[die.GetDIE()] = type_sp.get();<br>
@@ -254,7 +254,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                         }<br>
                     }<br>
<br>
-                    DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", dwarf->MakeUserID(die.GetOffset()),<br>
+                    DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", die.GetID(),<br>
                                  DW_TAG_value_to_name(tag), type_name_cstr);<br>
<br>
                     bool compiler_type_was_created = false;<br>
@@ -265,7 +265,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                         compiler_type = m_ast.CreateStructType(go_kind, type_name_const_str, byte_size);<br>
                     }<br>
<br>
-                    type_sp.reset(new Type(dwarf->MakeUserID(die.GetOffset()), dwarf, type_name_const_str, byte_size,<br>
+                    type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str, byte_size,<br>
                                            NULL, LLDB_INVALID_UID, Type::eEncodingIsUID, &decl, compiler_type,<br>
                                            Type::eResolveStateForward));<br>
<br>
@@ -347,7 +347,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                         }<br>
                     }<br>
<br>
-                    DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", dwarf->MakeUserID(die.GetOffset()),<br>
+                    DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", die.GetID(),<br>
                                  DW_TAG_value_to_name(tag), type_name_cstr);<br>
<br>
                     std::vector<CompilerType> function_param_types;<br>
@@ -363,7 +363,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                     compiler_type = m_ast.CreateFunctionType(type_name_const_str, function_param_types.data(),<br>
                                                           function_param_types.size(), is_variadic);<br>
<br>
-                    type_sp.reset(new Type(dwarf->MakeUserID(die.GetOffset()), dwarf, type_name_const_str, 0, NULL,<br>
+                    type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str, 0, NULL,<br>
                                            LLDB_INVALID_UID, Type::eEncodingIsUID, &decl, compiler_type,<br>
                                            Type::eResolveStateFull));<br>
                     assert(type_sp.get());<br>
@@ -410,7 +410,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                             }<br>
                         }<br>
<br>
-                        DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", dwarf->MakeUserID(die.GetOffset()),<br>
+                        DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", die.GetID(),<br>
                                      DW_TAG_value_to_name(tag), type_name_cstr);<br>
<br>
                         Type *element_type = dwarf->ResolveTypeUID(type_die_offset);<br>
@@ -433,7 +433,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                             {<br>
                                 compiler_type = m_ast.CreateArrayType(type_name_const_str, array_element_type, 0);<br>
                             }<br>
-                            type_sp.reset(new Type(dwarf->MakeUserID(die.GetOffset()), dwarf, type_name_const_str,<br>
+                            type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str,<br>
                                                    byte_stride, NULL, type_die_offset, Type::eEncodingIsUID, &decl,<br>
                                                    compiler_type, Type::eResolveStateFull));<br>
                             type_sp->SetEncodingType(element_type);<br>
@@ -463,7 +463,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
                 else if (sc.function != NULL && sc_parent_die)<br>
                 {<br>
                     symbol_context_scope =<br>
-                        sc.function->GetBlock(true).FindBlockByID(dwarf->MakeUserID(sc_parent_die.GetOffset()));<br>
+                        sc.function->GetBlock(true).FindBlockByID(sc_parent_die.GetID());<br>
                     if (symbol_context_scope == NULL)<br>
                         symbol_context_scope = sc.function;<br>
                 }<br>
@@ -510,7 +510,7 @@ DWARFASTParserGo::ParseChildParameters(c<br>
                 if (num_attributes > 0)<br>
                 {<br>
                     Declaration decl;<br>
-                    dw_offset_t param_type_die_offset = DW_INVALID_OFFSET;<br>
+                    DWARFFormValue param_type_die_offset;<br>
<br>
                     uint32_t i;<br>
                     for (i = 0; i < num_attributes; ++i)<br>
@@ -525,7 +525,7 @@ DWARFASTParserGo::ParseChildParameters(c<br>
                                     // = form_value.AsCString();<br>
                                     break;<br>
                                 case DW_AT_type:<br>
-                                    param_type_die_offset = form_value.Reference();<br>
+                                    param_type_die_offset = form_value;<br>
                                     break;<br>
                                 case DW_AT_location:<br>
                                 //                          if (form_value.BlockData())<br>
@@ -547,7 +547,7 @@ DWARFASTParserGo::ParseChildParameters(c<br>
                         }<br>
                     }<br>
<br>
-                    Type *type = parent_die.ResolveTypeUID(param_type_die_offset);<br>
+                    Type *type = parent_die.ResolveTypeUID(DIERef(param_type_die_offset));<br>
                     if (type)<br>
                     {<br>
                         function_param_types.push_back(type->GetForwardCompilerType());<br>
@@ -628,7 +628,7 @@ DWARFASTParserGo::CompleteTypeFromDWARF(<br>
     Log *log = nullptr; // (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO|DWARF_LOG_TYPE_COMPLETION));<br>
     if (log)<br>
         dwarf->GetObjectFile()->GetModule()->LogMessageVerboseBacktrace(<br>
-            log, "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...", dwarf->MakeUserID(die.GetOffset()),<br>
+            log, "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...", die.GetID(),<br>
             DW_TAG_value_to_name(tag), type->GetName().AsCString());<br>
     assert(compiler_type);<br>
     DWARFAttributes attributes;<br>
@@ -683,7 +683,7 @@ DWARFASTParserGo::ParseChildMembers(cons<br>
                     Declaration decl;<br>
                     const char *name = NULL;<br>
<br>
-                    lldb::user_id_t encoding_uid = LLDB_INVALID_UID;<br>
+                    DWARFFormValue encoding_uid;<br>
                     uint32_t member_byte_offset = UINT32_MAX;<br>
                     uint32_t i;<br>
                     for (i = 0; i < num_attributes; ++i)<br>
@@ -698,7 +698,7 @@ DWARFASTParserGo::ParseChildMembers(cons<br>
                                     name = form_value.AsCString();<br>
                                     break;<br>
                                 case DW_AT_type:<br>
-                                    encoding_uid = form_value.Reference();<br>
+                                    encoding_uid = form_value;<br>
                                     break;<br>
                                 case DW_AT_data_member_location:<br>
                                     if (form_value.BlockData())<br>
@@ -735,7 +735,7 @@ DWARFASTParserGo::ParseChildMembers(cons<br>
                         }<br>
                     }<br>
<br>
-                    Type *member_type = die.ResolveTypeUID(encoding_uid);<br>
+                    Type *member_type = die.ResolveTypeUID(DIERef(encoding_uid));<br>
                     if (member_type)<br>
                     {<br>
                         CompilerType member_go_type = member_type->GetFullCompilerType();<br>
@@ -808,10 +808,12 @@ DWARFASTParserGo::ParseFunctionFromDWARF<br>
<br>
             if (dwarf->FixupAddress(func_range.GetBaseAddress()))<br>
             {<br>
-                const user_id_t func_user_id = dwarf->MakeUserID(die.GetOffset());<br>
+                const user_id_t func_user_id = die.GetID();<br>
                 func_sp.reset(new Function(sc.comp_unit,<br>
-                                           dwarf->MakeUserID(func_user_id), // UserID is the DIE offset<br>
-                                           dwarf->MakeUserID(func_user_id), func_name, func_type,<br>
+                                           func_user_id, // UserID is the DIE offset<br>
+                                           func_user_id,<br>
+                                           func_name,<br>
+                                           func_type,<br>
                                            func_range)); // first address range<br>
<br>
                 if (func_sp.get() != NULL)<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp Wed Mar 30 15:14:35 2016<br>
@@ -77,7 +77,7 @@ DWARFASTParserJava::ParseArrayTypeFromDI<br>
     dwarf->m_die_to_type[die.GetDIE()] = DIE_IS_BEING_PARSED;<br>
<br>
     ConstString linkage_name;<br>
-    lldb::user_id_t type_die_offset = DW_INVALID_OFFSET;<br>
+    DWARFFormValue type_attr_value;<br>
     lldb::addr_t data_offset = LLDB_INVALID_ADDRESS;<br>
     DWARFExpression length_expression(die.GetCU());<br>
<br>
@@ -95,7 +95,7 @@ DWARFASTParserJava::ParseArrayTypeFromDI<br>
                     linkage_name.SetCString(form_value.AsCString());<br>
                     break;<br>
                 case DW_AT_type:<br>
-                    type_die_offset = form_value.Reference();<br>
+                    type_attr_value = form_value;<br>
                     break;<br>
                 case DW_AT_data_member_location:<br>
                     data_offset = form_value.Unsigned();<br>
@@ -140,7 +140,8 @@ DWARFASTParserJava::ParseArrayTypeFromDI<br>
         }<br>
     }<br>
<br>
-    Type *element_type = dwarf->ResolveTypeUID(type_die_offset);<br>
+    DIERef type_die_ref(type_attr_value);<br>
+    Type *element_type = dwarf->ResolveTypeUID(type_die_ref);<br>
     if (!element_type)<br>
         return nullptr;<br>
<br>
@@ -150,7 +151,7 @@ DWARFASTParserJava::ParseArrayTypeFromDI<br>
<br>
     Declaration decl;<br>
     TypeSP type_sp(new Type(die.GetID(), dwarf, array_compiler_type.GetTypeName(), -1, nullptr,<br>
-                            dwarf->MakeUserID(type_die_offset), Type::eEncodingIsUID, &decl,<br>
+                            type_die_ref.GetUID(dwarf), Type::eEncodingIsUID, &decl,<br>
                             array_compiler_type, Type::eResolveStateFull));<br>
     type_sp->SetEncodingType(element_type);<br>
     return type_sp;<br>
@@ -163,7 +164,7 @@ DWARFASTParserJava::ParseReferenceTypeFr<br>
     dwarf->m_die_to_type[die.GetDIE()] = DIE_IS_BEING_PARSED;<br>
<br>
     Declaration decl;<br>
-    lldb::user_id_t type_die_offset = DW_INVALID_OFFSET;<br>
+    DWARFFormValue type_attr_value;<br>
<br>
     DWARFAttributes attributes;<br>
     const size_t num_attributes = die.GetAttributes(attributes);<br>
@@ -176,7 +177,7 @@ DWARFASTParserJava::ParseReferenceTypeFr<br>
             switch (attr)<br>
             {<br>
                 case DW_AT_type:<br>
-                    type_die_offset = form_value.Reference();<br>
+                    type_attr_value = form_value;<br>
                     break;<br>
                 default:<br>
                     assert(false && "Unsupported attribute for DW_TAG_array_type");<br>
@@ -184,14 +185,15 @@ DWARFASTParserJava::ParseReferenceTypeFr<br>
         }<br>
     }<br>
<br>
-    Type *pointee_type = dwarf->ResolveTypeUID(type_die_offset);<br>
+    DIERef type_die_ref(type_attr_value);<br>
+    Type *pointee_type = dwarf->ResolveTypeUID(type_die_ref);<br>
     if (!pointee_type)<br>
         return nullptr;<br>
<br>
     CompilerType pointee_compiler_type = pointee_type->GetForwardCompilerType();<br>
     CompilerType reference_compiler_type = m_ast.CreateReferenceType(pointee_compiler_type);<br>
     TypeSP type_sp(new Type(die.GetID(), dwarf, reference_compiler_type.GetTypeName(), -1, nullptr,<br>
-                            dwarf->MakeUserID(type_die_offset), Type::eEncodingIsUID, &decl,<br>
+                            type_die_ref.GetUID(dwarf), Type::eEncodingIsUID, &decl,<br>
                             reference_compiler_type, Type::eResolveStateFull));<br>
     type_sp->SetEncodingType(pointee_type);<br>
     return type_sp;<br>
@@ -463,7 +465,7 @@ DWARFASTParserJava::ParseChildMembers(co<br>
             case DW_TAG_member:<br>
             {<br>
                 const char *name = nullptr;<br>
-                lldb::user_id_t encoding_uid = LLDB_INVALID_UID;<br>
+                DWARFFormValue encoding_uid;<br>
                 uint32_t member_byte_offset = UINT32_MAX;<br>
                 DWARFExpression member_location_expression(dwarf_cu);<br>
                 bool artificial = true;<br>
@@ -481,7 +483,7 @@ DWARFASTParserJava::ParseChildMembers(co<br>
                                 name = form_value.AsCString();<br>
                                 break;<br>
                             case DW_AT_type:<br>
-                                encoding_uid = form_value.Reference();<br>
+                                encoding_uid = form_value;<br>
                                 break;<br>
                             case DW_AT_data_member_location:<br>
                                 if (form_value.BlockData())<br>
@@ -508,7 +510,7 @@ DWARFASTParserJava::ParseChildMembers(co<br>
                     m_ast.SetDynamicTypeId(compiler_type, member_location_expression);<br>
                 else<br>
                 {<br>
-                    if (Type *member_type = die.ResolveTypeUID(encoding_uid))<br>
+                    if (Type *member_type = die.ResolveTypeUID(DIERef(encoding_uid)))<br>
                         m_ast.AddMemberToObject(compiler_type, ConstString(name), member_type->GetFullCompilerType(),<br>
                                                 member_byte_offset);<br>
                 }<br>
@@ -516,7 +518,7 @@ DWARFASTParserJava::ParseChildMembers(co<br>
             }<br>
             case DW_TAG_inheritance:<br>
             {<br>
-                lldb::user_id_t encoding_uid = LLDB_INVALID_UID;<br>
+                DWARFFormValue encoding_uid;<br>
                 uint32_t member_byte_offset = UINT32_MAX;<br>
<br>
                 DWARFAttributes attributes;<br>
@@ -529,7 +531,7 @@ DWARFASTParserJava::ParseChildMembers(co<br>
                         switch (attributes.AttributeAtIndex(i))<br>
                         {<br>
                             case DW_AT_type:<br>
-                                encoding_uid = form_value.Reference();<br>
+                                encoding_uid = form_value;<br>
                                 break;<br>
                             case DW_AT_data_member_location:<br>
                                 member_byte_offset = form_value.Unsigned();<br>
@@ -543,7 +545,7 @@ DWARFASTParserJava::ParseChildMembers(co<br>
                         }<br>
                     }<br>
                 }<br>
-                if (Type *base_type = die.ResolveTypeUID(encoding_uid))<br>
+                if (Type *base_type = die.ResolveTypeUID(DIERef(encoding_uid)))<br>
                     m_ast.AddBaseClassToObject(compiler_type, base_type->GetFullCompilerType(), member_byte_offset);<br>
                 break;<br>
             }<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Wed Mar 30 15:14:35 2016<br>
@@ -433,7 +433,7 @@ DWARFCompileUnit::GetID () const<br>
 {<br>
     dw_offset_t local_id = m_base_obj_offset != DW_INVALID_OFFSET ? m_base_obj_offset : m_offset;<br>
     if (m_dwarf2Data)<br>
-        return m_dwarf2Data->MakeUserID(local_id);<br>
+        return DIERef(local_id, local_id).GetUID(m_dwarf2Data);<br>
     else<br>
         return local_id;<br>
 }<br>
@@ -631,7 +631,7 @@ DWARFCompileUnit::GetDIE (dw_offset_t di<br>
         {<br>
             // Don't specify the compile unit offset as we don't know it because the DIE belongs to<br>
             // a different compile unit in the same symbol file.<br>
-            return m_dwarf2Data->DebugInfo()->GetDIE (DIERef(die_offset));<br>
+            return m_dwarf2Data->DebugInfo()->GetDIEForDIEOffset(die_offset);<br>
         }<br>
     }<br>
     return DWARFDIE(); // Not found<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp Wed Mar 30 15:14:35 2016<br>
@@ -9,6 +9,7 @@<br>
<br>
 #include "DWARFDIE.h"<br>
<br>
+#include "DWARFASTParser.h"<br>
 #include "DWARFCompileUnit.h"<br>
 #include "DWARFDebugAbbrev.h"<br>
 #include "DWARFDebugAranges.h"<br>
@@ -127,6 +128,21 @@ DWARFDIE::GetAttributeValueAsSigned (con<br>
         return fail_value;<br>
 }<br>
<br>
+DWARFDIE<br>
+DWARFDIE::GetAttributeValueAsReferenceDIE (const dw_attr_t attr) const<br>
+{<br>
+    if (IsValid())<br>
+    {<br>
+        DWARFCompileUnit *cu = GetCU();<br>
+        SymbolFileDWARF *dwarf = cu->GetSymbolFileDWARF();<br>
+        const bool check_specification_or_abstract_origin = true;<br>
+        DWARFFormValue form_value;<br>
+        if (m_die->GetAttributeValue(dwarf, cu, attr, form_value, nullptr, check_specification_or_abstract_origin))<br>
+            return dwarf->GetDIE(DIERef(form_value));<br>
+    }<br>
+    return DWARFDIE();<br>
+}<br>
+<br>
 uint64_t<br>
 DWARFDIE::GetAttributeValueAsReference (const dw_attr_t attr, uint64_t fail_value) const<br>
 {<br>
@@ -166,7 +182,7 @@ DWARFDIE::LookupDeepestBlock (lldb::addr<br>
                 if (cu->ContainsDIEOffset(block_die->GetOffset()))<br>
                     return DWARFDIE(cu, block_die);<br>
                 else<br>
-                    return DWARFDIE(dwarf->DebugInfo()->GetCompileUnitContainingDIE(DIERef(cu->GetOffset(), block_die->GetOffset())), block_die);<br>
+                    return DWARFDIE(dwarf->DebugInfo()->GetCompileUnit(DIERef(cu->GetOffset(), block_die->GetOffset())), block_die);<br>
             }<br>
         }<br>
     }<br>
@@ -176,27 +192,7 @@ DWARFDIE::LookupDeepestBlock (lldb::addr<br>
 lldb::user_id_t<br>
 DWARFDIE::GetID () const<br>
 {<br>
-    const dw_offset_t die_offset = GetOffset();<br>
-    if (die_offset != DW_INVALID_OFFSET)<br>
-    {<br>
-        lldb::user_id_t id = 0;<br>
-        SymbolFileDWARF *dwarf = GetDWARF();<br>
-        if (dwarf)<br>
-            id = dwarf->MakeUserID(die_offset);<br>
-        else<br>
-            id = die_offset;<br>
-<br>
-        if (m_cu)<br>
-        {<br>
-            lldb::user_id_t cu_id = m_cu->GetID()&0xffffffff00000000ull;<br>
-            assert ((id&0xffffffff00000000ull) == 0 ||<br>
-                    (cu_id&0xffffffff00000000ll) == 0 ||<br>
-                    (id&0xffffffff00000000ull) == (cu_id&0xffffffff00000000ll));<br>
-            id |= cu_id;<br>
-        }<br>
-        return id;<br>
-    }<br>
-    return LLDB_INVALID_UID;<br>
+    return GetDIERef().GetUID(GetDWARF());<br>
 }<br>
<br>
 const char *<br>
@@ -274,11 +270,11 @@ DWARFDIE::ResolveType () const<br>
 }<br>
<br>
 lldb_private::Type *<br>
-DWARFDIE::ResolveTypeUID (lldb::user_id_t uid) const<br>
+DWARFDIE::ResolveTypeUID (const DIERef &die_ref) const<br>
 {<br>
     SymbolFileDWARF *dwarf = GetDWARF();<br>
     if (dwarf)<br>
-        return dwarf->ResolveTypeUID(uid);<br>
+        return dwarf->ResolveTypeUID(dwarf->GetDIE(die_ref), true);<br>
     else<br>
         return nullptr;<br>
 }<br>
@@ -530,6 +526,36 @@ DWARFDIE::Dump (lldb_private::Stream *s,<br>
 }<br>
<br>
<br>
+CompilerDecl<br>
+DWARFDIE::GetDecl () const<br>
+{<br>
+    DWARFASTParser *dwarf_ast = GetDWARFParser();<br>
+    if (dwarf_ast)<br>
+        return dwarf_ast->GetDeclForUIDFromDWARF(*this);<br>
+    else<br>
+        return CompilerDecl();<br>
+}<br>
+<br>
+CompilerDeclContext<br>
+DWARFDIE::GetDeclContext () const<br>
+{<br>
+    DWARFASTParser *dwarf_ast = GetDWARFParser();<br>
+    if (dwarf_ast)<br>
+        return dwarf_ast->GetDeclContextForUIDFromDWARF(*this);<br>
+    else<br>
+        return CompilerDeclContext();<br>
+}<br>
+<br>
+CompilerDeclContext<br>
+DWARFDIE::GetContainingDeclContext () const<br>
+{<br>
+    DWARFASTParser *dwarf_ast = GetDWARFParser();<br>
+    if (dwarf_ast)<br>
+        return dwarf_ast->GetDeclContextContainingUIDFromDWARF(*this);<br>
+    else<br>
+        return CompilerDeclContext();<br>
+}<br>
+<br>
 bool operator == (const DWARFDIE &lhs, const DWARFDIE &rhs)<br>
 {<br>
     return lhs.GetDIE() == rhs.GetDIE() && lhs.GetCU() == rhs.GetCU();<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h Wed Mar 30 15:14:35 2016<br>
@@ -58,7 +58,7 @@ public:<br>
     //----------------------------------------------------------------------<br>
     // Tests<br>
     //----------------------------------------------------------------------<br>
-    operator bool () const<br>
+    explicit operator bool () const<br>
     {<br>
         return IsValid();<br>
     }<br>
@@ -180,9 +180,11 @@ public:<br>
     lldb_private::Type *<br>
     ResolveType () const;<br>
<br>
+    //----------------------------------------------------------------------<br>
     // Resolve a type by UID using this DIE's DWARF file<br>
+    //----------------------------------------------------------------------<br>
     lldb_private::Type *<br>
-    ResolveTypeUID (lldb::user_id_t uid) const;<br>
+    ResolveTypeUID (const DIERef &die_ref) const;<br>
<br>
     //----------------------------------------------------------------------<br>
     // Functions for obtaining DIE relations and references<br>
@@ -245,6 +247,9 @@ public:<br>
     uint64_t<br>
     GetAttributeValueAsReference (const dw_attr_t attr, uint64_t fail_value) const;<br>
<br>
+    DWARFDIE<br>
+    GetAttributeValueAsReferenceDIE (const dw_attr_t attr) const;<br>
+<br>
     uint64_t<br>
     GetAttributeValueAsAddress (const dw_attr_t attr, uint64_t fail_value) const;<br>
<br>
@@ -270,6 +275,15 @@ public:<br>
     void<br>
     Dump (lldb_private::Stream *s, const uint32_t recurse_depth) const;<br>
<br>
+    lldb_private::CompilerDecl<br>
+    GetDecl () const;<br>
+<br>
+    lldb_private::CompilerDeclContext<br>
+    GetDeclContext() const;<br>
+<br>
+    lldb_private::CompilerDeclContext<br>
+    GetContainingDeclContext() const;<br>
+<br>
 protected:<br>
     DWARFCompileUnit *m_cu;<br>
     DWARFDebugInfoEntry *m_die;<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp Wed Mar 30 15:14:35 2016<br>
@@ -16,17 +16,6 @@<br>
 using namespace lldb_private;<br>
 using namespace std;<br>
<br>
-bool<br>
-DWARFDIECollection::Insert(const DWARFDIE &die)<br>
-{<br>
-    iterator end_pos = m_dies.end();<br>
-    iterator insert_pos = upper_bound(m_dies.begin(), end_pos, die);<br>
-    if (insert_pos != end_pos && (*insert_pos == die))<br>
-        return false;<br>
-    m_dies.insert(insert_pos, die);<br>
-    return true;<br>
-}<br>
-<br>
 void<br>
 DWARFDIECollection::Append (const DWARFDIE &die)<br>
 {<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h Wed Mar 30 15:14:35 2016<br>
@@ -33,9 +33,6 @@ public:<br>
     DWARFDIE<br>
     GetDIEAtIndex (uint32_t idx) const;<br>
<br>
-    bool<br>
-    Insert(const DWARFDIE &die);<br>
-<br>
     size_t<br>
     Size() const;<br>
<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Wed Mar 30 15:14:35 2016<br>
@@ -209,48 +209,51 @@ DWARFDebugInfo::GetCompileUnit(dw_offset<br>
 }<br>
<br>
 DWARFCompileUnit *<br>
-DWARFDebugInfo::GetCompileUnitContainingDIE (const DIERef& die_ref)<br>
+DWARFDebugInfo::GetCompileUnit (const DIERef& die_ref)<br>
 {<br>
-    dw_offset_t search_offset = die_ref.die_offset;<br>
-    bool is_cu_offset = false;<br>
-    if (m_dwarf2Data->GetID() == 0 && die_ref.cu_offset != DW_INVALID_OFFSET)<br>
-    {<br>
-        is_cu_offset = true;<br>
-        search_offset = die_ref.cu_offset;<br>
-    }<br>
+    if (die_ref.cu_offset == DW_INVALID_OFFSET)<br>
+        return GetCompileUnitContainingDIEOffset(die_ref.die_offset);<br>
+    else<br>
+        return GetCompileUnit(die_ref.cu_offset);<br>
+}<br>
+<br>
+DWARFCompileUnit*<br>
+DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset)<br>
+{<br>
+    ParseCompileUnitHeadersIfNeeded();<br>
<br>
     DWARFCompileUnitSP cu_sp;<br>
-    if (search_offset != DW_INVALID_OFFSET)<br>
-    {<br>
-        ParseCompileUnitHeadersIfNeeded();<br>
<br>
-        // Watch out for single compile unit executable as they are pretty common<br>
-        const size_t num_cus = m_compile_units.size();<br>
-        if (num_cus == 1)<br>
-        {<br>
-            if ((is_cu_offset && m_compile_units[0]->GetOffset() == search_offset) ||<br>
-                (!is_cu_offset && m_compile_units[0]->ContainsDIEOffset(search_offset)))<br>
-            {<br>
-                cu_sp = m_compile_units[0];<br>
-            }<br>
-        }<br>
-        else if (num_cus)<br>
+    // Watch out for single compile unit executable as they are pretty common<br>
+    const size_t num_cus = m_compile_units.size();<br>
+    if (num_cus == 1)<br>
+    {<br>
+        if (m_compile_units[0]->ContainsDIEOffset(die_offset))<br>
+            return m_compile_units[0].get();<br>
+    }<br>
+    else if (num_cus)<br>
+    {<br>
+        CompileUnitColl::const_iterator end_pos = m_compile_units.end();<br>
+        CompileUnitColl::const_iterator begin_pos = m_compile_units.begin();<br>
+        CompileUnitColl::const_iterator pos = std::upper_bound(begin_pos, end_pos, die_offset, OffsetLessThanCompileUnitOffset);<br>
+        if (pos != begin_pos)<br>
         {<br>
-            CompileUnitColl::const_iterator end_pos = m_compile_units.end();<br>
-            CompileUnitColl::const_iterator begin_pos = m_compile_units.begin();<br>
-            CompileUnitColl::const_iterator pos = std::upper_bound(begin_pos, end_pos, search_offset, OffsetLessThanCompileUnitOffset);<br>
-            if (pos != begin_pos)<br>
-            {<br>
-                --pos;<br>
-                if ((is_cu_offset && (*pos)->GetOffset() == search_offset) ||<br>
-                    (!is_cu_offset && (*pos)->ContainsDIEOffset(search_offset)))<br>
-                {<br>
-                    cu_sp = *pos;<br>
-                }<br>
-            }<br>
+            --pos;<br>
+            if ((*pos)->ContainsDIEOffset(die_offset))<br>
+                return (*pos).get();<br>
         }<br>
     }<br>
-    return cu_sp.get();<br>
+<br>
+    return nullptr;<br>
+}<br>
+<br>
+DWARFDIE<br>
+DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset)<br>
+{<br>
+    DWARFCompileUnit* cu = GetCompileUnitContainingDIEOffset(die_offset);<br>
+    if (cu)<br>
+        return cu->GetDIE(die_offset);<br>
+    return DWARFDIE();<br>
 }<br>
<br>
 //----------------------------------------------------------------------<br>
@@ -261,7 +264,7 @@ DWARFDebugInfo::GetCompileUnitContaining<br>
 DWARFDIE<br>
 DWARFDebugInfo::GetDIE(const DIERef& die_ref)<br>
 {<br>
-    DWARFCompileUnit *cu = GetCompileUnitContainingDIE(die_ref);<br>
+    DWARFCompileUnit *cu = GetCompileUnit(die_ref);<br>
     if (cu)<br>
         return cu->GetDIE (die_ref.die_offset);<br>
     return DWARFDIE();    // Not found<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h Wed Mar 30 15:14:35 2016<br>
@@ -39,9 +39,10 @@ public:<br>
     size_t GetNumCompileUnits();<br>
     bool ContainsCompileUnit (const DWARFCompileUnit *cu) const;<br>
     DWARFCompileUnit* GetCompileUnitAtIndex (uint32_t idx);<br>
-    DWARFCompileUnit* GetCompileUnit (dw_offset_t cu_offset, uint32_t* idx_ptr = NULL);<br>
-    DWARFCompileUnit* GetCompileUnitContainingDIE (const DIERef& die_ref);<br>
-<br>
+    DWARFCompileUnit* GetCompileUnit(dw_offset_t cu_offset, uint32_t* idx_ptr = NULL);<br>
+    DWARFCompileUnit* GetCompileUnitContainingDIEOffset (dw_offset_t die_offset);<br>
+    DWARFCompileUnit* GetCompileUnit(const DIERef& die_ref);<br>
+    DWARFDIE GetDIEForDIEOffset(dw_offset_t die_offset);<br>
     DWARFDIE GetDIE (const DIERef& die_ref);<br>
<br>
     void Dump(lldb_private::Stream *s, const uint32_t die_offset, const uint32_t recurse_depth);<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h Wed Mar 30 15:14:35 2016<br>
@@ -115,6 +115,13 @@ public:<br>
                     DWARFAttributes& attrs,<br>
                     uint32_t curr_depth = 0) const; // "curr_depth" for internal use only, don't set this yourself!!!<br>
<br>
+    dw_offset_t GetAttributeValue(SymbolFileDWARF* dwarf2Data,<br>
+                                  const DWARFCompileUnit* cu,<br>
+                                  const dw_attr_t attr,<br>
+                                  DWARFFormValue& formValue,<br>
+                                  dw_offset_t* end_attr_offset_ptr = nullptr,<br>
+                                  bool check_specification_or_abstract_origin = false) const;<br>
+<br>
     const char* GetAttributeValueAsString(<br>
                     SymbolFileDWARF* dwarf2Data,<br>
                     const DWARFCompileUnit* cu,<br>
@@ -382,12 +389,6 @@ public:<br>
                        DWARFDebugInfoEntry::collection &die_collection);<br>
<br>
 protected:<br>
-    dw_offset_t GetAttributeValue(SymbolFileDWARF* dwarf2Data,<br>
-                                  const DWARFCompileUnit* cu,<br>
-                                  const dw_attr_t attr,<br>
-                                  DWARFFormValue& formValue,<br>
-                                  dw_offset_t* end_attr_offset_ptr = nullptr,<br>
-                                  bool check_specification_or_abstract_origin = false) const;<br>
<br>
     dw_offset_t m_offset;           // Offset within the .debug_info of the start of this entry<br>
     uint32_t    m_parent_idx;       // How many to subtract from "this" to get the parent. If zero this die has no parent<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp Wed Mar 30 15:14:35 2016<br>
@@ -167,6 +167,14 @@ DWARFFormValue::DWARFFormValue(const DWA<br>
 {<br>
 }<br>
<br>
+void<br>
+DWARFFormValue::Clear()<br>
+{<br>
+    m_cu = nullptr;<br>
+    m_form = 0;<br>
+    memset(&m_value, 0, sizeof(m_value));<br>
+}<br>
+<br>
 bool<br>
 DWARFFormValue::ExtractValue(const DWARFDataExtractor& data, lldb::offset_t* offset_ptr)<br>
 {<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h Wed Mar 30 15:14:35 2016<br>
@@ -101,6 +101,7 @@ public:<br>
     static FixedFormSizes GetFixedFormSizesForAddressSize (uint8_t addr_size, bool is_dwarf64);<br>
     static int          Compare (const DWARFFormValue& a,<br>
                                  const DWARFFormValue& b);<br>
+    void                Clear();<br>
 protected:<br>
     const DWARFCompileUnit* m_cu; // Compile unit for this form<br>
     dw_form_t   m_form;     // Form for this value<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Mar 30 15:14:35 2016<br>
@@ -279,9 +279,11 @@ SymbolFileDWARF::CreateInstance (ObjectF<br>
 TypeList *<br>
 SymbolFileDWARF::GetTypeList ()<br>
 {<br>
-    if (GetDebugMapSymfile ())<br>
-        return m_debug_map_symfile->GetTypeList();<br>
-    return m_obj_file->GetModule()->GetTypeList();<br>
+    SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile();<br>
+    if (debug_map_symfile)<br>
+        return debug_map_symfile->GetTypeList();<br>
+    else<br>
+        return m_obj_file->GetModule()->GetTypeList();<br>
<br>
 }<br>
 void<br>
@@ -485,15 +487,17 @@ GetDWARFMachOSegmentName ()<br>
 UniqueDWARFASTTypeMap &<br>
 SymbolFileDWARF::GetUniqueDWARFASTTypeMap ()<br>
 {<br>
-    if (GetDebugMapSymfile ())<br>
-        return m_debug_map_symfile->GetUniqueDWARFASTTypeMap ();<br>
-    return m_unique_ast_type_map;<br>
+    SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile();<br>
+    if (debug_map_symfile)<br>
+        return debug_map_symfile->GetUniqueDWARFASTTypeMap ();<br>
+    else<br>
+        return m_unique_ast_type_map;<br>
 }<br>
<br>
 TypeSystem *<br>
 SymbolFileDWARF::GetTypeSystemForLanguage (LanguageType language)<br>
 {<br>
-    SymbolFileDWARFDebugMap * debug_map_symfile = GetDebugMapSymfile ();<br>
+    SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile();<br>
     TypeSystem *type_system;<br>
     if (debug_map_symfile)<br>
     {<br>
@@ -825,30 +829,13 @@ SymbolFileDWARF::GetDWARFCompileUnit(lld<br>
     DWARFDebugInfo* info = DebugInfo();<br>
     if (info)<br>
     {<br>
-        if (GetDebugMapSymfile ())<br>
-        {<br>
-            // The debug map symbol file made the compile units for this DWARF<br>
-            // file which is .o file with DWARF in it, and we should have<br>
-            // only 1 compile unit which is at offset zero in the DWARF.<br>
-            // TODO: modify to support LTO .o files where each .o file might<br>
-            // have multiple DW_TAG_compile_unit tags.<br>
-<br>
-            DWARFCompileUnit *dwarf_cu = info->GetCompileUnit(0);<br>
-            if (dwarf_cu && dwarf_cu->GetUserData() == NULL)<br>
-                dwarf_cu->SetUserData(comp_unit);<br>
-            return dwarf_cu;<br>
-        }<br>
-        else<br>
-        {<br>
-            // Just a normal DWARF file whose user ID for the compile unit is<br>
-            // the DWARF offset itself<br>
-<br>
-            DWARFCompileUnit *dwarf_cu = info->GetCompileUnit((dw_offset_t)comp_unit->GetID());<br>
-            if (dwarf_cu && dwarf_cu->GetUserData() == NULL)<br>
-                dwarf_cu->SetUserData(comp_unit);<br>
-            return dwarf_cu;<br>
+        // Just a normal DWARF file whose user ID for the compile unit is<br>
+        // the DWARF offset itself<br>
<br>
-        }<br>
+        DWARFCompileUnit *dwarf_cu = info->GetCompileUnit((dw_offset_t)comp_unit->GetID());<br>
+        if (dwarf_cu && dwarf_cu->GetUserData() == NULL)<br>
+            dwarf_cu->SetUserData(comp_unit);<br>
+        return dwarf_cu;<br>
     }<br>
     return NULL;<br>
 }<br>
@@ -895,7 +882,7 @@ SymbolFileDWARF::ParseCompileUnit (DWARF<br>
             {<br>
                 return dwarf_cu->GetSymbolFileDWARF()->ParseCompileUnit(dwarf_cu, cu_idx);<br>
             }<br>
-            else if (GetDebugMapSymfile ())<br>
+            else if (dwarf_cu->GetOffset() == 0 && GetDebugMapSymfile ())<br>
             {<br>
                 // Let the debug map create the compile unit<br>
                 cu_sp = m_debug_map_symfile->GetCompileUnit(this);<br>
@@ -1009,7 +996,7 @@ SymbolFileDWARF::ParseCompileUnitFunctio<br>
 bool<br>
 SymbolFileDWARF::FixupAddress (Address &addr)<br>
 {<br>
-    SymbolFileDWARFDebugMap * debug_map_symfile = GetDebugMapSymfile ();<br>
+    SymbolFileDWARFDebugMap * debug_map_symfile = GetDebugMapSymfile();<br>
     if (debug_map_symfile)<br>
     {<br>
         return debug_map_symfile->LinkOSOAddress(addr);<br>
@@ -1230,13 +1217,14 @@ SymbolFileDWARF::ParseCompileUnitLineTab<br>
<br>
                     lldb::offset_t offset = cu_line_offset;<br>
                     DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info);<br>
-                    if (m_debug_map_symfile)<br>
+                    SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile();<br>
+                    if (debug_map_symfile)<br>
                     {<br>
                         // We have an object file that has a line table with addresses<br>
                         // that are not linked. We need to link the line table and convert<br>
                         // the addresses that are relative to the .o file into addresses<br>
                         // for the main executable.<br>
-                        sc.comp_unit->SetLineTable (m_debug_map_symfile->LinkOSOLineTable (this, line_table_ap.get()));<br>
+                        sc.comp_unit->SetLineTable (debug_map_symfile->LinkOSOLineTable (this, line_table_ap.get()));<br>
                     }<br>
                     else<br>
                     {<br>
@@ -1474,60 +1462,27 @@ SymbolFileDWARF::ParseDeclsForContext (C<br>
 CompilerDecl<br>
 SymbolFileDWARF::GetDeclForUID (lldb::user_id_t type_uid)<br>
 {<br>
-    if (UserIDMatches(type_uid))<br>
-    {<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
-        if (debug_info)<br>
-        {<br>
-            DWARFDIE die = debug_info->GetDIE(DIERef(type_uid));<br>
-            if (die)<br>
-            {<br>
-                DWARFASTParser *dwarf_ast = die.GetDWARFParser();<br>
-                if (dwarf_ast)<br>
-                    return dwarf_ast->GetDeclForUIDFromDWARF(die);<br>
-            }<br>
-        }<br>
-    }<br>
+    DWARFDIE die = GetDIE(DIERef(type_uid, this));<br>
+    if (die)<br>
+        return die.GetDecl();<br>
     return CompilerDecl();<br>
 }<br>
<br>
 CompilerDeclContext<br>
 SymbolFileDWARF::GetDeclContextForUID (lldb::user_id_t type_uid)<br>
 {<br>
-    if (UserIDMatches(type_uid))<br>
-    {<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
-        if (debug_info)<br>
-        {<br>
-            DWARFDIE die = debug_info->GetDIE(DIERef(type_uid));<br>
-            if (die)<br>
-            {<br>
-                DWARFASTParser *dwarf_ast = die.GetDWARFParser();<br>
-                if (dwarf_ast)<br>
-                    return dwarf_ast->GetDeclContextForUIDFromDWARF(die);<br>
-            }<br>
-        }<br>
-    }<br>
+    DWARFDIE die = GetDIE(DIERef(type_uid, this));<br>
+    if (die)<br>
+        return die.GetDeclContext();<br>
     return CompilerDeclContext();<br>
 }<br>
<br>
 CompilerDeclContext<br>
 SymbolFileDWARF::GetDeclContextContainingUID (lldb::user_id_t type_uid)<br>
 {<br>
-    if (UserIDMatches(type_uid))<br>
-    {<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
-        if (debug_info)<br>
-        {<br>
-            DWARFDIE die = debug_info->GetDIE(DIERef(type_uid));<br>
-            if (die)<br>
-            {<br>
-                DWARFASTParser *dwarf_ast = die.GetDWARFParser();<br>
-                if (dwarf_ast)<br>
-                    return dwarf_ast->GetDeclContextContainingUIDFromDWARF(die);<br>
-            }<br>
-        }<br>
-    }<br>
+    DWARFDIE die = GetDIE (DIERef(type_uid, this));<br>
+    if (die)<br>
+        return die.GetContainingDeclContext();<br>
     return CompilerDeclContext();<br>
 }<br>
<br>
@@ -1535,23 +1490,22 @@ SymbolFileDWARF::GetDeclContextContainin<br>
 Type*<br>
 SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid)<br>
 {<br>
-    if (UserIDMatches(type_uid))<br>
+    DWARFDIE type_die = GetDIE (DIERef(type_uid, this));<br>
+    if (type_die)<br>
     {<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
-        if (debug_info)<br>
-        {<br>
-            DWARFDIE type_die = debug_info->GetDIE (DIERef(type_uid));<br>
-            if (type_die)<br>
-            {<br>
-                const bool assert_not_being_parsed = true;<br>
-                return ResolveTypeUID (type_die, assert_not_being_parsed);<br>
-            }<br>
-        }<br>
+        const bool assert_not_being_parsed = true;<br>
+        return ResolveTypeUID (type_die, assert_not_being_parsed);<br>
     }<br>
     return NULL;<br>
 }<br>
<br>
 Type*<br>
+SymbolFileDWARF::ResolveTypeUID (const DIERef &die_ref)<br>
+{<br>
+    return ResolveType (GetDIE(die_ref), true);<br>
+}<br>
+<br>
+Type*<br>
 SymbolFileDWARF::ResolveTypeUID (const DWARFDIE &die, bool assert_not_being_parsed)<br>
 {<br>
     if (die)<br>
@@ -1642,30 +1596,29 @@ SymbolFileDWARF::CompleteType (CompilerT<br>
         return true;<br>
     }<br>
<br>
-    DWARFDebugInfo* debug_info = DebugInfo();<br>
-    DWARFDIE dwarf_die = debug_info->GetDIE(die_it->getSecond());<br>
-<br>
-    assert(UserIDMatches(die_it->getSecond().GetUID()) && "CompleteType called on the wrong SymbolFile");<br>
-<br>
-    // Once we start resolving this type, remove it from the forward declaration<br>
-    // map in case anyone child members or other types require this type to get resolved.<br>
-    // The type will get resolved when all of the calls to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition<br>
-    // are done.<br>
-    GetForwardDeclClangTypeToDie().erase (die_it);<br>
+    DWARFDIE dwarf_die = GetDIE(die_it->getSecond());<br>
+    if (dwarf_die)<br>
+    {<br>
+        // Once we start resolving this type, remove it from the forward declaration<br>
+        // map in case anyone child members or other types require this type to get resolved.<br>
+        // The type will get resolved when all of the calls to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition<br>
+        // are done.<br>
+        GetForwardDeclClangTypeToDie().erase (die_it);<br>
<br>
-    Type *type = GetDIEToType().lookup (dwarf_die.GetDIE());<br>
+        Type *type = GetDIEToType().lookup (dwarf_die.GetDIE());<br>
<br>
-    Log *log (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO|DWARF_LOG_TYPE_COMPLETION));<br>
-    if (log)<br>
-        GetObjectFile()->GetModule()->LogMessageVerboseBacktrace (log,<br>
-                                                                  "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...",<br>
-                                                                  dwarf_die.GetID(),<br>
-                                                                  dwarf_die.GetTagAsCString(),<br>
-                                                                  type->GetName().AsCString());<br>
-    assert (compiler_type);<br>
-    DWARFASTParser *dwarf_ast = dwarf_die.GetDWARFParser();<br>
-    if (dwarf_ast)<br>
-        return dwarf_ast->CompleteTypeFromDWARF (dwarf_die, type, compiler_type);<br>
+        Log *log (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO|DWARF_LOG_TYPE_COMPLETION));<br>
+        if (log)<br>
+            GetObjectFile()->GetModule()->LogMessageVerboseBacktrace (log,<br>
+                                                                      "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...",<br>
+                                                                      dwarf_die.GetID(),<br>
+                                                                      dwarf_die.GetTagAsCString(),<br>
+                                                                      type->GetName().AsCString());<br>
+        assert (compiler_type);<br>
+        DWARFASTParser *dwarf_ast = dwarf_die.GetDWARFParser();<br>
+        if (dwarf_ast)<br>
+            return dwarf_ast->CompleteTypeFromDWARF (dwarf_die, type, compiler_type);<br>
+    }<br>
     return false;<br>
 }<br>
<br>
@@ -1674,10 +1627,7 @@ SymbolFileDWARF::ResolveType (const DWAR<br>
 {<br>
     if (die)<br>
     {<br>
-        Type *type = GetDIEToType().lookup (die.GetDIE());<br>
-<br>
-        if (type == NULL)<br>
-            type = GetTypeForDIE (die, resolve_function_context).get();<br>
+        Type *type = GetTypeForDIE (die, resolve_function_context).get();<br>
<br>
         if (assert_not_being_parsed)<br>
         {<br>
@@ -1763,6 +1713,17 @@ SymbolFileDWARF::GetDWOModule (ConstStri<br>
         return lldb::ModuleSP();<br>
 }<br>
<br>
+DWARFDIE<br>
+SymbolFileDWARF::GetDIE (const DIERef &die_ref)<br>
+{<br>
+    DWARFDebugInfo * debug_info = DebugInfo();<br>
+    if (debug_info)<br>
+        return debug_info->GetDIE(die_ref);<br>
+    else<br>
+        return DWARFDIE();<br>
+}<br>
+<br>
+<br>
 std::unique_ptr<SymbolFileDWARFDwo><br>
 SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die)<br>
 {<br>
@@ -2330,12 +2291,11 @@ SymbolFileDWARF::FindGlobalVariables (co<br>
         sc.module_sp = m_obj_file->GetModule();<br>
         assert (sc.module_sp);<br>
<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
         bool done = false;<br>
         for (size_t i=0; i<num_die_matches && !done; ++i)<br>
         {<br>
             const DIERef& die_ref = die_offsets[i];<br>
-            DWARFDIE die = debug_info->GetDIE (die_ref);<br>
+            DWARFDIE die = GetDIE (die_ref);<br>
<br>
             if (die)<br>
             {<br>
@@ -2448,11 +2408,10 @@ SymbolFileDWARF::FindGlobalVariables(con<br>
     const size_t num_matches = die_offsets.size();<br>
     if (num_matches)<br>
     {<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
         for (size_t i=0; i<num_matches; ++i)<br>
         {<br>
             const DIERef& die_ref = die_offsets[i];<br>
-            DWARFDIE die = debug_info->GetDIE (die_ref);<br>
+            DWARFDIE die = GetDIE (die_ref);<br>
<br>
             if (die)<br>
             {<br>
@@ -3098,11 +3057,10 @@ SymbolFileDWARF::FindTypes (const Symbol<br>
     if (num_die_matches)<br>
     {<br>
         const uint32_t initial_types_size = types.GetSize();<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
         for (size_t i=0; i<num_die_matches; ++i)<br>
         {<br>
             const DIERef& die_ref = die_offsets[i];<br>
-            DWARFDIE die = debug_info->GetDIE (die_ref);<br>
+            DWARFDIE die = GetDIE (die_ref);<br>
<br>
             if (die)<br>
             {<br>
@@ -3221,11 +3179,10 @@ SymbolFileDWARF::FindTypes (const std::v<br>
     if (num_die_matches)<br>
     {<br>
         size_t num_matches = 0;<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
         for (size_t i=0; i<num_die_matches; ++i)<br>
         {<br>
             const DIERef& die_ref = die_offsets[i];<br>
-            DWARFDIE die = debug_info->GetDIE (die_ref);<br>
+            DWARFDIE die = GetDIE (die_ref);<br>
<br>
             if (die)<br>
             {<br>
@@ -3304,11 +3261,10 @@ SymbolFileDWARF::FindNamespace (const Sy<br>
         const size_t num_matches = die_offsets.size();<br>
         if (num_matches)<br>
         {<br>
-            DWARFDebugInfo* debug_info = DebugInfo();<br>
             for (size_t i=0; i<num_matches; ++i)<br>
             {<br>
                 const DIERef& die_ref = die_offsets[i];<br>
-                DWARFDIE die = debug_info->GetDIE (die_ref);<br>
+                DWARFDIE die = GetDIE (die_ref);<br>
<br>
                 if (die)<br>
                 {<br>
@@ -3523,11 +3479,10 @@ SymbolFileDWARF::FindCompleteObjCDefinit<br>
<br>
     if (num_matches)<br>
     {<br>
-        DWARFDebugInfo* debug_info = DebugInfo();<br>
         for (size_t i=0; i<num_matches; ++i)<br>
         {<br>
             const DIERef& die_ref = die_offsets[i];<br>
-            DWARFDIE type_die = debug_info->GetDIE (die_ref);<br>
+            DWARFDIE type_die = GetDIE (die_ref);<br>
<br>
             if (type_die)<br>
             {<br>
@@ -3747,11 +3702,10 @@ SymbolFileDWARF::FindDefinitionTypeForDW<br>
<br>
             if (num_matches)<br>
             {<br>
-                DWARFDebugInfo* debug_info = DebugInfo();<br>
                 for (size_t i=0; i<num_matches; ++i)<br>
                 {<br>
                     const DIERef& die_ref = die_offsets[i];<br>
-                    DWARFDIE type_die = debug_info->GetDIE (die_ref);<br>
+                    DWARFDIE type_die = GetDIE (die_ref);<br>
<br>
                     if (type_die)<br>
                     {<br>
@@ -3995,7 +3949,7 @@ SymbolFileDWARF::ParseVariablesForContex<br>
<br>
         if (sc.function)<br>
         {<br>
-            DWARFDIE function_die = info->GetDIE(DIERef(sc.function->GetID()));<br>
+            DWARFDIE function_die = info->GetDIE(DIERef(sc.function->GetID(), this));<br>
<br>
             const dw_addr_t func_lo_pc = function_die.GetAttributeValueAsAddress (DW_AT_low_pc, LLDB_INVALID_ADDRESS);<br>
             if (func_lo_pc != LLDB_INVALID_ADDRESS)<br>
@@ -4050,11 +4004,10 @@ SymbolFileDWARF::ParseVariablesForContex<br>
                 const size_t num_matches = die_offsets.size();<br>
                 if (num_matches)<br>
                 {<br>
-                    DWARFDebugInfo* debug_info = DebugInfo();<br>
                     for (size_t i=0; i<num_matches; ++i)<br>
                     {<br>
                         const DIERef& die_ref = die_offsets[i];<br>
-                        DWARFDIE die = debug_info->GetDIE (die_ref);<br>
+                        DWARFDIE die = GetDIE (die_ref);<br>
                         if (die)<br>
                         {<br>
                             VariableSP var_sp (ParseVariableDIE(sc, die, LLDB_INVALID_ADDRESS));<br>
@@ -4233,11 +4186,7 @@ SymbolFileDWARF::ParseVariableDIE<br>
                         }<br>
                         break;<br>
                     case DW_AT_specification:<br>
-                        {<br>
-                            DWARFDebugInfo* debug_info = DebugInfo();<br>
-                            if (debug_info)<br>
-                                spec_die = debug_info->GetDIE(DIERef(form_value));<br>
-                        }<br>
+                        spec_die = GetDIE(DIERef(form_value));<br>
                         break;<br>
                     case DW_AT_start_scope:<br>
                         {<br>
@@ -4350,7 +4299,7 @@ SymbolFileDWARF::ParseVariableDIE<br>
                         scope = eValueTypeVariableStatic;<br>
<br>
<br>
-                    SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile ();<br>
+                    SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile();<br>
<br>
                     if (debug_map_symfile)<br>
                     {<br>
@@ -4456,7 +4405,7 @@ SymbolFileDWARF::ParseVariableDIE<br>
<br>
             if (symbol_context_scope)<br>
             {<br>
-                SymbolFileTypeSP type_sp(new SymbolFileType(*this, DIERef(type_die_form).GetUID()));<br>
+                SymbolFileTypeSP type_sp(new SymbolFileType(*this, DIERef(type_die_form).GetUID(this)));<br>
<br>
                 if (const_value.Form() && type_sp && type_sp->GetType())<br>
                     location.CopyOpcodeData(const_value.Unsigned(), type_sp->GetType()->GetByteSize(), die.GetCU()->GetAddressByteSize());<br>
@@ -4615,7 +4564,7 @@ SymbolFileDWARF::ParseVariables (const S<br>
                                     // a concrete block counterpart in the current function. We need<br>
                                     // to find the concrete block so we can correctly add the<br>
                                     // variable to it<br>
-                                    const DWARFDIE concrete_block_die = FindBlockContainingSpecification (DIERef(sc.function->GetID()),<br>
+                                    const DWARFDIE concrete_block_die = FindBlockContainingSpecification (DIERef(sc.function->GetID(), this),<br>
                                                                                                           sc_parent_die.GetOffset());<br>
                                     if (concrete_block_die)<br>
                                         block = sc.function->GetBlock(true).FindBlockByID(concrete_block_die.GetID());<br>
@@ -4706,7 +4655,7 @@ SymbolFileDWARF::DumpIndexes ()<br>
<br>
<br>
 SymbolFileDWARFDebugMap *<br>
-SymbolFileDWARF::GetDebugMapSymfile ()<br>
+SymbolFileDWARF::GetDebugMapSymfile()<br>
 {<br>
     if (m_debug_map_symfile == NULL && !m_debug_map_module_wp.expired())<br>
     {<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Wed Mar 30 15:14:35 2016<br>
@@ -68,7 +68,9 @@ public:<br>
     friend class SymbolFileDWARFDebugMap;<br>
     friend class SymbolFileDWARFDwo;<br>
     friend class DebugMapModule;<br>
+    friend class DIERef;<br>
     friend class DWARFCompileUnit;<br>
+    friend class DWARFDIE;<br>
     friend class DWARFASTParserClang;<br>
     friend class DWARFASTParserGo;<br>
     friend class DWARFASTParserJava;<br>
@@ -302,12 +304,6 @@ public:<br>
     GetCompUnitForDWARFCompUnit(DWARFCompileUnit* dwarf_cu,<br>
                                 uint32_t cu_idx = UINT32_MAX);<br>
<br>
-    lldb::user_id_t<br>
-    MakeUserID (dw_offset_t die_offset) const<br>
-    {<br>
-        return GetID() | die_offset;<br>
-    }<br>
-<br>
     size_t<br>
     GetObjCMethodDIEOffsets (lldb_private::ConstString class_name,<br>
                              DIEArray &method_die_offsets);<br>
@@ -330,6 +326,9 @@ public:<br>
     lldb::ModuleSP<br>
     GetDWOModule (lldb_private::ConstString name);<br>
<br>
+    DWARFDIE<br>
+    GetDIE(const DIERef &die_ref);<br>
+<br>
     virtual std::unique_ptr<SymbolFileDWARFDwo><br>
     GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die);<br>
<br>
@@ -393,8 +392,10 @@ protected:<br>
                bool *type_is_new);<br>
<br>
     lldb_private::Type *<br>
-    ResolveTypeUID (const DWARFDIE &die,<br>
-                    bool assert_not_being_parsed);<br>
+    ResolveTypeUID(const DWARFDIE &die, bool assert_not_being_parsed);<br>
+<br>
+    lldb_private::Type *<br>
+    ResolveTypeUID(const DIERef &die_ref);<br>
<br>
     lldb::VariableSP<br>
     ParseVariableDIE(const lldb_private::SymbolContext& sc,<br>
@@ -489,15 +490,6 @@ protected:<br>
     GetUniqueDWARFASTTypeMap ();<br>
<br>
     bool<br>
-    UserIDMatches (lldb::user_id_t uid) const<br>
-    {<br>
-        const lldb::user_id_t high_uid = uid & 0xffffffff00000000ull;<br>
-        if (high_uid != 0 && GetID() != 0)<br>
-            return high_uid == GetID();<br>
-        return true;<br>
-    }<br>
-<br>
-    bool<br>
     DIEDeclContextsMatch (const DWARFDIE &die1,<br>
                           const DWARFDIE &die2);<br>
<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=264909&r1=264908&r2=264909&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=264909&r1=264908&r2=264909&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h Wed Mar 30 15:14:35 2016<br>
@@ -107,10 +107,11 @@ protected:<br>
         kNumFlags<br>
     };<br>
<br>
-    friend class DWARFCompileUnit;<br>
-    friend class SymbolFileDWARF;<br>
     friend class DebugMapModule;<br>
+    friend class DIERef;<br>
     friend class DWARFASTParserClang;<br>
+    friend class DWARFCompileUnit;<br>
+    friend class SymbolFileDWARF;<br>
     struct OSOInfo<br>
     {<br>
         lldb::ModuleSP module_sp;<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br></div>
</blockquote></div><br></div>