<div dir="ltr">Thanks Greg!</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 25, 2015 at 2:46 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</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: Thu Jun 25 16:46:34 2015<br>
New Revision: 240702<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D240702-26view-3Drev&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=sj8HaEILM-v0kgWYsiOkg5THlBSO-kT1r2UWTYhmrH0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=240702&view=rev</a><br>
Log:<br>
Resubmitting 240466 after fixing the linux test suite failures.<br>
<br>
A few extras were fixed<br>
<br>
- Symbol::GetAddress() now returns an Address object, not a reference. There were places where people were accessing the address of a symbol when the symbol's value wasn't an address symbol. On MacOSX, undefined symbols have a value zero and some places where using the symbol's address and getting an absolute address of zero (since an Address object with no section and an m_offset whose value isn't LLDB_INVALID_ADDRESS is considered an absolute address). So fixing this required some changes to make sure people were getting what they expected.<br>
- Since some places want to access the address as a reference, I added a few new functions to symbol:<br>
    Address &Symbol::GetAddressRef();<br>
    const Address &Symbol::GetAddressRef() const;<br>
<br>
Linux test suite passes just fine now.<br>
<br>
<rdar://problem/21494354><br>
<br>
<br>
Modified:<br>
    lldb/trunk/include/lldb/Core/RangeMap.h<br>
    lldb/trunk/include/lldb/Core/StructuredData.h<br>
    lldb/trunk/include/lldb/Symbol/Symbol.h<br>
    lldb/trunk/include/lldb/Target/Memory.h<br>
    lldb/trunk/source/API/SBSymbol.cpp<br>
    lldb/trunk/source/API/SBThread.cpp<br>
    lldb/trunk/source/Commands/CommandObjectSource.cpp<br>
    lldb/trunk/source/Commands/CommandObjectTarget.cpp<br>
    lldb/trunk/source/Core/Address.cpp<br>
    lldb/trunk/source/Core/AddressResolverName.cpp<br>
    lldb/trunk/source/Core/Disassembler.cpp<br>
    lldb/trunk/source/Core/FormatEntity.cpp<br>
    lldb/trunk/source/Core/Module.cpp<br>
    lldb/trunk/source/Core/StructuredData.cpp<br>
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp<br>
    lldb/trunk/source/Expression/IRExecutionUnit.cpp<br>
    lldb/trunk/source/Expression/Materializer.cpp<br>
    lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp<br>
    lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp<br>
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp<br>
    lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp<br>
    lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp<br>
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp<br>
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp<br>
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp<br>
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp<br>
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp<br>
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp<br>
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp<br>
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br>
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h<br>
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp<br>
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h<br>
    lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp<br>
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp<br>
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp<br>
    lldb/trunk/source/Symbol/ObjectFile.cpp<br>
    lldb/trunk/source/Symbol/Symbol.cpp<br>
    lldb/trunk/source/Symbol/SymbolContext.cpp<br>
    lldb/trunk/source/Symbol/Symtab.cpp<br>
    lldb/trunk/source/Target/Memory.cpp<br>
    lldb/trunk/source/Target/Process.cpp<br>
    lldb/trunk/source/Target/ThreadPlanStepRange.cpp<br>
    lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj<br>
    lldb/trunk/tools/debugserver/source/RNBRemote.cpp<br>
    lldb/trunk/tools/debugserver/source/RNBRemote.h<br>
<br>
Modified: lldb/trunk/include/lldb/Core/RangeMap.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_include_lldb_Core_RangeMap.h-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=39k8nCKnK8xW7whefrPNJCsYjtu1xzRCg8IWq8HupNY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/RangeMap.h?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Core/RangeMap.h (original)<br>
+++ lldb/trunk/include/lldb/Core/RangeMap.h Thu Jun 25 16:46:34 2015<br>
@@ -128,9 +128,10 @@ namespace lldb_private {<br>
         {<br>
             return Contains(range.GetRangeBase()) && ContainsEndInclusive(range.GetRangeEnd());<br>
         }<br>
-<br>
+<br>
+        // Returns true if the two ranges adjoing or intersect<br>
         bool<br>
-        Overlap (const Range &rhs) const<br>
+        DoesAdjoinOrIntersect (const Range &rhs) const<br>
         {<br>
             const BaseType lhs_base = this->GetRangeBase();<br>
             const BaseType rhs_base = rhs.GetRangeBase();<br>
@@ -139,7 +140,19 @@ namespace lldb_private {<br>
             bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base);<br>
             return result;<br>
         }<br>
-<br>
+<br>
+        // Returns true if the two ranges intersect<br>
+        bool<br>
+        DoesIntersect (const Range &rhs) const<br>
+        {<br>
+            const BaseType lhs_base = this->GetRangeBase();<br>
+            const BaseType rhs_base = rhs.GetRangeBase();<br>
+            const BaseType lhs_end = this->GetRangeEnd();<br>
+            const BaseType rhs_end = rhs.GetRangeEnd();<br>
+            bool result = (lhs_base < rhs_end) && (lhs_end > rhs_base);<br>
+            return result;<br>
+        }<br>
+<br>
         bool<br>
         operator < (const Range &rhs) const<br>
         {<br>
@@ -241,7 +254,7 @@ namespace lldb_private {<br>
                 // don't end up allocating and making a new collection for no reason<br>
                 for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)<br>
                 {<br>
-                    if (prev != end && prev->Overlap(*pos))<br>
+                    if (prev != end && prev->DoesAdjoinOrIntersect(*pos))<br>
                     {<br>
                         can_combine = true;<br>
                         break;<br>
@@ -255,7 +268,7 @@ namespace lldb_private {<br>
                     Collection minimal_ranges;<br>
                     for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)<br>
                     {<br>
-                        if (prev != end && prev->Overlap(*pos))<br>
+                        if (prev != end && prev->DoesAdjoinOrIntersect(*pos))<br>
                             minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd()));<br>
                         else<br>
                             minimal_ranges.push_back (*pos);<br>
@@ -521,7 +534,7 @@ namespace lldb_private {<br>
                 // don't end up allocating and making a new collection for no reason<br>
                 for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)<br>
                 {<br>
-                    if (prev != end && prev->Overlap(*pos))<br>
+                    if (prev != end && prev->DoesAdjoinOrIntersect(*pos))<br>
                     {<br>
                         can_combine = true;<br>
                         break;<br>
@@ -535,7 +548,7 @@ namespace lldb_private {<br>
                     Collection minimal_ranges;<br>
                     for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)<br>
                     {<br>
-                        if (prev != end && prev->Overlap(*pos))<br>
+                        if (prev != end && prev->DoesAdjoinOrIntersect(*pos))<br>
                             minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd()));<br>
                         else<br>
                             minimal_ranges.push_back (*pos);<br>
<br>
Modified: lldb/trunk/include/lldb/Core/StructuredData.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_include_lldb_Core_StructuredData.h-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=T7VQOsghyVhbntGGhe7ygzbeCmzi5zXt70kRcV-3X0o&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StructuredData.h?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Core/StructuredData.h (original)<br>
+++ lldb/trunk/include/lldb/Core/StructuredData.h Thu Jun 25 16:46:34 2015<br>
@@ -13,10 +13,11 @@<br>
 // C Includes<br>
 // C++ Includes<br>
<br>
+#include <functional><br>
 #include <map><br>
+#include <string><br>
 #include <utility><br>
 #include <vector><br>
-#include <string><br>
<br>
 #include "llvm/ADT/StringRef.h"<br>
<br>
@@ -140,6 +141,15 @@ public:<br>
             return NULL;<br>
         }<br>
<br>
+        uint64_t<br>
+        GetIntegerValue (uint64_t fail_value = 0)<br>
+        {<br>
+            Integer *integer = GetAsInteger ();<br>
+            if (integer)<br>
+                return integer->GetValue();<br>
+            return fail_value;<br>
+        }<br>
+<br>
         Float *<br>
         GetAsFloat ()<br>
         {<br>
@@ -148,6 +158,15 @@ public:<br>
             return NULL;<br>
         }<br>
<br>
+        double<br>
+        GetFloatValue (double fail_value = 0.0)<br>
+        {<br>
+            Float *f = GetAsFloat ();<br>
+            if (f)<br>
+                return f->GetValue();<br>
+            return fail_value;<br>
+        }<br>
+<br>
         Boolean *<br>
         GetAsBoolean ()<br>
         {<br>
@@ -156,6 +175,15 @@ public:<br>
             return NULL;<br>
         }<br>
<br>
+        bool<br>
+        GetBooleanValue (bool fail_value = false)<br>
+        {<br>
+            Boolean *b = GetAsBoolean ();<br>
+            if (b)<br>
+                return b->GetValue();<br>
+            return fail_value;<br>
+        }<br>
+<br>
         String *<br>
         GetAsString ()<br>
         {<br>
@@ -164,6 +192,19 @@ public:<br>
             return NULL;<br>
         }<br>
<br>
+        std::string<br>
+        GetStringValue(const char *fail_value = NULL)<br>
+        {<br>
+            String *s = GetAsString ();<br>
+            if (s)<br>
+                return s->GetValue();<br>
+<br>
+            if (fail_value && fail_value[0])<br>
+                return std::string(fail_value);<br>
+<br>
+            return std::string();<br>
+        }<br>
+<br>
         Generic *<br>
         GetAsGeneric()<br>
         {<br>
@@ -197,6 +238,17 @@ public:<br>
         {<br>
         }<br>
<br>
+        void<br>
+        ForEach (std::function <bool(Object* object)> const &foreach_callback) const<br>
+        {<br>
+            for (const auto &object_sp : m_items)<br>
+            {<br>
+                if (foreach_callback(object_sp.get()) == false)<br>
+                    break;<br>
+            }<br>
+        }<br>
+<br>
+<br>
         size_t<br>
         GetSize() const<br>
         {<br>
@@ -447,7 +499,7 @@ public:<br>
             m_value = string;<br>
         }<br>
<br>
-        std::string<br>
+        const std::string &<br>
         GetValue ()<br>
         {<br>
             return m_value;<br>
@@ -462,6 +514,7 @@ public:<br>
     class Dictionary : public Object<br>
     {<br>
     public:<br>
+<br>
         Dictionary () :<br>
             Object (Type::eTypeDictionary),<br>
             m_dict ()<br>
@@ -478,6 +531,16 @@ public:<br>
             return m_dict.size();<br>
         }<br>
<br>
+        void<br>
+        ForEach (std::function <bool(ConstString key, Object* object)> const &callback) const<br>
+        {<br>
+            for (const auto &pair : m_dict)<br>
+            {<br>
+                if (callback (pair.first, pair.second.get()) == false)<br>
+                    break;<br>
+            }<br>
+        }<br>
+<br>
         ObjectSP<br>
         GetKeys() const<br>
         {<br>
@@ -628,33 +691,25 @@ public:<br>
         void<br>
         AddIntegerItem (llvm::StringRef key, uint64_t value)<br>
         {<br>
-            ObjectSP val_obj (new Integer());<br>
-            val_obj->GetAsInteger()->SetValue (value);<br>
-            AddItem (key, val_obj);<br>
+            AddItem (key, ObjectSP (new Integer(value)));<br>
         }<br>
<br>
         void<br>
         AddFloatItem (llvm::StringRef key, double value)<br>
         {<br>
-            ObjectSP val_obj (new Float());<br>
-            val_obj->GetAsFloat()->SetValue (value);<br>
-            AddItem (key, val_obj);<br>
+            AddItem (key, ObjectSP (new Float(value)));<br>
         }<br>
<br>
         void<br>
         AddStringItem (llvm::StringRef key, std::string value)<br>
         {<br>
-            ObjectSP val_obj (new String());<br>
-            val_obj->GetAsString()->SetValue (value);<br>
-            AddItem (key, val_obj);<br>
+            AddItem (key, ObjectSP (new String(std::move(value))));<br>
         }<br>
<br>
         void<br>
         AddBooleanItem (llvm::StringRef key, bool value)<br>
         {<br>
-            ObjectSP val_obj (new Boolean());<br>
-            val_obj->GetAsBoolean()->SetValue (value);<br>
-            AddItem (key, val_obj);<br>
+            AddItem (key, ObjectSP (new Boolean(value)));<br>
         }<br>
<br>
         void Dump(Stream &s) const override;<br>
@@ -690,9 +745,9 @@ public:<br>
     class Generic : public Object<br>
     {<br>
       public:<br>
-        explicit Generic(void *object = nullptr)<br>
-            : Object(Type::eTypeGeneric)<br>
-            , m_object(object)<br>
+        explicit Generic(void *object = nullptr) :<br>
+            Object (Type::eTypeGeneric),<br>
+            m_object (object)<br>
         {<br>
         }<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/Symbol/Symbol.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_include_lldb_Symbol_Symbol.h-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=Ft-DIX6sS1_0mpTqBvt2GpWa5xIuOYUaB9_W35kxNgA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Symbol.h?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Symbol/Symbol.h (original)<br>
+++ lldb/trunk/include/lldb/Symbol/Symbol.h Thu Jun 25 16:46:34 2015<br>
@@ -72,25 +72,81 @@ public:<br>
     ValueIsAddress() const;<br>
<br>
     //------------------------------------------------------------------<br>
-    // Access the address value. Do NOT hand out the AddressRange as an<br>
-    // object as the byte size of the address range may not be filled in<br>
-    // and it should be accessed via GetByteSize().<br>
+    // The GetAddressRef() accessor functions should only be called if<br>
+    // you previously call ValueIsAddress() otherwise you might get an<br>
+    // reference to an Address object that contains an constant integer<br>
+    // value in m_addr_range.m_base_addr.m_offset which could be<br>
+    // incorrectly used to represent an absolute address since it has<br>
+    // no section.<br>
     //------------------------------------------------------------------<br>
     Address &<br>
-    GetAddress()<br>
+    GetAddressRef()<br>
     {<br>
         return m_addr_range.GetBaseAddress();<br>
     }<br>
<br>
+    const Address &<br>
+    GetAddressRef() const<br>
+    {<br>
+        return m_addr_range.GetBaseAddress();<br>
+    }<br>
+<br>
+    //------------------------------------------------------------------<br>
+    // Makes sure the symbol's value is an address and returns the file<br>
+    // address. Returns LLDB_INVALID_ADDRESS if the symbol's value isn't<br>
+    // an address.<br>
+    //------------------------------------------------------------------<br>
+    lldb::addr_t<br>
+    GetFileAddress () const;<br>
+<br>
+    //------------------------------------------------------------------<br>
+    // Makes sure the symbol's value is an address and gets the load<br>
+    // address using \a target if it is. Returns LLDB_INVALID_ADDRESS<br>
+    // if the symbol's value isn't an address or if the section isn't<br>
+    // loaded in \a target.<br>
+    //------------------------------------------------------------------<br>
+    lldb::addr_t<br>
+    GetLoadAddress (Target *target) const;<br>
+<br>
     //------------------------------------------------------------------<br>
     // Access the address value. Do NOT hand out the AddressRange as an<br>
     // object as the byte size of the address range may not be filled in<br>
     // and it should be accessed via GetByteSize().<br>
     //------------------------------------------------------------------<br>
-    const Address &<br>
+    Address<br>
     GetAddress() const<br>
     {<br>
-        return m_addr_range.GetBaseAddress();<br>
+        // Make sure the our value is an address before we hand a copy out.<br>
+        // We use the Address inside m_addr_range to contain the value for<br>
+        // symbols that are not address based symbols so we are using it<br>
+        // for more than just addresses. For example undefined symbols on<br>
+        // MacOSX have a nlist.n_value of 0 (zero) and this will get placed<br>
+        // into m_addr_range.m_base_addr.m_offset and it will have no section.<br>
+        // So in the GetAddress() accessor, we need to hand out an invalid<br>
+        // address if the symbol's value isn't an address.<br>
+        if (ValueIsAddress())<br>
+            return m_addr_range.GetBaseAddress();<br>
+        else<br>
+            return Address();<br>
+    }<br>
+<br>
+    // When a symbol's value isn't an address, we need to access the raw<br>
+    // value. This function will ensure this symbol's value isn't an address<br>
+    // and return the integer value if this checks out, otherwise it will<br>
+    // return "fail_value" if the symbol is an address value.<br>
+    uint64_t<br>
+    GetIntegerValue (uint64_t fail_value = 0) const<br>
+    {<br>
+        if (ValueIsAddress())<br>
+        {<br>
+            // This symbol's value is an address. Use Symbol::GetAddress() to get the address.<br>
+            return fail_value;<br>
+        }<br>
+        else<br>
+        {<br>
+            // The value is stored in the base address' offset<br>
+            return m_addr_range.GetBaseAddress().GetOffset();<br>
+        }<br>
     }<br>
<br>
     lldb::addr_t<br>
<br>
Modified: lldb/trunk/include/lldb/Target/Memory.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_include_lldb_Target_Memory.h-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=QRdT8NlyS8haoIEO3zR33ZyP-IvrfICOQ_pULvGakJg&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Memory.h?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Target/Memory.h (original)<br>
+++ lldb/trunk/include/lldb/Target/Memory.h Thu Jun 25 16:46:34 2015<br>
@@ -52,7 +52,7 @@ namespace lldb_private {<br>
         uint32_t<br>
         GetMemoryCacheLineSize() const<br>
         {<br>
-            return m_cache_line_byte_size ;<br>
+            return m_L2_cache_line_byte_size ;<br>
         }<br>
<br>
         void<br>
@@ -61,17 +61,26 @@ namespace lldb_private {<br>
         bool<br>
         RemoveInvalidRange (lldb::addr_t base_addr, lldb::addr_t byte_size);<br>
<br>
+        // Allow external sources to populate data into the L1 memory cache<br>
+        void<br>
+        AddL1CacheData(lldb::addr_t addr, const void *src, size_t src_len);<br>
+<br>
+        void<br>
+        AddL1CacheData(lldb::addr_t addr, const lldb::DataBufferSP &data_buffer_sp);<br>
+<br>
     protected:<br>
         typedef std::map<lldb::addr_t, lldb::DataBufferSP> BlockMap;<br>
         typedef RangeArray<lldb::addr_t, lldb::addr_t, 4> InvalidRanges;<br>
+        typedef Range<lldb::addr_t, lldb::addr_t> AddrRange;<br>
         //------------------------------------------------------------------<br>
         // Classes that inherit from MemoryCache can see and modify these<br>
         //------------------------------------------------------------------<br>
-        Process &m_process;<br>
-        uint32_t m_cache_line_byte_size;<br>
         Mutex m_mutex;<br>
-        BlockMap m_cache;<br>
+        BlockMap m_L1_cache; // A first level memory cache whose chunk sizes vary that will be used only if the memory read fits entirely in a chunk<br>
+        BlockMap m_L2_cache; // A memory cache of fixed size chinks (m_L2_cache_line_byte_size bytes in size each)<br>
         InvalidRanges m_invalid_ranges;<br>
+        Process &m_process;<br>
+        uint32_t m_L2_cache_line_byte_size;<br>
     private:<br>
         DISALLOW_COPY_AND_ASSIGN (MemoryCache);<br>
     };<br>
<br>
Modified: lldb/trunk/source/API/SBSymbol.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_API_SBSymbol.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=xrTHuU5AVdDACOswUB24OQ31rwNq95Zazmwd3SMaydI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbol.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/API/SBSymbol.cpp (original)<br>
+++ lldb/trunk/source/API/SBSymbol.cpp Thu Jun 25 16:46:34 2015<br>
@@ -137,10 +137,11 @@ SBSymbol::GetInstructions (SBTarget targ<br>
         }<br>
         if (m_opaque_ptr->ValueIsAddress())<br>
         {<br>
-            ModuleSP module_sp (m_opaque_ptr->GetAddress().GetModule());<br>
+            const Address &symbol_addr = m_opaque_ptr->GetAddressRef();<br>
+            ModuleSP module_sp = symbol_addr.GetModule();<br>
             if (module_sp)<br>
             {<br>
-                AddressRange symbol_range (m_opaque_ptr->GetAddress(), m_opaque_ptr->GetByteSize());<br>
+                AddressRange symbol_range (symbol_addr, m_opaque_ptr->GetByteSize());<br>
                 const bool prefer_file_cache = false;<br>
                 sb_instructions.SetDisassembler (Disassembler::DisassembleRange (module_sp->GetArchitecture (),<br>
                                                                                  NULL,<br>
@@ -172,7 +173,7 @@ SBSymbol::GetStartAddress ()<br>
     SBAddress addr;<br>
     if (m_opaque_ptr && m_opaque_ptr->ValueIsAddress())<br>
     {<br>
-        addr.SetAddress (&m_opaque_ptr->GetAddress());<br>
+        addr.SetAddress (&m_opaque_ptr->GetAddressRef());<br>
     }<br>
     return addr;<br>
 }<br>
@@ -186,7 +187,7 @@ SBSymbol::GetEndAddress ()<br>
         lldb::addr_t range_size = m_opaque_ptr->GetByteSize();<br>
         if (range_size > 0)<br>
         {<br>
-            addr.SetAddress (&m_opaque_ptr->GetAddress());<br>
+            addr.SetAddress (&m_opaque_ptr->GetAddressRef());<br>
             addr->Slide (m_opaque_ptr->GetByteSize());<br>
         }<br>
     }<br>
<br>
Modified: lldb/trunk/source/API/SBThread.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_API_SBThread.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=gmx-wTDknylKG1gTKpg0mFjxGX9recvCiQYRTDN_MH4&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/API/SBThread.cpp (original)<br>
+++ lldb/trunk/source/API/SBThread.cpp Thu Jun 25 16:46:34 2015<br>
@@ -114,13 +114,13 @@ SBThread::GetQueue () const<br>
         else<br>
         {<br>
             if (log)<br>
-                log->Printf ("SBThread(%p)::GetQueueKind() => error: process is running",<br>
+                log->Printf ("SBThread(%p)::GetQueue() => error: process is running",<br>
                              static_cast<void*>(exe_ctx.GetThreadPtr()));<br>
         }<br>
     }<br>
<br>
     if (log)<br>
-        log->Printf ("SBThread(%p)::GetQueueKind () => SBQueue(%p)",<br>
+        log->Printf ("SBThread(%p)::GetQueue () => SBQueue(%p)",<br>
                      static_cast<void*>(exe_ctx.GetThreadPtr()), static_cast<void*>(queue_sp.get()));<br>
<br>
     return sb_queue;<br>
<br>
Modified: lldb/trunk/source/Commands/CommandObjectSource.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Commands_CommandObjectSource.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=t6Mh3bSVk_PL0gQ3_M9fllx2MdcyjdQ2ILz7K6kIkog&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSource.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Commands/CommandObjectSource.cpp (original)<br>
+++ lldb/trunk/source/Commands/CommandObjectSource.cpp Thu Jun 25 16:46:34 2015<br>
@@ -537,9 +537,9 @@ protected:<br>
                 {<br>
                     SymbolContext sc;<br>
                     sc_list_symbols.GetContextAtIndex (i, sc);<br>
-                    if (sc.symbol)<br>
+                    if (sc.symbol && sc.symbol->ValueIsAddress())<br>
                     {<br>
-                        const Address &base_address = sc.symbol->GetAddress();<br>
+                        const Address &base_address = sc.symbol->GetAddressRef();<br>
                         Function *function = base_address.CalculateSymbolContextFunction();<br>
                         if (function)<br>
                         {<br>
<br>
Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Commands_CommandObjectTarget.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=C4vRtz9JuOVtfpXaXRCXTMN8BE7dUg8f5amgCPQHCY8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)<br>
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Thu Jun 25 16:46:34 2015<br>
@@ -1734,17 +1734,16 @@ LookupSymbolInModule (CommandInterpreter<br>
                     DumpFullpath (strm, &module->GetFileSpec(), 0);<br>
                     strm.PutCString(":\n");<br>
                     strm.IndentMore ();<br>
-                    //Symtab::DumpSymbolHeader (&strm);<br>
                     for (i=0; i < num_matches; ++i)<br>
                     {<br>
                         Symbol *symbol = symtab->SymbolAtIndex(match_indexes[i]);<br>
-                        DumpAddress (interpreter.GetExecutionContext().GetBestExecutionContextScope(),<br>
-                                     symbol->GetAddress(),<br>
-                                     verbose,<br>
-                                     strm);<br>
-<br>
-//                        strm.Indent ();<br>
-//                        symbol->Dump (&strm, interpreter.GetExecutionContext().GetTargetPtr(), i);<br>
+                        if (symbol && symbol->ValueIsAddress())<br>
+                        {<br>
+                            DumpAddress (interpreter.GetExecutionContext().GetBestExecutionContextScope(),<br>
+                                         symbol->GetAddressRef(),<br>
+                                         verbose,<br>
+                                         strm);<br>
+                        }<br>
                     }<br>
                     strm.IndentLess ();<br>
                     return num_matches;<br>
<br>
Modified: lldb/trunk/source/Core/Address.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Core_Address.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=jj1zVMfxcXNjYsUGzruAiRv-9HrTz5HMY-SQVETEDfo&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/Address.cpp (original)<br>
+++ lldb/trunk/source/Core/Address.cpp Thu Jun 25 16:46:34 2015<br>
@@ -501,7 +501,7 @@ Address::Dump (Stream *s, ExecutionConte<br>
                                     if (symbol_name)<br>
                                     {<br>
                                         s->PutCString(symbol_name);<br>
-                                        addr_t delta = file_Addr - symbol->GetAddress().GetFileAddress();<br>
+                                        addr_t delta = file_Addr - symbol->GetAddressRef().GetFileAddress();<br>
                                         if (delta)<br>
                                             s->Printf(" + %" PRIu64, delta);<br>
                                         showed_info = true;<br>
@@ -669,7 +669,7 @@ Address::Dump (Stream *s, ExecutionConte<br>
                             // If we have just a symbol make sure it is in the right section<br>
                             if (sc.symbol->ValueIsAddress())<br>
                             {<br>
-                                if (sc.symbol->GetAddress().GetSection() != GetSection())<br>
+                                if (sc.symbol->GetAddressRef().GetSection() != GetSection())<br>
                                 {<br>
                                     // don't show the module if the symbol is a trampoline symbol<br>
                                     show_stop_context = false;<br>
@@ -722,7 +722,7 @@ Address::Dump (Stream *s, ExecutionConte<br>
                     // as our address. If it isn't, then we might have just found<br>
                     // the last symbol that came before the address that we are<br>
                     // looking up that has nothing to do with our address lookup.<br>
-                    if (sc.symbol->ValueIsAddress() && sc.symbol->GetAddress().GetSection() != GetSection())<br>
+                    if (sc.symbol->ValueIsAddress() && sc.symbol->GetAddressRef().GetSection() != GetSection())<br>
                         sc.symbol = NULL;<br>
                 }<br>
                 sc.GetDescription(s, eDescriptionLevelBrief, target);<br>
<br>
Modified: lldb/trunk/source/Core/AddressResolverName.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Core_AddressResolverName.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=m9_bUYEac32iARBC2dRu6PZm7zN6eaJZL0mqMKJLxEQ&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/AddressResolverName.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/AddressResolverName.cpp (original)<br>
+++ lldb/trunk/source/Core/AddressResolverName.cpp Thu Jun 25 16:46:34 2015<br>
@@ -165,7 +165,7 @@ AddressResolverName::SearchCallback<br>
                 {<br>
                     if (symbol_sc.symbol && symbol_sc.symbol->ValueIsAddress())<br>
                     {<br>
-                        if (sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddress())<br>
+                        if (sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddressRef())<br>
                         {<br>
                             sym_list.RemoveContextAtIndex(j);<br>
                             continue;   // Don't increment j<br>
@@ -211,7 +211,7 @@ AddressResolverName::SearchCallback<br>
         {<br>
             if (sc.symbol && sc.symbol->ValueIsAddress())<br>
             {<br>
-                func_addr = sc.symbol->GetAddress();<br>
+                func_addr = sc.symbol->GetAddressRef();<br>
                 addr_t byte_size = sc.symbol->GetByteSize();<br>
<br>
                 if (skip_prologue)<br>
<br>
Modified: lldb/trunk/source/Core/Disassembler.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Core_Disassembler.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=j6kPdlkfIrl1nmyArLAfSeC6mCLKJfQ3B5jJTi4zT1Q&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/Disassembler.cpp (original)<br>
+++ lldb/trunk/source/Core/Disassembler.cpp Thu Jun 25 16:46:34 2015<br>
@@ -548,7 +548,7 @@ Disassembler::Disassemble<br>
         }<br>
         else if (sc.symbol && sc.symbol->ValueIsAddress())<br>
         {<br>
-            range.GetBaseAddress() = sc.symbol->GetAddress();<br>
+            range.GetBaseAddress() = sc.symbol->GetAddressRef();<br>
             range.SetByteSize (sc.symbol->GetByteSize());<br>
         }<br>
         else<br>
<br>
Modified: lldb/trunk/source/Core/FormatEntity.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Core_FormatEntity.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=zhBLXrrp6HUwZMwhPu3j8OAAq8bImhLHhfec8EeiV9c&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/FormatEntity.cpp (original)<br>
+++ lldb/trunk/source/Core/FormatEntity.cpp Thu Jun 25 16:46:34 2015<br>
@@ -477,7 +477,7 @@ DumpAddressOffsetFromFunction (Stream &s<br>
                 }<br>
             }<br>
             else if (sc->symbol && sc->symbol->ValueIsAddress())<br>
-                func_addr = sc->symbol->GetAddress();<br>
+                func_addr = sc->symbol->GetAddressRef();<br>
         }<br>
<br>
         if (func_addr.IsValid())<br>
<br>
Modified: lldb/trunk/source/Core/Module.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Core_Module.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=VkcNbAudQdFHpEPW-8hX6kLIoVTk3bl-auudG0WVDCo&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/Module.cpp (original)<br>
+++ lldb/trunk/source/Core/Module.cpp Thu Jun 25 16:46:34 2015<br>
@@ -902,10 +902,9 @@ Module::FindFunctions (const RegularExpr<br>
                         {<br>
                             sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);<br>
                             SymbolType sym_type = sc.symbol->GetType();<br>
-                            if (sc.symbol && (sym_type == eSymbolTypeCode ||<br>
-                                              sym_type == eSymbolTypeResolver))<br>
+                            if (sc.symbol && sc.symbol->ValueIsAddress() && (sym_type == eSymbolTypeCode || sym_type == eSymbolTypeResolver))<br>
                             {<br>
-                                FileAddrToIndexMap::const_iterator pos = file_addr_to_index.find(sc.symbol->GetAddress().GetFileAddress());<br>
+                                FileAddrToIndexMap::const_iterator pos = file_addr_to_index.find(sc.symbol->GetAddressRef().GetFileAddress());<br>
                                 if (pos == end)<br>
                                     sc_list.Append(sc);<br>
                                 else<br>
<br>
Modified: lldb/trunk/source/Core/StructuredData.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Core_StructuredData.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=R0-PhQfV7nM9vDjA0pOHWd5wE57PC_L8UV_q0uuYLjE&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/StructuredData.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/StructuredData.cpp (original)<br>
+++ lldb/trunk/source/Core/StructuredData.cpp Thu Jun 25 16:46:34 2015<br>
@@ -298,6 +298,10 @@ StructuredData::ParseJSON (std::string j<br>
             {<br>
                 object_sp = read_json_object (&c);<br>
             }<br>
+            else if (*c == '[')<br>
+            {<br>
+                object_sp = read_json_array (&c);<br>
+            }<br>
             else<br>
             {<br>
                 // We have bad characters here, this is likely an illegal JSON string.<br>
<br>
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Expression_ClangExpressionDeclMap.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=hoEwUMeSdHgCGYUc-vXmydpH0KTS73C0lQba8nXpIu8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)<br>
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Jun 25 16:46:34 2015<br>
@@ -665,74 +665,71 @@ ClangExpressionDeclMap::GetSymbolAddress<br>
         SymbolContext sym_ctx;<br>
         sc_list.GetContextAtIndex(i, sym_ctx);<br>
<br>
-        const Address *sym_address = &sym_ctx.symbol->GetAddress();<br>
+        const Address sym_address = sym_ctx.symbol->GetAddress();<br>
<br>
-        if (!sym_address || !sym_address->IsValid())<br>
+        if (!sym_address.IsValid())<br>
             continue;<br>
<br>
-        if (sym_address)<br>
+        switch (sym_ctx.symbol->GetType())<br>
         {<br>
-            switch (sym_ctx.symbol->GetType())<br>
-            {<br>
-                case eSymbolTypeCode:<br>
-                case eSymbolTypeTrampoline:<br>
-                    symbol_load_addr = sym_address->GetCallableLoadAddress (&target);<br>
-                    break;<br>
-<br>
-                case eSymbolTypeResolver:<br>
-                    symbol_load_addr = sym_address->GetCallableLoadAddress (&target, true);<br>
-                    break;<br>
+            case eSymbolTypeCode:<br>
+            case eSymbolTypeTrampoline:<br>
+                symbol_load_addr = sym_address.GetCallableLoadAddress (&target);<br>
+                break;<br>
+<br>
+            case eSymbolTypeResolver:<br>
+                symbol_load_addr = sym_address.GetCallableLoadAddress (&target, true);<br>
+                break;<br>
<br>
-                case eSymbolTypeReExported:<br>
+            case eSymbolTypeReExported:<br>
+                {<br>
+                    ConstString reexport_name = sym_ctx.symbol->GetReExportedSymbolName();<br>
+                    if (reexport_name)<br>
                     {<br>
-                        ConstString reexport_name = sym_ctx.symbol->GetReExportedSymbolName();<br>
-                        if (reexport_name)<br>
+                        ModuleSP reexport_module_sp;<br>
+                        ModuleSpec reexport_module_spec;<br>
+                        reexport_module_spec.GetPlatformFileSpec() = sym_ctx.symbol->GetReExportedSymbolSharedLibrary();<br>
+                        if (reexport_module_spec.GetPlatformFileSpec())<br>
                         {<br>
-                            ModuleSP reexport_module_sp;<br>
-                            ModuleSpec reexport_module_spec;<br>
-                            reexport_module_spec.GetPlatformFileSpec() = sym_ctx.symbol->GetReExportedSymbolSharedLibrary();<br>
-                            if (reexport_module_spec.GetPlatformFileSpec())<br>
+                            reexport_module_sp = target.GetImages().FindFirstModule(reexport_module_spec);<br>
+                            if (!reexport_module_sp)<br>
                             {<br>
+                                reexport_module_spec.GetPlatformFileSpec().GetDirectory().Clear();<br>
                                 reexport_module_sp = target.GetImages().FindFirstModule(reexport_module_spec);<br>
-                                if (!reexport_module_sp)<br>
-                                {<br>
-                                    reexport_module_spec.GetPlatformFileSpec().GetDirectory().Clear();<br>
-                                    reexport_module_sp = target.GetImages().FindFirstModule(reexport_module_spec);<br>
-                                }<br>
                             }<br>
-                            symbol_load_addr = GetSymbolAddress(target, process, sym_ctx.symbol->GetReExportedSymbolName(), symbol_type, reexport_module_sp.get());<br>
                         }<br>
+                        symbol_load_addr = GetSymbolAddress(target, process, sym_ctx.symbol->GetReExportedSymbolName(), symbol_type, reexport_module_sp.get());<br>
                     }<br>
-                    break;<br>
+                }<br>
+                break;<br>
<br>
-                case eSymbolTypeData:<br>
-                case eSymbolTypeRuntime:<br>
-                case eSymbolTypeVariable:<br>
-                case eSymbolTypeLocal:<br>
-                case eSymbolTypeParam:<br>
-                case eSymbolTypeInvalid:<br>
-                case eSymbolTypeAbsolute:<br>
-                case eSymbolTypeException:<br>
-                case eSymbolTypeSourceFile:<br>
-                case eSymbolTypeHeaderFile:<br>
-                case eSymbolTypeObjectFile:<br>
-                case eSymbolTypeCommonBlock:<br>
-                case eSymbolTypeBlock:<br>
-                case eSymbolTypeVariableType:<br>
-                case eSymbolTypeLineEntry:<br>
-                case eSymbolTypeLineHeader:<br>
-                case eSymbolTypeScopeBegin:<br>
-                case eSymbolTypeScopeEnd:<br>
-                case eSymbolTypeAdditional:<br>
-                case eSymbolTypeCompiler:<br>
-                case eSymbolTypeInstrumentation:<br>
-                case eSymbolTypeUndefined:<br>
-                case eSymbolTypeObjCClass:<br>
-                case eSymbolTypeObjCMetaClass:<br>
-                case eSymbolTypeObjCIVar:<br>
-                    symbol_load_addr = sym_address->GetLoadAddress (&target);<br>
-                    break;<br>
-            }<br>
+            case eSymbolTypeData:<br>
+            case eSymbolTypeRuntime:<br>
+            case eSymbolTypeVariable:<br>
+            case eSymbolTypeLocal:<br>
+            case eSymbolTypeParam:<br>
+            case eSymbolTypeInvalid:<br>
+            case eSymbolTypeAbsolute:<br>
+            case eSymbolTypeException:<br>
+            case eSymbolTypeSourceFile:<br>
+            case eSymbolTypeHeaderFile:<br>
+            case eSymbolTypeObjectFile:<br>
+            case eSymbolTypeCommonBlock:<br>
+            case eSymbolTypeBlock:<br>
+            case eSymbolTypeVariableType:<br>
+            case eSymbolTypeLineEntry:<br>
+            case eSymbolTypeLineHeader:<br>
+            case eSymbolTypeScopeBegin:<br>
+            case eSymbolTypeScopeEnd:<br>
+            case eSymbolTypeAdditional:<br>
+            case eSymbolTypeCompiler:<br>
+            case eSymbolTypeInstrumentation:<br>
+            case eSymbolTypeUndefined:<br>
+            case eSymbolTypeObjCClass:<br>
+            case eSymbolTypeObjCMetaClass:<br>
+            case eSymbolTypeObjCIVar:<br>
+                symbol_load_addr = sym_address.GetLoadAddress (&target);<br>
+                break;<br>
         }<br>
     }<br>
<br>
@@ -780,9 +777,9 @@ ClangExpressionDeclMap::FindGlobalDataSy<br>
         if (sym_ctx.symbol)<br>
         {<br>
             const Symbol *symbol = sym_ctx.symbol;<br>
-            const Address *sym_address = &symbol->GetAddress();<br>
+            const Address sym_address = symbol->GetAddress();<br>
<br>
-            if (sym_address && sym_address->IsValid())<br>
+            if (sym_address.IsValid())<br>
             {<br>
                 switch (symbol->GetType())<br>
                 {<br>
@@ -1818,7 +1815,7 @@ ClangExpressionDeclMap::AddOneGenericVar<br>
     entity->EnableParserVars(GetParserID());<br>
     ClangExpressionVariable::ParserVars *parser_vars = entity->GetParserVars(GetParserID());<br>
<br>
-    const Address &symbol_address = symbol.GetAddress();<br>
+    const Address symbol_address = symbol.GetAddress();<br>
     lldb::addr_t symbol_load_addr = symbol_address.GetLoadAddress(target);<br>
<br>
     //parser_vars->m_lldb_value.SetContext(Value::eContextTypeClangType, user_type.GetOpaqueQualType());<br>
@@ -1957,7 +1954,7 @@ ClangExpressionDeclMap::AddOneFunction (<br>
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));<br>
<br>
     NamedDecl *function_decl = NULL;<br>
-    const Address *fun_address = NULL;<br>
+    Address fun_address;<br>
     ClangASTType function_clang_type;<br>
<br>
     bool is_indirect_function = false;<br>
@@ -1982,7 +1979,7 @@ ClangExpressionDeclMap::AddOneFunction (<br>
             return;<br>
         }<br>
<br>
-        fun_address = &function->GetAddressRange().GetBaseAddress();<br>
+        fun_address = function->GetAddressRange().GetBaseAddress();<br>
<br>
         ClangASTType copied_function_type = GuardedCopyType(function_clang_type);<br>
         if (copied_function_type)<br>
@@ -2016,7 +2013,7 @@ ClangExpressionDeclMap::AddOneFunction (<br>
     }<br>
     else if (symbol)<br>
     {<br>
-        fun_address = &symbol->GetAddress();<br>
+        fun_address = symbol->GetAddress();<br>
         function_decl = context.AddGenericFunDecl();<br>
         is_indirect_function = symbol->IsIndirect();<br>
     }<br>
@@ -2029,7 +2026,7 @@ ClangExpressionDeclMap::AddOneFunction (<br>
<br>
     Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();<br>
<br>
-    lldb::addr_t load_addr = fun_address->GetCallableLoadAddress(target, is_indirect_function);<br>
+    lldb::addr_t load_addr = fun_address.GetCallableLoadAddress(target, is_indirect_function);<br>
<br>
     ClangExpressionVariableSP entity(m_found_entities.CreateVariable (m_parser_vars->m_exe_ctx.GetBestExecutionContextScope (),<br>
                                                                       m_parser_vars->m_target_info.byte_order,<br>
@@ -2052,7 +2049,7 @@ ClangExpressionDeclMap::AddOneFunction (<br>
     {<br>
         // We have to try finding a file address.<br>
<br>
-        lldb::addr_t file_addr = fun_address->GetFileAddress();<br>
+        lldb::addr_t file_addr = fun_address.GetFileAddress();<br>
<br>
         parser_vars->m_lldb_value.SetValueType(Value::eValueTypeFileAddress);<br>
         parser_vars->m_lldb_value.GetScalar() = file_addr;<br>
@@ -2068,7 +2065,7 @@ ClangExpressionDeclMap::AddOneFunction (<br>
<br>
         StreamString ss;<br>
<br>
-        fun_address->Dump(&ss, m_parser_vars->m_exe_ctx.GetBestExecutionContextScope(), Address::DumpStyleResolvedDescription);<br>
+        fun_address.Dump(&ss, m_parser_vars->m_exe_ctx.GetBestExecutionContextScope(), Address::DumpStyleResolvedDescription);<br>
<br>
         log->Printf("  CEDM::FEVD[%u] Found %s function %s (description %s), returned %s",<br>
                     current_id,<br>
<br>
Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Expression_IRExecutionUnit.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=8j5b8P2fh3bwBcf0l2bwA0qsdmRktloEAStIe9x4z0E&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original)<br>
+++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Thu Jun 25 16:46:34 2015<br>
@@ -679,16 +679,16 @@ IRExecutionUnit::MemoryManager::getSymbo<br>
         if (sym_ctx.symbol->GetType() == lldb::eSymbolTypeUndefined)<br>
             continue;<br>
<br>
-        const Address *sym_address = &sym_ctx.symbol->GetAddress();<br>
+        const Address sym_address = sym_ctx.symbol->GetAddress();<br>
<br>
-        if (!sym_address || !sym_address->IsValid())<br>
+        if (!sym_address.IsValid())<br>
             continue;<br>
<br>
         symbol_load_addr = sym_ctx.symbol->ResolveCallableAddress(*target_sp);<br>
<br>
         if (symbol_load_addr == LLDB_INVALID_ADDRESS)<br>
         {<br>
-            symbol_load_addr = sym_ctx.symbol->GetAddress().GetLoadAddress(target_sp.get());<br>
+            symbol_load_addr = sym_address.GetLoadAddress(target_sp.get());<br>
         }<br>
     }<br>
<br>
<br>
Modified: lldb/trunk/source/Expression/Materializer.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Expression_Materializer.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=xc0VPpd-8yIlz2xTBlM_TqrSfamjVKr55DJBg0c0oaM&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Expression/Materializer.cpp (original)<br>
+++ lldb/trunk/source/Expression/Materializer.cpp Thu Jun 25 16:46:34 2015<br>
@@ -1052,7 +1052,7 @@ public:<br>
                         m_symbol.GetName().AsCString());<br>
         }<br>
<br>
-        Address &sym_address = m_symbol.GetAddress();<br>
+        const Address sym_address = m_symbol.GetAddress();<br>
<br>
         ExecutionContextScope *exe_scope = map.GetBestExecutionContextScope();<br>
<br>
<br>
Modified: lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_DynamicLoader_Hexagon-2DDYLD_DynamicLoaderHexagonDYLD.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=_a4MtWuEn_AjizgbNrMhKy4Gwjqe3xHd_jaC6Yq5Q_o&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp (original)<br>
+++ lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp Thu Jun 25 16:46:34 2015<br>
@@ -64,7 +64,7 @@ static lldb::addr_t findSymbolAddress( P<br>
<br>
         if ( ConstString::Compare( findName, symName ) == 0 )<br>
         {<br>
-            Address addr = sym->GetAddress( );<br>
+            Address addr = sym->GetAddressObj( );<br>
             return addr.GetLoadAddress( & proc->GetTarget() );<br>
         }<br>
     }<br>
<br>
Modified: lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_DynamicLoader_Hexagon-2DDYLD_HexagonDYLDRendezvous.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=9gRU02lapabNt3dWeFWZIKRfK6VaIKGLAp-aZkOFW28&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp (original)<br>
+++ lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp Thu Jun 25 16:46:34 2015<br>
@@ -332,7 +332,7 @@ HexagonDYLDRendezvous::FindMetadata(cons<br>
     if (!target.GetImages().FindSymbolsWithNameAndType (ConstString(name), eSymbolTypeAny, list))<br>
         return false;<br>
<br>
-    Address address = list[0].symbol->GetAddress();<br>
+    Address address = list[0].symbol->GetAddressObj();<br>
     addr_t addr = address.GetLoadAddress (&target);<br>
     if (addr == LLDB_INVALID_ADDRESS)<br>
         return false;<br>
<br>
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_DynamicLoader_MacOSX-2DDYLD_DynamicLoaderMacOSXDYLD.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=zIs9kfZyKovcvEmKXeCd-pwxsFEhbZMDYrAunRxaik8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)<br>
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Thu Jun 25 16:46:34 2015<br>
@@ -407,7 +407,7 @@ DynamicLoaderMacOSXDYLD::ReadDYLDInfoFro<br>
                 static ConstString g_dyld_all_image_infos ("dyld_all_image_infos");<br>
                 const Symbol *symbol = dyld_module_sp->FindFirstSymbolWithNameAndType (g_dyld_all_image_infos, eSymbolTypeData);<br>
                 if (symbol)<br>
-                    m_dyld_all_image_infos_addr = symbol->GetAddress().GetLoadAddress(&target);<br>
+                    m_dyld_all_image_infos_addr = symbol->GetLoadAddress(&target);<br>
             }<br>
<br>
             // Update all image infos<br>
@@ -1370,7 +1370,7 @@ DynamicLoaderMacOSXDYLD::AlwaysRelyOnEHU<br>
     ModuleSP module_sp;<br>
     if (sym_ctx.symbol)<br>
     {<br>
-        module_sp = sym_ctx.symbol->GetAddress().GetModule();<br>
+        module_sp = sym_ctx.symbol->GetAddressRef().GetModule();<br>
     }<br>
     if (module_sp.get() == NULL && sym_ctx.function)<br>
     {<br>
@@ -1649,12 +1649,13 @@ DynamicLoaderMacOSXDYLD::GetStepThroughT<br>
                                 Symbol *actual_symbol = context.symbol->ResolveReExportedSymbol(*target_sp.get());<br>
                                 if (actual_symbol)<br>
                                 {<br>
-                                    if (actual_symbol->GetAddress().IsValid())<br>
+                                    const Address actual_symbol_addr = actual_symbol->GetAddress();<br>
+                                    if (actual_symbol_addr.IsValid())<br>
                                     {<br>
-                                        addresses.push_back(actual_symbol->GetAddress());<br>
+                                        addresses.push_back(actual_symbol_addr);<br>
                                         if (log)<br>
                                         {<br>
-                                            lldb::addr_t load_addr = actual_symbol->GetAddress().GetLoadAddress(target_sp.get());<br>
+                                            lldb::addr_t load_addr = actual_symbol_addr.GetLoadAddress(target_sp.get());<br>
                                             log->Printf ("Found a re-exported symbol: %s at 0x%" PRIx64 ".",<br>
                                                          actual_symbol->GetName().GetCString(), load_addr);<br>
                                         }<br>
@@ -1720,7 +1721,8 @@ DynamicLoaderMacOSXDYLD::GetStepThroughT<br>
                 if (symbol && symbol->IsIndirect())<br>
                 {<br>
                     Error error;<br>
-                    addr_t resolved_addr = thread.GetProcess()->ResolveIndirectFunction(&symbol->GetAddress(), error);<br>
+                    Address symbol_address = symbol->GetAddress();<br>
+                    addr_t resolved_addr = thread.GetProcess()->ResolveIndirectFunction(&symbol_address, error);<br>
                     if (error.Success())<br>
                     {<br>
                         load_addrs.push_back(resolved_addr);<br>
<br>
Modified: lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_InstrumentationRuntime_AddressSanitizer_AddressSanitizerRuntime.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=uMX510dEz9xAsMf4Y9Vrmq89RVRVSFUCoUWovsUmtLs&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp (original)<br>
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp Thu Jun 25 16:46:34 2015<br>
@@ -287,11 +287,11 @@ AddressSanitizerRuntime::Activate()<br>
     if (symbol == NULL)<br>
         return;<br>
<br>
-    if (!symbol->GetAddress().IsValid())<br>
+    if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid())<br>
         return;<br>
<br>
     Target &target = m_process->GetTarget();<br>
-    addr_t symbol_address = symbol->GetAddress().GetOpcodeLoadAddress(&target);<br>
+    addr_t symbol_address = symbol->GetAddressRef().GetOpcodeLoadAddress(&target);<br>
<br>
     if (symbol_address == LLDB_INVALID_ADDRESS)<br>
         return;<br>
<br>
Modified: lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_JITLoader_GDB_JITLoaderGDB.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=-vIaOyJIP5I8m5BpD3sNQTpih18pfNB2ACA9o01_L6g&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp (original)<br>
+++ lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp Thu Jun 25 16:46:34 2015<br>
@@ -436,10 +436,10 @@ JITLoaderGDB::GetSymbolAddress(ModuleLis<br>
     SymbolContext sym_ctx;<br>
     target_symbols.GetContextAtIndex(0, sym_ctx);<br>
<br>
-    const Address *jit_descriptor_addr = &sym_ctx.symbol->GetAddress();<br>
-    if (!jit_descriptor_addr || !jit_descriptor_addr->IsValid())<br>
+    const Address jit_descriptor_addr = sym_ctx.symbol->GetAddress();<br>
+    if (!jit_descriptor_addr.IsValid())<br>
         return LLDB_INVALID_ADDRESS;<br>
<br>
-    const addr_t jit_addr = jit_descriptor_addr->GetLoadAddress(&target);<br>
+    const addr_t jit_addr = jit_descriptor_addr.GetLoadAddress(&target);<br>
     return jit_addr;<br>
 }<br>
<br>
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_LanguageRuntime_ObjC_AppleObjCRuntime_AppleObjCRuntimeV1.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=Y5KbNYI6MbBa1gQYBcoFme0981sQlXJHLxMAkhFix-o&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (original)<br>
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp Thu Jun 25 16:46:34 2015<br>
@@ -299,13 +299,13 @@ AppleObjCRuntimeV1::GetISAHashTablePoint<br>
         static ConstString g_objc_debug_class_hash("_objc_debug_class_hash");<br>
<br>
         const Symbol *symbol = objc_module_sp->FindFirstSymbolWithNameAndType(g_objc_debug_class_hash, lldb::eSymbolTypeData);<br>
-        if (symbol)<br>
+        if (symbol && symbol->ValueIsAddress())<br>
         {<br>
             Process *process = GetProcess();<br>
             if (process)<br>
             {<br>
<br>
-                lldb::addr_t objc_debug_class_hash_addr = symbol->GetAddress().GetLoadAddress(&process->GetTarget());<br>
+                lldb::addr_t objc_debug_class_hash_addr = symbol->GetAddressRef().GetLoadAddress(&process->GetTarget());<br>
<br>
                 if (objc_debug_class_hash_addr != LLDB_INVALID_ADDRESS)<br>
                 {<br>
<br>
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_LanguageRuntime_ObjC_AppleObjCRuntime_AppleObjCRuntimeV2.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=nmaxdkjiELyliPEMQsmSzZmPPgefoxPrUpwWiEZX8aM&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)<br>
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Thu Jun 25 16:46:34 2015<br>
@@ -321,9 +321,9 @@ ExtractRuntimeGlobalSymbol (Process* pro<br>
     if (!byte_size)<br>
         byte_size = process->GetAddressByteSize();<br>
     const Symbol *symbol = module_sp->FindFirstSymbolWithNameAndType(name, lldb::eSymbolTypeData);<br>
-    if (symbol)<br>
+    if (symbol && symbol->ValueIsAddress())<br>
     {<br>
-        lldb::addr_t symbol_load_addr = symbol->GetAddress().GetLoadAddress(&process->GetTarget());<br>
+        lldb::addr_t symbol_load_addr = symbol->GetAddressRef().GetLoadAddress(&process->GetTarget());<br>
         if (symbol_load_addr != LLDB_INVALID_ADDRESS)<br>
         {<br>
             if (read_value)<br>
@@ -815,7 +815,7 @@ AppleObjCRuntimeV2::GetByteOffsetForIvar<br>
         if (sc_list.GetSize() == 1 && sc_list.GetContextAtIndex(0, ivar_offset_symbol))<br>
         {<br>
             if (ivar_offset_symbol.symbol)<br>
-                ivar_offset_address = ivar_offset_symbol.symbol->GetAddress().GetLoadAddress (&target);<br>
+                ivar_offset_address = ivar_offset_symbol.symbol->GetLoadAddress (&target);<br>
         }<br>
<br>
         //----------------------------------------------------------------------<br>
@@ -1191,7 +1191,7 @@ AppleObjCRuntimeV2::GetISAHashTablePoint<br>
         const Symbol *symbol = objc_module_sp->FindFirstSymbolWithNameAndType(g_gdb_objc_realized_classes, lldb::eSymbolTypeAny);<br>
         if (symbol)<br>
         {<br>
-            lldb::addr_t gdb_objc_realized_classes_ptr = symbol->GetAddress().GetLoadAddress(&process->GetTarget());<br>
+            lldb::addr_t gdb_objc_realized_classes_ptr = symbol->GetLoadAddress(&process->GetTarget());<br>
<br>
             if (gdb_objc_realized_classes_ptr != LLDB_INVALID_ADDRESS)<br>
             {<br>
<br>
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_LanguageRuntime_ObjC_AppleObjCRuntime_AppleObjCTrampolineHandler.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=5doyb-Kzwi5R3ipY7kBHsXAc7YervHAYpK5Z3JX9CFI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)<br>
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Thu Jun 25 16:46:34 2015<br>
@@ -471,10 +471,7 @@ AppleObjCTrampolineHandler::AppleObjCVTa<br>
                                                                                             eSymbolTypeData);<br>
         if (trampoline_symbol != NULL)<br>
         {<br>
-            if (!trampoline_symbol->GetAddress().IsValid())<br>
-                return false;<br>
-<br>
-            m_trampoline_header = trampoline_symbol->GetAddress().GetLoadAddress(&target);<br>
+            m_trampoline_header = trampoline_symbol->GetLoadAddress(&target);<br>
             if (m_trampoline_header == LLDB_INVALID_ADDRESS)<br>
                 return false;<br>
<br>
@@ -484,10 +481,11 @@ AppleObjCTrampolineHandler::AppleObjCVTa<br>
                                                                                              eSymbolTypeCode);<br>
             if (changed_symbol != NULL)<br>
             {<br>
-                if (!changed_symbol->GetAddress().IsValid())<br>
+                const Address changed_symbol_addr = changed_symbol->GetAddress();<br>
+                if (!changed_symbol_addr.IsValid())<br>
                     return false;<br>
<br>
-                lldb::addr_t changed_addr = changed_symbol->GetAddress().GetOpcodeLoadAddress (&target);<br>
+                lldb::addr_t changed_addr = changed_symbol_addr.GetOpcodeLoadAddress (&target);<br>
                 if (changed_addr != LLDB_INVALID_ADDRESS)<br>
                 {<br>
                     BreakpointSP trampolines_changed_bp_sp = target.CreateBreakpoint (changed_addr, true, false);<br>
@@ -703,13 +701,13 @@ AppleObjCTrampolineHandler::AppleObjCTra<br>
     {<br>
         ConstString name_const_str(g_dispatch_functions[i].name);<br>
         const Symbol *msgSend_symbol = m_objc_module_sp->FindFirstSymbolWithNameAndType (name_const_str, eSymbolTypeCode);<br>
-        if (msgSend_symbol)<br>
+        if (msgSend_symbol && msgSend_symbol->ValueIsAddress())<br>
         {<br>
             // FixMe: Make g_dispatch_functions static table of DispatchFunctions, and have the map be address->index.<br>
             // Problem is we also need to lookup the dispatch function.  For now we could have a side table of stret & non-stret<br>
             // dispatch functions.  If that's as complex as it gets, we're fine.<br>
<br>
-            lldb::addr_t sym_addr = msgSend_symbol->GetAddress().GetOpcodeLoadAddress(target);<br>
+            lldb::addr_t sym_addr = msgSend_symbol->GetAddressRef().GetOpcodeLoadAddress(target);<br>
<br>
             m_msgSend_map.insert(std::pair<lldb::addr_t, int>(sym_addr, i));<br>
         }<br>
<br>
Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_LanguageRuntime_RenderScript_RenderScriptRuntime_RenderScriptRuntime.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=qNnGVXk0s_4zuRoGB8fKakn7_gIegja09k65QPp9X1Q&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original)<br>
+++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Thu Jun 25 16:46:34 2015<br>
@@ -422,7 +422,7 @@ RenderScriptRuntime::LoadRuntimeHooks(ll<br>
<br>
         const Symbol *sym = module->FindFirstSymbolWithNameAndType(ConstString(hook_defn->symbol_name), eSymbolTypeCode);<br>
<br>
-        addr_t addr = sym->GetAddress().GetLoadAddress(&target);<br>
+        addr_t addr = sym->GetLoadAddress(&target);<br>
         if (addr == LLDB_INVALID_ADDRESS)<br>
         {<br>
             if(log)<br>
@@ -542,7 +542,7 @@ RenderScriptRuntime::LoadModule(const ll<br>
                         Error error;<br>
                         uint32_t flag = 0x00000001U;<br>
                         Target &target = GetProcess()->GetTarget();<br>
-                        addr_t addr = debug_present->GetAddress().GetLoadAddress(&target);<br>
+                        addr_t addr = debug_present->GetLoadAddress(&target);<br>
                         GetProcess()->WriteMemory(addr, &flag, sizeof(flag), error);<br>
                         if(error.Success())<br>
                         {<br>
@@ -597,7 +597,7 @@ RSModuleDescriptor::ParseRSInfo()<br>
     const Symbol *info_sym = m_module->FindFirstSymbolWithNameAndType(ConstString(".<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__rs.info&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=_U6wQeIeiVyCdz1yO452raLImfGj4fuaikYPwkXmKZY&e=" rel="noreferrer" target="_blank">rs.info</a>"), eSymbolTypeData);<br>
     if (info_sym)<br>
     {<br>
-        const addr_t addr = info_sym->GetAddress().GetFileAddress();<br>
+        const addr_t addr = info_sym->GetAddressRef().GetFileAddress();<br>
         const addr_t size = info_sym->GetByteSize();<br>
         const FileSpec fs = m_module->GetFileSpec();<br>
<br>
@@ -809,7 +809,7 @@ RenderScriptRuntime::AttemptBreakpointAt<br>
                     }<br>
                 }<br>
<br>
-                addr_t bp_addr = kernel_sym->GetAddress().GetLoadAddress(&GetProcess()->GetTarget());<br>
+                addr_t bp_addr = kernel_sym->GetLoadAddress(&GetProcess()->GetTarget());<br>
                 if (bp_addr == LLDB_INVALID_ADDRESS)<br>
                 {<br>
                     error.SetErrorStringWithFormat("Could not locate load address for symbols of kernel '%s'.", name);<br>
<br>
Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ObjectFile_ELF_ObjectFileELF.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=x-eCutJ0a-iiDa2aoyFIUEupVzfN2WFTOlRVUuLXC2Q&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)<br>
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Thu Jun 25 16:46:34 2015<br>
@@ -2381,7 +2381,7 @@ ObjectFileELF::RelocateSection(Symtab* s<br>
                 symbol = symtab->FindSymbolByID(reloc_symbol(rel));<br>
                 if (symbol)<br>
                 {<br>
-                    addr_t value = symbol->GetAddress().GetFileAddress();<br>
+                    addr_t value = symbol->GetAddressRef().GetFileAddress();<br>
                     DataBufferSP& data_buffer_sp = debug_data.GetSharedDataBuffer();<br>
                     uint64_t* dst = reinterpret_cast<uint64_t*>(data_buffer_sp->GetBytes() + rel_section->GetFileOffset() + ELFRelocation::RelocOffset64(rel));<br>
                     *dst = value + ELFRelocation::RelocAddend64(rel);<br>
@@ -2394,7 +2394,7 @@ ObjectFileELF::RelocateSection(Symtab* s<br>
                 symbol = symtab->FindSymbolByID(reloc_symbol(rel));<br>
                 if (symbol)<br>
                 {<br>
-                    addr_t value = symbol->GetAddress().GetFileAddress();<br>
+                    addr_t value = symbol->GetAddressRef().GetFileAddress();<br>
                     value += ELFRelocation::RelocAddend32(rel);<br>
                     assert((reloc_type(rel) == R_X86_64_32 && (value <= UINT32_MAX)) ||<br>
                            (reloc_type(rel) == R_X86_64_32S &&<br>
<br>
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ObjectFile_Mach-2DO_ObjectFileMachO.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=j71d-8hxvUupDVbc3TpqJaAar8xc8KP0iz4FgICu2ag&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)<br>
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Jun 25 16:46:34 2015<br>
@@ -1271,7 +1271,7 @@ ObjectFileMachO::GetAddressClass (lldb::<br>
         {<br>
             if (symbol->ValueIsAddress())<br>
             {<br>
-                SectionSP section_sp (symbol->GetAddress().GetSection());<br>
+                SectionSP section_sp (symbol->GetAddressRef().GetSection());<br>
                 if (section_sp)<br>
                 {<br>
                     const lldb::SectionType section_type = section_sp->GetType();<br>
@@ -3521,8 +3521,8 @@ ObjectFileMachO::ParseSymtab ()<br>
                                                                 m_nlist_idx_to_sym_idx[nlist_idx] = GSYM_sym_idx;<br>
                                                                 // Copy the address, because often the N_GSYM address has an invalid address of zero<br>
                                                                 // when the global is a common symbol<br>
-                                                                sym[GSYM_sym_idx].GetAddress().SetSection (symbol_section);<br>
-                                                                sym[GSYM_sym_idx].GetAddress().SetOffset (symbol_value);<br>
+                                                                sym[GSYM_sym_idx].GetAddressRef().SetSection (symbol_section);<br>
+                                                                sym[GSYM_sym_idx].GetAddressRef().SetOffset (symbol_value);<br>
                                                                 // We just need the flags from the linker symbol, so put these flags<br>
                                                                 // into the N_GSYM flags to avoid duplicate symbols in the symbol table<br>
                                                                 sym[GSYM_sym_idx].SetFlags (nlist.n_type << 16 | nlist.n_desc);<br>
@@ -3537,8 +3537,8 @@ ObjectFileMachO::ParseSymtab ()<br>
                                                 sym[sym_idx].SetType (type);<br>
                                                 if (set_value)<br>
                                                 {<br>
-                                                    sym[sym_idx].GetAddress().SetSection (symbol_section);<br>
-                                                    sym[sym_idx].GetAddress().SetOffset (symbol_value);<br>
+                                                    sym[sym_idx].GetAddressRef().SetSection (symbol_section);<br>
+                                                    sym[sym_idx].GetAddressRef().SetOffset (symbol_value);<br>
                                                 }<br>
                                                 sym[sym_idx].SetFlags (nlist.n_type << 16 | nlist.n_desc);<br>
<br>
@@ -4364,8 +4364,8 @@ ObjectFileMachO::ParseSymtab ()<br>
                                     m_nlist_idx_to_sym_idx[nlist_idx] = GSYM_sym_idx;<br>
                                     // Copy the address, because often the N_GSYM address has an invalid address of zero<br>
                                     // when the global is a common symbol<br>
-                                    sym[GSYM_sym_idx].GetAddress().SetSection (symbol_section);<br>
-                                    sym[GSYM_sym_idx].GetAddress().SetOffset (symbol_value);<br>
+                                    sym[GSYM_sym_idx].GetAddressRef().SetSection (symbol_section);<br>
+                                    sym[GSYM_sym_idx].GetAddressRef().SetOffset (symbol_value);<br>
                                     // We just need the flags from the linker symbol, so put these flags<br>
                                     // into the N_GSYM flags to avoid duplicate symbols in the symbol table<br>
                                     sym[GSYM_sym_idx].SetFlags (nlist.n_type << 16 | nlist.n_desc);<br>
@@ -4380,8 +4380,8 @@ ObjectFileMachO::ParseSymtab ()<br>
                     sym[sym_idx].SetType (type);<br>
                     if (set_value)<br>
                     {<br>
-                        sym[sym_idx].GetAddress().SetSection (symbol_section);<br>
-                        sym[sym_idx].GetAddress().SetOffset (symbol_value);<br>
+                        sym[sym_idx].GetAddressRef().SetSection (symbol_section);<br>
+                        sym[sym_idx].GetAddressRef().SetOffset (symbol_value);<br>
                     }<br>
                     sym[sym_idx].SetFlags (nlist.n_type << 16 | nlist.n_desc);<br>
<br>
@@ -4475,7 +4475,7 @@ ObjectFileMachO::ParseSymtab ()<br>
                                 sym[sym_idx].GetMangled().SetDemangledName(ConstString(synthetic_function_symbol));<br>
                                 sym[sym_idx].SetType (eSymbolTypeCode);<br>
                                 sym[sym_idx].SetIsSynthetic (true);<br>
-                                sym[sym_idx].GetAddress() = symbol_addr;<br>
+                                sym[sym_idx].GetAddressRef() = symbol_addr;<br>
                                 if (symbol_flags)<br>
                                     sym[sym_idx].SetFlags (symbol_flags);<br>
                                 if (symbol_byte_size)<br>
@@ -4559,7 +4559,7 @@ ObjectFileMachO::ParseSymtab ()<br>
                                         else<br>
                                             stub_symbol->SetType (eSymbolTypeResolver);<br>
                                         stub_symbol->SetExternal (false);<br>
-                                        stub_symbol->GetAddress() = so_addr;<br>
+                                        stub_symbol->GetAddressRef() = so_addr;<br>
                                         stub_symbol->SetByteSize (symbol_stub_byte_size);<br>
                                     }<br>
                                     else<br>
@@ -4578,7 +4578,7 @@ ObjectFileMachO::ParseSymtab ()<br>
                                         else<br>
                                             sym[sym_idx].SetType (eSymbolTypeResolver);<br>
                                         sym[sym_idx].SetIsSynthetic (true);<br>
-                                        sym[sym_idx].GetAddress() = so_addr;<br>
+                                        sym[sym_idx].GetAddressRef() = so_addr;<br>
                                         sym[sym_idx].SetByteSize (symbol_stub_byte_size);<br>
                                         ++sym_idx;<br>
                                     }<br>
<br>
Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ObjectFile_PECOFF_ObjectFilePECOFF.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=nM6iqASVnupjMQHmGGQWgECMjhgubhXYQFcqLla8BK0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)<br>
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Thu Jun 25 16:46:34 2015<br>
@@ -574,7 +574,7 @@ ObjectFilePECOFF::GetSymtab()<br>
                     if ((int16_t)symbol.sect >= 1)<br>
                     {<br>
                         Address symbol_addr(sect_list->GetSectionAtIndex(symbol.sect-1), symbol.value);<br>
-                        symbols[i].GetAddress() = symbol_addr;<br>
+                        symbols[i].GetAddressRef() = symbol_addr;<br>
                     }<br>
<br>
                     if (symbol.naux > 0)<br>
@@ -633,7 +633,7 @@ ObjectFilePECOFF::GetSymtab()<br>
<br>
                     Address symbol_addr(m_coff_header_opt.image_base + function_rva, sect_list);<br>
                     symbols[i].GetMangled().SetValue(ConstString(symbol_name.c_str()));<br>
-                    symbols[i].GetAddress() = symbol_addr;<br>
+                    symbols[i].GetAddressRef() = symbol_addr;<br>
                     symbols[i].SetType(lldb::eSymbolTypeCode);<br>
                     symbols[i].SetDebug(true);<br>
                 }<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_Process_gdb-2Dremote_GDBRemoteCommunicationClient.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=w7qWbTLOQGvuYlIG7vH0LFytItFaYiOhzHeHgv2Qgao&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Jun 25 16:46:34 2015<br>
@@ -100,6 +100,7 @@ GDBRemoteCommunicationClient::GDBRemoteC<br>
     m_supports_QEnvironment (true),<br>
     m_supports_QEnvironmentHexEncoded (true),<br>
     m_supports_qSymbol (true),<br>
+    m_supports_jThreadsInfo (true),<br>
     m_curr_pid (LLDB_INVALID_PROCESS_ID),<br>
     m_curr_tid (LLDB_INVALID_THREAD_ID),<br>
     m_curr_tid_run (LLDB_INVALID_THREAD_ID),<br>
@@ -604,6 +605,32 @@ GDBRemoteCommunicationClient::GetpPacket<br>
     return m_supports_p;<br>
 }<br>
<br>
+StructuredData::ObjectSP<br>
+GDBRemoteCommunicationClient::GetThreadsInfo()<br>
+{<br>
+    // Get information on all threads at one using the "jThreadsInfo" packet<br>
+    StructuredData::ObjectSP object_sp;<br>
+<br>
+    if (m_supports_jThreadsInfo)<br>
+    {<br>
+        StringExtractorGDBRemote response;<br>
+        m_supports_jThreadExtendedInfo = eLazyBoolNo;<br>
+        if (SendPacketAndWaitForResponse("jThreadsInfo", response, false) == PacketResult::Success)<br>
+        {<br>
+            if (response.IsUnsupportedResponse())<br>
+            {<br>
+                m_supports_jThreadsInfo = false;<br>
+            }<br>
+            else if (!response.Empty())<br>
+            {<br>
+                object_sp = StructuredData::ParseJSON (response.GetStringRef());<br>
+            }<br>
+        }<br>
+    }<br>
+    return object_sp;<br>
+}<br>
+<br>
+<br>
 bool<br>
 GDBRemoteCommunicationClient::GetThreadExtendedInfoSupported ()<br>
 {<br>
@@ -4296,11 +4323,52 @@ GDBRemoteCommunicationClient::ServeSymbo<br>
                                 lldb_private::SymbolContextList sc_list;<br>
                                 if (process->GetTarget().GetImages().FindSymbolsWithNameAndType(ConstString(symbol_name), eSymbolTypeAny, sc_list))<br>
                                 {<br>
-                                    SymbolContext sc;<br>
-                                    if (sc_list.GetContextAtIndex(0, sc))<br>
+                                    const size_t num_scs = sc_list.GetSize();<br>
+                                    for (size_t sc_idx=0; sc_idx<num_scs && symbol_load_addr == LLDB_INVALID_ADDRESS; ++sc_idx)<br>
                                     {<br>
-                                        if (sc.symbol)<br>
-                                            symbol_load_addr = sc.symbol->GetAddress().GetLoadAddress(&process->GetTarget());<br>
+                                        SymbolContext sc;<br>
+                                        if (sc_list.GetContextAtIndex(sc_idx, sc))<br>
+                                        {<br>
+                                            if (sc.symbol)<br>
+                                            {<br>
+                                                switch (sc.symbol->GetType())<br>
+                                                {<br>
+                                                case eSymbolTypeInvalid:<br>
+                                                case eSymbolTypeAbsolute:<br>
+                                                case eSymbolTypeUndefined:<br>
+                                                case eSymbolTypeSourceFile:<br>
+                                                case eSymbolTypeHeaderFile:<br>
+                                                case eSymbolTypeObjectFile:<br>
+                                                case eSymbolTypeCommonBlock:<br>
+                                                case eSymbolTypeBlock:<br>
+                                                case eSymbolTypeLocal:<br>
+                                                case eSymbolTypeParam:<br>
+                                                case eSymbolTypeVariable:<br>
+                                                case eSymbolTypeVariableType:<br>
+                                                case eSymbolTypeLineEntry:<br>
+                                                case eSymbolTypeLineHeader:<br>
+                                                case eSymbolTypeScopeBegin:<br>
+                                                case eSymbolTypeScopeEnd:<br>
+                                                case eSymbolTypeAdditional:<br>
+                                                case eSymbolTypeCompiler:<br>
+                                                case eSymbolTypeInstrumentation:<br>
+                                                case eSymbolTypeTrampoline:<br>
+                                                    break;<br>
+<br>
+                                                case eSymbolTypeCode:<br>
+                                                case eSymbolTypeResolver:<br>
+                                                case eSymbolTypeData:<br>
+                                                case eSymbolTypeRuntime:<br>
+                                                case eSymbolTypeException:<br>
+                                                case eSymbolTypeObjCClass:<br>
+                                                case eSymbolTypeObjCMetaClass:<br>
+                                                case eSymbolTypeObjCIVar:<br>
+                                                case eSymbolTypeReExported:<br>
+                                                    symbol_load_addr = sc.symbol->GetLoadAddress(&process->GetTarget());<br>
+                                                    break;<br>
+                                                }<br>
+                                            }<br>
+                                        }<br>
                                     }<br>
                                 }<br>
                                 // This is the normal path where our symbol lookup was successful and we want<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_Process_gdb-2Dremote_GDBRemoteCommunicationClient.h-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=G3LcM0cfDb5giEu00tHxgoIDR_LoQhLjp_TPEYLaKKQ&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)<br>
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Thu Jun 25 16:46:34 2015<br>
@@ -17,6 +17,7 @@<br>
 // Other libraries and framework includes<br>
 // Project includes<br>
 #include "lldb/Core/ArchSpec.h"<br>
+#include "lldb/Core/StructuredData.h"<br>
 #include "lldb/Target/Process.h"<br>
<br>
 #include "GDBRemoteCommunication.h"<br>
@@ -542,6 +543,9 @@ public:<br>
     bool<br>
     AvoidGPackets(ProcessGDBRemote *process);<br>
<br>
+    StructuredData::ObjectSP<br>
+    GetThreadsInfo();<br>
+<br>
     bool<br>
     GetThreadExtendedInfoSupported();<br>
<br>
@@ -624,7 +628,8 @@ protected:<br>
         m_supports_z4:1,<br>
         m_supports_QEnvironment:1,<br>
         m_supports_QEnvironmentHexEncoded:1,<br>
-        m_supports_qSymbol:1;<br>
+        m_supports_qSymbol:1,<br>
+        m_supports_jThreadsInfo:1;<br>
<br>
     lldb::pid_t m_curr_pid;<br>
     lldb::tid_t m_curr_tid;         // Current gdb remote protocol thread index for all other operations<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_Process_gdb-2Dremote_ProcessGDBRemote.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=_sudIjRXPDKdOs71QHfMBC8CChpiPAU8j1ec76HKjmk&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Jun 25 16:46:34 2015<br>
@@ -378,6 +378,7 @@ ProcessGDBRemote::ProcessGDBRemote(Targe<br>
     m_async_broadcaster (NULL, "lldb.process.gdb-remote.async-broadcaster"),<br>
     m_async_thread_state_mutex(Mutex::eMutexTypeRecursive),<br>
     m_thread_ids (),<br>
+    m_threads_info_sp (),<br>
     m_continue_c_tids (),<br>
     m_continue_C_tids (),<br>
     m_continue_s_tids (),<br>
@@ -1795,6 +1796,362 @@ ProcessGDBRemote::UpdateThreadList (Thre<br>
     return true;<br>
 }<br>
<br>
+bool<br>
+ProcessGDBRemote::CalculateThreadStopInfo (ThreadGDBRemote *thread)<br>
+{<br>
+    // See if we got thread stop infos for all threads via the "jThreadsInfo" packet<br>
+    if (m_threads_info_sp)<br>
+    {<br>
+        StructuredData::Array *thread_infos = m_threads_info_sp->GetAsArray();<br>
+        if (thread_infos)<br>
+        {<br>
+            lldb::tid_t tid;<br>
+            const size_t n = thread_infos->GetSize();<br>
+            for (size_t i=0; i<n; ++i)<br>
+            {<br>
+                StructuredData::Dictionary *thread_dict = thread_infos->GetItemAtIndex(i)->GetAsDictionary();<br>
+                if (thread_dict)<br>
+                {<br>
+                    if (thread_dict->GetValueForKeyAsInteger<lldb::tid_t>("tid", tid, LLDB_INVALID_THREAD_ID))<br>
+                    {<br>
+                        if (tid == thread->GetID())<br>
+                            return SetThreadStopInfo(thread_dict);<br>
+                    }<br>
+                }<br>
+            }<br>
+        }<br>
+    }<br>
+<br>
+    // Fall back to using the qThreadStopInfo packet<br>
+    StringExtractorGDBRemote stop_packet;<br>
+    if (GetGDBRemote().GetThreadStopInfo(thread->GetProtocolID(), stop_packet))<br>
+        return SetThreadStopInfo (stop_packet) == eStateStopped;<br>
+    return false;<br>
+}<br>
+<br>
+<br>
+ThreadSP<br>
+ProcessGDBRemote::SetThreadStopInfo (lldb::tid_t tid,<br>
+                                     ExpeditedRegisterMap &expedited_register_map,<br>
+                                     uint8_t signo,<br>
+                                     const std::string &thread_name,<br>
+                                     const std::string &reason,<br>
+                                     const std::string &description,<br>
+                                     uint32_t exc_type,<br>
+                                     const std::vector<addr_t> &exc_data,<br>
+                                     addr_t thread_dispatch_qaddr)<br>
+{<br>
+    ThreadSP thread_sp;<br>
+    if (tid != LLDB_INVALID_THREAD_ID)<br>
+    {<br>
+        // Scope for "locker" below<br>
+        {<br>
+            // m_thread_list_real does have its own mutex, but we need to<br>
+            // hold onto the mutex between the call to m_thread_list_real.FindThreadByID(...)<br>
+            // and the m_thread_list_real.AddThread(...) so it doesn't change on us<br>
+            Mutex::Locker locker (m_thread_list_real.GetMutex ());<br>
+            thread_sp = m_thread_list_real.FindThreadByProtocolID(tid, false);<br>
+<br>
+            if (!thread_sp)<br>
+            {<br>
+                // Create the thread if we need to<br>
+                thread_sp.reset (new ThreadGDBRemote (*this, tid));<br>
+                m_thread_list_real.AddThread(thread_sp);<br>
+            }<br>
+        }<br>
+<br>
+        if (thread_sp)<br>
+        {<br>
+            ThreadGDBRemote *gdb_thread = static_cast<ThreadGDBRemote *> (thread_sp.get());<br>
+            gdb_thread->GetRegisterContext()->InvalidateIfNeeded(true);<br>
+<br>
+            for (const auto &pair : expedited_register_map)<br>
+            {<br>
+                StringExtractor reg_value_extractor;<br>
+                reg_value_extractor.GetStringRef() = pair.second;<br>
+                gdb_thread->PrivateSetRegisterValue (pair.first, reg_value_extractor);<br>
+            }<br>
+<br>
+            // Clear the stop info just in case we don't set it to anything<br>
+            thread_sp->SetStopInfo (StopInfoSP());<br>
+            thread_sp->SetName (thread_name.empty() ? NULL : thread_name.c_str());<br>
+<br>
+            gdb_thread->SetThreadDispatchQAddr (thread_dispatch_qaddr);<br>
+            if (exc_type != 0)<br>
+            {<br>
+                const size_t exc_data_size = exc_data.size();<br>
+<br>
+                thread_sp->SetStopInfo (StopInfoMachException::CreateStopReasonWithMachException (*thread_sp,<br>
+                                                                                                  exc_type,<br>
+                                                                                                  exc_data_size,<br>
+                                                                                                  exc_data_size >= 1 ? exc_data[0] : 0,<br>
+                                                                                                  exc_data_size >= 2 ? exc_data[1] : 0,<br>
+                                                                                                  exc_data_size >= 3 ? exc_data[2] : 0));<br>
+            }<br>
+            else<br>
+            {<br>
+                bool handled = false;<br>
+                bool did_exec = false;<br>
+                if (!reason.empty())<br>
+                {<br>
+                    if (reason.compare("trace") == 0)<br>
+                    {<br>
+                        thread_sp->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp));<br>
+                        handled = true;<br>
+                    }<br>
+                    else if (reason.compare("breakpoint") == 0)<br>
+                    {<br>
+                        addr_t pc = thread_sp->GetRegisterContext()->GetPC();<br>
+                        lldb::BreakpointSiteSP bp_site_sp = thread_sp->GetProcess()->GetBreakpointSiteList().FindByAddress(pc);<br>
+                        if (bp_site_sp)<br>
+                        {<br>
+                            // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread,<br>
+                            // we can just report no reason.  We don't need to worry about stepping over the breakpoint here, that<br>
+                            // will be taken care of when the thread resumes and notices that there's a breakpoint under the pc.<br>
+                            handled = true;<br>
+                            if (bp_site_sp->ValidForThisThread (thread_sp.get()))<br>
+                            {<br>
+                                thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID()));<br>
+                            }<br>
+                            else<br>
+                            {<br>
+                                StopInfoSP invalid_stop_info_sp;<br>
+                                thread_sp->SetStopInfo (invalid_stop_info_sp);<br>
+                            }<br>
+                        }<br>
+                    }<br>
+                    else if (reason.compare("trap") == 0)<br>
+                    {<br>
+                        // Let the trap just use the standard signal stop reason below...<br>
+                    }<br>
+                    else if (reason.compare("watchpoint") == 0)<br>
+                    {<br>
+                        StringExtractor desc_extractor(description.c_str());<br>
+                        addr_t wp_addr = desc_extractor.GetU64(LLDB_INVALID_ADDRESS);<br>
+                        uint32_t wp_index = desc_extractor.GetU32(LLDB_INVALID_INDEX32);<br>
+                        watch_id_t watch_id = LLDB_INVALID_WATCH_ID;<br>
+                        if (wp_addr != LLDB_INVALID_ADDRESS)<br>
+                        {<br>
+                            WatchpointSP wp_sp = GetTarget().GetWatchpointList().FindByAddress(wp_addr);<br>
+                            if (wp_sp)<br>
+                            {<br>
+                                wp_sp->SetHardwareIndex(wp_index);<br>
+                                watch_id = wp_sp->GetID();<br>
+                            }<br>
+                        }<br>
+                        if (watch_id == LLDB_INVALID_WATCH_ID)<br>
+                        {<br>
+                            Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_WATCHPOINTS));<br>
+                            if (log) log->Printf ("failed to find watchpoint");<br>
+                        }<br>
+                        thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithWatchpointID (*thread_sp, watch_id));<br>
+                        handled = true;<br>
+                    }<br>
+                    else if (reason.compare("exception") == 0)<br>
+                    {<br>
+                        thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithException(*thread_sp, description.c_str()));<br>
+                        handled = true;<br>
+                    }<br>
+                    else if (reason.compare("exec") == 0)<br>
+                    {<br>
+                        did_exec = true;<br>
+                        thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithExec(*thread_sp));<br>
+                        handled = true;<br>
+                    }<br>
+                }<br>
+<br>
+                if (!handled && signo && did_exec == false)<br>
+                {<br>
+                    if (signo == SIGTRAP)<br>
+                    {<br>
+                        // Currently we are going to assume SIGTRAP means we are either<br>
+                        // hitting a breakpoint or hardware single stepping.<br>
+                        handled = true;<br>
+                        addr_t pc = thread_sp->GetRegisterContext()->GetPC() + m_breakpoint_pc_offset;<br>
+                        lldb::BreakpointSiteSP bp_site_sp = thread_sp->GetProcess()->GetBreakpointSiteList().FindByAddress(pc);<br>
+<br>
+                        if (bp_site_sp)<br>
+                        {<br>
+                            // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread,<br>
+                            // we can just report no reason.  We don't need to worry about stepping over the breakpoint here, that<br>
+                            // will be taken care of when the thread resumes and notices that there's a breakpoint under the pc.<br>
+                            if (bp_site_sp->ValidForThisThread (thread_sp.get()))<br>
+                            {<br>
+                                if(m_breakpoint_pc_offset != 0)<br>
+                                    thread_sp->GetRegisterContext()->SetPC(pc);<br>
+                                thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID()));<br>
+                            }<br>
+                            else<br>
+                            {<br>
+                                StopInfoSP invalid_stop_info_sp;<br>
+                                thread_sp->SetStopInfo (invalid_stop_info_sp);<br>
+                            }<br>
+                        }<br>
+                        else<br>
+                        {<br>
+                            // If we were stepping then assume the stop was the result of the trace.  If we were<br>
+                            // not stepping then report the SIGTRAP.<br>
+                            // FIXME: We are still missing the case where we single step over a trap instruction.<br>
+                            if (thread_sp->GetTemporaryResumeState() == eStateStepping)<br>
+                                thread_sp->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp));<br>
+                            else<br>
+                                thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithSignal(*thread_sp, signo, description.c_str()));<br>
+                        }<br>
+                    }<br>
+                    if (!handled)<br>
+                        thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithSignal (*thread_sp, signo, description.c_str()));<br>
+                }<br>
+<br>
+                if (!description.empty())<br>
+                {<br>
+                    lldb::StopInfoSP stop_info_sp (thread_sp->GetStopInfo ());<br>
+                    if (stop_info_sp)<br>
+                    {<br>
+                        const char *stop_info_desc = stop_info_sp->GetDescription();<br>
+                        if (!stop_info_desc || !stop_info_desc[0])<br>
+                            stop_info_sp->SetDescription (description.c_str());<br>
+                    }<br>
+                    else<br>
+                    {<br>
+                        thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithException (*thread_sp, description.c_str()));<br>
+                    }<br>
+                }<br>
+            }<br>
+        }<br>
+    }<br>
+    return thread_sp;<br>
+}<br>
+<br>
+StateType<br>
+ProcessGDBRemote::SetThreadStopInfo (StructuredData::Dictionary *thread_dict)<br>
+{<br>
+    static ConstString g_key_tid("tid");<br>
+    static ConstString g_key_name("name");<br>
+    static ConstString g_key_reason("reason");<br>
+    static ConstString g_key_metype("metype");<br>
+    static ConstString g_key_medata("medata");<br>
+    static ConstString g_key_qaddr("qaddr");<br>
+    static ConstString g_key_registers("registers");<br>
+    static ConstString g_key_memory("memory");<br>
+    static ConstString g_key_address("address");<br>
+    static ConstString g_key_bytes("bytes");<br>
+    static ConstString g_key_description("description");<br>
+<br>
+    // Stop with signal and thread info<br>
+    lldb::tid_t tid = LLDB_INVALID_THREAD_ID;<br>
+    uint8_t signo = 0;<br>
+    std::string value;<br>
+    std::string thread_name;<br>
+    std::string reason;<br>
+    std::string description;<br>
+    uint32_t exc_type = 0;<br>
+    std::vector<addr_t> exc_data;<br>
+    addr_t thread_dispatch_qaddr = LLDB_INVALID_ADDRESS;<br>
+    ExpeditedRegisterMap expedited_register_map;<br>
+    // Iterate through all of the thread dictionary key/value pairs from the structured data dictionary<br>
+<br>
+    thread_dict->ForEach([this, &tid, &expedited_register_map, &thread_name, &signo, &reason, &description, &exc_type, &exc_data, &thread_dispatch_qaddr](ConstString key, StructuredData::Object* object) -> bool<br>
+    {<br>
+        if (key == g_key_tid)<br>
+        {<br>
+            // thread in big endian hex<br>
+            tid = object->GetIntegerValue(LLDB_INVALID_THREAD_ID);<br>
+        }<br>
+        else if (key == g_key_metype)<br>
+        {<br>
+            // exception type in big endian hex<br>
+            exc_type = object->GetIntegerValue(0);<br>
+        }<br>
+        else if (key == g_key_medata)<br>
+        {<br>
+            // exception data in big endian hex<br>
+            StructuredData::Array *array = object->GetAsArray();<br>
+            if (array)<br>
+            {<br>
+                array->ForEach([&exc_data](StructuredData::Object* object) -> bool {<br>
+                    exc_data.push_back(object->GetIntegerValue());<br>
+                    return true; // Keep iterating through all array items<br>
+                });<br>
+            }<br>
+        }<br>
+        else if (key == g_key_name)<br>
+        {<br>
+            thread_name = std::move(object->GetStringValue());<br>
+        }<br>
+        else if (key == g_key_qaddr)<br>
+        {<br>
+            thread_dispatch_qaddr = object->GetIntegerValue(LLDB_INVALID_ADDRESS);<br>
+        }<br>
+        else if (key == g_key_reason)<br>
+        {<br>
+            reason = std::move(object->GetStringValue());<br>
+        }<br>
+        else if (key == g_key_description)<br>
+        {<br>
+            description = std::move(object->GetStringValue());<br>
+        }<br>
+        else if (key == g_key_registers)<br>
+        {<br>
+            StructuredData::Dictionary *registers_dict = object->GetAsDictionary();<br>
+<br>
+            if (registers_dict)<br>
+            {<br>
+                registers_dict->ForEach([&expedited_register_map](ConstString key, StructuredData::Object* object) -> bool {<br>
+                    const uint32_t reg = StringConvert::ToUInt32 (key.GetCString(), UINT32_MAX, 10);<br>
+                    if (reg != UINT32_MAX)<br>
+                        expedited_register_map[reg] = std::move(object->GetStringValue());<br>
+                    return true; // Keep iterating through all array items<br>
+                });<br>
+            }<br>
+        }<br>
+        else if (key == g_key_memory)<br>
+        {<br>
+            StructuredData::Array *array = object->GetAsArray();<br>
+            if (array)<br>
+            {<br>
+                array->ForEach([this](StructuredData::Object* object) -> bool {<br>
+                    StructuredData::Dictionary *mem_cache_dict = object->GetAsDictionary();<br>
+                    if (mem_cache_dict)<br>
+                    {<br>
+                        lldb::addr_t mem_cache_addr = LLDB_INVALID_ADDRESS;<br>
+                        if (mem_cache_dict->GetValueForKeyAsInteger<lldb::addr_t>("address", mem_cache_addr))<br>
+                        {<br>
+                            if (mem_cache_addr != LLDB_INVALID_ADDRESS)<br>
+                            {<br>
+                                StringExtractor bytes;<br>
+                                if (mem_cache_dict->GetValueForKeyAsString("bytes", bytes.GetStringRef()))<br>
+                                {<br>
+                                    bytes.SetFilePos(0);<br>
+<br>
+                                    const size_t byte_size = bytes.GetStringRef().size()/2;<br>
+                                    DataBufferSP data_buffer_sp(new DataBufferHeap(byte_size, 0));<br>
+                                    const size_t bytes_copied = bytes.GetHexBytes (data_buffer_sp->GetBytes(), byte_size, 0);<br>
+                                    if (bytes_copied == byte_size)<br>
+                                        m_memory_cache.AddL1CacheData(mem_cache_addr, data_buffer_sp);<br>
+                                }<br>
+                            }<br>
+                        }<br>
+                    }<br>
+                    return true; // Keep iterating through all array items<br>
+                });<br>
+            }<br>
+<br>
+        }<br>
+        return true; // Keep iterating through all dictionary key/value pairs<br>
+    });<br>
+<br>
+    SetThreadStopInfo (tid,<br>
+                       expedited_register_map,<br>
+                       signo,<br>
+                       thread_name,<br>
+                       reason,<br>
+                       description,<br>
+                       exc_type,<br>
+                       exc_data,<br>
+                       thread_dispatch_qaddr);<br>
+<br>
+    return eStateExited;<br>
+}<br>
<br>
 StateType<br>
 ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet)<br>
@@ -1825,8 +2182,9 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
                 BuildDynamicRegisterInfo (true);<br>
             }<br>
             // Stop with signal and thread info<br>
+            lldb::tid_t tid = LLDB_INVALID_THREAD_ID;<br>
             const uint8_t signo = stop_packet.GetHexU8();<br>
-            std::string name;<br>
+            std::string key;<br>
             std::string value;<br>
             std::string thread_name;<br>
             std::string reason;<br>
@@ -1838,48 +2196,25 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
             std::string queue_name;<br>
             QueueKind queue_kind = eQueueKindUnknown;<br>
             uint64_t queue_serial = 0;<br>
-            ThreadSP thread_sp;<br>
-            ThreadGDBRemote *gdb_thread = NULL;<br>
-<br>
-            while (stop_packet.GetNameColonValue(name, value))<br>
+            ExpeditedRegisterMap expedited_register_map;<br>
+            while (stop_packet.GetNameColonValue(key, value))<br>
             {<br>
-                if (name.compare("metype") == 0)<br>
+                if (key.compare("metype") == 0)<br>
                 {<br>
                     // exception type in big endian hex<br>
                     exc_type = StringConvert::ToUInt32 (value.c_str(), 0, 16);<br>
                 }<br>
-                else if (name.compare("medata") == 0)<br>
+                else if (key.compare("medata") == 0)<br>
                 {<br>
                     // exception data in big endian hex<br>
                     exc_data.push_back(StringConvert::ToUInt64 (value.c_str(), 0, 16));<br>
                 }<br>
-                else if (name.compare("thread") == 0)<br>
+                else if (key.compare("thread") == 0)<br>
                 {<br>
                     // thread in big endian hex<br>
-                    lldb::tid_t tid = StringConvert::ToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16);<br>
-                    // m_thread_list_real does have its own mutex, but we need to<br>
-                    // hold onto the mutex between the call to m_thread_list_real.FindThreadByID(...)<br>
-                    // and the m_thread_list_real.AddThread(...) so it doesn't change on us<br>
-                    Mutex::Locker locker (m_thread_list_real.GetMutex ());<br>
-                    thread_sp = m_thread_list_real.FindThreadByProtocolID(tid, false);<br>
-<br>
-                    if (!thread_sp)<br>
-                    {<br>
-                        // Create the thread if we need to<br>
-                        thread_sp.reset (new ThreadGDBRemote (*this, tid));<br>
-                        Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_THREAD));<br>
-                        if (log && log->GetMask().Test(GDBR_LOG_VERBOSE))<br>
-                            log->Printf ("ProcessGDBRemote::%s Adding new thread: %p for thread ID: 0x%" PRIx64 ".\n",<br>
-                                         __FUNCTION__,<br>
-                                         static_cast<void*>(thread_sp.get()),<br>
-                                         thread_sp->GetID());<br>
-<br>
-                        m_thread_list_real.AddThread(thread_sp);<br>
-                    }<br>
-                    gdb_thread = static_cast<ThreadGDBRemote *> (thread_sp.get());<br>
-<br>
+                    tid = StringConvert::ToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16);<br>
                 }<br>
-                else if (name.compare("threads") == 0)<br>
+                else if (key.compare("threads") == 0)<br>
                 {<br>
                     Mutex::Locker locker(m_thread_list_real.GetMutex());<br>
                     m_thread_ids.clear();<br>
@@ -1901,7 +2236,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
                     if (tid != LLDB_INVALID_THREAD_ID)<br>
                         m_thread_ids.push_back (tid);<br>
                 }<br>
-                else if (name.compare("hexname") == 0)<br>
+                else if (key.compare("hexname") == 0)<br>
                 {<br>
                     StringExtractor name_extractor;<br>
                     // Swap "value" over into "name_extractor"<br>
@@ -1910,15 +2245,15 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
                     name_extractor.GetHexByteString (value);<br>
                     thread_name.swap (value);<br>
                 }<br>
-                else if (name.compare("name") == 0)<br>
+                else if (key.compare("name") == 0)<br>
                 {<br>
                     thread_name.swap (value);<br>
                 }<br>
-                else if (name.compare("qaddr") == 0)<br>
+                else if (key.compare("qaddr") == 0)<br>
                 {<br>
                     thread_dispatch_qaddr = StringConvert::ToUInt64 (value.c_str(), 0, 16);<br>
                 }<br>
-                else if (name.compare("qname") == 0)<br>
+                else if (key.compare("qname") == 0)<br>
                 {<br>
                     queue_vars_valid = true;<br>
                     StringExtractor name_extractor;<br>
@@ -1928,7 +2263,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
                     name_extractor.GetHexByteString (value);<br>
                     queue_name.swap (value);<br>
                 }<br>
-                else if (name.compare("qkind") == 0)<br>
+                else if (key.compare("qkind") == 0)<br>
                 {<br>
                     queue_vars_valid = true;<br>
                     if (value == "serial")<br>
@@ -1936,16 +2271,16 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
                     else if (value == "concurrent")<br>
                         queue_kind = eQueueKindConcurrent;<br>
                 }<br>
-                else if (name.compare("qserial") == 0)<br>
+                else if (key.compare("qserial") == 0)<br>
                 {<br>
                     queue_vars_valid = true;<br>
                     queue_serial = StringConvert::ToUInt64 (value.c_str(), 0, 0);<br>
                 }<br>
-                else if (name.compare("reason") == 0)<br>
+                else if (key.compare("reason") == 0)<br>
                 {<br>
                     reason.swap(value);<br>
                 }<br>
-                else if (name.compare("description") == 0)<br>
+                else if (key.compare("description") == 0)<br>
                 {<br>
                     StringExtractor desc_extractor;<br>
                     // Swap "value" over into "name_extractor"<br>
@@ -1954,34 +2289,57 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
                     desc_extractor.GetHexByteString (value);<br>
                     description.swap(value);<br>
                 }<br>
-                else if (name.size() == 2 && ::isxdigit(name[0]) && ::isxdigit(name[1]))<br>
+                else if (key.compare("memory") == 0)<br>
                 {<br>
-                    // We have a register number that contains an expedited<br>
-                    // register value. Lets supply this register to our thread<br>
-                    // so it won't have to go and read it.<br>
-                    if (gdb_thread)<br>
-                    {<br>
-                        uint32_t reg = StringConvert::ToUInt32 (name.c_str(), UINT32_MAX, 16);<br>
-<br>
-                        if (reg != UINT32_MAX)<br>
+                    // Expedited memory. GDB servers can choose to send back expedited memory<br>
+                    // that can populate the L1 memory cache in the process so that things like<br>
+                    // the frame pointer backchain can be expedited. This will help stack<br>
+                    // backtracing be more efficient by not having to send as many memory read<br>
+                    // requests down the remote GDB server.<br>
+<br>
+                    // Key/value pair format: memory:<addr>=<bytes>;<br>
+                    // <addr> is a number whose base will be interpreted by the prefix:<br>
+                    //      "0x[0-9a-fA-F]+" for hex<br>
+                    //      "0[0-7]+" for octal<br>
+                    //      "[1-9]+" for decimal<br>
+                    // <bytes> is native endian ASCII hex bytes just like the register values<br>
+                    llvm::StringRef value_ref(value);<br>
+                    std::pair<llvm::StringRef, llvm::StringRef> pair;<br>
+                    pair = value_ref.split('=');<br>
+                    if (!pair.first.empty() && !pair.second.empty())<br>
+                    {<br>
+                        std::string addr_str(pair.first.str());<br>
+                        const lldb::addr_t mem_cache_addr = StringConvert::ToUInt64(addr_str.c_str(), LLDB_INVALID_ADDRESS, 0);<br>
+                        if (mem_cache_addr != LLDB_INVALID_ADDRESS)<br>
                         {<br>
-                            StringExtractor reg_value_extractor;<br>
-                            // Swap "value" over into "reg_value_extractor"<br>
-                            reg_value_extractor.GetStringRef().swap(value);<br>
-                            if (!gdb_thread->PrivateSetRegisterValue (reg, reg_value_extractor))<br>
-                            {<br>
-                                Host::SetCrashDescriptionWithFormat("Setting thread register '%s' (decoded to %u (0x%x)) with value '%s' for stop packet: '%s'",<br>
-                                                                    name.c_str(),<br>
-                                                                    reg,<br>
-                                                                    reg,<br>
-                                                                    reg_value_extractor.GetStringRef().c_str(),<br>
-                                                                    stop_packet.GetStringRef().c_str());<br>
-                            }<br>
+                            StringExtractor bytes;<br>
+                            bytes.GetStringRef() = std::move(pair.second.str());<br>
+                            const size_t byte_size = bytes.GetStringRef().size()/2;<br>
+                            DataBufferSP data_buffer_sp(new DataBufferHeap(byte_size, 0));<br>
+                            const size_t bytes_copied = bytes.GetHexBytes (data_buffer_sp->GetBytes(), byte_size, 0);<br>
+                            if (bytes_copied == byte_size)<br>
+                                m_memory_cache.AddL1CacheData(mem_cache_addr, data_buffer_sp);<br>
                         }<br>
                     }<br>
                 }<br>
+                else if (key.size() == 2 && ::isxdigit(key[0]) && ::isxdigit(key[1]))<br>
+                {<br>
+                    uint32_t reg = StringConvert::ToUInt32 (key.c_str(), UINT32_MAX, 16);<br>
+                    if (reg != UINT32_MAX)<br>
+                        expedited_register_map[reg] = std::move(value);<br>
+                }<br>
             }<br>
<br>
+            ThreadSP thread_sp = SetThreadStopInfo (tid,<br>
+                                                    expedited_register_map,<br>
+                                                    signo,<br>
+                                                    thread_name,<br>
+                                                    reason,<br>
+                                                    description,<br>
+                                                    exc_type,<br>
+                                                    exc_data,<br>
+                                                    thread_dispatch_qaddr);<br>
+<br>
             // If the response is old style 'S' packet which does not provide us with thread information<br>
             // then update the thread list and choose the first one.<br>
             if (!thread_sp)<br>
@@ -1992,164 +2350,9 @@ ProcessGDBRemote::SetThreadStopInfo (Str<br>
                 {<br>
                     Mutex::Locker locker (m_thread_list_real.GetMutex ());<br>
                     thread_sp = m_thread_list_real.FindThreadByProtocolID (m_thread_ids.front (), false);<br>
-                    if (thread_sp)<br>
-                        gdb_thread = static_cast<ThreadGDBRemote *> (thread_sp.get ());<br>
                 }<br>
             }<br>
<br>
-            if (thread_sp)<br>
-            {<br>
-                // Clear the stop info just in case we don't set it to anything<br>
-                thread_sp->SetStopInfo (StopInfoSP());<br>
-<br>
-                gdb_thread->SetThreadDispatchQAddr (thread_dispatch_qaddr);<br>
-                if (queue_vars_valid)<br>
-                    gdb_thread->SetQueueInfo(std::move(queue_name), queue_kind, queue_serial);<br>
-                else<br>
-                    gdb_thread->ClearQueueInfo();<br>
-<br>
-                gdb_thread->SetName (thread_name.empty() ? NULL : thread_name.c_str());<br>
-                if (exc_type != 0)<br>
-                {<br>
-                    const size_t exc_data_size = exc_data.size();<br>
-<br>
-                    thread_sp->SetStopInfo (StopInfoMachException::CreateStopReasonWithMachException (*thread_sp,<br>
-                                                                                                      exc_type,<br>
-                                                                                                      exc_data_size,<br>
-                                                                                                      exc_data_size >= 1 ? exc_data[0] : 0,<br>
-                                                                                                      exc_data_size >= 2 ? exc_data[1] : 0,<br>
-                                                                                                      exc_data_size >= 3 ? exc_data[2] : 0));<br>
-                }<br>
-                else<br>
-                {<br>
-                    bool handled = false;<br>
-                    bool did_exec = false;<br>
-                    if (!reason.empty())<br>
-                    {<br>
-                        if (reason.compare("trace") == 0)<br>
-                        {<br>
-                            thread_sp->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp));<br>
-                            handled = true;<br>
-                        }<br>
-                        else if (reason.compare("breakpoint") == 0)<br>
-                        {<br>
-                            addr_t pc = thread_sp->GetRegisterContext()->GetPC();<br>
-                            lldb::BreakpointSiteSP bp_site_sp = thread_sp->GetProcess()->GetBreakpointSiteList().FindByAddress(pc);<br>
-                            if (bp_site_sp)<br>
-                            {<br>
-                                // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread,<br>
-                                // we can just report no reason.  We don't need to worry about stepping over the breakpoint here, that<br>
-                                // will be taken care of when the thread resumes and notices that there's a breakpoint under the pc.<br>
-                                handled = true;<br>
-                                if (bp_site_sp->ValidForThisThread (thread_sp.get()))<br>
-                                {<br>
-                                    thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID()));<br>
-                                }<br>
-                                else<br>
-                                {<br>
-                                    StopInfoSP invalid_stop_info_sp;<br>
-                                    thread_sp->SetStopInfo (invalid_stop_info_sp);<br>
-                                }<br>
-                            }<br>
-                        }<br>
-                        else if (reason.compare("trap") == 0)<br>
-                        {<br>
-                            // Let the trap just use the standard signal stop reason below...<br>
-                        }<br>
-                        else if (reason.compare("watchpoint") == 0)<br>
-                        {<br>
-                            StringExtractor desc_extractor(description.c_str());<br>
-                            addr_t wp_addr = desc_extractor.GetU64(LLDB_INVALID_ADDRESS);<br>
-                            uint32_t wp_index = desc_extractor.GetU32(LLDB_INVALID_INDEX32);<br>
-                            watch_id_t watch_id = LLDB_INVALID_WATCH_ID;<br>
-                            if (wp_addr != LLDB_INVALID_ADDRESS)<br>
-                            {<br>
-                                WatchpointSP wp_sp = GetTarget().GetWatchpointList().FindByAddress(wp_addr);<br>
-                                if (wp_sp)<br>
-                                {<br>
-                                    wp_sp->SetHardwareIndex(wp_index);<br>
-                                    watch_id = wp_sp->GetID();<br>
-                                }<br>
-                            }<br>
-                            if (watch_id == LLDB_INVALID_WATCH_ID)<br>
-                            {<br>
-                                Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_WATCHPOINTS));<br>
-                                if (log) log->Printf ("failed to find watchpoint");<br>
-                            }<br>
-                            thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithWatchpointID (*thread_sp, watch_id));<br>
-                            handled = true;<br>
-                        }<br>
-                        else if (reason.compare("exception") == 0)<br>
-                        {<br>
-                            thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithException(*thread_sp, description.c_str()));<br>
-                            handled = true;<br>
-                        }<br>
-                        else if (reason.compare("exec") == 0)<br>
-                        {<br>
-                            did_exec = true;<br>
-                            thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithExec(*thread_sp));<br>
-                            handled = true;<br>
-                        }<br>
-                    }<br>
-<br>
-                    if (!handled && signo && did_exec == false)<br>
-                    {<br>
-                        if (signo == SIGTRAP)<br>
-                        {<br>
-                            // Currently we are going to assume SIGTRAP means we are either<br>
-                            // hitting a breakpoint or hardware single stepping.<br>
-                            handled = true;<br>
-                            addr_t pc = thread_sp->GetRegisterContext()->GetPC() + m_breakpoint_pc_offset;<br>
-                            lldb::BreakpointSiteSP bp_site_sp = thread_sp->GetProcess()->GetBreakpointSiteList().FindByAddress(pc);<br>
-<br>
-                            if (bp_site_sp)<br>
-                            {<br>
-                                // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread,<br>
-                                // we can just report no reason.  We don't need to worry about stepping over the breakpoint here, that<br>
-                                // will be taken care of when the thread resumes and notices that there's a breakpoint under the pc.<br>
-                                if (bp_site_sp->ValidForThisThread (thread_sp.get()))<br>
-                                {<br>
-                                    if(m_breakpoint_pc_offset != 0)<br>
-                                        thread_sp->GetRegisterContext()->SetPC(pc);<br>
-                                    thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID()));<br>
-                                }<br>
-                                else<br>
-                                {<br>
-                                    StopInfoSP invalid_stop_info_sp;<br>
-                                    thread_sp->SetStopInfo (invalid_stop_info_sp);<br>
-                                }<br>
-                            }<br>
-                            else<br>
-                            {<br>
-                                // If we were stepping then assume the stop was the result of the trace.  If we were<br>
-                                // not stepping then report the SIGTRAP.<br>
-                                // FIXME: We are still missing the case where we single step over a trap instruction.<br>
-                                if (thread_sp->GetTemporaryResumeState() == eStateStepping)<br>
-                                    thread_sp->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp));<br>
-                                else<br>
-                                    thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithSignal(*thread_sp, signo, description.c_str()));<br>
-                            }<br>
-                        }<br>
-                        if (!handled)<br>
-                            thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithSignal (*thread_sp, signo, description.c_str()));<br>
-                    }<br>
-<br>
-                    if (!description.empty())<br>
-                    {<br>
-                        lldb::StopInfoSP stop_info_sp (thread_sp->GetStopInfo ());<br>
-                        if (stop_info_sp)<br>
-                        {<br>
-                            const char *stop_info_desc = stop_info_sp->GetDescription();<br>
-                            if (!stop_info_desc || !stop_info_desc[0])<br>
-                                stop_info_sp->SetDescription (description.c_str());<br>
-                        }<br>
-                        else<br>
-                        {<br>
-                            thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithException (*thread_sp, description.c_str()));<br>
-                        }<br>
-                    }<br>
-                }<br>
-            }<br>
             return eStateStopped;<br>
         }<br>
         break;<br>
@@ -2206,6 +2409,11 @@ ProcessGDBRemote::RefreshStateAfterStop<br>
         m_initial_tid = LLDB_INVALID_THREAD_ID;<br>
     }<br>
<br>
+    // Fetch the threads via an efficient packet that gets stop infos for all threads<br>
+    // only if we have more than one thread<br>
+    if (m_thread_ids.size() > 1)<br>
+        m_threads_info_sp = m_gdb_comm.GetThreadsInfo();<br>
+<br>
     // Let all threads recover from stopping and do any clean up based<br>
     // on the previous thread state (if any).<br>
     m_thread_list_real.RefreshStateAfterStop();<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_Process_gdb-2Dremote_ProcessGDBRemote.h-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=amPw16p01reCwnhIp3uGZmsYBU67x0VyNXEil2OC64I&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)<br>
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Thu Jun 25 16:46:34 2015<br>
@@ -326,6 +326,9 @@ protected:<br>
     void<br>
     GetMaxMemorySize();<br>
<br>
+    bool<br>
+    CalculateThreadStopInfo (ThreadGDBRemote *thread);<br>
+<br>
     //------------------------------------------------------------------<br>
     /// Broadcaster event bits definitions.<br>
     //------------------------------------------------------------------<br>
@@ -348,7 +351,9 @@ protected:<br>
     typedef std::vector<lldb::tid_t> tid_collection;<br>
     typedef std::vector< std::pair<lldb::tid_t,int> > tid_sig_collection;<br>
     typedef std::map<lldb::addr_t, lldb::addr_t> MMapMap;<br>
+    typedef std::map<uint32_t, std::string> ExpeditedRegisterMap;<br>
     tid_collection m_thread_ids; // Thread IDs for all threads. This list gets updated after stopping<br>
+    StructuredData::ObjectSP m_threads_info_sp; // Stop info for all threads if "jThreadsInfo" packet is supported<br>
     tid_collection m_continue_c_tids;                  // 'c' for continue<br>
     tid_sig_collection m_continue_C_tids; // 'C' for continue with signal<br>
     tid_collection m_continue_s_tids;                  // 's' for step<br>
@@ -385,6 +390,20 @@ protected:<br>
     lldb::StateType<br>
     SetThreadStopInfo (StringExtractor& stop_packet);<br>
<br>
+    lldb::StateType<br>
+    SetThreadStopInfo (StructuredData::Dictionary *thread_dict);<br>
+<br>
+    lldb::ThreadSP<br>
+    SetThreadStopInfo (lldb::tid_t tid,<br>
+                       ExpeditedRegisterMap &expedited_register_map,<br>
+                       uint8_t signo,<br>
+                       const std::string &thread_name,<br>
+                       const std::string &reason,<br>
+                       const std::string &description,<br>
+                       uint32_t exc_type,<br>
+                       const std::vector<lldb::addr_t> &exc_data,<br>
+                       lldb::addr_t thread_dispatch_qaddr);<br>
+<br>
     void<br>
     HandleStopReplySequence ();<br>
<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_Process_gdb-2Dremote_ThreadGDBRemote.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=3Zam_oTPXYDkBFkgTgbBsOv4eBQDSjX1LxZce-RrGiI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp Thu Jun 25 16:46:34 2015<br>
@@ -317,12 +317,7 @@ ThreadGDBRemote::CalculateStopInfo ()<br>
 {<br>
     ProcessSP process_sp (GetProcess());<br>
     if (process_sp)<br>
-    {<br>
-        StringExtractorGDBRemote stop_packet;<br>
-        ProcessGDBRemote *gdb_process = static_cast<ProcessGDBRemote *>(process_sp.get());<br>
-        if (gdb_process->GetGDBRemote().GetThreadStopInfo(GetProtocolID(), stop_packet))<br>
-            return gdb_process->SetThreadStopInfo (stop_packet) == eStateStopped;<br>
-    }<br>
+        return static_cast<ProcessGDBRemote *>(process_sp.get())->CalculateThreadStopInfo(this);<br>
     return false;<br>
 }<br>
<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=ol2GIE2GzZxGZhkKbrfnraZmyOxNCM9I2lB20kRyPpA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Thu Jun 25 16:46:34 2015<br>
@@ -7620,7 +7620,7 @@ SymbolFileDWARF::ParseVariableDIE<br>
                                     {<br>
                                         if (exe_symbol->ValueIsAddress())<br>
                                         {<br>
-                                            const addr_t exe_file_addr = exe_symbol->GetAddress().GetFileAddress();<br>
+                                            const addr_t exe_file_addr = exe_symbol->GetAddressRef().GetFileAddress();<br>
                                             if (exe_file_addr != LLDB_INVALID_ADDRESS)<br>
                                             {<br>
                                                 if (location.Update_DW_OP_addr (exe_file_addr))<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_SymbolFile_DWARF_SymbolFileDWARFDebugMap.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=LqsgqSpguWbAzqMuo1EliRpgoYYlJeWroMg68PEZzvY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Thu Jun 25 16:46:34 2015<br>
@@ -121,8 +121,8 @@ SymbolFileDWARFDebugMap::CompileUnitInfo<br>
                             {<br>
                                 // Add the inverse OSO file address to debug map entry mapping<br>
                                 exe_symfile->AddOSOFileRange (this,<br>
-                                                              exe_symbol->GetAddress().GetFileAddress(),<br>
-                                                              oso_fun_symbol->GetAddress().GetFileAddress(),<br>
+                                                              exe_symbol->GetAddressRef().GetFileAddress(),<br>
+                                                              oso_fun_symbol->GetAddressRef().GetFileAddress(),<br>
                                                               std::min<addr_t>(exe_symbol->GetByteSize(), oso_fun_symbol->GetByteSize()));<br>
<br>
                             }<br>
@@ -155,8 +155,8 @@ SymbolFileDWARFDebugMap::CompileUnitInfo<br>
                             {<br>
                                 // Add the inverse OSO file address to debug map entry mapping<br>
                                 exe_symfile->AddOSOFileRange (this,<br>
-                                                              exe_symbol->GetAddress().GetFileAddress(),<br>
-                                                              oso_gsym_symbol->GetAddress().GetFileAddress(),<br>
+                                                              exe_symbol->GetAddressRef().GetFileAddress(),<br>
+                                                              oso_gsym_symbol->GetAddressRef().GetFileAddress(),<br>
                                                               std::min<addr_t>(exe_symbol->GetByteSize(), oso_gsym_symbol->GetByteSize()));<br>
                             }<br>
                         }<br>
@@ -374,7 +374,7 @@ SymbolFileDWARFDebugMap::InitOSO()<br>
             for (uint32_t sym_idx : m_func_indexes)<br>
             {<br>
                 const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);<br>
-                lldb::addr_t file_addr = symbol->GetAddress().GetFileAddress();<br>
+                lldb::addr_t file_addr = symbol->GetAddressRef().GetFileAddress();<br>
                 lldb::addr_t byte_size = symbol->GetByteSize();<br>
                 DebugMap::Entry debug_map_entry(file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));<br>
                 m_debug_map.Append(debug_map_entry);<br>
@@ -382,7 +382,7 @@ SymbolFileDWARFDebugMap::InitOSO()<br>
             for (uint32_t sym_idx : m_glob_indexes)<br>
             {<br>
                 const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);<br>
-                lldb::addr_t file_addr = symbol->GetAddress().GetFileAddress();<br>
+                lldb::addr_t file_addr = symbol->GetAddressRef().GetFileAddress();<br>
                 lldb::addr_t byte_size = symbol->GetByteSize();<br>
                 DebugMap::Entry debug_map_entry(file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));<br>
                 m_debug_map.Append(debug_map_entry);<br>
@@ -405,7 +405,7 @@ SymbolFileDWARFDebugMap::InitOSO()<br>
                     m_compile_unit_infos[i].so_file.SetFile(so_symbol->GetName().AsCString(), false);<br>
                     m_compile_unit_infos[i].oso_path = oso_symbol->GetName();<br>
                     TimeValue oso_mod_time;<br>
-                    oso_mod_time.OffsetWithSeconds(oso_symbol->GetAddress().GetOffset());<br>
+                    oso_mod_time.OffsetWithSeconds(oso_symbol->GetIntegerValue(0));<br>
                     m_compile_unit_infos[i].oso_mod_time = oso_mod_time;<br>
                     uint32_t sibling_idx = so_symbol->GetSiblingIndex();<br>
                     // The sibling index can't be less that or equal to the current index "i"<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_SymbolFile_Symtab_SymbolFileSymtab.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=7a18e2NHKtSPKDeOIrCJKmen929h2upRXd5Qx0Q_1KU&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Thu Jun 25 16:46:34 2015<br>
@@ -225,7 +225,7 @@ SymbolFileSymtab::ParseCompileUnitFuncti<br>
                             next_symbol = symtab->SymbolAtIndex(m_code_indexes[idx + 1]);<br>
                             if (next_symbol)<br>
                             {<br>
-                                func_range.SetByteSize(next_symbol->GetAddress().GetOffset() - curr_symbol->GetAddress().GetOffset());<br>
+                                func_range.SetByteSize(next_symbol->GetAddressRef().GetOffset() - curr_symbol->GetAddressRef().GetOffset());<br>
                             }<br>
                         }<br>
<br>
<br>
Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_SystemRuntime_MacOSX_SystemRuntimeMacOSX.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=bnEmUtG3eMm_RqB1-uKV8Yl7-x-EW0ZeH-S47VWnJvk&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp Thu Jun 25 16:46:34 2015<br>
@@ -316,7 +316,7 @@ SystemRuntimeMacOSX::ReadLibdispatchOffs<br>
             dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);<br>
     }<br>
     if (dispatch_queue_offsets_symbol)<br>
-        m_dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetAddress().GetLoadAddress(&m_process->GetTarget());<br>
+        m_dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetLoadAddress(&m_process->GetTarget());<br>
 }<br>
<br>
 void<br>
@@ -361,7 +361,7 @@ SystemRuntimeMacOSX::ReadLibpthreadOffse<br>
                                                            (g_libpthread_layout_offsets_symbol_name, eSymbolTypeData);<br>
         if (libpthread_layout_offsets_symbol)<br>
         {<br>
-            m_libpthread_layout_offsets_addr =  libpthread_layout_offsets_symbol->GetAddress().GetLoadAddress(&m_process->GetTarget());<br>
+            m_libpthread_layout_offsets_addr = libpthread_layout_offsets_symbol->GetLoadAddress(&m_process->GetTarget());<br>
         }<br>
     }<br>
 }<br>
@@ -410,7 +410,7 @@ SystemRuntimeMacOSX::ReadLibdispatchTSDI<br>
                                                            (g_libdispatch_tsd_indexes_symbol_name, eSymbolTypeData);<br>
         if (libdispatch_tsd_indexes_symbol)<br>
         {<br>
-            m_dispatch_tsd_indexes_addr =  libdispatch_tsd_indexes_symbol->GetAddress().GetLoadAddress(&m_process->GetTarget());<br>
+            m_dispatch_tsd_indexes_addr = libdispatch_tsd_indexes_symbol->GetLoadAddress(&m_process->GetTarget());<br>
         }<br>
     }<br>
 }<br>
<br>
Modified: lldb/trunk/source/Symbol/ObjectFile.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Symbol_ObjectFile.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=5qOXL5ncap2sosr7s8hSEfV37Z4_tBubfpAh53txIh4&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ObjectFile.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Symbol/ObjectFile.cpp (original)<br>
+++ lldb/trunk/source/Symbol/ObjectFile.cpp Thu Jun 25 16:46:34 2015<br>
@@ -328,7 +328,7 @@ ObjectFile::GetAddressClass (addr_t file<br>
         {<br>
             if (symbol->ValueIsAddress())<br>
             {<br>
-                const SectionSP section_sp (symbol->GetAddress().GetSection());<br>
+                const SectionSP section_sp (symbol->GetAddressRef().GetSection());<br>
                 if (section_sp)<br>
                 {<br>
                     const SectionType section_type = section_sp->GetType();<br>
<br>
Modified: lldb/trunk/source/Symbol/Symbol.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Symbol_Symbol.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=gWVDdFHMh6004ExektLSgUwjjLtzJEgxwToM5DqwK20&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Symbol/Symbol.cpp (original)<br>
+++ lldb/trunk/source/Symbol/Symbol.cpp Thu Jun 25 16:46:34 2015<br>
@@ -491,7 +491,7 @@ Symbol::CalculateSymbolContext (SymbolCo<br>
     // Symbols can reconstruct the symbol and the module in the symbol context<br>
     sc->symbol = this;<br>
     if (ValueIsAddress())<br>
-        sc->module_sp = GetAddress().GetModule();<br>
+        sc->module_sp = GetAddressRef().GetModule();<br>
     else<br>
         sc->module_sp.reset();<br>
 }<br>
@@ -500,7 +500,7 @@ ModuleSP<br>
 Symbol::CalculateSymbolContextModule ()<br>
 {<br>
     if (ValueIsAddress())<br>
-        return GetAddress().GetModule();<br>
+        return GetAddressRef().GetModule();<br>
     return ModuleSP();<br>
 }<br>
<br>
@@ -516,7 +516,7 @@ Symbol::DumpSymbolContext (Stream *s)<br>
     bool dumped_module = false;<br>
     if (ValueIsAddress())<br>
     {<br>
-        ModuleSP module_sp (GetAddress().GetModule());<br>
+        ModuleSP module_sp (GetAddressRef().GetModule());<br>
         if (module_sp)<br>
         {<br>
             dumped_module = true;<br>
@@ -618,6 +618,25 @@ Symbol::ResolveReExportedSymbol (Target<br>
 }<br>
<br>
 lldb::addr_t<br>
+Symbol::GetFileAddress () const<br>
+{<br>
+    if (ValueIsAddress())<br>
+        return GetAddressRef().GetFileAddress();<br>
+    else<br>
+        return LLDB_INVALID_ADDRESS;<br>
+}<br>
+<br>
+lldb::addr_t<br>
+Symbol::GetLoadAddress (Target *target) const<br>
+{<br>
+    if (ValueIsAddress())<br>
+        return GetAddressRef().GetLoadAddress(target);<br>
+    else<br>
+        return LLDB_INVALID_ADDRESS;<br>
+}<br>
+<br>
+<br>
+lldb::addr_t<br>
 Symbol::ResolveCallableAddress(Target &target) const<br>
 {<br>
     if (GetType() == lldb::eSymbolTypeUndefined)<br>
<br>
Modified: lldb/trunk/source/Symbol/SymbolContext.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Symbol_SymbolContext.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=PjBGax2NoXFQ6epdS5K2vIDcMWbeJEF8unMzyz7YHds&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)<br>
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Thu Jun 25 16:46:34 2015<br>
@@ -245,7 +245,7 @@ SymbolContext::DumpStopContext (<br>
<br>
         if (addr.IsValid() && symbol->ValueIsAddress())<br>
         {<br>
-            const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddress().GetOffset();<br>
+            const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddressRef().GetOffset();<br>
             if (show_function_name == false)<br>
             {<br>
                 // Print +offset even if offset is 0<br>
@@ -515,7 +515,7 @@ SymbolContext::GetAddressRange (uint32_t<br>
         {<br>
             if (symbol->ValueIsAddress())<br>
             {<br>
-                range.GetBaseAddress() = symbol->GetAddress();<br>
+                range.GetBaseAddress() = symbol->GetAddressRef();<br>
                 range.SetByteSize (symbol->GetByteSize());<br>
                 return true;<br>
             }<br>
@@ -1106,7 +1106,7 @@ SymbolContextList::AppendIfUnique (const<br>
<br>
                 if (pos->function)<br>
                 {<br>
-                    if (pos->function->GetAddressRange().GetBaseAddress() == sc.symbol->GetAddress())<br>
+                    if (pos->function->GetAddressRange().GetBaseAddress() == sc.symbol->GetAddressRef())<br>
                     {<br>
                         // Do we already have a function with this symbol?<br>
                         if (pos->symbol == sc.symbol)<br>
@@ -1148,7 +1148,7 @@ SymbolContextList::MergeSymbolContextInt<br>
<br>
                 if (function_sc.function)<br>
                 {<br>
-                    if (function_sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddress())<br>
+                    if (function_sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddressRef())<br>
                     {<br>
                         // Do we already have a function with this symbol?<br>
                         if (function_sc.symbol == symbol_sc.symbol)<br>
<br>
Modified: lldb/trunk/source/Symbol/Symtab.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Symbol_Symtab.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=r6rad8KOY5KEUJ6HLvQNPCeckmvaOBJ_SvoIRy2poic&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Symbol/Symtab.cpp (original)<br>
+++ lldb/trunk/source/Symbol/Symtab.cpp Thu Jun 25 16:46:34 2015<br>
@@ -598,14 +598,14 @@ namespace {<br>
             addr_t value_a = addr_cache[index_a];<br>
             if (value_a == LLDB_INVALID_ADDRESS)<br>
             {<br>
-                value_a = symbols[index_a].GetAddress().GetFileAddress();<br>
+                value_a = symbols[index_a].GetAddressRef().GetFileAddress();<br>
                 addr_cache[index_a] = value_a;<br>
             }<br>
<br>
             addr_t value_b = addr_cache[index_b];<br>
             if (value_b == LLDB_INVALID_ADDRESS)<br>
             {<br>
-                value_b = symbols[index_b].GetAddress().GetFileAddress();<br>
+                value_b = symbols[index_b].GetAddressRef().GetFileAddress();<br>
                 addr_cache[index_b] = value_b;<br>
             }<br>
<br>
@@ -902,7 +902,7 @@ SymbolWithClosestFileAddress (SymbolSear<br>
     const addr_t info_file_addr = info->file_addr;<br>
     if (symbol->ValueIsAddress())<br>
     {<br>
-        const addr_t curr_file_addr = symbol->GetAddress().GetFileAddress();<br>
+        const addr_t curr_file_addr = symbol->GetAddressRef().GetFileAddress();<br>
         if (info_file_addr < curr_file_addr)<br>
             return -1;<br>
<br>
@@ -936,7 +936,7 @@ Symtab::InitAddressIndexes()<br>
         {<br>
             if (pos->ValueIsAddress())<br>
             {<br>
-                entry.SetRangeBase(pos->GetAddress().GetFileAddress());<br>
+                entry.SetRangeBase(pos->GetAddressRef().GetFileAddress());<br>
                 entry.SetByteSize(pos->GetByteSize());<br>
                 entry.data = std::distance(begin, pos);<br>
                 m_file_addr_to_index.Append(entry);<br>
<br>
Modified: lldb/trunk/source/Target/Memory.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Target_Memory.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=6WYDSHpial8AnZjVF31zJgWsEI87kLadiQbep6TPd0w&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Memory.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/Memory.cpp (original)<br>
+++ lldb/trunk/source/Target/Memory.cpp Thu Jun 25 16:46:34 2015<br>
@@ -14,8 +14,9 @@<br>
 // Other libraries and framework includes<br>
 // Project includes<br>
 #include "lldb/Core/DataBufferHeap.h"<br>
-#include "lldb/Core/State.h"<br>
 #include "lldb/Core/Log.h"<br>
+#include "lldb/Core/RangeMap.h"<br>
+#include "lldb/Core/State.h"<br>
 #include "lldb/Target/Process.h"<br>
<br>
 using namespace lldb;<br>
@@ -25,11 +26,12 @@ using namespace lldb_private;<br>
 // MemoryCache constructor<br>
 //----------------------------------------------------------------------<br>
 MemoryCache::MemoryCache(Process &process) :<br>
-    m_process (process),<br>
-    m_cache_line_byte_size (process.GetMemoryCacheLineSize()),<br>
     m_mutex (Mutex::eMutexTypeRecursive),<br>
-    m_cache (),<br>
-    m_invalid_ranges ()<br>
+    m_L1_cache (),<br>
+    m_L2_cache (),<br>
+    m_invalid_ranges (),<br>
+    m_process (process),<br>
+    m_L2_cache_line_byte_size (process.GetMemoryCacheLineSize())<br>
 {<br>
 }<br>
<br>
@@ -44,10 +46,24 @@ void<br>
 MemoryCache::Clear(bool clear_invalid_ranges)<br>
 {<br>
     Mutex::Locker locker (m_mutex);<br>
-    m_cache.clear();<br>
+    m_L1_cache.clear();<br>
+    m_L2_cache.clear();<br>
     if (clear_invalid_ranges)<br>
         m_invalid_ranges.Clear();<br>
-    m_cache_line_byte_size = m_process.GetMemoryCacheLineSize();<br>
+    m_L2_cache_line_byte_size = m_process.GetMemoryCacheLineSize();<br>
+}<br>
+<br>
+void<br>
+MemoryCache::AddL1CacheData(lldb::addr_t addr, const void *src, size_t src_len)<br>
+{<br>
+    AddL1CacheData(addr,DataBufferSP (new DataBufferHeap(DataBufferHeap(src, src_len))));<br>
+}<br>
+<br>
+void<br>
+MemoryCache::AddL1CacheData(lldb::addr_t addr, const DataBufferSP &data_buffer_sp)<br>
+{<br>
+    Mutex::Locker locker (m_mutex);<br>
+    m_L1_cache[addr] = data_buffer_sp;<br>
 }<br>
<br>
 void<br>
@@ -57,29 +73,44 @@ MemoryCache::Flush (addr_t addr, size_t<br>
         return;<br>
<br>
     Mutex::Locker locker (m_mutex);<br>
-    if (m_cache.empty())<br>
-        return;<br>
<br>
-    const uint32_t cache_line_byte_size = m_cache_line_byte_size;<br>
-    const addr_t end_addr = (addr + size - 1);<br>
-    const addr_t first_cache_line_addr = addr - (addr % cache_line_byte_size);<br>
-    const addr_t last_cache_line_addr = end_addr - (end_addr % cache_line_byte_size);<br>
-    // Watch for overflow where size will cause us to go off the end of the<br>
-    // 64 bit address space<br>
-    uint32_t num_cache_lines;<br>
-    if (last_cache_line_addr >= first_cache_line_addr)<br>
-        num_cache_lines = ((last_cache_line_addr - first_cache_line_addr)/cache_line_byte_size) + 1;<br>
-    else<br>
-        num_cache_lines = (UINT64_MAX - first_cache_line_addr + 1)/cache_line_byte_size;<br>
-<br>
-    uint32_t cache_idx = 0;<br>
-    for (addr_t curr_addr = first_cache_line_addr;<br>
-         cache_idx < num_cache_lines;<br>
-         curr_addr += cache_line_byte_size, ++cache_idx)<br>
-    {<br>
-        BlockMap::iterator pos = m_cache.find (curr_addr);<br>
-        if (pos != m_cache.end())<br>
-            m_cache.erase(pos);<br>
+    // Erase any blocks from the L1 cache that intersect with the flush range<br>
+    if (!m_L1_cache.empty())<br>
+    {<br>
+        AddrRange flush_range(addr, size);<br>
+        BlockMap::iterator pos = m_L1_cache.lower_bound(addr);<br>
+        while (pos != m_L1_cache.end())<br>
+        {<br>
+            AddrRange chunk_range(pos->first, pos->second->GetByteSize());<br>
+            if (!chunk_range.DoesIntersect(flush_range))<br>
+                break;<br>
+            pos = m_L1_cache.erase(pos);<br>
+        }<br>
+    }<br>
+<br>
+    if (!m_L2_cache.empty())<br>
+    {<br>
+        const uint32_t cache_line_byte_size = m_L2_cache_line_byte_size;<br>
+        const addr_t end_addr = (addr + size - 1);<br>
+        const addr_t first_cache_line_addr = addr - (addr % cache_line_byte_size);<br>
+        const addr_t last_cache_line_addr = end_addr - (end_addr % cache_line_byte_size);<br>
+        // Watch for overflow where size will cause us to go off the end of the<br>
+        // 64 bit address space<br>
+        uint32_t num_cache_lines;<br>
+        if (last_cache_line_addr >= first_cache_line_addr)<br>
+            num_cache_lines = ((last_cache_line_addr - first_cache_line_addr)/cache_line_byte_size) + 1;<br>
+        else<br>
+            num_cache_lines = (UINT64_MAX - first_cache_line_addr + 1)/cache_line_byte_size;<br>
+<br>
+        uint32_t cache_idx = 0;<br>
+        for (addr_t curr_addr = first_cache_line_addr;<br>
+             cache_idx < num_cache_lines;<br>
+             curr_addr += cache_line_byte_size, ++cache_idx)<br>
+        {<br>
+            BlockMap::iterator pos = m_L2_cache.find (curr_addr);<br>
+            if (pos != m_L2_cache.end())<br>
+                m_L2_cache.erase(pos);<br>
+        }<br>
     }<br>
 }<br>
<br>
@@ -122,6 +153,39 @@ MemoryCache::Read (addr_t addr,<br>
 {<br>
     size_t bytes_left = dst_len;<br>
<br>
+    // Check the L1 cache for a range that contain the entire memory read.<br>
+    // If we find a range in the L1 cache that does, we use it. Else we fall<br>
+    // back to reading memory in m_L2_cache_line_byte_size byte sized chunks.<br>
+    // The L1 cache contains chunks of memory that are not required to be<br>
+    // m_L2_cache_line_byte_size bytes in size, so we don't try anything<br>
+    // tricky when reading from them (no partial reads from the L1 cache).<br>
+<br>
+    Mutex::Locker locker(m_mutex);<br>
+    if (!m_L1_cache.empty())<br>
+    {<br>
+        AddrRange read_range(addr, dst_len);<br>
+        BlockMap::iterator pos = m_L1_cache.lower_bound(addr);<br>
+        if (pos != m_L1_cache.end())<br>
+        {<br>
+            AddrRange chunk_range(pos->first, pos->second->GetByteSize());<br>
+            bool match = chunk_range.Contains(read_range);<br>
+            if (!match && pos != m_L1_cache.begin())<br>
+            {<br>
+                --pos;<br>
+                chunk_range.SetRangeBase(pos->first);<br>
+                chunk_range.SetByteSize(pos->second->GetByteSize());<br>
+                match = chunk_range.Contains(read_range);<br>
+            }<br>
+<br>
+            if (match)<br>
+            {<br>
+                memcpy(dst, pos->second->GetBytes() + addr - chunk_range.GetRangeBase(), dst_len);<br>
+                return dst_len;<br>
+            }<br>
+        }<br>
+    }<br>
+<br>
+<br>
     // If this memory read request is larger than the cache line size, then<br>
     // we (1) try to read as much of it at once as possible, and (2) don't<br>
     // add the data to the memory cache.  We don't want to split a big read<br>
@@ -129,19 +193,22 @@ MemoryCache::Read (addr_t addr,<br>
     // request, it is unlikely that the caller function will ask for the next<br>
     // 4 bytes after the large memory read - so there's little benefit to saving<br>
     // it in the cache.<br>
-    if (dst && dst_len > m_cache_line_byte_size)<br>
+    if (dst && dst_len > m_L2_cache_line_byte_size)<br>
     {<br>
-        return m_process.ReadMemoryFromInferior (addr, dst, dst_len, error);<br>
+        size_t bytes_read = m_process.ReadMemoryFromInferior (addr, dst, dst_len, error);<br>
+        // Add this non block sized range to the L1 cache if we actually read anything<br>
+        if (bytes_read > 0)<br>
+            AddL1CacheData(addr, dst, bytes_read);<br>
+        return bytes_read;<br>
     }<br>
<br>
     if (dst && bytes_left > 0)<br>
     {<br>
-        const uint32_t cache_line_byte_size = m_cache_line_byte_size;<br>
+        const uint32_t cache_line_byte_size = m_L2_cache_line_byte_size;<br>
         uint8_t *dst_buf = (uint8_t *)dst;<br>
         addr_t curr_addr = addr - (addr % cache_line_byte_size);<br>
         addr_t cache_offset = addr - curr_addr;<br>
-        Mutex::Locker locker (m_mutex);<br>
-<br>
+<br>
         while (bytes_left > 0)<br>
         {<br>
             if (m_invalid_ranges.FindEntryThatContains(curr_addr))<br>
@@ -150,8 +217,8 @@ MemoryCache::Read (addr_t addr,<br>
                 return dst_len - bytes_left;<br>
             }<br>
<br>
-            BlockMap::const_iterator pos = m_cache.find (curr_addr);<br>
-            BlockMap::const_iterator end = m_cache.end ();<br>
+            BlockMap::const_iterator pos = m_L2_cache.find (curr_addr);<br>
+            BlockMap::const_iterator end = m_L2_cache.end ();<br>
<br>
             if (pos != end)<br>
             {<br>
@@ -208,7 +275,7 @@ MemoryCache::Read (addr_t addr,<br>
<br>
                 if (process_bytes_read != cache_line_byte_size)<br>
                     data_buffer_heap_ap->SetByteSize (process_bytes_read);<br>
-                m_cache[curr_addr] = DataBufferSP (data_buffer_heap_ap.release());<br>
+                m_L2_cache[curr_addr] = DataBufferSP (data_buffer_heap_ap.release());<br>
                 // We have read data and put it into the cache, continue through the<br>
                 // loop again to get the data out of the cache...<br>
             }<br>
<br>
Modified: lldb/trunk/source/Target/Process.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Target_Process.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=aBMsw7I8QP7btjSk3z-srPMjBpoOjHYyXa3x37eLAlk&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/Process.cpp (original)<br>
+++ lldb/trunk/source/Target/Process.cpp Thu Jun 25 16:46:34 2015<br>
@@ -2246,11 +2246,12 @@ Process::CreateBreakpointSite (const Bre<br>
         if (symbol && symbol->IsIndirect())<br>
         {<br>
             Error error;<br>
-            load_addr = ResolveIndirectFunction (&symbol->GetAddress(), error);<br>
+            Address symbol_address = symbol->GetAddress();<br>
+            load_addr = ResolveIndirectFunction (&symbol_address, error);<br>
             if (!error.Success() && show_error)<br>
             {<br>
                 m_target.GetDebugger().GetErrorFile()->Printf ("warning: failed to resolve indirect function at 0x%" PRIx64 " for breakpoint %i.%i: %s\n",<br>
-                                                               symbol->GetAddress().GetLoadAddress(&m_target),<br>
+                                                               symbol->GetLoadAddress(&m_target),<br>
                                                                owner->GetBreakpoint().GetID(),<br>
                                                                owner->GetID(),<br>
                                                                error.AsCString() ? error.AsCString() : "unknown error");<br>
<br>
Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Target_ThreadPlanStepRange.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=PRnLcnqJpgOkjBb54mv6zhBXK1wqLSJnw1ZdEWaxhXE&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)<br>
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Thu Jun 25 16:46:34 2015<br>
@@ -243,9 +243,9 @@ ThreadPlanStepRange::InSymbol()<br>
     {<br>
         return m_addr_context.function->GetAddressRange().ContainsLoadAddress (cur_pc, m_thread.CalculateTarget().get());<br>
     }<br>
-    else if (m_addr_context.symbol)<br>
+    else if (m_addr_context.symbol && m_addr_context.symbol->ValueIsAddress())<br>
     {<br>
-        AddressRange range(m_addr_context.symbol->GetAddress(), m_addr_context.symbol->GetByteSize());<br>
+        AddressRange range(m_addr_context.symbol->GetAddressRef(), m_addr_context.symbol->GetByteSize());<br>
         return range.ContainsLoadAddress (cur_pc, m_thread.CalculateTarget().get());<br>
     }<br>
     return false;<br>
<br>
Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_tools_debugserver_debugserver.xcodeproj_project.pbxproj-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=YdLCxJONiChxTgQlC8vslAoODHw-5D5gfHBPNuFcciE&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)<br>
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Thu Jun 25 16:46:34 2015<br>
@@ -55,6 +55,7 @@<br>
                26203D1D1641EFB200A662F7 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.internal.plist; sourceTree = "<group>"; };<br>
                26242C390DDBD33C0054A4CC /* debugserver-entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "debugserver-entitlements.plist"; sourceTree = "<group>"; };<br>
                264D5D571293835600ED4C01 /* DNBArch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArch.cpp; sourceTree = "<group>"; };<br>
+               264F679A1B2F9EB200140093 /* JSONGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONGenerator.h; sourceTree = "<group>"; };<br>
                26593A060D4931CC001C9FE3 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; };<br>
                2660D9CC1192280900958FBD /* StringExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringExtractor.cpp; path = ../../source/Utility/StringExtractor.cpp; sourceTree = SOURCE_ROOT; };<br>
                2660D9CD1192280900958FBD /* StringExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringExtractor.h; path = ../../source/Utility/StringExtractor.h; sourceTree = SOURCE_ROOT; };<br>
@@ -232,6 +233,7 @@<br>
                                26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */,<br>
                                260E7332114BFFE600D1DFB3 /* DNBThreadResumeActions.h */,<br>
                                260E7331114BFFE600D1DFB3 /* DNBThreadResumeActions.cpp */,<br>
+                               264F679A1B2F9EB200140093 /* JSONGenerator.h */,<br>
                                AF67AC000D34604D0022D128 /* PseudoTerminal.h */,<br>
                                AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp */,<br>
                                26C637FD0C71334A0024798E /* PThreadCondition.h */,<br>
<br>
Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_tools_debugserver_source_RNBRemote.cpp-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=iOChLT_WYh1aWuyx9H67E2UiOv1TET9M8DeulnCS3oI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)<br>
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Thu Jun 25 16:46:34 2015<br>
@@ -29,6 +29,7 @@<br>
 #include "DNBDataRef.h"<br>
 #include "DNBLog.h"<br>
 #include "DNBThreadResumeActions.h"<br>
+#include "JSONGenerator.h"<br>
 #include "RNBContext.h"<br>
 #include "RNBServices.h"<br>
 #include "RNBSocket.h"<br>
@@ -262,6 +263,7 @@ RNBRemote::CreatePacketTable  ()<br>
     t.push_back (Packet (query_process_info,            &RNBRemote::HandlePacket_qProcessInfo           , NULL, "qProcessInfo", "Replies with multiple 'key:value;' tuples appended to each other."));<br>
     t.push_back (Packet (query_symbol_lookup,           &RNBRemote::HandlePacket_qSymbol                , NULL, "qSymbol:", "Notify that host debugger is ready to do symbol lookups"));<br>
     t.push_back (Packet (json_query_thread_extended_info,&RNBRemote::HandlePacket_jThreadExtendedInfo   , NULL, "jThreadExtendedInfo", "Replies with JSON data of thread extended information."));<br>
+    //t.push_back (Packet (json_query_threads_info,       &RNBRemote::HandlePacket_jThreadsInfo           , NULL, "jThreadsInfo", "Replies with JSON data with information about all threads."));<br>
     t.push_back (Packet (start_noack_mode,              &RNBRemote::HandlePacket_QStartNoAckMode        , NULL, "QStartNoAckMode", "Request that " DEBUGSERVER_PROGRAM_NAME " stop acking remote protocol packets"));<br>
     t.push_back (Packet (prefix_reg_packets_with_tid,   &RNBRemote::HandlePacket_QThreadSuffixSupported , NULL, "QThreadSuffixSupported", "Check if thread specific packets (register packets 'g', 'G', 'p', and 'P') support having the thread ID appended to the end of the command"));<br>
     t.push_back (Packet (set_logging_mode,              &RNBRemote::HandlePacket_QSetLogging            , NULL, "QSetLogging:", "Check if register packets ('g', 'G', 'p', and 'P' support having the thread ID prefix"));<br>
@@ -2559,6 +2561,52 @@ RNBRemote::DispatchQueueOffsets::GetThre<br>
     }<br>
 }<br>
<br>
+struct StackMemory<br>
+{<br>
+    uint8_t bytes[2*sizeof(nub_addr_t)];<br>
+    nub_size_t length;<br>
+};<br>
+typedef std::map<nub_addr_t, StackMemory> StackMemoryMap;<br>
+<br>
+<br>
+static void<br>
+ReadStackMemory (nub_process_t pid, nub_thread_t tid, StackMemoryMap &stack_mmap)<br>
+{<br>
+    DNBRegisterValue reg_value;<br>
+    if (DNBThreadGetRegisterValueByID(pid, tid, REGISTER_SET_GENERIC, GENERIC_REGNUM_FP, &reg_value))<br>
+    {<br>
+        uint32_t frame_count = 0;<br>
+        uint64_t fp = 0;<br>
+        if (reg_value.info.size == 4)<br>
+            fp = reg_value.value.uint32;<br>
+        else<br>
+            fp = reg_value.value.uint64;<br>
+        while (fp != 0)<br>
+        {<br>
+            // Make sure we never recurse more than 256 times so we don't recurse too far or<br>
+            // store up too much memory in the expedited cache<br>
+            if (++frame_count > 256)<br>
+                break;<br>
+<br>
+            const nub_size_t read_size = reg_value.info.size*2;<br>
+            StackMemory stack_memory;<br>
+            stack_memory.length = read_size;<br>
+            if (DNBProcessMemoryRead(pid, fp, read_size, stack_memory.bytes) != read_size)<br>
+                break;<br>
+            // Make sure we don't try to put the same stack memory in more than once<br>
+            if (stack_mmap.find(fp) != stack_mmap.end())<br>
+                break;<br>
+            // Put the entry into the cache<br>
+            stack_mmap[fp] = stack_memory;<br>
+            // Dereference the frame pointer to get to the previous frame pointer<br>
+            if (reg_value.info.size == 4)<br>
+                fp = ((uint32_t *)stack_memory.bytes)[0];<br>
+            else<br>
+                fp = ((uint64_t *)stack_memory.bytes)[0];<br>
+        }<br>
+    }<br>
+}<br>
+<br>
 rnb_err_t<br>
 RNBRemote::SendStopReplyPacketForThread (nub_thread_t tid)<br>
 {<br>
@@ -2714,11 +2762,26 @@ RNBRemote::SendStopReplyPacketForThread<br>
         }<br>
         else if (tid_stop_info.details.exception.type)<br>
         {<br>
-            ostrm << "metype:" << std::hex << tid_stop_info.details.exception.type << ";";<br>
-            ostrm << "mecount:" << std::hex << tid_stop_info.details.exception.data_count << ";";<br>
+            ostrm << "metype:" << std::hex << tid_stop_info.details.exception.type << ';';<br>
+            ostrm << "mecount:" << std::hex << tid_stop_info.details.exception.data_count << ';';<br>
             for (int i = 0; i < tid_stop_info.details.exception.data_count; ++i)<br>
-                ostrm << "medata:" << std::hex << tid_stop_info.details.exception.data[i] << ";";<br>
+                ostrm << "medata:" << std::hex << tid_stop_info.details.exception.data[i] << ';';<br>
         }<br>
+<br>
+        // Add expedited stack memory so stack backtracing doesn't need to read anything from the<br>
+        // frame pointer chain.<br>
+        StackMemoryMap stack_mmap;<br>
+        ReadStackMemory (pid, tid, stack_mmap);<br>
+        if (!stack_mmap.empty())<br>
+        {<br>
+            for (const auto &stack_memory : stack_mmap)<br>
+            {<br>
+                ostrm << "memory:" << HEXBASE << stack_memory.first << '=';<br>
+                append_hex_value (ostrm, stack_memory.second.bytes, stack_memory.second.length, false);<br>
+                ostrm << ';';<br>
+            }<br>
+        }<br>
+<br>
         return SendPacket (ostrm.str ());<br>
     }<br>
     return SendPacket("E51");<br>
@@ -4898,11 +4961,136 @@ get_integer_value_for_key_name_from_json<br>
 }<br>
<br>
 rnb_err_t<br>
+RNBRemote::HandlePacket_jThreadsInfo (const char *p)<br>
+{<br>
+    JSONGenerator::Array threads_array;<br>
+<br>
+    std::ostringstream json;<br>
+    std::ostringstream reply_strm;<br>
+    // If we haven't run the process yet, return an error.<br>
+    if (m_ctx.HasValidProcessID())<br>
+    {<br>
+        nub_process_t pid = m_ctx.ProcessID();<br>
+<br>
+        nub_size_t numthreads = DNBProcessGetNumThreads (pid);<br>
+        for (nub_size_t i = 0; i < numthreads; ++i)<br>
+        {<br>
+            nub_thread_t tid = DNBProcessGetThreadAtIndex (pid, i);<br>
+<br>
+            struct DNBThreadStopInfo tid_stop_info;<br>
+<br>
+            JSONGenerator::DictionarySP thread_dict_sp(new JSONGenerator::Dictionary());<br>
+<br>
+            thread_dict_sp->AddIntegerItem("tid", tid);<br>
+<br>
+            std::string reason_value("none");<br>
+            if (DNBThreadGetStopReason (pid, tid, &tid_stop_info))<br>
+            {<br>
+                switch (tid_stop_info.reason)<br>
+                {<br>
+                    case eStopTypeInvalid:<br>
+                        break;<br>
+                    case eStopTypeSignal:<br>
+                        if (tid_stop_info.details.signal.signo != 0)<br>
+                            reason_value = "signal";<br>
+                        break;<br>
+                    case eStopTypeException:<br>
+                        if (tid_stop_info.details.exception.type != 0)<br>
+                            reason_value = "exception";<br>
+                        break;<br>
+                    case eStopTypeExec:<br>
+                        reason_value = "exec";<br>
+                        break;<br>
+                }<br>
+                if (tid_stop_info.reason == eStopTypeSignal)<br>
+                {<br>
+                    thread_dict_sp->AddIntegerItem("signal", tid_stop_info.details.signal.signo);<br>
+                }<br>
+                else if (tid_stop_info.reason == eStopTypeException && tid_stop_info.details.exception.type != 0)<br>
+                {<br>
+                    thread_dict_sp->AddIntegerItem("metype", tid_stop_info.details.exception.type);<br>
+                    JSONGenerator::ArraySP medata_array_sp(new JSONGenerator::Array());<br>
+                    for (nub_size_t i=0; i<tid_stop_info.details.exception.data_count; ++i)<br>
+                    {<br>
+                        medata_array_sp->AddItem(JSONGenerator::IntegerSP(new JSONGenerator::Integer(tid_stop_info.details.exception.data[i])));<br>
+                    }<br>
+                    thread_dict_sp->AddItem("medata", medata_array_sp);<br>
+                }<br>
+            }<br>
+<br>
+            thread_dict_sp->AddStringItem("reason", reason_value);<br>
+<br>
+            const char *thread_name = DNBThreadGetName (pid, tid);<br>
+            if (thread_name && thread_name[0])<br>
+                thread_dict_sp->AddStringItem("name", thread_name);<br>
+<br>
+<br>
+            thread_identifier_info_data_t thread_ident_info;<br>
+            if (DNBThreadGetIdentifierInfo (pid, tid, &thread_ident_info))<br>
+            {<br>
+                if (thread_ident_info.dispatch_qaddr != 0)<br>
+                    thread_dict_sp->AddIntegerItem("qaddr", thread_ident_info.dispatch_qaddr);<br>
+            }<br>
+            DNBRegisterValue reg_value;<br>
+<br>
+            if (g_reg_entries != NULL)<br>
+            {<br>
+                JSONGenerator::DictionarySP registers_dict_sp(new JSONGenerator::Dictionary());<br>
+<br>
+                for (uint32_t reg = 0; reg < g_num_reg_entries; reg++)<br>
+                {<br>
+                    // Expedite all registers in the first register set that aren't<br>
+                    // contained in other registers<br>
+                    if (g_reg_entries[reg].nub_info.set == 1 &&<br>
+                        g_reg_entries[reg].nub_info.value_regs == NULL)<br>
+                    {<br>
+                        if (!DNBThreadGetRegisterValueByID (pid, tid, g_reg_entries[reg].nub_info.set, g_reg_entries[reg].nub_info.reg, &reg_value))<br>
+                            continue;<br>
+<br>
+                        std::ostringstream reg_num;<br>
+                        reg_num << std::dec << g_reg_entries[reg].gdb_regnum;<br>
+                        // Encode native byte ordered bytes as hex ascii<br>
+                        registers_dict_sp->AddBytesAsHexASCIIString(reg_num.str(), reg_value.value.v_uint8, g_reg_entries[reg].nub_info.size);<br>
+                    }<br>
+                }<br>
+                thread_dict_sp->AddItem("registers", registers_dict_sp);<br>
+            }<br>
+<br>
+            // Add expedited stack memory so stack backtracing doesn't need to read anything from the<br>
+            // frame pointer chain.<br>
+            StackMemoryMap stack_mmap;<br>
+            ReadStackMemory (pid, tid, stack_mmap);<br>
+            if (!stack_mmap.empty())<br>
+            {<br>
+                JSONGenerator::ArraySP memory_array_sp(new JSONGenerator::Array());<br>
+<br>
+                for (const auto &stack_memory : stack_mmap)<br>
+                {<br>
+                    JSONGenerator::DictionarySP stack_memory_sp(new JSONGenerator::Dictionary());<br>
+                    stack_memory_sp->AddIntegerItem("address", stack_memory.first);<br>
+                    stack_memory_sp->AddBytesAsHexASCIIString("bytes", stack_memory.second.bytes, stack_memory.second.length);<br>
+                    memory_array_sp->AddItem(stack_memory_sp);<br>
+                }<br>
+                thread_dict_sp->AddItem("memory", memory_array_sp);<br>
+            }<br>
+            threads_array.AddItem(thread_dict_sp);<br>
+        }<br>
+<br>
+        std::ostringstream strm;<br>
+        threads_array.Dump (strm);<br>
+        std::string binary_packet = binary_encode_string (strm.str());<br>
+        if (!binary_packet.empty())<br>
+            return SendPacket (binary_packet.c_str());<br>
+    }<br>
+    return SendPacket ("E85");<br>
+<br>
+}<br>
+<br>
+rnb_err_t<br>
 RNBRemote::HandlePacket_jThreadExtendedInfo (const char *p)<br>
 {<br>
     nub_process_t pid;<br>
     std::ostringstream json;<br>
-    std::ostringstream reply_strm;<br>
     // If we haven't run the process yet, return an error.<br>
     if (!m_ctx.HasValidProcessID())<br>
     {<br>
@@ -5132,8 +5320,7 @@ RNBRemote::HandlePacket_jThreadExtendedI<br>
<br>
             json << "}";<br>
             std::string json_quoted = binary_encode_string (json.str());<br>
-            reply_strm << json_quoted;<br>
-            return SendPacket (reply_strm.str());<br>
+            return SendPacket (json_quoted);<br>
         }<br>
     }<br>
     return SendPacket ("OK");<br>
<br>
Modified: lldb/trunk/tools/debugserver/source/RNBRemote.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_tools_debugserver_source_RNBRemote.h-3Frev-3D240702-26r1-3D240701-26r2-3D240702-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=EH3iKBF1o__UyQaq3RTknyZsw8svpm1EsJWQuyhyA4Q&s=h2NAGUvT_UN1crdf3DgpUTZzrj1wZWmUdrf1spUAEHs&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.h?rev=240702&r1=240701&r2=240702&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/debugserver/source/RNBRemote.h (original)<br>
+++ lldb/trunk/tools/debugserver/source/RNBRemote.h Thu Jun 25 16:46:34 2015<br>
@@ -103,6 +103,7 @@ public:<br>
         query_gdb_server_version,       // 'qGDBServerVersion'<br>
         query_process_info,             // 'qProcessInfo'<br>
         json_query_thread_extended_info,// 'jThreadExtendedInfo'<br>
+        json_query_threads_info,        // 'jThreadsInfo'<br>
         pass_signals_to_inferior,       // 'QPassSignals'<br>
         start_noack_mode,               // 'QStartNoAckMode'<br>
         prefix_reg_packets_with_tid,    // 'QPrefixRegisterPacketsWithThreadID<br>
@@ -190,6 +191,7 @@ public:<br>
     rnb_err_t HandlePacket_qSyncThreadStateSupported (const char *p);<br>
     rnb_err_t HandlePacket_qThreadInfo (const char *p);<br>
     rnb_err_t HandlePacket_jThreadExtendedInfo (const char *p);<br>
+    rnb_err_t HandlePacket_jThreadsInfo (const char *p);<br>
     rnb_err_t HandlePacket_qThreadExtraInfo (const char *p);<br>
     rnb_err_t HandlePacket_qThreadStopInfo (const char *p);<br>
     rnb_err_t HandlePacket_qHostInfo (const char *p);<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br></div>