[llvm-branch-commits] [lldb] r183468 - Update platform branch with top of tree.

Greg Clayton gclayton at apple.com
Thu Jun 6 17:08:08 PDT 2013


Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupBoolean.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupBoolean.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupBoolean.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupBoolean.h Thu Jun  6 19:06:43 2013
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
 
 namespace lldb_private {
     //-------------------------------------------------------------------------
@@ -25,15 +25,16 @@ namespace lldb_private {
     class OptionGroupBoolean : public OptionGroup
     {
     public:
-        
+         // When 'no_argument_toggle_default' is true, then setting the option
+         // value does NOT require an argument, it sets the boolean value to the
+         // inverse of the default value
         OptionGroupBoolean (uint32_t usage_mask,
                             bool required,
                             const char *long_option, 
-                            char short_option,
-                            uint32_t completion_type,
-                            lldb::CommandArgumentType argument_type,
+                            int short_option,
                             const char *usage_text,
-                            bool default_value);
+                            bool default_value,
+                            bool no_argument_toggle_default);
         
         virtual
         ~OptionGroupBoolean ();
@@ -76,7 +77,7 @@ namespace lldb_private {
         OptionDefinition m_option_definition;
         
     };
-    
+
 } // namespace lldb_private
 
 #endif  // liblldb_OptionGroupBoolean_h_

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFile.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFile.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFile.h Thu Jun  6 19:06:43 2013
@@ -15,7 +15,8 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+#include "lldb/Interpreter/OptionValueFileSpecList.h"
 
 namespace lldb_private {
 
@@ -30,7 +31,7 @@ public:
     OptionGroupFile (uint32_t usage_mask,
                      bool required,
                      const char *long_option, 
-                     char short_option,
+                     int short_option,
                      uint32_t completion_type,
                      lldb::CommandArgumentType argument_type,
                      const char *usage_text);
@@ -88,7 +89,7 @@ public:
     OptionGroupFileList (uint32_t usage_mask,
                          bool required,
                          const char *long_option, 
-                         char short_option,
+                         int short_option,
                          uint32_t completion_type,
                          lldb::CommandArgumentType argument_type,
                          const char *usage_text);

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFormat.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFormat.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFormat.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupFormat.h Thu Jun  6 19:06:43 2013
@@ -15,7 +15,9 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueFormat.h"
+#include "lldb/Interpreter/OptionValueSInt64.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
 
 namespace lldb_private {
 
@@ -95,6 +97,11 @@ public:
         return m_count;
     }
     
+    bool
+    HasGDBFormat () const
+    {
+        return m_has_gdb_format;
+    }
     
     bool
     AnyOptionWasSet () const
@@ -107,13 +114,18 @@ public:
 protected:
 
     bool
-    ParserGDBFormatLetter (char format_letter, lldb::Format &format, uint32_t &byte_size);
+    ParserGDBFormatLetter (CommandInterpreter &interpreter,
+                           char format_letter,
+                           lldb::Format &format,
+                           uint32_t &byte_size);
 
     OptionValueFormat m_format;
     OptionValueUInt64 m_byte_size;
     OptionValueUInt64 m_count;
     char m_prev_gdb_format;
     char m_prev_gdb_size;
+    
+    bool m_has_gdb_format;
 };
 
 } // namespace lldb_private

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupOutputFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupOutputFile.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupOutputFile.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupOutputFile.h Thu Jun  6 19:06:43 2013
@@ -15,7 +15,8 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
 
 namespace lldb_private {
 //-------------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUInt64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUInt64.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUInt64.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUInt64.h Thu Jun  6 19:06:43 2013
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
 
 namespace lldb_private {
     //-------------------------------------------------------------------------
@@ -29,7 +29,7 @@ namespace lldb_private {
         OptionGroupUInt64 (uint32_t usage_mask,
                            bool required,
                            const char *long_option, 
-                           char short_option,
+                           int short_option,
                            uint32_t completion_type,
                            lldb::CommandArgumentType argument_type,
                            const char *usage_text,

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUUID.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUUID.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUUID.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupUUID.h Thu Jun  6 19:06:43 2013
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueUUID.h"
 
 namespace lldb_private {
 //-------------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h Thu Jun  6 19:06:43 2013
@@ -14,6 +14,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Core/ValueObject.h"
 #include "lldb/Interpreter/Options.h"
 
 namespace lldb_private {
@@ -60,6 +61,11 @@ public:
                be_raw == true ||
                ignore_cap == true;
     }
+    
+    ValueObject::DumpValueObjectOptions
+    GetAsDumpOptions (bool objc_is_compact = false,
+                      lldb::Format format = lldb::eFormatDefault,
+                      lldb::TypeSummaryImplSP summary_sp = lldb::TypeSummaryImplSP());
 
     bool show_types;
     uint32_t no_summary_depth;

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h Thu Jun  6 19:06:43 2013
@@ -14,7 +14,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueString.h"
 #include "lldb/Interpreter/Options.h"
 
 namespace lldb_private {

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/Options.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/Options.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/Options.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/Options.h Thu Jun  6 19:06:43 2013
@@ -25,6 +25,15 @@
 
 namespace lldb_private {
 
+  static inline bool
+  isprint8 (int ch)
+  {
+      if (ch & 0xffffff00u)
+          return false;
+      return isprint(ch);
+  }
+
+
 //----------------------------------------------------------------------
 /// @class Options Options.h "lldb/Interpreter/Options.h"
 /// @brief A command line option parsing protocol class.
@@ -36,10 +45,10 @@ namespace lldb_private {
 /// \endcode
 ///
 /// The options are specified using the format defined for the libc
-/// options parsing function getopt_long:
+/// options parsing function getopt_long_only:
 /// \code
 ///     #include <getopt.h>
-///     int getopt_long(int argc, char * const *argv, const char *optstring, const struct option *longopts, int *longindex);
+///     int getopt_long_only(int argc, char * const *argv, const char *optstring, const struct option *longopts, int *longindex);
 /// \endcode
 ///
 /// Example code:
@@ -130,7 +139,7 @@ public:
     /// Get the option definitions to use when parsing Args options.
     ///
     /// @see Args::ParseOptions (Options&)
-    /// @see man getopt_long
+    /// @see man getopt_long_only
     //------------------------------------------------------------------
     struct option *
     GetLongOptions ();
@@ -191,7 +200,7 @@ public:
     ///
     ///
     /// @see Args::ParseOptions (Options&)
-    /// @see man getopt_long
+    /// @see man getopt_long_only
     //------------------------------------------------------------------
     virtual Error
     SetOptionValue (uint32_t option_idx, const char *option_arg) = 0;
@@ -296,7 +305,7 @@ public:
     
 protected:
     // This is a set of options expressed as indexes into the options table for this Option.
-    typedef std::set<char> OptionSet;
+    typedef std::set<int> OptionSet;
     typedef std::vector<OptionSet> OptionSetVector;
 
     CommandInterpreter &m_interpreter;

Copied: lldb/branches/lldb-platform-work/include/lldb/Interpreter/PythonDataObjects.h (from r182522, lldb/trunk/include/lldb/Interpreter/PythonDataObjects.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/PythonDataObjects.h?p2=lldb/branches/lldb-platform-work/include/lldb/Interpreter/PythonDataObjects.h&p1=lldb/trunk/include/lldb/Interpreter/PythonDataObjects.h&r1=182522&r2=183468&rev=183468&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/PythonDataObjects.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/PythonDataObjects.h Thu Jun  6 19:06:43 2013
@@ -82,13 +82,16 @@ namespace lldb_private {
         }
         
         void
-        Dump  () const
+        Dump () const
         {
             if (m_py_obj)
                 _PyObject_Dump (m_py_obj);
             else
                 puts ("NULL");
         }
+        
+        void
+        Dump (Stream &strm) const;
 
         PyObject*
         GetPythonObject () const

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h Thu Jun  6 19:06:43 2013
@@ -41,6 +41,11 @@ public:
         return m_object;
     }
     
+    operator bool ()
+    {
+        return m_object != NULL;
+    }
+    
     ScriptInterpreterObject&
     operator = (const ScriptInterpreterObject& rhs)
     {
@@ -56,6 +61,22 @@ public:
 protected:
     void* m_object;
 };
+    
+class ScriptInterpreterLocker
+{
+public:
+    
+    ScriptInterpreterLocker ()
+    {
+    }
+    
+    virtual ~ScriptInterpreterLocker ()
+    {
+    }
+private:
+    DISALLOW_COPY_AND_ASSIGN (ScriptInterpreterLocker);
+};
+
 
 class ScriptInterpreter
 {
@@ -79,15 +100,22 @@ public:
                                                           void** pyfunct_wrapper,
                                                           std::string& retval);
     
-    typedef void* (*SWIGPythonCreateSyntheticProvider) (const std::string python_class_name,
+    typedef void* (*SWIGPythonCreateSyntheticProvider) (const char *python_class_name,
                                                         const char *session_dictionary_name,
                                                         const lldb::ValueObjectSP& valobj_sp);
-    
-    typedef uint32_t       (*SWIGPythonCalculateNumChildren)        (void *implementor);
-    typedef void*          (*SWIGPythonGetChildAtIndex)             (void *implementor, uint32_t idx);
-    typedef int            (*SWIGPythonGetIndexOfChildWithName)     (void *implementor, const char* child_name);
-    typedef void*          (*SWIGPythonCastPyObjectToSBValue)       (void* data);
-    typedef bool           (*SWIGPythonUpdateSynthProviderInstance) (void* data);
+
+    typedef void* (*SWIGPythonCreateOSPlugin) (const char *python_class_name,
+                                               const char *session_dictionary_name,
+                                               const lldb::ProcessSP& process_sp);
+    
+    typedef uint32_t       (*SWIGPythonCalculateNumChildren)                   (void *implementor);
+    typedef void*          (*SWIGPythonGetChildAtIndex)                        (void *implementor, uint32_t idx);
+    typedef int            (*SWIGPythonGetIndexOfChildWithName)                (void *implementor, const char* child_name);
+    typedef void*          (*SWIGPythonCastPyObjectToSBValue)                  (void* data);
+    typedef lldb::ValueObjectSP  (*SWIGPythonGetValueObjectSPFromSBValue)      (void* data);
+    typedef bool           (*SWIGPythonUpdateSynthProviderInstance)            (void* data);
+    typedef bool           (*SWIGPythonMightHaveChildrenSynthProviderInstance) (void* data);
+
     
     typedef bool           (*SWIGPythonCallCommand)                 (const char *python_function_name,
                                                                      const char *session_dictionary_name,
@@ -96,7 +124,7 @@ public:
                                                                      std::string& err_msg,
                                                                      lldb_private::CommandReturnObject& cmd_retobj);
     
-    typedef bool           (*SWIGPythonCallModuleInit)              (const std::string python_module_name,
+    typedef bool           (*SWIGPythonCallModuleInit)              (const char *python_module_name,
                                                                      const char *session_dictionary_name,
                                                                      lldb::DebuggerSP& debugger);
 
@@ -122,20 +150,81 @@ public:
 
     virtual ~ScriptInterpreter ();
 
+    struct ExecuteScriptOptions
+    {
+    public:
+        ExecuteScriptOptions () :
+            m_enable_io(true),
+            m_set_lldb_globals(true),
+            m_maskout_errors(true)
+        {
+        }
+        
+        bool
+        GetEnableIO () const
+        {
+            return m_enable_io;
+        }
+        
+        bool
+        GetSetLLDBGlobals () const
+        {
+            return m_set_lldb_globals;
+        }
+        
+        bool
+        GetMaskoutErrors () const
+        {
+            return m_maskout_errors;
+        }
+        
+        ExecuteScriptOptions&
+        SetEnableIO (bool enable)
+        {
+            m_enable_io = enable;
+            return *this;
+        }
+
+        ExecuteScriptOptions&
+        SetSetLLDBGlobals (bool set)
+        {
+            m_set_lldb_globals = set;
+            return *this;
+        }
+
+        ExecuteScriptOptions&
+        SetMaskoutErrors (bool maskout)
+        {
+            m_maskout_errors = maskout;
+            return *this;
+        }
+        
+    private:
+        bool m_enable_io;
+        bool m_set_lldb_globals;
+        bool m_maskout_errors;
+    };
+    
     virtual bool
-    ExecuteOneLine (const char *command, CommandReturnObject *result, bool enable_io) = 0;
+    ExecuteOneLine (const char *command,
+                    CommandReturnObject *result,
+                    const ExecuteScriptOptions &options = ExecuteScriptOptions()) = 0;
 
     virtual void
     ExecuteInterpreterLoop () = 0;
 
     virtual bool
-    ExecuteOneLineWithReturn (const char *in_string, ScriptReturnType return_type, void *ret_value, bool enable_io)
+    ExecuteOneLineWithReturn (const char *in_string,
+                              ScriptReturnType return_type,
+                              void *ret_value,
+                              const ExecuteScriptOptions &options = ExecuteScriptOptions())
     {
         return true;
     }
 
     virtual bool
-    ExecuteMultipleLines (const char *in_string, bool enable_io)
+    ExecuteMultipleLines (const char *in_string,
+                          const ExecuteScriptOptions &options = ExecuteScriptOptions())
     {
         return true;
     }
@@ -189,12 +278,46 @@ public:
     }
     
     virtual lldb::ScriptInterpreterObjectSP
-    CreateSyntheticScriptedProvider (std::string class_name,
+    CreateSyntheticScriptedProvider (const char *class_name,
                                      lldb::ValueObjectSP valobj)
     {
         return lldb::ScriptInterpreterObjectSP();
     }
     
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_CreatePluginObject (const char *class_name,
+                                 lldb::ProcessSP process_sp)
+    {
+        return lldb::ScriptInterpreterObjectSP();
+    }
+    
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_RegisterInfo (lldb::ScriptInterpreterObjectSP os_plugin_object_sp)
+    {
+        return lldb::ScriptInterpreterObjectSP();
+    }
+    
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_ThreadsInfo (lldb::ScriptInterpreterObjectSP os_plugin_object_sp)
+    {
+        return lldb::ScriptInterpreterObjectSP();
+    }
+    
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_RegisterContextData (lldb::ScriptInterpreterObjectSP os_plugin_object_sp,
+                                  lldb::tid_t thread_id)
+    {
+        return lldb::ScriptInterpreterObjectSP();
+    }
+
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_CreateThread (lldb::ScriptInterpreterObjectSP os_plugin_object_sp,
+                           lldb::tid_t tid,
+                           lldb::addr_t context)
+    {
+        return lldb::ScriptInterpreterObjectSP();
+    }
+
     virtual bool
     GenerateFunction(const char *signature, const StringList &input)
     {
@@ -234,7 +357,7 @@ public:
         return false;
     }
     
-    virtual uint32_t
+    virtual size_t
     CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor)
     {
         return 0;
@@ -257,7 +380,13 @@ public:
     {
         return false;
     }
-        
+    
+    virtual bool
+    MightHaveChildrenSynthProviderInstance (const lldb::ScriptInterpreterObjectSP& implementor)
+    {
+        return true;
+    }
+    
     virtual bool
     RunScriptBasedCommand (const char* impl_function,
                            const char* args,
@@ -268,15 +397,23 @@ public:
         return false;
     }
     
-    virtual std::string
-    GetDocumentationForItem (const char* item)
+    virtual bool
+    GetDocumentationForItem (const char* item, std::string& dest)
+    {
+		dest.clear();
+        return false;
+    }
+    
+    virtual bool
+    CheckObjectExists (const char* name)
     {
-        return std::string("");
+        return false;
     }
 
     virtual bool
     LoadScriptingModule (const char* filename,
                          bool can_reload,
+                         bool init_session,
                          lldb_private::Error& error)
     {
         error.SetErrorString("loading unimplemented");
@@ -289,6 +426,9 @@ public:
         return lldb::ScriptInterpreterObjectSP(new ScriptInterpreterObject(object));
     }
     
+    virtual std::unique_ptr<ScriptInterpreterLocker>
+    AcquireInterpreterLock ();
+    
     const char *
     GetScriptInterpreterPtyName ();
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterNone.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterNone.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterNone.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterNone.h Thu Jun  6 19:06:43 2013
@@ -23,7 +23,7 @@ public:
     ~ScriptInterpreterNone ();
 
     bool
-    ExecuteOneLine (const char *command, CommandReturnObject *result, bool enable_io);
+    ExecuteOneLine (const char *command, CommandReturnObject *result, const ExecuteScriptOptions &options = ExecuteScriptOptions());
 
     void
     ExecuteInterpreterLoop ();

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h Thu Jun  6 19:06:43 2013
@@ -39,7 +39,9 @@ public:
     ~ScriptInterpreterPython ();
 
     bool
-    ExecuteOneLine (const char *command, CommandReturnObject *result, bool enable_io);
+    ExecuteOneLine (const char *command,
+                    CommandReturnObject *result,
+                    const ExecuteScriptOptions &options = ExecuteScriptOptions());
 
     void
     ExecuteInterpreterLoop ();
@@ -48,10 +50,11 @@ public:
     ExecuteOneLineWithReturn (const char *in_string, 
                               ScriptInterpreter::ScriptReturnType return_type,
                               void *ret_value,
-                              bool enable_io);
+                              const ExecuteScriptOptions &options = ExecuteScriptOptions());
 
     bool
-    ExecuteMultipleLines (const char *in_string, bool enable_io);
+    ExecuteMultipleLines (const char *in_string,
+                          const ExecuteScriptOptions &options = ExecuteScriptOptions());
 
     bool
     ExportFunctionDefinitionToInterpreter (StringList &function_def);
@@ -73,10 +76,29 @@ public:
     GenerateScriptAliasFunction (StringList &input, std::string& output);
     
     lldb::ScriptInterpreterObjectSP
-    CreateSyntheticScriptedProvider (std::string class_name,
+    CreateSyntheticScriptedProvider (const char *class_name,
                                      lldb::ValueObjectSP valobj);
     
-    virtual uint32_t
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_CreatePluginObject (const char *class_name,
+                                 lldb::ProcessSP process_sp);
+    
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_RegisterInfo (lldb::ScriptInterpreterObjectSP os_plugin_object_sp);
+    
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_ThreadsInfo (lldb::ScriptInterpreterObjectSP os_plugin_object_sp);
+    
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_RegisterContextData (lldb::ScriptInterpreterObjectSP os_plugin_object_sp,
+                                  lldb::tid_t thread_id);
+    
+    virtual lldb::ScriptInterpreterObjectSP
+    OSPlugin_CreateThread (lldb::ScriptInterpreterObjectSP os_plugin_object_sp,
+                           lldb::tid_t tid,
+                           lldb::addr_t context);
+    
+    virtual size_t
     CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor);
     
     virtual lldb::ValueObjectSP
@@ -89,6 +111,9 @@ public:
     UpdateSynthProviderInstance (const lldb::ScriptInterpreterObjectSP& implementor);
     
     virtual bool
+    MightHaveChildrenSynthProviderInstance (const lldb::ScriptInterpreterObjectSP& implementor);
+    
+    virtual bool
     RunScriptBasedCommand(const char* impl_function,
                           const char* args,
                           ScriptedCommandSynchronicity synchronicity,
@@ -135,17 +160,30 @@ public:
                         lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
                         std::string& retval);
     
-    virtual std::string
-    GetDocumentationForItem (const char* item);
+    virtual bool
+    GetDocumentationForItem (const char* item, std::string& dest);
+    
+    virtual bool
+    CheckObjectExists (const char* name)
+    {
+        if (!name || !name[0])
+            return false;
+        std::string temp;
+        return GetDocumentationForItem (name,temp);
+    }
     
     virtual bool
     LoadScriptingModule (const char* filename,
                          bool can_reload,
+                         bool init_session,
                          lldb_private::Error& error);
     
     virtual lldb::ScriptInterpreterObjectSP
     MakeScriptObject (void* object);
     
+    virtual std::unique_ptr<ScriptInterpreterLocker>
+    AcquireInterpreterLock ();
+    
     void
     CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
                                              CommandReturnObject &result);
@@ -181,8 +219,8 @@ public:
 
 protected:
 
-    void
-    EnterSession ();
+    bool
+    EnterSession (bool init_lldb_globals);
     
     void
     LeaveSession ();
@@ -220,6 +258,12 @@ private:
             Py_XINCREF(m_object);
         }
         
+        operator bool ()
+        {
+            return m_object && m_object != Py_None;
+        }
+        
+        
         virtual
         ~ScriptInterpreterPythonObject()
         {
@@ -230,14 +274,15 @@ private:
             DISALLOW_COPY_AND_ASSIGN (ScriptInterpreterPythonObject);
     };
     
-	class Locker
+	class Locker : public ScriptInterpreterLocker
 	{
 	public:
         
         enum OnEntry
         {
             AcquireLock         = 0x0001,
-            InitSession         = 0x0002
+            InitSession         = 0x0002,
+            InitGlobals         = 0x0004
         };
         
         enum OnLeave
@@ -253,34 +298,28 @@ private:
                 FILE* wait_msg_handle = NULL);
         
     	~Locker ();
-    
-        static bool
-        CurrentThreadHasPythonLock ();
-        
+
 	private:
         
         bool
         DoAcquireLock ();
         
         bool
-        DoInitSession ();
+        DoInitSession (bool init_lldb_globals);
         
         bool
         DoFreeLock ();
         
         bool
         DoTearDownSession ();
-        
-        static bool
-        TryGetPythonLock (uint32_t seconds_to_wait);
-        
+
         static void
         ReleasePythonLock ();
         
-    	bool                     m_need_session;
-    	bool                     m_release_lock;
+    	bool                     m_teardown_session;
     	ScriptInterpreterPython *m_python_interpreter;
     	FILE*                    m_tmp_fh;
+        PyGILState_STATE         m_GILState;
 	};
     
     class PythonInputReaderManager
@@ -321,8 +360,10 @@ private:
                          size_t bytes_len);
 
 
+    lldb_utility::PseudoTerminal m_embedded_thread_pty;
     lldb_utility::PseudoTerminal m_embedded_python_pty;
     lldb::InputReaderSP m_embedded_thread_input_reader_sp;
+    lldb::InputReaderSP m_embedded_python_input_reader_sp;
     FILE *m_dbg_stdout;
     PyObject *m_new_sysout;
     PyObject *m_old_sysout;
@@ -333,7 +374,7 @@ private:
     bool m_session_is_active;
     bool m_pty_slave_is_open;
     bool m_valid_session;
-                         
+    PyThreadState *m_command_thread_state;
 };
 } // namespace lldb_private
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h Thu Jun  6 19:06:43 2013
@@ -435,7 +435,7 @@ public:
     Block *
     FindBlockByID (lldb::user_id_t block_id);
 
-    uint32_t
+    size_t
     GetNumRanges () const
     {
         return m_ranges.GetSize();
@@ -446,6 +446,9 @@ public:
 
     bool
     GetRangeContainingAddress (const Address& addr, AddressRange &range);
+    
+    bool
+    GetRangeContainingLoadAddress (lldb::addr_t load_addr, Target &target, AddressRange &range);
 
     uint32_t
     GetRangeIndexContainingAddress (const Address& addr);

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h Thu Jun  6 19:06:43 2013
@@ -11,11 +11,11 @@
 #define liblldb_ClangASTContext_h_
 
 // C Includes
+#include <stdint.h>
+
 // C++ Includes
 #include <string>
 #include <vector>
-#include <memory>
-#include <stdint.h>
 
 // Other libraries and framework includes
 #include "llvm/ADT/OwningPtr.h"
@@ -53,7 +53,11 @@ public:
         eTypeIsTemplate         = (1u << 14),
         eTypeIsTypedef          = (1u << 15),
         eTypeIsVector           = (1u << 16),
-        eTypeIsScalar           = (1u << 17)
+        eTypeIsScalar           = (1u << 17),
+        eTypeIsInteger          = (1u << 18),
+        eTypeIsFloat            = (1u << 19),
+        eTypeIsComplex          = (1u << 20),
+        eTypeIsSigned           = (1u << 21)
     };
 
     typedef void (*CompleteTagDeclCallback)(void *baton, clang::TagDecl *);
@@ -144,25 +148,29 @@ public:
     GetCompleteDecl (clang::ASTContext *ast,
                      clang::Decl *decl);
 
-    void SetMetadata (uintptr_t object,
-                      uint64_t metadata)
+    void SetMetadataAsUserID (const void *object,
+                              lldb::user_id_t user_id);
+
+    void SetMetadata (const void *object,
+                      ClangASTMetadata &meta_data)
     {
-        SetMetadata(getASTContext(), object, metadata);
+        SetMetadata(getASTContext(), object, meta_data);
     }
     
     static void
     SetMetadata (clang::ASTContext *ast,
-                 uintptr_t object,
-                 uint64_t metadata);
+                 const void *object,
+                 ClangASTMetadata &meta_data);
     
-    uint64_t GetMetadata (uintptr_t object)
+    ClangASTMetadata *
+    GetMetadata (const void *object)
     {
         return GetMetadata(getASTContext(), object);
     }
     
-    static uint64_t
+    static ClangASTMetadata *
     GetMetadata (clang::ASTContext *ast,
-                 uintptr_t object);
+                 const void *object);
     
     //------------------------------------------------------------------
     // Basic Types
@@ -197,6 +205,9 @@ public:
 
     lldb::clang_type_t
     GetBuiltInType_objc_id();
+    
+    static lldb::clang_type_t
+    GetBuiltInType_objc_id(clang::ASTContext *ast);
 
     lldb::clang_type_t
     GetBuiltInType_objc_Class();
@@ -274,6 +285,9 @@ public:
     lldb::clang_type_t
     GetTypeForDecl (clang::ObjCInterfaceDecl *objc_decl);
 
+    static lldb::BasicType
+    GetLLDBBasicTypeEnumeration (lldb::clang_type_t clang_type);
+
     //------------------------------------------------------------------
     // CVR modifiers
     //------------------------------------------------------------------
@@ -297,7 +311,7 @@ public:
                       const char *name,
                       int kind,
                       lldb::LanguageType language,
-                      uint64_t metadata = 0);
+                      ClangASTMetadata *metadata = NULL);
 
     static clang::FieldDecl *
     AddFieldToRecordType (clang::ASTContext *ast,
@@ -322,6 +336,26 @@ public:
                                                       bitfield_bit_size);
     }
     
+    clang::VarDecl *
+    AddVariableToRecordType (lldb::clang_type_t record_opaque_type,
+                             const char *name,
+                             lldb::clang_type_t var_opaque_type,
+                             lldb::AccessType access)
+    {
+        return ClangASTContext::AddVariableToRecordType (getASTContext(),
+                                                         record_opaque_type,
+                                                         name,
+                                                         var_opaque_type,
+                                                         access);
+    }
+
+    static clang::VarDecl *
+    AddVariableToRecordType (clang::ASTContext *ast,
+                             lldb::clang_type_t record_opaque_type,
+                             const char *name,
+                             lldb::clang_type_t var_opaque_type,
+                             lldb::AccessType access);
+
     static void
     BuildIndirectFields (clang::ASTContext *ast,
                          lldb::clang_type_t record_qual_type);
@@ -456,7 +490,7 @@ public:
                      clang::DeclContext *decl_ctx, 
                      bool isForwardDecl, 
                      bool isInternal,
-                     uint64_t metadata = 0);
+                     ClangASTMetadata *metadata = NULL);
     
     static clang::FieldDecl *
     AddObjCClassIVar (clang::ASTContext *ast,
@@ -495,7 +529,7 @@ public:
         const char *property_setter_name,
         const char *property_getter_name,
         uint32_t property_attributes,
-        uint64_t metadata = 0
+        ClangASTMetadata *metadata = NULL
     );
 
     bool
@@ -508,7 +542,7 @@ public:
         const char *property_setter_name,
         const char *property_getter_name,
         uint32_t property_attributes,
-        uint64_t metadata = 0
+        ClangASTMetadata *metadata = NULL
     )
     {
         return ClangASTContext::AddObjCClassProperty (getASTContext(),
@@ -539,19 +573,21 @@ public:
                                lldb::clang_type_t class_opaque_type, 
                                const char *name,  // the full symbol name as seen in the symbol table ("-[NString stringWithCString:]")
                                lldb::clang_type_t method_opaque_type,
-                               lldb::AccessType access);
+                               lldb::AccessType access,
+                               bool is_artificial);
 
     clang::ObjCMethodDecl *
     AddMethodToObjCObjectType (lldb::clang_type_t class_opaque_type, 
                                const char *name,  // the full symbol name as seen in the symbol table ("-[NString stringWithCString:]")
                                lldb::clang_type_t method_opaque_type,
-                               lldb::AccessType access)
+                               lldb::AccessType access,
+                               bool is_artificial)
     {
         return AddMethodToObjCObjectType (getASTContext(),
                                           class_opaque_type,
                                           name,
                                           method_opaque_type,
-                                          access);
+                                          access, is_artificial);
     }
 
     static bool
@@ -566,8 +602,8 @@ public:
     // Returns a mask containing bits from the ClangASTContext::eTypeXXX enumerations
     static uint32_t
     GetTypeInfo (lldb::clang_type_t clang_type, 
-                     clang::ASTContext *ast,                // The AST for clang_type (can be NULL)
-                     lldb::clang_type_t *pointee_or_element_type);  // (can be NULL)
+                 clang::ASTContext *ast,                // The AST for clang_type (can be NULL)
+                 lldb::clang_type_t *pointee_or_element_type);  // (can be NULL)
 
     static uint32_t
     GetNumChildren (clang::ASTContext *ast,
@@ -589,23 +625,32 @@ public:
     static lldb::clang_type_t
     GetDirectBaseClassAtIndex (clang::ASTContext *ast, 
                                lldb::clang_type_t clang_type,
-                               uint32_t idx, 
+                               size_t idx, 
                                uint32_t *bit_offset_ptr);
 
     static lldb::clang_type_t
     GetVirtualBaseClassAtIndex (clang::ASTContext *ast, 
                                 lldb::clang_type_t clang_type,
-                                uint32_t idx, 
+                                size_t idx, 
                                 uint32_t *bit_offset_ptr);
 
     static lldb::clang_type_t
     GetFieldAtIndex (clang::ASTContext *ast, 
                      lldb::clang_type_t clang_type,
-                     uint32_t idx, 
+                     size_t idx, 
                      std::string& name,
                      uint64_t *bit_offset_ptr,
                      uint32_t *bitfield_bit_size_ptr,
                      bool *is_bitfield_ptr);
+    
+    static size_t
+    GetIndexOfFieldWithName (clang::ASTContext *ast,
+                             lldb::clang_type_t clang_type,
+                             const char* name,
+                             lldb::clang_type_t* field_clang_type = NULL,
+                             uint64_t *bit_offset_ptr = NULL,
+                             uint32_t *bitfield_bit_size_ptr = NULL,
+                             bool *is_bitfield_ptr = NULL);
 
     static uint32_t
     GetNumPointeeChildren (lldb::clang_type_t clang_type);
@@ -614,7 +659,7 @@ public:
     GetChildClangTypeAtIndex (ExecutionContext *exe_ctx,
                               const char *parent_name,
                               lldb::clang_type_t  parent_clang_type,
-                              uint32_t idx,
+                              size_t idx,
                               bool transparent_pointers,
                               bool omit_empty_base_classes,
                               bool ignore_array_bounds,
@@ -631,7 +676,7 @@ public:
                               clang::ASTContext *ast,
                               const char *parent_name,
                               lldb::clang_type_t  parent_clang_type,
-                              uint32_t idx,
+                              size_t idx,
                               bool transparent_pointers,
                               bool omit_empty_base_classes,
                               bool ignore_array_bounds,
@@ -778,9 +823,9 @@ public:
     //------------------------------------------------------------------
 
     lldb::clang_type_t
-    CreateArrayType (lldb::clang_type_t  element_type,
+    CreateArrayType (lldb::clang_type_t element_type,
                      size_t element_count,
-                     uint32_t bit_stride);
+                     bool is_vector);
 
     //------------------------------------------------------------------
     // Tag Declarations
@@ -845,7 +890,7 @@ public:
     CreateMemberPointerType (lldb::clang_type_t  clang_pointee_type,
                              lldb::clang_type_t  clang_class_type);
 
-    uint32_t
+    uint64_t
     GetPointerBitSize ();
 
     static bool
@@ -868,9 +913,9 @@ public:
     static bool
     IsPossibleDynamicType (clang::ASTContext *ast, 
                            lldb::clang_type_t clang_type, 
-                           lldb::clang_type_t *dynamic_pointee_type = NULL,
-                           bool cplusplus = true,
-                           bool objc = true);
+                           lldb::clang_type_t *dynamic_pointee_type, // Can pass NULL
+                           bool check_cplusplus,
+                           bool check_objc);
 
     static bool
     IsCStringType (lldb::clang_type_t clang_type, uint32_t &length);
@@ -880,15 +925,17 @@ public:
     
     static lldb::clang_type_t
     GetAsArrayType (lldb::clang_type_t clang_type, 
-                    lldb::clang_type_t *member_type = NULL, 
-                    uint64_t *size = NULL);
+                    lldb::clang_type_t *member_type,
+                    uint64_t *size,
+                    bool *is_incomplete);
     
     static bool
     IsArrayType (lldb::clang_type_t clang_type,
-                 lldb::clang_type_t *member_type = NULL,
-                 uint64_t *size = NULL)
+                 lldb::clang_type_t *member_type,
+                 uint64_t *size,
+                 bool *is_incomplete)
     {
-        return GetAsArrayType(clang_type, member_type, size) != 0;
+        return GetAsArrayType(clang_type, member_type, size, is_incomplete) != 0;
     }
 
     //------------------------------------------------------------------
@@ -966,22 +1013,22 @@ protected:
     //------------------------------------------------------------------
     // Classes that inherit from ClangASTContext can see and modify these
     //------------------------------------------------------------------
-    std::string                             m_target_triple;
-    std::auto_ptr<clang::ASTContext>        m_ast_ap;
-    std::auto_ptr<clang::LangOptions>       m_language_options_ap;
-    std::auto_ptr<clang::FileManager>       m_file_manager_ap;
-    std::auto_ptr<clang::FileSystemOptions> m_file_system_options_ap;
-    std::auto_ptr<clang::SourceManager>     m_source_manager_ap;
-    std::auto_ptr<clang::DiagnosticsEngine>  m_diagnostics_engine_ap;
-    std::auto_ptr<clang::DiagnosticConsumer> m_diagnostic_consumer_ap;
-    std::auto_ptr<clang::TargetOptions>     m_target_options_ap;
-    std::auto_ptr<clang::TargetInfo>        m_target_info_ap;
-    std::auto_ptr<clang::IdentifierTable>   m_identifier_table_ap;
-    std::auto_ptr<clang::SelectorTable>     m_selector_table_ap;
-    std::auto_ptr<clang::Builtin::Context>  m_builtins_ap;
-    CompleteTagDeclCallback                 m_callback_tag_decl;
-    CompleteObjCInterfaceDeclCallback       m_callback_objc_decl;
-    void *                                  m_callback_baton;
+    std::string                                     m_target_triple;
+    std::unique_ptr<clang::ASTContext>               m_ast_ap;
+    std::unique_ptr<clang::LangOptions>              m_language_options_ap;
+    std::unique_ptr<clang::FileManager>              m_file_manager_ap;
+    std::unique_ptr<clang::FileSystemOptions>        m_file_system_options_ap;
+    std::unique_ptr<clang::SourceManager>            m_source_manager_ap;
+    std::unique_ptr<clang::DiagnosticsEngine>        m_diagnostics_engine_ap;
+    std::unique_ptr<clang::DiagnosticConsumer>       m_diagnostic_consumer_ap;
+    llvm::IntrusiveRefCntPtr<clang::TargetOptions>  m_target_options_rp;
+    std::unique_ptr<clang::TargetInfo>               m_target_info_ap;
+    std::unique_ptr<clang::IdentifierTable>          m_identifier_table_ap;
+    std::unique_ptr<clang::SelectorTable>            m_selector_table_ap;
+    std::unique_ptr<clang::Builtin::Context>         m_builtins_ap;
+    CompleteTagDeclCallback                         m_callback_tag_decl;
+    CompleteObjCInterfaceDeclCallback               m_callback_objc_decl;
+    void *                                          m_callback_baton;
 private:
     //------------------------------------------------------------------
     // For ClangASTContext only

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTImporter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTImporter.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTImporter.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTImporter.h Thu Jun  6 19:06:43 2013
@@ -11,6 +11,7 @@
 #define liblldb_ClangASTImporter_h_
 
 #include <map>
+#include <set>
 
 #include "lldb/lldb-types.h"
 
@@ -20,6 +21,68 @@
 #include "lldb/Symbol/ClangNamespaceDecl.h"
 
 namespace lldb_private {
+    
+class ClangASTMetrics
+{
+public:
+    static void DumpCounters (Log *log);
+    static void ClearLocalCounters ()
+    {
+        local_counters = { 0, 0, 0, 0, 0, 0 };
+    }
+    
+    static void RegisterVisibleQuery ()
+    {
+        ++global_counters.m_visible_query_count;
+        ++local_counters.m_visible_query_count;
+    }
+    
+    static void RegisterLexicalQuery ()
+    {
+        ++global_counters.m_lexical_query_count;
+        ++local_counters.m_lexical_query_count;
+    }
+    
+    static void RegisterLLDBImport ()
+    {
+        ++global_counters.m_lldb_import_count;
+        ++local_counters.m_lldb_import_count;
+    }
+    
+    static void RegisterClangImport ()
+    {
+        ++global_counters.m_clang_import_count;
+        ++local_counters.m_clang_import_count;
+    }
+    
+    static void RegisterDeclCompletion ()
+    {
+        ++global_counters.m_decls_completed_count;
+        ++local_counters.m_decls_completed_count;
+    }
+    
+    static void RegisterRecordLayout ()
+    {
+        ++global_counters.m_record_layout_count;
+        ++local_counters.m_record_layout_count;
+    }
+    
+private:
+    struct Counters
+    {
+        uint64_t    m_visible_query_count;
+        uint64_t    m_lexical_query_count;
+        uint64_t    m_lldb_import_count;
+        uint64_t    m_clang_import_count;
+        uint64_t    m_decls_completed_count;
+        uint64_t    m_record_layout_count;
+    };
+    
+    static Counters global_counters;
+    static Counters local_counters;
+    
+    static void DumpCounters (Log *log, Counters &counters);
+};
 
 class ClangASTImporter 
 {
@@ -67,6 +130,9 @@ public:
     CompleteObjCInterfaceDecl (clang::ObjCInterfaceDecl *interface_decl);
     
     bool
+    RequireCompleteType (clang::QualType type);
+    
+    bool
     ResolveDeclOrigin (const clang::Decl *decl, clang::Decl **original_decl, clang::ASTContext **original_ctx)
     {
         DeclOrigin origin = GetDeclOrigin(decl);
@@ -80,7 +146,10 @@ public:
         return origin.Valid();
     }
     
-    uint64_t
+    void
+    SetDeclOrigin (const clang::Decl *decl, clang::Decl *original_decl);
+    
+    ClangASTMetadata *
     GetDeclMetadata (const clang::Decl *decl);
     
     //
@@ -88,7 +157,7 @@ public:
     //
     
     typedef std::vector < std::pair<lldb::ModuleSP, ClangNamespaceDecl> > NamespaceMap;
-    typedef STD_SHARED_PTR(NamespaceMap) NamespaceMapSP;
+    typedef std::shared_ptr<NamespaceMap> NamespaceMapSP;
     
     void RegisterNamespaceMap (const clang::NamespaceDecl *decl, 
                                NamespaceMapSP &namespace_map);
@@ -182,20 +251,41 @@ private:
                                *source_ctx,
                                master.m_file_manager,
                                true /*minimal*/),
+            m_decls_to_deport(NULL),
+            m_decls_already_deported(NULL),
             m_master(master),
             m_source_ctx(source_ctx)
         {
         }
         
+        // A call to "InitDeportWorkQueues" puts the minion into deport mode.
+        // In deport mode, every copied Decl that could require completion is
+        // recorded and placed into the decls_to_deport set.
+        //
+        // A call to "ExecuteDeportWorkQueues" completes all the Decls that
+        // are in decls_to_deport, adding any Decls it sees along the way that
+        // it hasn't already deported.  It proceeds until decls_to_deport is
+        // empty.
+        //
+        // These calls must be paired.  Leaving a minion in deport mode or
+        // trying to start deport minion with a new pair of queues will result
+        // in an assertion failure.
+        
+        void InitDeportWorkQueues (std::set<clang::NamedDecl *> *decls_to_deport,
+                                   std::set<clang::NamedDecl *> *decls_already_deported);
+        void ExecuteDeportWorkQueues ();
+        
         void ImportDefinitionTo (clang::Decl *to, clang::Decl *from);
         
         clang::Decl *Imported (clang::Decl *from, clang::Decl *to);
         
-        ClangASTImporter   &m_master;
-        clang::ASTContext  *m_source_ctx;
+        std::set<clang::NamedDecl *>   *m_decls_to_deport;
+        std::set<clang::NamedDecl *>   *m_decls_already_deported;
+        ClangASTImporter               &m_master;
+        clang::ASTContext              *m_source_ctx;
     };
     
-    typedef STD_SHARED_PTR(Minion) MinionSP;
+    typedef std::shared_ptr<Minion> MinionSP;
     typedef std::map<clang::ASTContext *, MinionSP> MinionMap;
     typedef std::map<const clang::NamespaceDecl *, NamespaceMapSP> NamespaceMetaMap;
     
@@ -218,7 +308,7 @@ private:
         MapCompleter           *m_map_completer;
     };
     
-    typedef STD_SHARED_PTR(ASTContextMetadata) ASTContextMetadataSP;    
+    typedef std::shared_ptr<ASTContextMetadata> ASTContextMetadataSP;    
     typedef std::map<const clang::ASTContext *, ASTContextMetadataSP> ContextMetadataMap;
     
     ContextMetadataMap m_metadata_map;

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTType.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTType.h Thu Jun  6 19:06:43 2013
@@ -76,12 +76,30 @@ public:
         return m_ast; 
     }
 
+    static ClangASTType
+    GetCanonicalType (clang::ASTContext *ast, lldb::clang_type_t clang_type);
+
+    ClangASTType
+    GetCanonicalType ()
+    {
+        return GetCanonicalType (GetASTContext(), GetOpaqueQualType());
+    }
+
     ConstString
     GetConstTypeName ();
     
     ConstString
     GetConstQualifiedTypeName ();
 
+    static lldb::BasicType
+    GetBasicTypeEnumeration (const ConstString &name);
+
+    static ClangASTType
+    GetBasicType (clang::ASTContext *ast, lldb::BasicType type);
+
+    static ClangASTType
+    GetBasicType (clang::ASTContext *ast, const ConstString &name);
+
     static ConstString
     GetConstTypeName (clang::ASTContext *ast,
                       lldb::clang_type_t clang_type);
@@ -98,10 +116,17 @@ public:
     GetTypeNameForOpaqueQualType (clang::ASTContext *ast,
                                   lldb::clang_type_t opaque_qual_type);
 
-    uint32_t
+    uint64_t
+    GetClangTypeByteSize ();
+
+    static uint64_t
+    GetClangTypeByteSize (clang::ASTContext *ast_context,
+                          lldb::clang_type_t clang_type);
+    
+    uint64_t
     GetClangTypeBitWidth ();
 
-    static uint32_t
+    static uint64_t
     GetClangTypeBitWidth (clang::ASTContext *ast_context, lldb::clang_type_t opaque_clang_qual_type);
 
     size_t
@@ -121,12 +146,18 @@ public:
     GetTypeClass (clang::ASTContext *ast_context, 
                   lldb::clang_type_t clang_type);
 
+    lldb::TypeClass
+    GetTypeClass () const
+    {
+        return GetTypeClass (GetASTContext(), GetOpaqueQualType());
+    }
+
     void
     DumpValue (ExecutionContext *exe_ctx,
                Stream *s,
                lldb::Format format,
                const DataExtractor &data,
-               uint32_t data_offset,
+               lldb::offset_t data_offset,
                size_t data_byte_size,
                uint32_t bitfield_bit_size,
                uint32_t bitfield_bit_offset,
@@ -142,7 +173,7 @@ public:
                Stream *s,
                lldb::Format format,
                const DataExtractor &data,
-               uint32_t data_offset,
+               lldb::offset_t data_offset,
                size_t data_byte_size,
                uint32_t bitfield_bit_size,
                uint32_t bitfield_bit_offset,
@@ -155,7 +186,7 @@ public:
     DumpTypeValue (Stream *s,
                    lldb::Format format,
                    const DataExtractor &data,
-                   uint32_t data_offset,
+                   lldb::offset_t data_offset,
                    size_t data_byte_size,
                    uint32_t bitfield_bit_size,
                    uint32_t bitfield_bit_offset,
@@ -168,7 +199,7 @@ public:
                    Stream *s,
                    lldb::Format format,
                    const DataExtractor &data,
-                   uint32_t data_offset,
+                   lldb::offset_t data_offset,
                    size_t data_byte_size,
                    uint32_t bitfield_bit_size,
                    uint32_t bitfield_bit_offset,
@@ -178,7 +209,7 @@ public:
     DumpSummary (ExecutionContext *exe_ctx,
                  Stream *s,
                  const DataExtractor &data,
-                 uint32_t data_offset,
+                 lldb::offset_t data_offset,
                  size_t data_byte_size);
                  
     
@@ -188,10 +219,13 @@ public:
                  ExecutionContext *exe_ctx,
                  Stream *s,
                  const DataExtractor &data,
-                 uint32_t data_offset,
+                 lldb::offset_t data_offset,
                  size_t data_byte_size);
     
     void
+    DumpTypeDescription (); // Dump to stdout
+
+    void
     DumpTypeDescription (Stream *s);
     
     static void
@@ -199,17 +233,11 @@ public:
                          lldb::clang_type_t opaque_clang_qual_type,
                          Stream *s);
     
-    void DumpTypeCode (Stream *s);
-    
-    static void
-    DumpTypeCode (void *type,
-                  Stream *s);
-                         
     lldb::Encoding
-    GetEncoding (uint32_t &count);                 
+    GetEncoding (uint64_t &count);
 
     static lldb::Encoding
-    GetEncoding (lldb::clang_type_t opaque_clang_qual_type, uint32_t &count);
+    GetEncoding (lldb::clang_type_t opaque_clang_qual_type, uint64_t &count);
 
     lldb::Format
     GetFormat ();
@@ -217,16 +245,16 @@ public:
     static lldb::Format
     GetFormat (lldb::clang_type_t opaque_clang_qual_type);
     
-    uint32_t
+    uint64_t
     GetTypeByteSize() const;
     
-    static uint32_t
+    static uint64_t
     GetTypeByteSize(clang::ASTContext *ast_context,
                     lldb::clang_type_t opaque_clang_qual_type);
 
     bool
     GetValueAsScalar (const DataExtractor &data,
-                      uint32_t data_offset,
+                      lldb::offset_t data_offset,
                       size_t data_byte_size,
                       Scalar &value);
 
@@ -234,7 +262,7 @@ public:
     GetValueAsScalar (clang::ASTContext *ast_context,
                       lldb::clang_type_t opaque_clang_qual_type,
                       const DataExtractor &data,
-                      uint32_t data_offset,
+                      lldb::offset_t data_offset,
                       size_t data_byte_size,
                       Scalar &value);
 
@@ -297,18 +325,18 @@ public:
                    StreamString &new_value);
 
     lldb::clang_type_t
-    GetPointeeType ();
+    GetPointeeType () const;
 
     static lldb::clang_type_t
     GetPointeeType (lldb::clang_type_t opaque_clang_qual_type);
     
     lldb::clang_type_t
-    GetArrayElementType (uint32_t& stride);
+    GetArrayElementType (uint64_t& stride);
     
     static lldb::clang_type_t
     GetArrayElementType (clang::ASTContext* ast,
                          lldb::clang_type_t opaque_clang_qual_type,
-						 uint32_t& stride);
+						 uint64_t& stride);
     
     lldb::clang_type_t
     GetPointerType () const;
@@ -320,6 +348,9 @@ public:
     static lldb::clang_type_t
     RemoveFastQualifiers (lldb::clang_type_t);
 
+    static clang::CXXRecordDecl *
+    GetAsCXXRecordDecl (lldb::clang_type_t opaque_clang_qual_type);
+
     void
     Clear()
     {

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h Thu Jun  6 19:06:43 2013
@@ -14,7 +14,6 @@
 // C++ Includes
 #include <string>
 #include <vector>
-#include <memory>
 #include <stdint.h>
 
 // Other libraries and framework includes
@@ -113,7 +112,7 @@ public:
         return clang::ELR_Failure;
     }
     
-    virtual clang::DeclContextLookupResult 
+    virtual bool
     FindExternalVisibleDeclsByName (const clang::DeclContext *decl_ctx,
                                     clang::DeclarationName decl_name);
     

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCommon.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCommon.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCommon.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangExternalASTSourceCommon.h Thu Jun  6 19:06:43 2013
@@ -36,19 +36,144 @@
 #include <assert.h>
 #endif
 
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-enumerations.h"
+#include "lldb/Core/dwarf.h"
+
 namespace lldb_private {
 
+class ClangASTMetadata
+{
+public:
+    ClangASTMetadata () :
+        m_user_id(0),
+        m_union_is_user_id(false),
+        m_union_is_isa_ptr(false),
+        m_has_object_ptr(false),
+        m_is_self (false),
+        m_is_dynamic_cxx (true)
+    {
+    }
+
+    bool
+    GetIsDynamicCXXType () const
+    {
+        return m_is_dynamic_cxx;
+    }
+
+    void
+    SetIsDynamicCXXType (bool b)
+    {
+        m_is_dynamic_cxx = b;
+    }
+
+    void
+    SetUserID (lldb::user_id_t user_id)
+    {
+        m_user_id = user_id;
+        m_union_is_user_id = true;
+        m_union_is_isa_ptr = false;
+    }
+
+    lldb::user_id_t
+    GetUserID () const
+    {
+        if (m_union_is_user_id)
+            return m_user_id;
+        else
+            return LLDB_INVALID_UID;
+    }
+
+    void
+    SetISAPtr (uint64_t isa_ptr)
+    {
+        m_isa_ptr = isa_ptr;
+        m_union_is_user_id = false;
+        m_union_is_isa_ptr = true;
+    }
+    
+    uint64_t
+    GetISAPtr () const
+    {
+        if (m_union_is_isa_ptr)
+            return m_isa_ptr;
+        else
+            return 0;
+    }
+    
+    void
+    SetObjectPtrName(const char *name)
+    {
+        m_has_object_ptr = true;
+        if (strcmp (name, "self") == 0)
+            m_is_self = true;
+        else if (strcmp (name, "this") == 0)
+            m_is_self = false;
+        else
+            m_has_object_ptr = false;
+    }
+    
+    lldb::LanguageType
+    GetObjectPtrLanguage () const
+    {
+        if (m_has_object_ptr)
+        {
+            if (m_is_self)
+                return lldb::eLanguageTypeObjC;
+            else
+                return lldb::eLanguageTypeC_plus_plus;
+        }
+        return lldb::eLanguageTypeUnknown;
+            
+    }
+    const char *
+    GetObjectPtrName() const
+    {
+        if (m_has_object_ptr)
+        {
+            if (m_is_self)
+                return "self";
+            else
+                return "this";
+        }
+        else
+            return NULL;
+    }
+    
+    bool
+    HasObjectPtr() const
+    {
+        return m_has_object_ptr;
+    }
+    
+    void
+    Dump (Stream *s);
+    
+private:
+    union
+    {
+        lldb::user_id_t m_user_id;
+        uint64_t  m_isa_ptr;
+    };
+    bool m_union_is_user_id : 1,
+         m_union_is_isa_ptr : 1,
+         m_has_object_ptr : 1,
+         m_is_self : 1,
+         m_is_dynamic_cxx : 1;
+    
+};
+
 class ClangExternalASTSourceCommon : public clang::ExternalASTSource 
 {
 public:
     ClangExternalASTSourceCommon();
     ~ClangExternalASTSourceCommon();
-    
-    virtual uint64_t GetMetadata(uintptr_t object);
-    virtual void SetMetadata(uintptr_t object, uint64_t metadata);
-    virtual bool HasMetadata(uintptr_t object);
+
+    virtual ClangASTMetadata *GetMetadata(const void *object);
+    virtual void SetMetadata(const void *object, ClangASTMetadata &metadata);
+    virtual bool HasMetadata(const void *object);
 private:
-    typedef llvm::DenseMap<uintptr_t, uint64_t> MetadataMap;
+    typedef llvm::DenseMap<const void *, ClangASTMetadata> MetadataMap;
     
     MetadataMap m_metadata;
     uint64_t    m_magic;        ///< Because we don't have RTTI, we must take it

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/CompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/CompileUnit.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/CompileUnit.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/CompileUnit.h Thu Jun  6 19:06:43 2013
@@ -10,9 +10,9 @@
 #ifndef liblldb_CompUnit_h_
 #define liblldb_CompUnit_h_
 
+#include "lldb/lldb-enumerations.h"
 #include "lldb/Symbol/Function.h"
 #include "lldb/Core/FileSpecList.h"
-#include "lldb/Core/Language.h"
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/UserID.h"
@@ -32,11 +32,10 @@ namespace lldb_private {
 /// files), and a line table.
 //----------------------------------------------------------------------
 class CompileUnit :
-    public STD_ENABLE_SHARED_FROM_THIS(CompileUnit),
+    public std::enable_shared_from_this<CompileUnit>,
     public ModuleChild,
     public FileSpec,
     public UserID,
-    public Language,
     public SymbolContextScope
 {
 public:
@@ -143,6 +142,15 @@ public:
     virtual void
     DumpSymbolContext(Stream *s);
 
+    lldb::LanguageType
+    GetLanguage();
+
+    void
+    SetLanguage(lldb::LanguageType language)
+    {
+        m_flags.Set(flagsParsedLanguage);
+        m_language = language;
+    }
 
     void
     GetDescription(Stream *s, lldb::DescriptionLevel level) const;
@@ -388,20 +396,22 @@ public:
 
 protected:
     void *m_user_data; ///< User data for the SymbolFile parser to store information into.
+    lldb::LanguageType m_language; ///< The programming language enumeration value.
     Flags m_flags; ///< Compile unit flags that help with partial parsing.
     std::vector<lldb::FunctionSP> m_functions; ///< The sparsely populated list of shared pointers to functions
                                          ///< that gets populated as functions get partially parsed.
     FileSpecList m_support_files; ///< Files associated with this compile unit's line table and declarations.
-    std::auto_ptr<LineTable> m_line_table_ap; ///< Line table that will get parsed on demand.
+    std::unique_ptr<LineTable> m_line_table_ap; ///< Line table that will get parsed on demand.
     lldb::VariableListSP m_variables; ///< Global and static variable list that will get parsed on demand.
 
 private:
     enum
     {
-        flagsParsedAllFunctions = (1 << 0), ///< Have we already parsed all our functions
-        flagsParsedVariables    = (1 << 1), ///< Have we already parsed globals and statics?
-        flagsParsedSupportFiles = (1 << 2), ///< Have we already parsed the support files for this compile unit?
-        flagsParsedLineTable    = (1 << 3)  ///< Have we parsed the line table already?
+        flagsParsedAllFunctions = (1u << 0), ///< Have we already parsed all our functions
+        flagsParsedVariables    = (1u << 1), ///< Have we already parsed globals and statics?
+        flagsParsedSupportFiles = (1u << 2), ///< Have we already parsed the support files for this compile unit?
+        flagsParsedLineTable    = (1u << 3),  ///< Have we parsed the line table already?
+        flagsParsedLanguage     = (1u << 4)   ///< Have we parsed the line table already?
     };
 
     DISALLOW_COPY_AND_ASSIGN (CompileUnit);

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h Thu Jun  6 19:06:43 2013
@@ -12,15 +12,16 @@
 
 #include <map>
 
-#include "lldb/lldb-private.h"
+#include "lldb/Core/AddressRange.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Flags.h"
-#include "lldb/Core/AddressRange.h"
+#include "lldb/Core/RangeMap.h"
 #include "lldb/Core/VMRange.h"
 #include "lldb/Core/dwarf.h"
 #include "lldb/Host/Mutex.h"
-#include "lldb/Symbol/UnwindPlan.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/UnwindPlan.h"
+#include "lldb/lldb-private.h"
 
 namespace lldb_private {
 
@@ -53,6 +54,24 @@ public:
     bool
     GetUnwindPlan (Address addr, UnwindPlan& unwind_plan);
 
+    typedef RangeVector<lldb::addr_t, uint32_t> FunctionAddressAndSizeVector;
+
+    //------------------------------------------------------------------
+    // Build a vector of file address and size for all functions in this Module
+    // based on the eh_frame FDE entries.
+    //
+    // The eh_frame information can be a useful source of file address and size of
+    // the functions in a Module.  Often a binary's non-exported symbols are stripped
+    // before shipping so lldb won't know the start addr / size of many functions
+    // in the Module.  But the eh_frame can help to give the addresses of these 
+    // stripped symbols, at least.
+    //
+    // @param[out] function_info
+    //      A vector provided by the caller is filled out.  May be empty if no FDEs/no eh_frame
+    //      is present in this Module.
+
+    void
+    GetFunctionAddressAndSizeVector (FunctionAddressAndSizeVector &function_info);
 
 private:
     enum
@@ -75,36 +94,24 @@ private:
         lldb_private::UnwindPlan::Row initial_row;
 
         CIE(dw_offset_t offset) : cie_offset(offset), version (-1), code_align (0),
-                                  data_align (0), return_addr_reg_num (-1), inst_offset (0),
+                                  data_align (0), return_addr_reg_num (LLDB_INVALID_REGNUM), inst_offset (0),
                                   inst_length (0), ptr_encoding (0), initial_row() {}
     };
 
-    typedef STD_SHARED_PTR(CIE) CIESP;
-
-    struct FDEEntry
-    {
-        AddressRange bounds;   // function bounds
-        dw_offset_t offset;    // offset to this FDE within the Section
-
-        FDEEntry () : bounds (), offset (0) { }
-
-        inline bool
-        operator<(const DWARFCallFrameInfo::FDEEntry& b) const
-        {
-            if (bounds.GetBaseAddress().GetOffset() < b.bounds.GetBaseAddress().GetOffset())
-                return true;
-            else
-                return false;
-        }
-    };
+    typedef std::shared_ptr<CIE> CIESP;
 
     typedef std::map<off_t, CIESP> cie_map_t;
 
+    // Start address (file address), size, offset of FDE location
+    // used for finding an FDE for a given File address; the start address field is
+    // an offset into an individual Module.
+    typedef RangeDataVector<lldb::addr_t, uint32_t, dw_offset_t> FDEEntryMap;
+
     bool
     IsEHFrame() const;
 
     bool
-    GetFDEEntryByAddress (Address addr, FDEEntry& fde_entry);
+    GetFDEEntryByFileAddress (lldb::addr_t file_offset, FDEEntryMap::Entry& fde_entry);
 
     void
     GetFDEIndex ();
@@ -127,7 +134,7 @@ private:
     DataExtractor               m_cfi_data;
     bool                        m_cfi_data_initialized;   // only copy the section into the DE once
 
-    std::vector<FDEEntry>       m_fde_index;
+    FDEEntryMap                 m_fde_index;
     bool                        m_fde_index_initialized;  // only scan the section for FDEs once
     Mutex                       m_fde_index_mutex;        // and isolate the thread that does it
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/FuncUnwinders.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/FuncUnwinders.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/FuncUnwinders.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/FuncUnwinders.h Thu Jun  6 19:06:43 2013
@@ -1,9 +1,6 @@
 #ifndef liblldb_FuncUnwinders_h
 #define liblldb_FuncUnwinders_h
 
-
-#include <memory>
-
 #include "lldb/Core/AddressRange.h"
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/AddressRange.h"
@@ -70,6 +67,13 @@ public:
         return m_range.ContainsFileAddress (addr);
     }
 
+    // When we're doing an unwind using the UnwindPlanAtNonCallSite and we find an
+    // impossible unwind condition, we know that the UnwindPlan is invalid.  Calling
+    // this method on the FuncUnwinder will tell it to replace that UnwindPlan with
+    // the architectural default UnwindPlan so hopefully our stack walk will get past
+    // this frame.
+    void
+    InvalidateNonCallSiteUnwindPlan (lldb_private::Thread& Thread);
 
 private:
     UnwindTable& m_unwind_table;

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/LineTable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/LineTable.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/LineTable.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/LineTable.h Thu Jun  6 19:06:43 2013
@@ -16,10 +16,30 @@
 #include "lldb/Symbol/LineEntry.h"
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/Section.h"
+#include "lldb/Core/RangeMap.h"
 
 namespace lldb_private {
 
 //----------------------------------------------------------------------
+/// @class LineSequence LineTable.h "lldb/Symbol/LineTable.h"
+/// @brief An abstract base class used during symbol table creation.
+//----------------------------------------------------------------------
+class LineSequence
+{
+public:
+    LineSequence ();
+
+    virtual
+    ~LineSequence() {}
+
+    virtual void
+    Clear() = 0;
+
+private:
+    DISALLOW_COPY_AND_ASSIGN (LineSequence);
+};
+
+//----------------------------------------------------------------------
 /// @class LineTable LineTable.h "lldb/Symbol/LineTable.h"
 /// @brief A line table class.
 //----------------------------------------------------------------------
@@ -53,10 +73,9 @@ public:
 //  void
 //  AddLineEntry (const LineEntry& line_entry);
 
-    // Called when you can guarantee the addresses are in increasing order
+    // Called when you can't guarantee the addresses are in increasing order
     void
-    AppendLineEntry (const lldb::SectionSP& section_sp,
-                     lldb::addr_t section_offset,
+    InsertLineEntry (lldb::addr_t file_addr,
                      uint32_t line,
                      uint16_t column,
                      uint16_t file_idx,
@@ -66,18 +85,27 @@ public:
                      bool is_epilogue_begin,
                      bool is_terminal_entry);
 
-    // Called when you can't guarantee the addresses are in increasing order
+    // Used to instantiate the LineSequence helper classw
+    LineSequence*
+    CreateLineSequenceContainer ();
+
+    // Append an entry to a caller-provided collection that will later be
+    // inserted in this line table.
     void
-    InsertLineEntry (const lldb::SectionSP& section_sp,
-                     lldb::addr_t section_offset,
-                     uint32_t line,
-                     uint16_t column,
-                     uint16_t file_idx,
-                     bool is_start_of_statement,
-                     bool is_start_of_basic_block,
-                     bool is_prologue_end,
-                     bool is_epilogue_begin,
-                     bool is_terminal_entry);
+    AppendLineEntryToSequence (LineSequence* sequence,
+                               lldb::addr_t file_addr,
+                               uint32_t line,
+                               uint16_t column,
+                               uint16_t file_idx,
+                               bool is_start_of_statement,
+                               bool is_start_of_basic_block,
+                               bool is_prologue_end,
+                               bool is_epilogue_begin,
+                               bool is_terminal_entry);
+
+    // Insert a sequence of entries into this line table.
+    void
+    InsertSequence (LineSequence* sequence);
 
     //------------------------------------------------------------------
     /// Dump all line entries in this line table to the stream \a s.
@@ -204,15 +232,48 @@ public:
     uint32_t
     GetSize () const;
 
+    typedef lldb_private::RangeArray<lldb::addr_t, lldb::addr_t, 32> FileAddressRanges;
+    
+    //------------------------------------------------------------------
+    /// Gets all contiguous file address ranges for the entire line table.
+    ///
+    /// @param[out] file_ranges
+    ///     A collection of file address ranges that will be filled in
+    ///     by this function.
+    ///
+    /// @param[out] append
+    ///     If \b true, then append to \a file_ranges, otherwise clear
+    ///     \a file_ranges prior to adding any ranges. 
+    ///
+    /// @return
+    ///     The number of address ranges added to \a file_ranges
+    //------------------------------------------------------------------
+    size_t
+    GetContiguousFileAddressRanges (FileAddressRanges &file_ranges, bool append);
+
+    //------------------------------------------------------------------
+    /// Given a file range link map, relink the current line table
+    /// and return a fixed up line table.
+    ///
+    /// @param[out] file_range_map
+    ///     A collection of file ranges that maps to new file ranges
+    ///     that will be used when linking the line table.
+    ///
+    /// @return
+    ///     A new line table if at least one line table entry was able
+    ///     to be mapped.
+    //------------------------------------------------------------------
+    typedef RangeDataVector<lldb::addr_t, lldb::addr_t, lldb::addr_t> FileRangeMap;
+
+    LineTable *
+    LinkLineTable (const FileRangeMap &file_range_map);
+
 protected:
 
     struct Entry
     {
-        enum { kInvalidSectIdx = UINT32_MAX };
-
         Entry () :
-            sect_idx (kInvalidSectIdx),
-            sect_offset (0),
+            file_addr (LLDB_INVALID_ADDRESS),
             line (0),
             column (0),
             file_idx (0),
@@ -224,8 +285,7 @@ protected:
         {
         }
 
-        Entry ( uint32_t _sect_idx,
-                lldb::addr_t _sect_offset,
+        Entry ( lldb::addr_t _file_addr,
                 uint32_t _line,
                 uint16_t _column,
                 uint16_t _file_idx,
@@ -234,8 +294,7 @@ protected:
                 bool _is_prologue_end,
                 bool _is_epilogue_begin,
                 bool _is_terminal_entry) :
-            sect_idx (_sect_idx),
-            sect_offset (_sect_offset),
+            file_addr (_file_addr),
             line (_line),
             column (_column),
             file_idx (_file_idx),
@@ -245,10 +304,6 @@ protected:
             is_epilogue_begin (_is_epilogue_begin),
             is_terminal_entry (_is_terminal_entry)
         {
-            // We have reserved 32 bits for the section offset which should
-            // be enough, but if it isn't then we need to make m_section_offset
-            // bigger
-            assert(_sect_offset <= UINT32_MAX);
         }
 
         int
@@ -257,8 +312,7 @@ protected:
         void
         Clear ()
         {
-            sect_idx = kInvalidSectIdx;
-            sect_offset = 0;
+            file_addr = LLDB_INVALID_ADDRESS;
             line = 0;
             column = 0;
             file_idx = 0;
@@ -274,7 +328,7 @@ protected:
         {
             // Compare the sections before calling
             #define SCALAR_COMPARE(a,b) if (a < b) return -1; if (a > b) return +1
-            SCALAR_COMPARE (lhs.sect_offset, rhs.sect_offset);
+            SCALAR_COMPARE (lhs.file_addr, rhs.file_addr);
             SCALAR_COMPARE (lhs.line, rhs.line);
             SCALAR_COMPARE (lhs.column, rhs.column);
             SCALAR_COMPARE (lhs.is_start_of_statement, rhs.is_start_of_statement);
@@ -301,16 +355,13 @@ protected:
 
         static bool EntryAddressLessThan (const Entry& lhs, const Entry& rhs)
         {
-            if (lhs.sect_idx == rhs.sect_idx)
-                return lhs.sect_offset < rhs.sect_offset;
-            return lhs.sect_idx < rhs.sect_idx;
+            return lhs.file_addr < rhs.file_addr;
         }
 
         //------------------------------------------------------------------
         // Member variables.
         //------------------------------------------------------------------
-        uint32_t    sect_idx;                   ///< The section index for this line entry.
-        uint32_t    sect_offset;                ///< The offset into the section for this line entry.
+        lldb::addr_t file_addr;                 ///< The file address for this line entry
         uint32_t    line;                       ///< The source line number, or zero if there is no line number information.
         uint16_t    column;                     ///< The column number of the source line, or zero if there is no column information.
         uint16_t    file_idx:11,                ///< The file index into CompileUnit's file table, or zero if there is no file information.
@@ -331,20 +382,37 @@ protected:
     //------------------------------------------------------------------
     // Types
     //------------------------------------------------------------------
-    typedef std::vector<lldb_private::Section*> section_collection; ///< The collection type for the line entries.
-    typedef std::vector<Entry> entry_collection;    ///< The collection type for the line entries.
+    typedef std::vector<lldb_private::Section*> section_collection; ///< The collection type for the sections.
+    typedef std::vector<Entry>                  entry_collection;   ///< The collection type for the line entries.
     //------------------------------------------------------------------
     // Member variables.
     //------------------------------------------------------------------
-    CompileUnit* m_comp_unit;       ///< The compile unit that this line table belongs to.
-    SectionList m_section_list; ///< The list of sections that at least one of the line entries exists in.
+    CompileUnit* m_comp_unit;   ///< The compile unit that this line table belongs to.
     entry_collection m_entries; ///< The collection of line entries in this line table.
 
+    //------------------------------------------------------------------
+    // Helper class
+    //------------------------------------------------------------------
+    class LineSequenceImpl : public LineSequence
+    {
+    public:
+        LineSequenceImpl() :
+            LineSequence()
+        {}
+
+        virtual
+        ~LineSequenceImpl()
+        {}
+
+        virtual void
+        Clear();
+
+        entry_collection m_entries; ///< The collection of line entries in this sequence.
+    };
+
     bool
     ConvertEntryAtIndexToLineEntry (uint32_t idx, LineEntry &line_entry);
 
-    lldb_private::Section *
-    GetSectionForEntryIndex (uint32_t idx);
 private:
     DISALLOW_COPY_AND_ASSIGN (LineTable);
 };

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectContainer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectContainer.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectContainer.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectContainer.h Thu Jun  6 19:06:43 2013
@@ -49,19 +49,20 @@ public:
     //------------------------------------------------------------------
     ObjectContainer (const lldb::ModuleSP &module_sp,
                      const FileSpec *file,
-                     lldb::addr_t file_offset,
-                     lldb::addr_t file_size,
-                     lldb::DataBufferSP& file_data_sp) :
+                     lldb::offset_t file_offset,
+                     lldb::offset_t length,
+                     lldb::DataBufferSP& data_sp,
+                     lldb::offset_t data_offset) :
         ModuleChild (module_sp),
         m_file (),  // This file can be different than the module's file spec
         m_offset (file_offset),
-        m_length (file_size),
+        m_length (length),
         m_data ()
     {
         if (file)
             m_file = *file;
-        if (file_data_sp)
-            m_data.SetData (file_data_sp, file_offset, file_size);
+        if (data_sp)
+            m_data.SetData (data_sp, data_offset, length);
     }
 
     //------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectFile.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectFile.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ObjectFile.h Thu Jun  6 19:06:43 2013
@@ -50,7 +50,7 @@ namespace lldb_private {
 /// this abstract class.
 //----------------------------------------------------------------------
 class ObjectFile:
-    public STD_ENABLE_SHARED_FROM_THIS(ObjectFile),
+    public std::enable_shared_from_this<ObjectFile>,
     public PluginInterface,
     public ModuleChild
 {
@@ -88,14 +88,15 @@ public:
     //------------------------------------------------------------------
     ObjectFile (const lldb::ModuleSP &module_sp, 
                 const FileSpec *file_spec_ptr, 
-                lldb::addr_t offset, 
-                lldb::addr_t length, 
-                lldb::DataBufferSP& headerDataSP);
+                lldb::offset_t file_offset,
+                lldb::offset_t length,
+                lldb::DataBufferSP& data_sp,
+                lldb::offset_t data_offset);
 
     ObjectFile (const lldb::ModuleSP &module_sp, 
                 const lldb::ProcessSP &process_sp,
                 lldb::addr_t header_addr, 
-                lldb::DataBufferSP& headerDataSP);
+                lldb::DataBufferSP& data_sp);
 
     //------------------------------------------------------------------
     /// Destructor.
@@ -148,9 +149,10 @@ public:
     static lldb::ObjectFileSP
     FindPlugin (const lldb::ModuleSP &module_sp,
                 const FileSpec* file_spec,
-                lldb::addr_t file_offset,
-                lldb::addr_t file_size,
-                lldb::DataBufferSP &data_sp);
+                lldb::offset_t file_offset,
+                lldb::offset_t file_size,
+                lldb::DataBufferSP &data_sp,
+                lldb::offset_t &data_offset);
 
     //------------------------------------------------------------------
     /// Find a ObjectFile plug-in that can parse a file in memory.
@@ -175,6 +177,50 @@ public:
                 lldb::addr_t header_addr,
                 lldb::DataBufferSP &file_data_sp);
 
+    
+    static size_t
+    GetModuleSpecifications (const FileSpec &file,
+                             lldb::offset_t file_offset,
+                             ModuleSpecList &specs);
+    
+    static size_t
+    GetModuleSpecifications (const lldb_private::FileSpec& file,
+                             lldb::DataBufferSP& data_sp,
+                             lldb::offset_t data_offset,
+                             lldb::offset_t file_offset,
+                             lldb::offset_t length,
+                             lldb_private::ModuleSpecList &specs);
+    //------------------------------------------------------------------
+    /// Split a path into a file path with object name.
+    ///
+    /// For paths like "/tmp/foo.a(bar.o)" we often need to split a path
+    /// up into the actual path name and into the object name so we can
+    /// make a valid object file from it.
+    ///
+    /// @param[in] path_with_object
+    ///     A path that might contain an archive path with a .o file
+    ///     specified in parens in the basename of the path.
+    ///
+    /// @param[out] archive_file
+    ///     If \b true is returned, \a file_spec will be filled in with
+    ///     the path to the archive.
+    ///
+    /// @param[out] archive_object
+    ///     If \b true is returned, \a object will be filled in with
+    ///     the name of the object inside the archive.
+    ///
+    /// @return
+    ///     \b true if the path matches the pattern of archive + object
+    ///     and \a archive_file and \a archive_object are modified,
+    ///     \b false otherwise and \a archive_file and \a archive_object
+    ///     are guaranteed to be remain unchanged.
+    //------------------------------------------------------------------
+    static bool
+    SplitArchivePathWithObject (const char *path_with_object,
+                                lldb_private::FileSpec &archive_file,
+                                lldb_private::ConstString &archive_object,
+                                bool must_exist);
+
     //------------------------------------------------------------------
     /// Gets the address size in bytes for the current object file.
     ///
@@ -183,7 +229,7 @@ public:
     ///     architecture (and object for archives). Returns zero if no
     ///     architecture or object has been selected.
     //------------------------------------------------------------------
-    virtual size_t
+    virtual uint32_t
     GetAddressByteSize ()  const = 0;
 
     //------------------------------------------------------------------
@@ -247,8 +293,8 @@ public:
     ///     simple object files that a represented by an entire file.
     //------------------------------------------------------------------
     virtual lldb::addr_t
-    GetOffset () const
-    { return m_offset; }
+    GetFileOffset () const
+    { return m_file_offset; }
 
     virtual lldb::addr_t
     GetByteSize () const
@@ -317,6 +363,17 @@ public:
     GetSymtab () = 0;
 
     //------------------------------------------------------------------
+    /// Frees the symbol table.
+    ///
+    /// This function should only be used when an object file is
+    ///
+    /// @return
+    ///     The symbol table for this object file.
+    //------------------------------------------------------------------
+    virtual void
+    ClearSymtab ();
+    
+    //------------------------------------------------------------------
     /// Gets the UUID for this object file.
     ///
     /// If the object file format contains a UUID, the value should be
@@ -408,13 +465,13 @@ public:
     /// file is that describes the content of the file. If the header
     /// doesn't appear in a section that is defined in the object file,
     /// an address with no section is returned that has the file offset
-    /// set in the m_offset member of the lldb_private::Address object.
+    /// set in the m_file_offset member of the lldb_private::Address object.
     ///
     /// @return
     ///     Returns the entry address for this module.
     //------------------------------------------------------------------
     virtual lldb_private::Address
-    GetHeaderAddress () { return Address();}
+    GetHeaderAddress () { return Address(m_memory_addr);}
 
     
     virtual uint32_t
@@ -570,12 +627,14 @@ protected:
     FileSpec m_file;
     Type m_type;
     Strata m_strata;
-    lldb::addr_t m_offset; ///< The offset in bytes into the file, or the address in memory
+    lldb::addr_t m_file_offset; ///< The offset in bytes into the file, or the address in memory
     lldb::addr_t m_length; ///< The length of this object file if it is known (can be zero if length is unknown or can't be determined).
     DataExtractor m_data; ///< The data for this object file so things can be parsed lazily.
     lldb_private::UnwindTable m_unwind_table; /// < Table of FuncUnwinders objects created for this ObjectFile's functions
     lldb::ProcessWP m_process_wp;
     const lldb::addr_t m_memory_addr;
+    std::unique_ptr<lldb_private::SectionList> m_sections_ap;
+    std::unique_ptr<lldb_private::Symtab> m_symtab_ap;
     
     //------------------------------------------------------------------
     /// Sets the architecture for a module.  At present the architecture

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/Symbol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/Symbol.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/Symbol.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/Symbol.h Thu Jun  6 19:06:43 2013
@@ -37,7 +37,8 @@ public:
             bool is_artificial,
             const lldb::SectionSP &section_sp,
             lldb::addr_t value,
-            uint32_t size,
+            lldb::addr_t size,
+            bool size_is_valid,
             uint32_t flags);
 
     Symbol (uint32_t symID,
@@ -49,6 +50,7 @@ public:
             bool is_trampoline,
             bool is_artificial,
             const AddressRange &range,
+            bool size_is_valid,
             uint32_t flags);
 
     Symbol (const Symbol& rhs);
@@ -91,7 +93,7 @@ public:
     }
 
     const ConstString &
-    GetName ()
+    GetName () const
     {
         return m_mangled.GetName();
     }
@@ -205,11 +207,14 @@ public:
     bool
     IsTrampoline () const;
 
+    bool
+    IsIndirect () const;
+
     lldb::addr_t
     GetByteSize () const;
     
     void
-    SetByteSize (uint32_t size)
+    SetByteSize (lldb::addr_t size)
     {
         m_calculated_size = size > 0;
         m_addr_range.SetByteSize(size);
@@ -250,6 +255,17 @@ public:
     uint32_t
     GetPrologueByteSize ();
 
+    bool
+    GetDemangledNameIsSynthesized() const
+    {
+        return m_demangled_is_synthesized;
+    }
+    void
+    SetDemangledNameIsSynthesized(bool b)
+    {
+        m_demangled_is_synthesized = b;
+    }
+
     //------------------------------------------------------------------
     /// @copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*)
     ///
@@ -284,6 +300,7 @@ protected:
                     m_size_is_sibling:1,    // m_size contains the index of this symbol's sibling
                     m_size_is_synthesized:1,// non-zero if this symbol's size was calculated using a delta between this symbol and the next
                     m_calculated_size:1,
+                    m_demangled_is_synthesized:1, // The demangled name was created should not be used for expressions or other lookups
                     m_type:8;
     uint32_t        m_flags;                // A copy of the flags from the original symbol table, the ObjectFile plug-in can interpret these
     AddressRange    m_addr_range;           // Contains the value, or the section offset address when the value is an address in a section, and the size (if any)

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h Thu Jun  6 19:06:43 2013
@@ -131,7 +131,7 @@ public:
     /// to their default state.
     //------------------------------------------------------------------
     void
-    Clear ();
+    Clear (bool clear_target);
 
     //------------------------------------------------------------------
     /// Dump a description of this object to a Stream.
@@ -153,7 +153,7 @@ public:
     /// information in this context. If a module, function, file and
     /// line number are available, they will be dumped. If only a
     /// module and function or symbol name with offset is available,
-    /// that will be ouput. Else just the address at which the target
+    /// that will be output. Else just the address at which the target
     /// was stopped will be displayed.
     ///
     /// @param[in] s
@@ -285,7 +285,31 @@ public:
     ///     The name of the function represented by this symbol context.
     //------------------------------------------------------------------
     ConstString
-    GetFunctionName (Mangled::NamePreference preference = Mangled::ePreferDemangled);
+    GetFunctionName (Mangled::NamePreference preference = Mangled::ePreferDemangled) const;
+
+    
+    //------------------------------------------------------------------
+    /// Get the line entry that corresponds to the function.
+    ///
+    /// If the symbol context contains an inlined block, the line entry
+    /// for the start address of the inlined function will be returned,
+    /// otherwise the line entry for the start address of the function
+    /// will be returned. This can be used after doing a
+    /// Module::FindFunctions(...) or ModuleList::FindFunctions(...)
+    /// call in order to get the correct line table information for
+    /// the symbol context.
+    /// it will return the inlined function name.
+    ///
+    /// @param[in] prefer_mangled
+    ///    if \btrue, then the mangled name will be returned if there
+    ///    is one.  Otherwise the unmangled name will be returned if it
+    ///    is available.
+    ///
+    /// @return
+    ///     The name of the function represented by this symbol context.
+    //------------------------------------------------------------------
+    LineEntry
+    GetFunctionStartLineEntry () const;
 
     //------------------------------------------------------------------
     /// Find the block containing the inlined block that contains this block.
@@ -367,12 +391,12 @@ private:
     lldb::TargetSP                 m_target_sp;
     std::string                    m_module_spec;
     lldb::ModuleSP                 m_module_sp;
-    std::auto_ptr<FileSpec>        m_file_spec_ap;
+    std::unique_ptr<FileSpec>       m_file_spec_ap;
     size_t                         m_start_line;
     size_t                         m_end_line;
     std::string                    m_function_spec;
     std::string                    m_class_name;
-    std::auto_ptr<AddressRange>    m_address_range_ap;
+    std::unique_ptr<AddressRange>   m_address_range_ap;
     uint32_t                       m_type; // Or'ed bits from SpecificationType
 
 };
@@ -459,10 +483,23 @@ public:
     ///     otherwise.
     //------------------------------------------------------------------
     bool
-    GetContextAtIndex(uint32_t idx, SymbolContext& sc) const;
+    GetContextAtIndex(size_t idx, SymbolContext& sc) const;
+
+    //------------------------------------------------------------------
+    /// Get accessor for the last symbol context in the list.
+    ///
+    /// @param[out] sc
+    ///     A reference to the symbol context to fill in.
+    ///
+    /// @return
+    ///     Returns \b true if \a sc was filled in, \b false if the
+    ///     list is empty.
+    //------------------------------------------------------------------
+    bool
+    GetLastContext(SymbolContext& sc) const;
 
     bool
-    RemoveContextAtIndex (uint32_t idx);
+    RemoveContextAtIndex (size_t idx);
     //------------------------------------------------------------------
     /// Get accessor for a symbol context list size.
     ///

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolFile.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolFile.h Thu Jun  6 19:06:43 2013
@@ -120,6 +120,7 @@ public:
     virtual uint32_t        GetNumCompileUnits() = 0;
     virtual lldb::CompUnitSP  ParseCompileUnitAtIndex(uint32_t index) = 0;
 
+    virtual lldb::LanguageType ParseCompileUnitLanguage (const SymbolContext& sc) = 0;
     virtual size_t          ParseCompileUnitFunctions (const SymbolContext& sc) = 0;
     virtual bool            ParseCompileUnitLineTable (const SymbolContext& sc) = 0;
     virtual bool            ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpecList& support_files) = 0;

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolVendor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolVendor.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolVendor.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolVendor.h Thu Jun  6 19:06:43 2013
@@ -36,17 +36,9 @@ class SymbolVendor :
     public PluginInterface
 {
 public:
-    static bool
-    RegisterPlugin (const char *name,
-                    const char *description,
-                    SymbolVendorCreateInstance create_callback);
-
-    static bool
-    UnregisterPlugin (SymbolVendorCreateInstance create_callback);
-
-
     static SymbolVendor*
-    FindPlugin (const lldb::ModuleSP &module_sp);
+    FindPlugin (const lldb::ModuleSP &module_sp,
+                lldb_private::Stream *feedback_strm);
 
     //------------------------------------------------------------------
     // Constructors and Destructors
@@ -62,6 +54,9 @@ public:
     virtual void
     Dump(Stream *s);
 
+    virtual lldb::LanguageType
+    ParseCompileUnitLanguage (const SymbolContext& sc);
+    
     virtual size_t
     ParseCompileUnitFunctions (const SymbolContext& sc);
 
@@ -96,20 +91,20 @@ public:
                           uint32_t resolve_scope,
                           SymbolContextList& sc_list);
 
-    virtual uint32_t
+    virtual size_t
     FindGlobalVariables (const ConstString &name,
                          const ClangNamespaceDecl *namespace_decl,
                          bool append,
-                         uint32_t max_matches,
+                         size_t max_matches,
                          VariableList& variables);
 
-    virtual uint32_t
+    virtual size_t
     FindGlobalVariables (const RegularExpression& regex,
                          bool append,
-                         uint32_t max_matches,
+                         size_t max_matches,
                          VariableList& variables);
 
-    virtual uint32_t
+    virtual size_t
     FindFunctions (const ConstString &name,
                    const ClangNamespaceDecl *namespace_decl,
                    uint32_t name_type_mask,
@@ -117,18 +112,18 @@ public:
                    bool append,
                    SymbolContextList& sc_list);
 
-    virtual uint32_t
+    virtual size_t
     FindFunctions (const RegularExpression& regex,
                    bool include_inlines,
                    bool append,
                    SymbolContextList& sc_list);
 
-    virtual uint32_t
+    virtual size_t
     FindTypes (const SymbolContext& sc, 
                const ConstString &name,
                const ClangNamespaceDecl *namespace_decl, 
                bool append, 
-               uint32_t max_matches, 
+               size_t max_matches,
                TypeList& types);
 
     virtual lldb_private::ClangNamespaceDecl
@@ -136,15 +131,15 @@ public:
                    const ConstString &name,
                    const ClangNamespaceDecl *parent_namespace_decl);
     
-    virtual uint32_t
+    virtual size_t
     GetNumCompileUnits();
 
     virtual bool
-    SetCompileUnitAtIndex (uint32_t cu_idx,
+    SetCompileUnitAtIndex (size_t cu_idx,
                            const lldb::CompUnitSP &cu_sp);
 
     virtual lldb::CompUnitSP
-    GetCompileUnitAtIndex(uint32_t idx);
+    GetCompileUnitAtIndex(size_t idx);
 
     TypeList&
     GetTypeList()
@@ -167,12 +162,9 @@ public:
     //------------------------------------------------------------------
     // PluginInterface protocol
     //------------------------------------------------------------------
-    virtual const char *
+    virtual lldb_private::ConstString
     GetPluginName();
 
-    virtual const char *
-    GetShortPluginName();
-
     virtual uint32_t
     GetPluginVersion();
 
@@ -187,7 +179,7 @@ protected:
     TypeList m_type_list; // Uniqued types for all parsers owned by this module
     CompileUnits m_compile_units; // The current compile units
     lldb::ObjectFileSP m_objfile_sp;    // Keep a reference to the object file in case it isn't the same as the module object file (debug symbols in a separate file)
-    std::auto_ptr<SymbolFile> m_sym_file_ap; // A single symbol file. Suclasses can add more of these if needed.
+    std::unique_ptr<SymbolFile> m_sym_file_ap; // A single symbol file. Suclasses can add more of these if needed.
 
 private:
     //------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/Symtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/Symtab.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/Symtab.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/Symtab.h Thu Jun  6 19:06:43 2013
@@ -41,8 +41,8 @@ public:
                         Symtab(ObjectFile *objfile);
                         ~Symtab();
 
-            void        Reserve (uint32_t count);
-            Symbol *    Resize (uint32_t count);
+            void        Reserve (size_t count);
+            Symbol *    Resize (size_t count);
             uint32_t    AddSymbol(const Symbol& symbol);
             size_t      GetNumSymbols() const;
             void        Dump(Stream *s, Target *target, SortOrder sort_type);
@@ -53,10 +53,9 @@ public:
                             return m_mutex;
                         }
             Symbol *    FindSymbolByID (lldb::user_id_t uid) const;
-            Symbol *    SymbolAtIndex (uint32_t idx);
-    const   Symbol *    SymbolAtIndex (uint32_t idx) const;
+            Symbol *    SymbolAtIndex (size_t idx);
+    const   Symbol *    SymbolAtIndex (size_t idx) const;
             Symbol *    FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx);
-//    const   Symbol *    FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx) const;
             uint32_t    AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
             uint32_t    AppendSymbolIndexesWithTypeAndFlagsValue (lldb::SymbolType symbol_type, uint32_t flags_value, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
             uint32_t    AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
@@ -70,11 +69,9 @@ public:
             size_t      FindAllSymbolsWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes);
             size_t      FindAllSymbolsMatchingRexExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes);
             Symbol *    FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility);
-            Symbol *    FindSymbolWithFileAddress (lldb::addr_t file_addr);
-//            Symbol *    FindSymbolContainingAddress (const Address& value, const uint32_t* indexes, uint32_t num_indexes);
-//            Symbol *    FindSymbolContainingAddress (const Address& value);
             Symbol *    FindSymbolContainingFileAddress (lldb::addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes);
             Symbol *    FindSymbolContainingFileAddress (lldb::addr_t file_addr);
+            size_t      FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list);
             size_t      CalculateSymbolSize (Symbol *symbol);
 
             void        SortSymbolIndexesByValue (std::vector<uint32_t>& indexes, bool remove_duplicates) const;
@@ -109,13 +106,16 @@ protected:
     collection          m_symbols;
     std::vector<uint32_t> m_addr_indexes;
     UniqueCStringMap<uint32_t> m_name_to_index;
+    UniqueCStringMap<uint32_t> m_basename_to_index;
+    UniqueCStringMap<uint32_t> m_method_to_index;
+    UniqueCStringMap<uint32_t> m_selector_to_index;
     mutable Mutex       m_mutex; // Provide thread safety for this symbol table
     bool                m_addr_indexes_computed:1,
                         m_name_indexes_computed:1;
 private:
 
     bool
-    CheckSymbolAtIndex (uint32_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
+    CheckSymbolAtIndex (size_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
     {
         switch (symbol_debug_type)
         {
@@ -147,6 +147,9 @@ private:
         return false;
     }
 
+    void
+    SymbolIndicesToSymbolContextList (std::vector<uint32_t> &symbol_indexes,
+                                      SymbolContextList &sc_list);
 
     DISALLOW_COPY_AND_ASSIGN (Symtab);
 };

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h Thu Jun  6 19:06:43 2013
@@ -21,7 +21,7 @@
 namespace lldb_private {
 
 class SymbolFileType :
-    public STD_ENABLE_SHARED_FROM_THIS(SymbolFileType),
+    public std::enable_shared_from_this<SymbolFileType>,
     public UserID
     {
     public:
@@ -50,7 +50,7 @@ class SymbolFileType :
     };
     
 class Type :
-    public STD_ENABLE_SHARED_FROM_THIS(Type),
+    public std::enable_shared_from_this<Type>,
     public UserID
 {
 public:
@@ -79,7 +79,7 @@ public:
     Type (lldb::user_id_t uid,
           SymbolFile* symbol_file,
           const ConstString &name,
-          uint32_t byte_size,
+          uint64_t byte_size,
           SymbolContextScope *context,
           lldb::user_id_t encoding_uid,
           EncodingDataType encoding_uid_type,
@@ -123,7 +123,7 @@ public:
     const ConstString&
     GetName();
 
-    uint32_t
+    uint64_t
     GetByteSize();
 
     uint32_t
@@ -147,9 +147,6 @@ public:
     lldb::TypeSP
     GetTypedefType();
 
-    void
-    SetByteSize(uint32_t byte_size);
-
     const ConstString &
     GetName () const
     {
@@ -206,7 +203,7 @@ public:
     GetFormat ();
 
     lldb::Encoding
-    GetEncoding (uint32_t &count);
+    GetEncoding (uint64_t &count);
 
     SymbolContextScope *
     GetSymbolContextScope()
@@ -255,9 +252,10 @@ public:
     // From a fully qualified typename, split the type into the type basename
     // and the remaining type scope (namespaces/classes).
     static bool
-    GetTypeScopeAndBasename (const char* name_cstr,
+    GetTypeScopeAndBasename (const char* &name_cstr,
                              std::string &scope,
-                             std::string &basename);
+                             std::string &basename,
+                             lldb::TypeClass &type_class);
     void
     SetEncodingType (Type *encoding_type)
     {
@@ -301,9 +299,9 @@ protected:
     SymbolFile *m_symbol_file;
     SymbolContextScope *m_context; // The symbol context in which this type is defined
     Type *m_encoding_type;
-    uint32_t m_encoding_uid;
+    lldb::user_id_t m_encoding_uid;
     EncodingDataType m_encoding_uid_type;
-    uint32_t m_byte_size;
+    uint64_t m_byte_size;
     Declaration m_decl;
     lldb::clang_type_t m_clang_type;
     
@@ -339,6 +337,12 @@ public:
     TypeAndOrName &
     operator= (const TypeAndOrName &rhs);
     
+    bool
+    operator==(const TypeAndOrName &other) const;
+    
+    bool
+    operator!=(const TypeAndOrName &other) const;
+    
     ConstString GetName () const;
 
     lldb::TypeSP
@@ -348,10 +352,10 @@ public:
     }
     
     void
-    SetName (ConstString &type_name_const_str);
+    SetName (const ConstString &type_name);
     
     void 
-    SetName (const char *type_name_str);
+    SetName (const char *type_name_cstr);
     
     void
     SetTypeSP (lldb::TypeSP type_sp);
@@ -359,6 +363,21 @@ public:
     bool
     IsEmpty ();
     
+    bool
+    HasName ();
+    
+    bool
+    HasTypeSP ();
+    
+    void
+    Clear ();
+    
+    operator
+    bool ()
+    {
+        return !IsEmpty();
+    }
+    
 private:
     lldb::TypeSP m_type_sp;
     ConstString m_type_name;

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/TypeList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/TypeList.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/TypeList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/TypeList.h Thu Jun  6 19:06:43 2013
@@ -61,7 +61,12 @@ public:
     void
     RemoveMismatchedTypes (const std::string &type_scope,
                            const std::string &type_basename,
+                           lldb::TypeClass type_class,
                            bool exact_match);
+
+    void
+    RemoveMismatchedTypes (lldb::TypeClass type_class);
+
 private:
     typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
     typedef collection::iterator iterator;

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h Thu Jun  6 19:06:43 2013
@@ -342,13 +342,16 @@ public:
 
 public:
 
-    typedef STD_SHARED_PTR(Row) RowSP;
+    typedef std::shared_ptr<Row> RowSP;
 
     UnwindPlan (lldb::RegisterKind reg_kind) : 
         m_row_list (), 
         m_plan_valid_address_range (), 
         m_register_kind (reg_kind), 
-        m_source_name ()
+        m_return_addr_register (LLDB_INVALID_REGNUM),
+        m_source_name (),
+        m_plan_is_sourced_from_compiler (eLazyBoolCalculate),
+        m_plan_is_valid_at_all_instruction_locations (eLazyBoolCalculate)
     {
     }
 
@@ -381,6 +384,18 @@ public:
         m_register_kind = kind;
     }
     
+    void
+    SetReturnAddressRegister (uint32_t regnum)
+    {
+        m_return_addr_register = regnum;
+    }
+    
+    uint32_t
+    GetReturnAddressRegister (void)
+    {
+        return m_return_addr_register;
+    }
+
     uint32_t
     GetInitialCFARegister () const
     {
@@ -419,6 +434,36 @@ public:
     void
     SetSourceName (const char *);
 
+    // Was this UnwindPlan emitted by a compiler?
+    lldb_private::LazyBool
+    GetSourcedFromCompiler () const
+    {
+        return m_plan_is_sourced_from_compiler;
+    }
+
+    // Was this UnwindPlan emitted by a compiler?
+    void
+    SetSourcedFromCompiler (lldb_private::LazyBool from_compiler)
+    {
+        m_plan_is_sourced_from_compiler = from_compiler;
+    }
+
+    // Is this UnwindPlan valid at all instructions?  If not, then it is assumed valid at call sites,
+    // e.g. for exception handling.
+    lldb_private::LazyBool
+    GetUnwindPlanValidAtAllInstructions () const
+    {
+        return m_plan_is_valid_at_all_instruction_locations;
+    }
+
+    // Is this UnwindPlan valid at all instructions?  If not, then it is assumed valid at call sites,
+    // e.g. for exception handling.
+    void
+    SetUnwindPlanValidAtAllInstructions (lldb_private::LazyBool valid_at_all_insn)
+    {
+        m_plan_is_valid_at_all_instruction_locations = valid_at_all_insn;
+    }
+
     int
     GetRowCount () const;
 
@@ -441,8 +486,12 @@ private:
     collection m_row_list;
     AddressRange m_plan_valid_address_range;
     lldb::RegisterKind m_register_kind;   // The RegisterKind these register numbers are in terms of - will need to be
-                                // translated to lldb native reg nums at unwind time
+                                          // translated to lldb native reg nums at unwind time
+    uint32_t m_return_addr_register;      // The register that has the return address for the caller frame
+                                          // e.g. the lr on arm
     lldb_private::ConstString m_source_name;  // for logging, where this UnwindPlan originated from
+    lldb_private::LazyBool m_plan_is_sourced_from_compiler;
+    lldb_private::LazyBool m_plan_is_valid_at_all_instruction_locations;
 }; // class UnwindPlan
 
 } // namespace lldb_private

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/Variable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/Variable.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/Variable.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/Variable.h Thu Jun  6 19:06:43 2013
@@ -144,9 +144,9 @@ public:
         m_loc_is_const_data = b;
     }
     
-    typedef uint32_t (*GetVariableCallback) (void *baton, 
-                                             const char *name,
-                                             VariableList &var_list);
+    typedef size_t (*GetVariableCallback) (void *baton,
+                                           const char *name,
+                                           VariableList &var_list);
 
 
     static Error
@@ -157,6 +157,12 @@ public:
                                         VariableList &variable_list,
                                         ValueObjectList &valobj_list);
 
+    static size_t
+    AutoComplete (const ExecutionContext &exe_ctx,
+                  const char *name,
+                  StringList &matches,
+                  bool &word_complete);
+
 protected:
     ConstString m_name;                 // The basename of the variable (no namespaces)
     Mangled m_mangled;                  // The mangled name of the variable

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h Thu Jun  6 19:06:43 2013
@@ -42,19 +42,14 @@ public:
     Dump(Stream *s, bool show_context) const;
 
     lldb::VariableSP
-    GetVariableAtIndex(uint32_t idx);
+    GetVariableAtIndex(size_t idx) const;
 
     lldb::VariableSP
-    RemoveVariableAtIndex (uint32_t idx);
+    RemoveVariableAtIndex (size_t idx);
     
     lldb::VariableSP
     FindVariable (const ConstString& name);
 
-    // Find the argument variable that represents the language specific
-    // object pointer ("this" in C++, or "self" in Objective C).
-    lldb::VariableSP
-    FindArtificialObjectVariable (lldb::LanguageType language) const;
-
     uint32_t
     FindVariableIndex (const lldb::VariableSP &var_sp);
 
@@ -67,6 +62,11 @@ public:
     AppendVariablesIfUnique (const RegularExpression& regex, 
                              VariableList &var_list, 
                              size_t& total_matches);
+    
+    size_t
+    AppendVariablesWithScope (lldb::ValueType type,
+                              VariableList &var_list,
+                              bool if_unique = true);
 
     uint32_t
     FindIndexForVariable (Variable* variable);

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ABI.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ABI.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ABI.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ABI.h Thu Jun  6 19:06:43 2013
@@ -14,6 +14,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Core/Error.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/lldb-private.h"
 
@@ -45,11 +46,14 @@ public:
     GetArgumentValues (Thread &thread,
                        ValueList &values) const = 0;
     
-public:
     lldb::ValueObjectSP
     GetReturnValueObject (Thread &thread,
                           ClangASTType &type,
                           bool persistent = true) const;
+    
+    // Set the Return value object in the current frame as though a function with 
+    virtual Error
+    SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) = 0;
 
 protected:    
     // This is the method the ABI will call to actually calculate the return value.
@@ -67,12 +71,22 @@ public:
     virtual bool
     RegisterIsVolatile (const RegisterInfo *reg_info) = 0;
 
+    // Should return true if your ABI uses frames when doing stack backtraces. This
+    // means a frame pointer is used that points to the previous stack frame in some
+    // way or another.
     virtual bool
     StackUsesFrames () = 0;
 
+    // Should take a look at a call frame address (CFA) which is just the stack
+    // pointer value upon entry to a function. ABIs usually impose alignment
+    // restrictions (4, 8 or 16 byte aligned), and zero is usually not allowed.
+    // This function should return true if "cfa" is valid call frame address for
+    // the ABI, and false otherwise. This is used by the generic stack frame unwinding
+    // code to help determine when a stack ends.
     virtual bool
     CallFrameAddressIsValid (lldb::addr_t cfa) = 0;
 
+    // Validates a possible PC value and returns true if an opcode can be at "pc".
     virtual bool
     CodeAddressIsValid (lldb::addr_t pc) = 0;    
 
@@ -88,7 +102,15 @@ public:
     virtual const RegisterInfo *
     GetRegisterInfoArray (uint32_t &count) = 0;
 
-    
+    // Some architectures (e.g. x86) will push the return address on the stack and decrement
+    // the stack pointer when making a function call.  This means that every stack frame will
+    // have a unique CFA.
+    // Other architectures (e.g. arm) pass the return address in a register so it is possible
+    // to have a frame on a backtrace that does not push anything on the stack or change the 
+    // CFA.
+    virtual bool
+    FunctionCallsChangeCFA () = 0;
+
     
     bool
     GetRegisterInfoByName (const ConstString &name, RegisterInfo &info);

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/CPPLanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/CPPLanguageRuntime.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/CPPLanguageRuntime.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/CPPLanguageRuntime.h Thu Jun  6 19:06:43 2013
@@ -25,6 +25,93 @@ class CPPLanguageRuntime :
     public LanguageRuntime
 {
 public:
+    
+    class MethodName
+    {
+    public:
+        enum Type
+        {
+            eTypeInvalid,
+            eTypeUnknownMethod,
+            eTypeClassMethod,
+            eTypeInstanceMethod
+        };
+        
+        MethodName () :
+            m_full(),
+            m_basename(),
+            m_context(),
+            m_arguments(),
+            m_qualifiers(),
+            m_type (eTypeInvalid),
+            m_parsed (false),
+            m_parse_error (false)
+        {
+        }
+
+        MethodName (const ConstString &s) :
+            m_full(s),
+            m_basename(),
+            m_context(),
+            m_arguments(),
+            m_qualifiers(),
+            m_type (eTypeInvalid),
+            m_parsed (false),
+            m_parse_error (false)
+        {
+        }
+
+        void
+        Clear();
+        
+        bool
+        IsValid () const
+        {
+            if (m_parse_error)
+                return false;
+            if (m_type == eTypeInvalid)
+                return false;
+            return (bool)m_full;
+        }
+
+        Type
+        GetType () const
+        {
+            return m_type;
+        }
+        
+        const ConstString &
+        GetFullName () const
+        {
+            return m_full;
+        }
+        
+        llvm::StringRef
+        GetBasename ();
+
+        llvm::StringRef
+        GetContext ();
+        
+        llvm::StringRef
+        GetArguments ();
+        
+        llvm::StringRef
+        GetQualifiers ();
+
+    protected:
+        void
+        Parse();
+
+        ConstString     m_full;         // Full name:    "lldb::SBTarget::GetBreakpointAtIndex(unsigned int) const"
+        llvm::StringRef m_basename;     // Basename:     "GetBreakpointAtIndex"
+        llvm::StringRef m_context;      // Decl context: "lldb::SBTarget"
+        llvm::StringRef m_arguments;    // Arguments:    "(unsigned int)"
+        llvm::StringRef m_qualifiers;   // Qualifiers:   "const"
+        Type m_type;
+        bool m_parsed;
+        bool m_parse_error;
+    };
+
     virtual
     ~CPPLanguageRuntime();
     
@@ -47,9 +134,6 @@ public:
     IsCPPMangledName(const char *name);
     
     static bool
-    IsPossibleCPPCall (const char *name, const char *&base_name_start, const char *&base_name_end);
-
-    static bool
     StripNamespacesFromVariableName (const char *name, const char *&base_name_start, const char *&base_name_end);
     
     // in some cases, compilers will output different names for one same type. when tht happens, it might be impossible

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/DynamicLoader.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/DynamicLoader.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/DynamicLoader.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/DynamicLoader.h Thu Jun  6 19:06:43 2013
@@ -93,7 +93,20 @@ public:
     DidLaunch () = 0;
     
     
-
+    //------------------------------------------------------------------
+    /// Helper function that can be used to detect when a process has
+    /// called exec and is now a new and different process. This can
+    /// be called when necessary to try and detect the exec. The process
+    /// might be able to answer this question, but sometimes it might
+    /// not be able and the dynamic loader often knows what the program
+    /// entry point is. So the process and the dynamic loader can work
+    /// together to detect this.
+    //------------------------------------------------------------------
+    virtual bool
+    ProcessDidExec ()
+    {
+        return false;
+    }
     //------------------------------------------------------------------
     /// Get whether the process should stop when images change.
     ///
@@ -216,7 +229,6 @@ protected:
     // Member variables.
     //------------------------------------------------------------------
     Process* m_process; ///< The process that this dynamic loader plug-in is tracking.
-    bool m_stop_when_images_change; ///< Boolean value that indicates if the process should stop when imamges change.
 private:
     DISALLOW_COPY_AND_ASSIGN (DynamicLoader);
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h Thu Jun  6 19:06:43 2013
@@ -37,6 +37,7 @@
 
 #include "lldb/lldb-private.h"
 #include "lldb/Target/StackID.h"
+#include "lldb/Host/Mutex.h"
 
 namespace lldb_private {
 
@@ -254,10 +255,7 @@ public:
     ///     A shared pointer to a target that is not guaranteed to be valid.
     //------------------------------------------------------------------
     lldb::TargetSP
-    GetTargetSP () const
-    {
-        return m_target_wp.lock();
-    }
+    GetTargetSP () const;
     
     //------------------------------------------------------------------
     /// Get accessor that creates a strong reference from the weak process
@@ -267,10 +265,7 @@ public:
     ///     A shared pointer to a process that is not guaranteed to be valid.
     //------------------------------------------------------------------
     lldb::ProcessSP
-    GetProcessSP () const
-    {
-        return m_process_wp.lock();
-    }
+    GetProcessSP () const;
     
     //------------------------------------------------------------------
     /// Get accessor that creates a strong reference from the weak thread
@@ -340,7 +335,6 @@ public:
     ClearFrame ()
     {
         m_stack_id.Clear();
-        m_frame_wp.reset();
     }
 
 protected:
@@ -350,7 +344,6 @@ protected:
     lldb::TargetWP m_target_wp;             ///< A weak reference to a target
     lldb::ProcessWP m_process_wp;           ///< A weak reference to a process
     mutable lldb::ThreadWP m_thread_wp;     ///< A weak reference to a thread
-    mutable lldb::StackFrameWP m_frame_wp;  ///< A weak reference to a frame
     lldb::tid_t m_tid;                      ///< The thread ID that this object refers to in case the backing object changes
     StackID m_stack_id;                     ///< The stack ID that this object refers to in case the backing object changes
 };
@@ -410,6 +403,11 @@ public:
     ExecutionContext (const lldb::StackFrameWP &frame_wp);    
     ExecutionContext (const ExecutionContextRef &exe_ctx_ref);
     ExecutionContext (const ExecutionContextRef *exe_ctx_ref);
+    
+    // These two variants take in a locker, and grab the target, lock the API mutex into locker, then
+    // fill in the rest of the shared pointers.
+    ExecutionContext (const ExecutionContextRef &exe_ctx_ref, Mutex::Locker &locker);
+    ExecutionContext (const ExecutionContextRef *exe_ctx_ref, Mutex::Locker &locker);
     //------------------------------------------------------------------
     // Create execution contexts from execution context scopes
     //------------------------------------------------------------------
@@ -727,10 +725,7 @@ public:
     /// GetTargetRef() do not need to be checked for validity.
     //------------------------------------------------------------------
     bool
-    HasTargetScope () const
-    {
-        return (bool) m_target_sp;
-    }
+    HasTargetScope () const;
 
     //------------------------------------------------------------------
     /// Returns true the ExecutionContext object contains a valid 
@@ -742,10 +737,7 @@ public:
     /// need to be checked for validity.
     //------------------------------------------------------------------
     bool
-    HasProcessScope () const
-    {
-        return m_target_sp && m_process_sp;
-    }
+    HasProcessScope () const;
 
     //------------------------------------------------------------------
     /// Returns true the ExecutionContext object contains a valid 
@@ -757,10 +749,7 @@ public:
     /// and GetThreadRef() do not need to be checked for validity.
     //------------------------------------------------------------------
     bool
-    HasThreadScope () const
-    {
-        return m_target_sp && m_process_sp && m_thread_sp;
-    }
+    HasThreadScope () const;
     
     //------------------------------------------------------------------
     /// Returns true the ExecutionContext object contains a valid 
@@ -773,10 +762,7 @@ public:
     /// to be checked for validity.
     //------------------------------------------------------------------
     bool
-    HasFrameScope () const
-    {
-        return m_target_sp && m_process_sp && m_thread_sp && m_frame_sp;
-    }
+    HasFrameScope () const;
     
 protected:
     //------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/LanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/LanguageRuntime.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/LanguageRuntime.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/LanguageRuntime.h Thu Jun  6 19:06:43 2013
@@ -44,6 +44,7 @@ public:
     virtual bool
     GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope) = 0;
     
+    // this call should return true if it could set the name and/or the type
     virtual bool
     GetDynamicTypeAndAddress (ValueObject &in_value, 
                               lldb::DynamicValueType use_dynamic, 
@@ -83,57 +84,24 @@ public:
     
     static const char *
     GetNameForLanguageType (lldb::LanguageType language);
-        
-protected:
-    //------------------------------------------------------------------
-    // Classes that inherit from LanguageRuntime can see and modify these
-    //------------------------------------------------------------------
     
-    // The Target is the one that knows how to create breakpoints, so this function is meant to be used either
-    // by the target or internally in Set/ClearExceptionBreakpoints.
-    class ExceptionBreakpointResolver : public BreakpointResolver
+    Process *
+    GetProcess()
     {
-    public:
-        ExceptionBreakpointResolver (Breakpoint *bkpt,
-                                lldb::LanguageType language,
-                                bool catch_bp,
-                                bool throw_bp);
-
-        virtual ~ExceptionBreakpointResolver() {}
-
-        virtual Searcher::CallbackReturn
-        SearchCallback (SearchFilter &filter,
-                        SymbolContext &context,
-                        Address *addr,
-                        bool containing);
-
-        virtual Searcher::Depth
-        GetDepth ();
-
-        virtual void
-        GetDescription (Stream *s);
-        
-        virtual void
-        Dump (Stream *s) const {}
+        return m_process;
+    }
 
-        /// Methods for support type inquiry through isa, cast, and dyn_cast:
-        static inline bool classof(const BreakpointResolverName *) { return true; }
-        static inline bool classof(const BreakpointResolver *V) {
-            return V->getResolverID() == BreakpointResolver::ExceptionResolver;
-        }
-    protected:
-        bool SetActualResolver();
-        
-        lldb::BreakpointResolverSP m_actual_resolver_sp;
-        lldb::ProcessWP m_process_wp;
-        lldb::LanguageType m_language;
-        bool m_catch_bp;
-        bool m_throw_bp;
-    };
-    
     virtual lldb::BreakpointResolverSP
     CreateExceptionResolver (Breakpoint *bkpt, bool catch_bp, bool throw_bp) = 0;
     
+    virtual lldb::SearchFilterSP
+    CreateExceptionSearchFilter ();
+
+protected:
+    //------------------------------------------------------------------
+    // Classes that inherit from LanguageRuntime can see and modify these
+    //------------------------------------------------------------------
+    
     LanguageRuntime(Process *process);
     Process *m_process;
 private:

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Memory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Memory.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Memory.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Memory.h Thu Jun  6 19:06:43 2013
@@ -38,7 +38,7 @@ namespace lldb_private {
         ~MemoryCache ();
         
         void
-        Clear();
+        Clear(bool clear_invalid_ranges = false);
         
         void
         Flush (lldb::addr_t addr, size_t size);
@@ -170,7 +170,7 @@ namespace lldb_private {
         DeallocateMemory (lldb::addr_t ptr);
         
     protected:
-        typedef STD_SHARED_PTR(AllocatedBlock) AllocatedBlockSP;
+        typedef std::shared_ptr<AllocatedBlock> AllocatedBlockSP;
 
         AllocatedBlockSP
         AllocatePage (uint32_t byte_size, 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ObjCLanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ObjCLanguageRuntime.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ObjCLanguageRuntime.h Thu Jun  6 19:06:43 2013
@@ -12,13 +12,16 @@
 
 // C Includes
 // C++ Includes
+#include <functional>
 #include <map>
+#include <unordered_set>
 
 // Other libraries and framework includes
 // Project includes
 #include "lldb/lldb-private.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Symbol/Type.h"
+#include "lldb/Symbol/TypeVendor.h"
 #include "lldb/Target/LanguageRuntime.h"
 
 namespace lldb_private {
@@ -29,6 +32,241 @@ class ObjCLanguageRuntime :
     public LanguageRuntime
 {
 public:
+    class MethodName
+    {
+    public:
+        enum Type
+        {
+            eTypeUnspecified,
+            eTypeClassMethod,
+            eTypeInstanceMethod
+        };
+        
+        MethodName () :
+            m_full(),
+            m_class(),
+            m_category(),
+            m_selector(),
+            m_type (eTypeUnspecified),
+            m_category_is_valid (false)
+        {
+        }
+
+        MethodName (const char *name, bool strict) :
+            m_full(),
+            m_class(),
+            m_category(),
+            m_selector(),
+            m_type (eTypeUnspecified),
+            m_category_is_valid (false)
+        {
+            SetName (name, strict);
+        }
+
+        void
+        Clear();
+
+        bool
+        IsValid (bool strict) const
+        {
+            // If "strict" is true, the name must have everything specified including
+            // the leading "+" or "-" on the method name
+            if (strict && m_type == eTypeUnspecified)
+                return false;
+            // Other than that, m_full will only be filled in if the objective C
+            // name is valid.
+            return (bool)m_full;
+        }
+        
+        bool
+        HasCategory()
+        {
+            return (bool)GetCategory();
+        }
+
+        Type
+        GetType () const
+        {
+            return m_type;
+        }
+        
+        const ConstString &
+        GetFullName () const
+        {
+            return m_full;
+        }
+        
+        ConstString
+        GetFullNameWithoutCategory (bool empty_if_no_category);
+
+        bool
+        SetName (const char *name, bool strict);
+
+        const ConstString &
+        GetClassName ();
+
+        const ConstString &
+        GetClassNameWithCategory ();
+
+        const ConstString &
+        GetCategory ();
+        
+        const ConstString &
+        GetSelector ();
+
+        // Get all possible names for a method. Examples:
+        // If name is "+[NSString(my_additions) myStringWithCString:]"
+        //  names[0] => "+[NSString(my_additions) myStringWithCString:]"
+        //  names[1] => "+[NSString myStringWithCString:]"
+        // If name is specified without the leading '+' or '-' like "[NSString(my_additions) myStringWithCString:]"
+        //  names[0] => "+[NSString(my_additions) myStringWithCString:]"
+        //  names[1] => "-[NSString(my_additions) myStringWithCString:]"
+        //  names[2] => "+[NSString myStringWithCString:]"
+        //  names[3] => "-[NSString myStringWithCString:]"
+        size_t
+        GetFullNames (std::vector<ConstString> &names, bool append);
+    protected:
+        ConstString m_full;     // Full name:   "+[NSString(my_additions) myStringWithCString:]"
+        ConstString m_class;    // Class name:  "NSString"
+        ConstString m_class_category; // Class with category: "NSString(my_additions)"
+        ConstString m_category; // Category:    "my_additions"
+        ConstString m_selector; // Selector:    "myStringWithCString:"
+        Type m_type;
+        bool m_category_is_valid;
+
+    };
+    typedef lldb::addr_t ObjCISA;
+    
+    class ClassDescriptor;
+    typedef std::shared_ptr<ClassDescriptor> ClassDescriptorSP;
+    
+    // the information that we want to support retrieving from an ObjC class
+    // this needs to be pure virtual since there are at least 2 different implementations
+    // of the runtime, and more might come
+    class ClassDescriptor
+    {
+    public:
+        
+        ClassDescriptor() :
+            m_is_kvo (eLazyBoolCalculate),
+            m_is_cf (eLazyBoolCalculate),
+            m_type_wp ()
+        {
+        }
+
+        virtual
+        ~ClassDescriptor ()
+        {
+        }
+        
+        virtual ConstString
+        GetClassName () = 0;
+        
+        virtual ClassDescriptorSP
+        GetSuperclass () = 0;
+        
+        // virtual if any implementation has some other version-specific rules
+        // but for the known v1/v2 this is all that needs to be done
+        virtual bool
+        IsKVO ()
+        {
+            if (m_is_kvo == eLazyBoolCalculate)
+            {
+                const char* class_name = GetClassName().AsCString();
+                if (class_name && *class_name)
+                    m_is_kvo = (LazyBool)(strstr(class_name,"NSKVONotifying_") == class_name);
+            }
+            return (m_is_kvo == eLazyBoolYes);
+        }
+        
+        // virtual if any implementation has some other version-specific rules
+        // but for the known v1/v2 this is all that needs to be done
+        virtual bool
+        IsCFType ()
+        {
+            if (m_is_cf == eLazyBoolCalculate)
+            {
+                const char* class_name = GetClassName().AsCString();
+                if (class_name && *class_name)
+                    m_is_cf = (LazyBool)(strcmp(class_name,"__NSCFType") == 0 ||
+                                         strcmp(class_name,"NSCFType") == 0);
+            }
+            return (m_is_cf == eLazyBoolYes);
+        }
+        
+        virtual bool
+        IsValid () = 0;
+        
+        virtual bool
+        GetTaggedPointerInfo (uint64_t* info_bits = NULL,
+                              uint64_t* value_bits = NULL,
+                              uint64_t* payload = NULL) = 0;
+        
+        virtual uint64_t
+        GetInstanceSize () = 0;
+        
+        // use to implement version-specific additional constraints on pointers
+        virtual bool
+        CheckPointer (lldb::addr_t value,
+                      uint32_t ptr_size) const
+        {
+            return true;
+        }
+        
+        virtual ObjCISA
+        GetISA () = 0;
+        
+        // This should return true iff the interface could be completed
+        virtual bool
+        Describe (std::function <void (ObjCISA)> const &superclass_func,
+                  std::function <bool (const char*, const char*)> const &instance_method_func,
+                  std::function <bool (const char*, const char*)> const &class_method_func,
+                  std::function <bool (const char *, const char *, lldb::addr_t, uint64_t)> const &ivar_func)
+        {
+            return false;
+        }
+        
+        lldb::TypeSP
+        GetType ()
+        {
+            return m_type_wp.lock();
+        }
+        
+        void
+        SetType (const lldb::TypeSP &type_sp)
+        {
+            m_type_wp = type_sp;
+        }
+        
+    protected:
+        bool
+        IsPointerValid (lldb::addr_t value,
+                        uint32_t ptr_size,
+                        bool allow_NULLs = false,
+                        bool allow_tagged = false,
+                        bool check_version_specific = false) const;
+        
+    private:
+        LazyBool m_is_kvo;
+        LazyBool m_is_cf;
+        lldb::TypeWP m_type_wp;
+    };
+    
+    virtual ClassDescriptorSP
+    GetClassDescriptor (ValueObject& in_value);
+    
+    ClassDescriptorSP
+    GetNonKVOClassDescriptor (ValueObject& in_value);
+
+    virtual ClassDescriptorSP
+    GetClassDescriptorFromClassName (const ConstString &class_name);
+
+    virtual ClassDescriptorSP
+    GetClassDescriptorFromISA (ObjCISA isa);
+
+    ClassDescriptorSP
+    GetNonKVOClassDescriptor (ObjCISA isa);
+    
     virtual
     ~ObjCLanguageRuntime();
     
@@ -49,7 +287,7 @@ public:
     
     virtual lldb::ThreadPlanSP
     GetStepThroughTrampolinePlan (Thread &thread, bool stop_others) = 0;
-    
+
     lldb::addr_t
     LookupInMethodCache (lldb::addr_t class_addr, lldb::addr_t sel);
 
@@ -77,22 +315,36 @@ public:
         return eObjC_VersionUnknown;
     }
         
-    typedef lldb::addr_t ObjCISA;
-    
-    virtual bool
-    IsValidISA(ObjCISA isa) = 0;
+    bool
+    IsValidISA(ObjCISA isa)
+    {
+        UpdateISAToDescriptorMap();
+        return m_isa_to_descriptor.count(isa) > 0;
+    }
+
+    virtual void
+    UpdateISAToDescriptorMapIfNeeded() = 0;
+
+    void
+    UpdateISAToDescriptorMap()
+    {
+        if (m_process && m_process->GetStopID() != m_isa_to_descriptor_stop_id)
+        {
+            UpdateISAToDescriptorMapIfNeeded ();
+        }
+    }
     
     virtual ObjCISA
-    GetISA(ValueObject& valobj) = 0;
+    GetISA(const ConstString &name);
     
     virtual ConstString
-    GetActualTypeName(ObjCISA isa) = 0;
+    GetActualTypeName(ObjCISA isa);
     
     virtual ObjCISA
-    GetParentClass(ObjCISA isa) = 0;
+    GetParentClass(ObjCISA isa);
     
-    virtual SymbolVendor *
-    GetSymbolVendor()
+    virtual TypeVendor *
+    GetTypeVendor()
     {
         return NULL;
     }
@@ -103,6 +355,15 @@ public:
     virtual size_t
     GetByteOffsetForIvar (ClangASTType &parent_qual_type, const char *ivar_name);
     
+    // Given the name of an Objective-C runtime symbol (e.g., ivar offset symbol),
+    // try to determine from the runtime what the value of that symbol would be.
+    // Useful when the underlying binary is stripped.
+    virtual lldb::addr_t
+    LookupRuntimeSymbol (const ConstString &name)
+    {
+        return LLDB_INVALID_ADDRESS;
+    }
+    
     //------------------------------------------------------------------
     /// Chop up an objective C function prototype.
     ///
@@ -160,12 +421,12 @@ public:
     ///     Returns the number of strings that were successfully filled
     ///     in.
     //------------------------------------------------------------------
-    static uint32_t
-    ParseMethodName (const char *name, 
-                     ConstString *class_name,               // Class name (with category if there is one)
-                     ConstString *selector_name,            // selector only
-                     ConstString *name_sans_category,       // full function name with no category (empty if no category)
-                     ConstString *class_name_sans_category);// Class name without category (empty if no category)
+//    static uint32_t
+//    ParseMethodName (const char *name, 
+//                     ConstString *class_name,               // Class name (with category if there is one)
+//                     ConstString *selector_name,            // selector only
+//                     ConstString *name_sans_category,       // full function name with no category (empty if no category)
+//                     ConstString *class_name_sans_category);// Class name without category (empty if no category)
     
     static bool
     IsPossibleObjCMethodName (const char *name)
@@ -205,6 +466,12 @@ public:
         return (m_has_new_literals_and_indexing == eLazyBoolYes);
     }
     
+    virtual void
+    SymbolsDidLoad (const ModuleList& module_list)
+    {
+        m_negative_complete_class_cache.clear();
+    }
+    
 protected:
     //------------------------------------------------------------------
     // Classes that inherit from ObjCLanguageRuntime can see and modify these
@@ -215,6 +482,40 @@ protected:
     {
         return false;
     }
+    
+    
+    bool
+    ISAIsCached (ObjCISA isa) const
+    {
+        return m_isa_to_descriptor.find(isa) != m_isa_to_descriptor.end();
+    }
+
+    bool
+    AddClass (ObjCISA isa, const ClassDescriptorSP &descriptor_sp)
+    {
+        if (isa != 0)
+        {
+            m_isa_to_descriptor[isa] = descriptor_sp;
+            return true;
+        }
+        return false;
+    }
+
+    bool
+    AddClass (ObjCISA isa, const ClassDescriptorSP &descriptor_sp, const char *class_name);
+
+    bool
+    AddClass (ObjCISA isa, const ClassDescriptorSP &descriptor_sp, uint32_t class_name_hash)
+    {
+        if (isa != 0)
+        {
+            m_isa_to_descriptor[isa] = descriptor_sp;
+            m_hash_to_isa_map.insert(std::make_pair(class_name_hash, isa));
+            return true;
+        }
+        return false;
+    }
+
 private:
     // We keep a map of <Class,Selector>->Implementation so we don't have to call the resolver
     // function over and over.
@@ -263,16 +564,37 @@ private:
     };
 
     typedef std::map<ClassAndSel,lldb::addr_t> MsgImplMap;
+    typedef std::map<ObjCISA, ClassDescriptorSP> ISAToDescriptorMap;
+    typedef std::multimap<uint32_t, ObjCISA> HashToISAMap;
+    typedef ISAToDescriptorMap::iterator ISAToDescriptorIterator;
+    typedef HashToISAMap::iterator HashToISAIterator;
+
     MsgImplMap m_impl_cache;
-    
     LazyBool m_has_new_literals_and_indexing;
+    ISAToDescriptorMap m_isa_to_descriptor;
+    HashToISAMap m_hash_to_isa_map;
+
 protected:
-    typedef std::map<lldb::addr_t,TypeAndOrName> ClassNameMap;
-    typedef ClassNameMap::iterator ClassNameIterator;
-    ClassNameMap m_class_name_cache;
-    
+    uint32_t m_isa_to_descriptor_stop_id;
+
     typedef std::map<ConstString, lldb::TypeWP> CompleteClassMap;
     CompleteClassMap m_complete_class_cache;
+    
+    struct ConstStringSetHelpers {
+        size_t operator () (const ConstString& arg) const // for hashing
+        {
+            return (size_t)arg.GetCString();
+        }
+        bool operator () (const ConstString& arg1, const ConstString& arg2) const // for equality
+        {
+            return arg1.operator==(arg2);
+        }
+    };
+    typedef std::unordered_set<ConstString, ConstStringSetHelpers, ConstStringSetHelpers> CompleteClassSet;
+    CompleteClassSet m_negative_complete_class_cache;
+
+    ISAToDescriptorIterator
+    GetDescriptorIterator (const ConstString &name);
 
     DISALLOW_COPY_AND_ASSIGN (ObjCLanguageRuntime);
 };

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/OperatingSystem.h Thu Jun  6 19:06:43 2013
@@ -65,17 +65,28 @@ public:
     // Plug-in Methods
     //------------------------------------------------------------------
     virtual bool
-    UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list) = 0;
+    UpdateThreadList (ThreadList &old_thread_list,
+                      ThreadList &real_thread_list,
+                      ThreadList &new_thread_list) = 0;
     
     virtual void
     ThreadWasSelected (Thread *thread) = 0;
     
     virtual lldb::RegisterContextSP
-    CreateRegisterContextForThread (Thread *thread) = 0;
+    CreateRegisterContextForThread (Thread *thread, lldb::addr_t reg_data_addr) = 0;
 
     virtual lldb::StopInfoSP
     CreateThreadStopReason (Thread *thread) = 0;
 
+    virtual lldb::ThreadSP
+    CreateThread (lldb::tid_t tid, lldb::addr_t context)
+    {
+        return lldb::ThreadSP();
+    }
+    
+    virtual bool
+    IsOperatingSystemPluginThread (const lldb::ThreadSP &thread_sp);
+
 protected:
     //------------------------------------------------------------------
     // Member variables.

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/PathMappingList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/PathMappingList.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/PathMappingList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/PathMappingList.h Thu Jun  6 19:06:43 2013
@@ -86,9 +86,14 @@ public:
 
     bool
     Replace (const ConstString &path, 
-             const ConstString &new_path, 
+             const ConstString &replacement, 
+             bool notify);
+
+    bool
+    Replace (const ConstString &path,
+             const ConstString &replacement,
+             uint32_t index,
              bool notify);
-    
     bool
     RemapPath (const ConstString &path, ConstString &new_path) const;
 
@@ -139,6 +144,11 @@ public:
     uint32_t
     FindIndexForPath (const ConstString &path) const;
 
+    uint32_t
+    GetModificationID() const
+    {
+        return m_mod_id;
+    }
 protected:
     typedef std::pair <ConstString, ConstString> pair;
     typedef std::vector <pair> collection;
@@ -154,6 +164,7 @@ protected:
     collection m_pairs;
     ChangedCallback m_callback;
     void * m_callback_baton;
+    uint32_t m_mod_id; // Incremented anytime anything is added or removed.
 };
 
 } // namespace lldb_private

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h Thu Jun  6 19:06:43 2013
@@ -95,6 +95,23 @@ namespace lldb_private {
         ~Platform();
 
         //------------------------------------------------------------------
+        /// Find a platform plugin for a given process.
+        ///
+        /// Scans the installed Platform plug-ins and tries to find
+        /// an instance that can be used for \a process
+        ///
+        /// @param[in] process
+        ///     The process for which to try and locate a platform
+        ///     plug-in instance.
+        ///
+        /// @param[in] plugin_name
+        ///     An optional name of a specific platform plug-in that
+        ///     should be used. If NULL, pick the best plug-in.
+        //------------------------------------------------------------------
+        static Platform*
+        FindPlugin (Process *process, const ConstString &plugin_name);
+
+        //------------------------------------------------------------------
         /// Set the target's executable based off of the existing 
         /// architecture information in \a target given a path to an 
         /// executable \a exe_file.
@@ -119,6 +136,59 @@ namespace lldb_private {
                            lldb::ModuleSP &module_sp,
                            const FileSpecList *module_search_paths_ptr);
 
+        
+        //------------------------------------------------------------------
+        /// Find a symbol file given a symbol file module specification.
+        ///
+        /// Each platform might have tricks to find symbol files for an
+        /// executable given information in a symbol file ModuleSpec. Some
+        /// platforms might also support symbol files that are bundles and
+        /// know how to extract the right symbol file given a bundle.
+        ///
+        /// @param[in] target
+        ///     The target in which we are trying to resolve the symbol file.
+        ///     The target has a list of modules that we might be able to
+        ///     use in order to help find the right symbol file. If the
+        ///     "m_file" or "m_platform_file" entries in the \a sym_spec
+        ///     are filled in, then we might be able to locate a module in
+        ///     the target, extract its UUID and locate a symbol file.
+        ///     If just the "m_uuid" is specified, then we might be able
+        ///     to find the module in the target that matches that UUID
+        ///     and pair the symbol file along with it. If just "m_symbol_file"
+        ///     is specified, we can use a variety of tricks to locate the
+        ///     symbols in an SDK, PDK, or other development kit location.
+        ///
+        /// @param[in] sym_spec
+        ///     A module spec that describes some information about the
+        ///     symbol file we are trying to resolve. The ModuleSpec might
+        ///     contain the following:
+        ///     m_file - A full or partial path to an executable from the
+        ///              target (might be empty).
+        ///     m_platform_file - Another executable hint that contains
+        ///                       the path to the file as known on the
+        ///                       local/remote platform.
+        ///     m_symbol_file - A full or partial path to a symbol file
+        ///                     or symbol bundle that should be used when
+        ///                     trying to resolve the symbol file.
+        ///     m_arch - The architecture we are looking for when resolving
+        ///              the symbol file.
+        ///     m_uuid - The UUID of the executable and symbol file. This
+        ///              can often be used to match up an exectuable with
+        ///              a symbol file, or resolve an symbol file in a
+        ///              symbol file bundle.
+        ///
+        /// @param[out] sym_file
+        ///     The resolved symbol file spec if the returned error
+        ///     indicates succes.
+        ///
+        /// @return
+        ///     Returns an error that describes success or failure.
+        //------------------------------------------------------------------
+        virtual Error
+        ResolveSymbolFile (Target &target,
+                           const ModuleSpec &sym_spec,
+                           FileSpec &sym_file);
+
         //------------------------------------------------------------------
         /// Resolves the FileSpec to a (possibly) remote path. Remote
         /// platforms must override this to resolve to a path on the remote
@@ -146,7 +216,7 @@ namespace lldb_private {
 
         // Returns the the hostname if we are connected, else the short plugin
         // name.
-        const char *
+        ConstString
         GetName ();
 
         virtual const char *
@@ -239,6 +309,16 @@ namespace lldb_private {
                  const UUID *uuid_ptr,
                  FileSpec &local_file);
 
+        //----------------------------------------------------------------------
+        // Locate the scripting resource given a module specification.
+        //
+        // Locating the file should happen only on the local computer or using
+        // the current computers global settings.
+        //----------------------------------------------------------------------
+        virtual FileSpecList
+        LocateExecutableScriptingResources (Target *target,
+                                            Module &module);
+        
         virtual Error
         GetSharedModule (const ModuleSpec &module_spec, 
                          lldb::ModuleSP &module_sp,
@@ -286,7 +366,9 @@ namespace lldb_private {
         /// architecture and the target triple contained within.
         //------------------------------------------------------------------
         virtual bool
-        IsCompatibleArchitecture (const ArchSpec &arch, ArchSpec *compatible_arch_ptr = NULL);
+        IsCompatibleArchitecture (const ArchSpec &arch,
+                                  bool exact_arch_match,
+                                  ArchSpec *compatible_arch_ptr);
 
         //------------------------------------------------------------------
         /// Not all platforms will support debugging a process by spawning
@@ -416,13 +498,13 @@ namespace lldb_private {
         }
 
         // Used for column widths
-        uint32_t
+        size_t
         GetMaxUserIDNameLength() const
         {
             return m_max_uid_name_len;
         }
         // Used for column widths
-        uint32_t
+        size_t
         GetMaxGroupIDNameLength() const
         {
             return m_max_gid_name_len;
@@ -477,13 +559,15 @@ namespace lldb_private {
         virtual lldb::user_id_t
         OpenFile (const FileSpec& file_spec,
                   uint32_t flags,
-                  mode_t mode)
+                  mode_t mode,
+                  Error &error)
         {
             return UINT64_MAX;
         }
         
         virtual bool
-        CloseFile (lldb::user_id_t fd)
+        CloseFile (lldb::user_id_t fd,
+                   Error &error)
         {
             return false;
         }
@@ -494,18 +578,26 @@ namespace lldb_private {
             return UINT64_MAX;
         }
 
-        virtual uint32_t
-        ReadFile (lldb::user_id_t fd, uint64_t offset,
-                  void *data_ptr, size_t len)
+        virtual uint64_t
+        ReadFile (lldb::user_id_t fd,
+                  uint64_t offset,
+                  void *dst,
+                  uint64_t dst_len,
+                  Error &error)
+        {
+            error.SetErrorStringWithFormat ("Platform::ReadFile() is not supported in the %s platform", GetName().GetCString());
+            return -1;
+        }
+        
+        virtual uint64_t
+        WriteFile (lldb::user_id_t fd,
+                   uint64_t offset,
+                   const void* src,
+                   uint64_t src_len,
+                   Error &error)
         {
-            return UINT32_MAX;
-        }
-        
-        virtual uint32_t
-        WriteFile (lldb::user_id_t fd, uint64_t offset,
-                   void* data, size_t len)
-        {
-            return UINT32_MAX;
+            error.SetErrorStringWithFormat ("Platform::ReadFile() is not supported in the %s platform", GetName().GetCString());
+            return -1;
         }
         
         virtual Error
@@ -514,6 +606,9 @@ namespace lldb_private {
                  uint32_t uid = UINT32_MAX,
                  uint32_t gid = UINT32_MAX);
                 
+        virtual size_t
+        GetEnvironment (StringList &environment);
+        
         virtual Error
         GetFile (const FileSpec& source,
                  const FileSpec& destination);
@@ -521,6 +616,14 @@ namespace lldb_private {
         virtual bool
         GetFileExists (const lldb_private::FileSpec& file_spec);
         
+        virtual uint32_t
+        GetFilePermissions (const lldb_private::FileSpec &file_spec,
+                            Error &error)
+        {
+            error.SetErrorStringWithFormat ("Platform::GetFilePermissions() is not supported in the %s platform", GetName().GetCString());
+            return 0;
+        }
+
         virtual bool
         GetSupportsRSync ()
         {
@@ -646,8 +749,8 @@ namespace lldb_private {
         Mutex m_gid_map_mutex;
         IDToNameMap m_uid_map;
         IDToNameMap m_gid_map;
-        uint32_t m_max_uid_name_len;
-        uint32_t m_max_gid_name_len;
+        size_t m_max_uid_name_len;
+        size_t m_max_gid_name_len;
         bool m_supports_rsync;
         std::string m_rsync_opts;
         std::string m_rsync_prefix;

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Process.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Process.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Process.h Thu Jun  6 19:06:43 2013
@@ -49,74 +49,58 @@
 namespace lldb_private {
 
 //----------------------------------------------------------------------
-// ProcessInstanceSettings
+// ProcessProperties
 //----------------------------------------------------------------------
-class ProcessInstanceSettings : public InstanceSettings
+class ProcessProperties : public Properties
 {
 public:
-
-    ProcessInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-  
-    ProcessInstanceSettings (const ProcessInstanceSettings &rhs);
+    ProcessProperties(bool is_global);
 
     virtual
-    ~ProcessInstanceSettings ();
-  
-    ProcessInstanceSettings&
-    operator= (const ProcessInstanceSettings &rhs);
-  
-
-    void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending);
-
-    bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err);
-
-    bool GetDisableMemoryCache() const
-    {
-        return m_disable_memory_cache;
-    }
+    ~ProcessProperties();
     
-    const Args &
-    GetExtraStartupCommands () const
-    {
-        return m_extra_startup_commands;
-    }
+    bool
+    GetDisableMemoryCache() const;
+
+    Args
+    GetExtraStartupCommands () const;
+
+    void
+    SetExtraStartupCommands (const Args &args);
     
+    FileSpec
+    GetPythonOSPluginPath () const;
+
     void
-    SetExtraStartupCommands (const Args &args)
-    {
-        m_extra_startup_commands = args;
-    }
+    SetPythonOSPluginPath (const FileSpec &file);
     
-protected:
-    const ConstString &
-    GetDisableMemoryCacheVarName () const;
+    bool
+    GetIgnoreBreakpointsInExpressions () const;
     
-    const ConstString &
-    GetExtraStartupCommandVarName () const;
-
     void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending);
+    SetIgnoreBreakpointsInExpressions (bool ignore);
 
-    const ConstString
-    CreateInstanceName ();
+    bool
+    GetUnwindOnErrorInExpressions () const;
+    
+    void
+    SetUnwindOnErrorInExpressions (bool ignore);
+    
+    bool
+    GetStopOnSharedLibraryEvents () const;
     
-    bool        m_disable_memory_cache;
-    Args        m_extra_startup_commands;
+    void
+    SetStopOnSharedLibraryEvents (bool stop);
+    
+    bool
+    GetDetachKeepsStopped () const;
+    
+    void
+    SetDetachKeepsStopped (bool keep_stopped);
 };
 
+typedef std::shared_ptr<ProcessProperties> ProcessPropertiesSP;
+
 //----------------------------------------------------------------------
 // ProcessInfo
 //
@@ -294,15 +278,28 @@ public:
         return m_arguments;
     }
     
+    const char *
+    GetArg0 () const
+    {
+        if (m_arg0.empty())
+            return NULL;
+        return m_arg0.c_str();
+    }
+    
+    void
+    SetArg0 (const char *arg)
+    {
+        if (arg && arg[0])
+            m_arg0 = arg;
+        else
+            m_arg0.clear();
+    }
+    
     void
-    SetArguments (const Args& args, 
-                  bool first_arg_is_executable,
-                  bool first_arg_is_executable_and_argument);
+    SetArguments (const Args& args, bool first_arg_is_executable);
 
     void
-    SetArguments (char const **argv,
-                  bool first_arg_is_executable,
-                  bool first_arg_is_executable_and_argument);
+    SetArguments (char const **argv, bool first_arg_is_executable);
     
     Args &
     GetEnvironmentEntries ()
@@ -318,7 +315,11 @@ public:
     
 protected:
     FileSpec m_executable;
-    Args m_arguments;
+    std::string m_arg0; // argv[0] if supported. If empty, then use m_executable.
+                        // Not all process plug-ins support specifying an argv[0]
+                        // that differs from the resolved platform executable
+                        // (which is in m_executable)
+    Args m_arguments;   // All program arguments except argv[0]
     Args m_environment;
     uint32_t m_uid;
     uint32_t m_gid;    
@@ -654,7 +655,7 @@ public:
     const FileAction *
     GetFileActionForFD (int fd) const
     {
-        for (uint32_t idx=0, count=m_file_actions.size(); idx < count; ++idx)
+        for (size_t idx=0, count=m_file_actions.size(); idx < count; ++idx)
         {
             if (m_file_actions[idx].GetFD () == fd)
                 return &m_file_actions[idx];
@@ -1086,7 +1087,7 @@ public:
         m_infos.clear();
     }
     
-    uint32_t
+    size_t
     GetSize()
     {
         return m_infos.size();
@@ -1099,7 +1100,7 @@ public:
     }
 
     const char *
-    GetProcessNameAtIndex (uint32_t idx)
+    GetProcessNameAtIndex (size_t idx)
     {
         if (idx < m_infos.size())
             return m_infos[idx].GetName();
@@ -1107,7 +1108,7 @@ public:
     }
 
     size_t
-    GetProcessNameLengthAtIndex (uint32_t idx)
+    GetProcessNameLengthAtIndex (size_t idx)
     {
         if (idx < m_infos.size())
             return m_infos[idx].GetNameLength();
@@ -1115,7 +1116,7 @@ public:
     }
 
     lldb::pid_t
-    GetProcessIDAtIndex (uint32_t idx)
+    GetProcessIDAtIndex (size_t idx)
     {
         if (idx < m_infos.size())
             return m_infos[idx].GetProcessID();
@@ -1123,7 +1124,7 @@ public:
     }
 
     bool
-    GetInfoAtIndex (uint32_t idx, ProcessInstanceInfo &info)
+    GetInfoAtIndex (size_t idx, ProcessInstanceInfo &info)
     {
         if (idx < m_infos.size())
         {
@@ -1135,7 +1136,7 @@ public:
     
     // You must ensure "idx" is valid before calling this function
     const ProcessInstanceInfo &
-    GetProcessInfoAtIndex (uint32_t idx) const
+    GetProcessInfoAtIndex (size_t idx) const
     {
         assert (idx < m_infos.size());
         return m_infos[idx];
@@ -1158,6 +1159,7 @@ friend bool operator== (const ProcessMod
 public:
     ProcessModID () : 
         m_stop_id (0),
+        m_last_natural_stop_id(0),
         m_resume_id (0), 
         m_memory_id (0),
         m_last_user_expression_resume (0),
@@ -1182,7 +1184,9 @@ public:
     ~ProcessModID () {}
     
     void BumpStopID () { 
-        m_stop_id++; 
+        m_stop_id++;
+        if (!IsLastResumeForUserExpression())
+            m_last_natural_stop_id++;
     }
     
     void BumpMemoryID () { m_memory_id++; }
@@ -1194,6 +1198,7 @@ public:
     }
     
     uint32_t GetStopID() const { return m_stop_id; }
+    uint32_t GetLastNaturalStopID() const { return m_last_natural_stop_id; }
     uint32_t GetMemoryID () const { return m_memory_id; }
     uint32_t GetResumeID () const { return m_resume_id; }
     uint32_t GetLastUserExpressionResumeID () const { return m_last_user_expression_resume; }
@@ -1236,6 +1241,7 @@ public:
     
 private:
     uint32_t m_stop_id;
+    uint32_t m_last_natural_stop_id;
     uint32_t m_resume_id;
     uint32_t m_memory_id;
     uint32_t m_last_user_expression_resume;
@@ -1349,12 +1355,12 @@ protected:
 /// @brief A plug-in interface definition class for debugging a process.
 //----------------------------------------------------------------------
 class Process :
-    public STD_ENABLE_SHARED_FROM_THIS(Process),
+    public std::enable_shared_from_this<Process>,
+    public ProcessProperties,
     public UserID,
     public Broadcaster,
     public ExecutionContextScope,
-    public PluginInterface,
-    public ProcessInstanceSettings
+    public PluginInterface
 {
 friend class ThreadList;
 friend class ClangFunction; // For WaitForStateChangeEventsPrivate
@@ -1373,7 +1379,8 @@ public:
         eBroadcastBitStateChanged   = (1 << 0),
         eBroadcastBitInterrupt      = (1 << 1),
         eBroadcastBitSTDOUT         = (1 << 2),
-        eBroadcastBitSTDERR         = (1 << 3)
+        eBroadcastBitSTDERR         = (1 << 3),
+        eBroadcastBitProfileData    = (1 << 4)
     };
 
     enum
@@ -1403,6 +1410,7 @@ public:
         return GetStaticBroadcasterClass();
     }
 
+    
     //------------------------------------------------------------------
     /// A notification structure that can be used by clients to listen
     /// for changes in a process's lifetime.
@@ -1450,6 +1458,22 @@ public:
             {
                 return m_restarted;
             }
+        
+            size_t
+            GetNumRestartedReasons ()
+            {
+                return m_restarted_reasons.size();
+            }
+        
+            const char *
+            GetRestartedReasonAtIndex(size_t idx)
+            {
+                if (idx > m_restarted_reasons.size())
+                    return NULL;
+                else
+                    return m_restarted_reasons[idx].c_str();
+            }
+        
             bool
             GetInterrupted () const
             {
@@ -1473,6 +1497,15 @@ public:
 
             static bool
             GetRestartedFromEvent (const Event *event_ptr);
+        
+            static size_t
+            GetNumRestartedReasons(const Event *event_ptr);
+        
+            static const char *
+            GetRestartedReasonAtIndex(const Event *event_ptr, size_t idx);
+        
+            static void
+            AddRestartedReason (Event *event_ptr, const char *reason);
 
             static void
             SetRestartedInEvent (Event *event_ptr, bool new_value);
@@ -1503,9 +1536,15 @@ public:
             {
                 m_interrupted = new_value;
             }
+            void
+            AddRestartedReason (const char *reason)
+            {
+                m_restarted_reasons.push_back(reason);
+            }
 
             lldb::ProcessSP m_process_sp;
             lldb::StateType m_state;
+            std::vector<std::string> m_restarted_reasons;
             bool m_restarted;  // For "eStateStopped" events, this is true if the target was automatically restarted.
             int m_update_state;
             bool m_interrupted;
@@ -1513,31 +1552,6 @@ public:
 
     };
 
-    class SettingsController : public UserSettingsController
-    {
-    public:
-        
-        SettingsController ();
-
-        virtual
-        ~SettingsController ();
-
-        static SettingEntry global_settings_table[];
-        static SettingEntry instance_settings_table[];
-
-    protected:
-
-        lldb::InstanceSettingsSP
-        CreateInstanceSettings (const char *instance_name);
-
-    private:
-
-        // Class-wide settings.
-
-        DISALLOW_COPY_AND_ASSIGN (SettingsController);
-    };
-
-
 #endif
 
     static void
@@ -1545,14 +1559,10 @@ public:
 
     static void
     SettingsTerminate ();
-
-    static lldb::UserSettingsControllerSP &
-    GetSettingsController ();
-
-    void
-    UpdateInstanceName ();
-
     
+    static const ProcessPropertiesSP &
+    GetGlobalProperties();
+
     //------------------------------------------------------------------
     /// Construct with a shared pointer to a target, and the Process listener.
     //------------------------------------------------------------------
@@ -1620,6 +1630,11 @@ public:
     uint32_t
     GetAddressByteSize () const;
 
+    uint32_t
+    GetUniqueID() const
+    {
+        return m_process_unique_id;
+    }
     //------------------------------------------------------------------
     /// Check if a plug-in instance can debug the file in \a module.
     ///
@@ -1644,6 +1659,40 @@ public:
     //------------------------------------------------------------------
     virtual void
     Finalize();
+    
+    
+    //------------------------------------------------------------------
+    /// Return whether this object is valid (i.e. has not been finalized.)
+    ///
+    /// @return
+    ///     Returns \b true if this Process has not been finalized
+    ///     and \b false otherwise.
+    //------------------------------------------------------------------
+    bool
+    IsValid() const
+    {
+        return !m_finalize_called;
+    }
+
+    //------------------------------------------------------------------
+    /// Return a multi-word command object that can be used to expose
+    /// plug-in specific commands.
+    ///
+    /// This object will be used to resolve plug-in commands and can be
+    /// triggered by a call to:
+    ///
+    ///     (lldb) process commmand <args>
+    ///
+    /// @return
+    ///     A CommandObject which can be one of the concrete subclasses
+    ///     of CommandObject like CommandObjectRaw, CommandObjectParsed,
+    ///     or CommandObjectMultiword.
+    //------------------------------------------------------------------
+    virtual CommandObject *
+    GetPluginCommandObject()
+    {
+        return NULL;
+    }
 
     //------------------------------------------------------------------
     /// Launch a new process.
@@ -1704,7 +1753,7 @@ public:
     DoLoadCore ()
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support loading core files.", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support loading core files.", GetPluginName().GetCString());
         return error;
     }
     
@@ -1740,8 +1789,22 @@ public:
     virtual Error
     Attach (ProcessAttachInfo &attach_info);
 
+    //------------------------------------------------------------------
+    /// Attach to a remote system via a URL
+    ///
+    /// @param[in] strm
+    ///     A stream where output intended for the user
+    ///     (if the driver has a way to display that) generated during
+    ///     the connection.  This may be NULL if no output is needed.A
+    ///
+    /// @param[in] remote_url
+    ///     The URL format that we are connecting to.
+    ///
+    /// @return
+    ///     Returns an error object.
+    //------------------------------------------------------------------
     virtual Error
-    ConnectRemote (const char *remote_url);
+    ConnectRemote (Stream *strm, const char *remote_url);
 
     bool
     GetShouldDetach () const
@@ -1879,12 +1942,15 @@ public:
     /// process event with GetInterrupted will be broadcast.  If false, we will
     /// halt the process with no events generated by the halt.
     ///
+    /// @param[in] clear_thread_plans
+    ///     If true, when the process stops, clear all thread plans.
+    ///
     /// @return
     ///     Returns an error object.  If the error is empty, the process is halted.
     ///     otherwise the halt has failed.
     //------------------------------------------------------------------
     Error
-    Halt ();
+    Halt (bool clear_thread_plans = false);
 
     //------------------------------------------------------------------
     /// Detaches from a running or stopped process.
@@ -1892,11 +1958,14 @@ public:
     /// This function is not meant to be overridden by Process
     /// subclasses.
     ///
+    /// @param[in] keep_stopped
+    ///     If true, don't resume the process on detach.
+    ///
     /// @return
     ///     Returns an error object.
     //------------------------------------------------------------------
     Error
-    Detach ();
+    Detach (bool keep_stopped);
 
     //------------------------------------------------------------------
     /// Kills the process and shuts down all threads that were spawned
@@ -1963,8 +2032,22 @@ public:
         return Error(); 
     }
 
+    //------------------------------------------------------------------
+    /// Attach to a remote system via a URL
+    ///
+    /// @param[in] strm
+    ///     A stream where output intended for the user 
+    ///     (if the driver has a way to display that) generated during
+    ///     the connection.  This may be NULL if no output is needed.A
+    ///
+    /// @param[in] remote_url
+    ///     The URL format that we are connecting to.
+    ///
+    /// @return
+    ///     Returns an error object.
+    //------------------------------------------------------------------
     virtual Error
-    DoConnectRemote (const char *remote_url)
+    DoConnectRemote (Stream *strm, const char *remote_url)
     {
         Error error;
         error.SetErrorString ("remote connections are not supported");
@@ -1985,7 +2068,7 @@ public:
     DoAttachToProcessWithID (lldb::pid_t pid)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetPluginName().GetCString());
         return error;
     }
 
@@ -2008,7 +2091,7 @@ public:
     DoAttachToProcessWithID (lldb::pid_t pid,  const ProcessAttachInfo &attach_info)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetPluginName().GetCString());
         return error;
     }
 
@@ -2050,6 +2133,27 @@ public:
 
 
     //------------------------------------------------------------------
+    /// Called after a process re-execs itself.
+    ///
+    /// Allow Process plug-ins to execute some code after a process has
+    /// exec'ed itself. Subclasses typically should override DoDidExec()
+    /// as the lldb_private::Process class needs to remove its dynamic
+    /// loader, runtime, ABI and other plug-ins, as well as unload all
+    /// shared libraries.
+    //------------------------------------------------------------------
+    virtual void
+    DidExec ();
+
+    //------------------------------------------------------------------
+    /// Subclasses of Process should implement this function if they
+    /// need to do anything after a process exec's itself.
+    //------------------------------------------------------------------
+    virtual void
+    DoDidExec ()
+    {
+    }
+
+    //------------------------------------------------------------------
     /// Called before launching to a process.
     ///
     /// Allow Process plug-ins to execute some code before launching a
@@ -2113,7 +2217,7 @@ public:
               const ProcessLaunchInfo &launch_info)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support launching processes", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support launching processes", GetPluginName().GetCString());
         return error;
     }
 
@@ -2162,7 +2266,7 @@ public:
     DoResume ()
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support resuming processes", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support resuming processes", GetPluginName().GetCString());
         return error;
     }
 
@@ -2211,7 +2315,7 @@ public:
     DoHalt (bool &caused_stop)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support halting processes", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support halting processes", GetPluginName().GetCString());
         return error;
     }
 
@@ -2248,10 +2352,10 @@ public:
     ///     false otherwise.
     //------------------------------------------------------------------
     virtual Error
-    DoDetach ()
+    DoDetach (bool keep_stopped)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support detaching from processes", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support detaching from processes", GetPluginName().GetCString());
         return error;
     }
 
@@ -2264,6 +2368,9 @@ public:
     //------------------------------------------------------------------
     virtual void
     DidDetach () {}
+    
+    virtual bool
+    DetachRequiresHalt() { return false; }
 
     //------------------------------------------------------------------
     /// Called before sending a signal to a process.
@@ -2289,7 +2396,7 @@ public:
     DoSignal (int signal)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support senging signals to processes", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support senging signals to processes", GetPluginName().GetCString());
         return error;
     }
 
@@ -2301,6 +2408,9 @@ public:
 
     virtual void
     DidDestroy () { }
+    
+    virtual bool
+    DestroyRequiresHalt() { return true; }
 
 
     //------------------------------------------------------------------
@@ -2382,9 +2492,10 @@ public:
     RunThreadPlan (ExecutionContext &exe_ctx,    
                     lldb::ThreadPlanSP &thread_plan_sp,
                     bool stop_others,
-                    bool try_all_threads,
-                    bool discard_on_error,
-                    uint32_t single_thread_timeout_usec,
+                    bool run_others,
+                    bool unwind_on_error,
+                    bool ignore_breakpoints,
+                    uint32_t timeout_usec,
                     Stream &errors);
 
     static const char *
@@ -2490,6 +2601,12 @@ public:
         return m_mod_id.GetLastUserExpressionResumeID();
     }
     
+    uint32_t
+    GetLastNaturalStopID()
+    {
+        return m_mod_id.GetLastNaturalStopID();
+    }
+    
     //------------------------------------------------------------------
     /// Set accessor for the process exit status (return code).
     ///
@@ -2520,6 +2637,20 @@ public:
     IsAlive () = 0;
 
     //------------------------------------------------------------------
+    /// Before lldb detaches from a process, it warns the user that they are about to lose their debug session.
+    /// In some cases, this warning doesn't need to be emitted -- for instance, with core file debugging where 
+    /// the user can reconstruct the "state" by simply re-running the debugger on the core file.  
+    ///
+    /// @return
+    //      true if the user should be warned about detaching from this process.
+    //------------------------------------------------------------------
+    virtual bool
+    WarnBeforeDetach () const
+    {
+        return true;
+    }
+
+    //------------------------------------------------------------------
     /// Actually do the reading of memory from a process.
     ///
     /// Subclasses must override this function and can return fewer 
@@ -2583,10 +2714,46 @@ public:
                 Error &error);
 
     //------------------------------------------------------------------
+    /// Read a NULL terminated string from memory
+    ///
+    /// This function will read a cache page at a time until a NULL
+    /// string terminator is found. It will stop reading if an aligned
+    /// sequence of NULL termination \a type_width bytes is not found
+    /// before reading \a cstr_max_len bytes.  The results are always 
+    /// guaranteed to be NULL terminated, and that no more than
+    /// (max_bytes - type_width) bytes will be read.
+    ///
+    /// @param[in] vm_addr
+    ///     The virtual load address to start the memory read.
+    ///
+    /// @param[in] str
+    ///     A character buffer containing at least max_bytes.
+    ///
+    /// @param[in] max_bytes
+    ///     The maximum number of bytes to read.
+    ///
+    /// @param[in] error
+    ///     The error status of the read operation.
+    ///
+    /// @param[in] type_width
+    ///     The size of the null terminator (1 to 4 bytes per
+    ///     character).  Defaults to 1.
+    ///
+    /// @return
+    ///     The error status or the number of bytes prior to the null terminator.
+    //------------------------------------------------------------------
+    size_t
+    ReadStringFromMemory (lldb::addr_t vm_addr, 
+                           char *str, 
+                           size_t max_bytes,
+                           Error &error,
+                           size_t type_width = 1);
+
+    //------------------------------------------------------------------
     /// Read a NULL terminated C string from memory
     ///
     /// This function will read a cache page at a time until the NULL
-    /// C stirng terminator is found. It will stop reading if the NULL
+    /// C string terminator is found. It will stop reading if the NULL
     /// termination byte isn't found before reading \a cstr_max_len
     /// bytes, and the results are always guaranteed to be NULL 
     /// terminated (at most cstr_max_len - 1 bytes will be read).
@@ -2673,7 +2840,7 @@ public:
     virtual size_t
     DoWriteMemory (lldb::addr_t vm_addr, const void *buf, size_t size, Error &error)
     {
-        error.SetErrorStringWithFormat("error: %s does not support writing to processes", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support writing to processes", GetPluginName().GetCString());
         return 0;
     }
 
@@ -2713,7 +2880,7 @@ public:
     size_t
     WriteScalarToMemory (lldb::addr_t vm_addr, 
                          const Scalar &scalar, 
-                         uint32_t size, 
+                         size_t size, 
                          Error &error);
 
     size_t
@@ -2770,7 +2937,7 @@ public:
     virtual lldb::addr_t
     DoAllocateMemory (size_t size, uint32_t permissions, Error &error)
     {
-        error.SetErrorStringWithFormat("error: %s does not support allocating in the debug process", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support allocating in the debug process", GetPluginName().GetCString());
         return LLDB_INVALID_ADDRESS;
     }
 
@@ -2801,6 +2968,28 @@ public:
     lldb::addr_t
     AllocateMemory (size_t size, uint32_t permissions, Error &error);
 
+
+    //------------------------------------------------------------------
+    /// Resolve dynamically loaded indirect functions.
+    ///
+    /// @param[in] address
+    ///     The load address of the indirect function to resolve.
+    ///
+    /// @param[out] error
+    ///     An error value in case the resolve fails.
+    ///
+    /// @return
+    ///     The address of the resolved function.
+    ///     LLDB_INVALID_ADDRESS if the resolution failed.
+    //------------------------------------------------------------------
+
+    virtual lldb::addr_t
+    ResolveIndirectFunction(const Address *address, Error &error)
+    {
+        error.SetErrorStringWithFormat("error: %s does not support indirect functions in the debug process", GetPluginName().GetCString());
+        return LLDB_INVALID_ADDRESS;
+    }
+
     virtual Error
     GetMemoryRegionInfo (lldb::addr_t load_addr, 
                         MemoryRegionInfo &range_info)
@@ -2814,6 +3003,7 @@ public:
     GetWatchpointSupportInfo (uint32_t &num)
     {
         Error error;
+        num = 0;
         error.SetErrorString ("Process::GetWatchpointSupportInfo() not supported");
         return error;
     }
@@ -2822,15 +3012,15 @@ public:
     GetWatchpointSupportInfo (uint32_t &num, bool& after)
     {
         Error error;
+        num = 0;
+        after = true;
         error.SetErrorString ("Process::GetWatchpointSupportInfo() not supported");
         return error;
     }
     
     lldb::ModuleSP
     ReadModuleFromMemory (const FileSpec& file_spec, 
-                          lldb::addr_t header_addr,
-                          bool add_image_to_target,
-                          bool load_sections_in_target);
+                          lldb::addr_t header_addr);
 
     //------------------------------------------------------------------
     /// Attempt to get the attributes for a region of memory in the process.
@@ -2917,7 +3107,7 @@ public:
     DoDeallocateMemory (lldb::addr_t ptr)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support deallocating in the debug process", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support deallocating in the debug process", GetPluginName().GetCString());
         return error;
     }
 
@@ -2938,7 +3128,7 @@ public:
 
     Error
     DeallocateMemory (lldb::addr_t ptr);
-
+    
     //------------------------------------------------------------------
     /// Get any available STDOUT.
     ///
@@ -2994,6 +3184,24 @@ public:
         return 0;
     }
 
+    //------------------------------------------------------------------
+    /// Get any available profile data.
+    ///
+    /// @param[out] buf
+    ///     A buffer that will receive any profile data bytes that are
+    ///     currently available.
+    ///
+    /// @param[out] buf_size
+    ///     The size in bytes for the buffer \a buf.
+    ///
+    /// @return
+    ///     The number of bytes written into \a buf. If this value is
+    ///     equal to \a buf_size, another call to this function should
+    ///     be made to retrieve more profile data.
+    //------------------------------------------------------------------
+    virtual size_t
+    GetAsyncProfileData (char *buf, size_t buf_size, Error &error);
+    
     //----------------------------------------------------------------------
     // Process Breakpoints
     //----------------------------------------------------------------------
@@ -3001,19 +3209,19 @@ public:
     GetSoftwareBreakpointTrapOpcode (BreakpointSite* bp_site);
 
     virtual Error
-    EnableBreakpoint (BreakpointSite *bp_site)
+    EnableBreakpointSite (BreakpointSite *bp_site)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support enabling breakpoints", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support enabling breakpoints", GetPluginName().GetCString());
         return error;
     }
 
 
     virtual Error
-    DisableBreakpoint (BreakpointSite *bp_site)
+    DisableBreakpointSite (BreakpointSite *bp_site)
     {
         Error error;
-        error.SetErrorStringWithFormat("error: %s does not support disabling breakpoints", GetShortPluginName());
+        error.SetErrorStringWithFormat("error: %s does not support disabling breakpoints", GetPluginName().GetCString());
         return error;
     }
 
@@ -3056,10 +3264,7 @@ public:
 
 
     // BreakpointLocations use RemoveOwnerFromBreakpointSite to remove
-    // themselves from the owner's list of this breakpoint sites.  This has to
-    // be a static function because you can't be sure that removing the
-    // breakpoint from it's containing map won't delete the breakpoint site,
-    // and doing that in an instance method isn't copasetic.
+    // themselves from the owner's list of this breakpoint sites.
     void
     RemoveOwnerFromBreakpointSite (lldb::user_id_t owner_id,
                                    lldb::user_id_t owner_loc_id,
@@ -3069,10 +3274,10 @@ public:
     // Process Watchpoints (optional)
     //----------------------------------------------------------------------
     virtual Error
-    EnableWatchpoint (Watchpoint *wp);
+    EnableWatchpoint (Watchpoint *wp, bool notify = true);
 
     virtual Error
-    DisableWatchpoint (Watchpoint *wp);
+    DisableWatchpoint (Watchpoint *wp, bool notify = true);
 
     //------------------------------------------------------------------
     // Thread Queries
@@ -3088,10 +3293,25 @@ public:
     {
         return m_thread_list;
     }
-
-
+    
+    // This is obsoleted and will be removed very soon.
     uint32_t
     GetNextThreadIndexID ();
+    
+    uint32_t
+    GetNextThreadIndexID (uint64_t thread_id);
+    
+    lldb::ThreadSP
+    CreateOSPluginThread (lldb::tid_t tid, lldb::addr_t context);
+    
+    // Returns true if an index id has been assigned to a thread.
+    bool
+    HasAssignedIndexIDToThread(uint64_t sb_thread_id);
+    
+    // Given a thread_id, it will assign a more reasonable index id for display to the user.
+    // If the thread_id has previously been assigned, the same index id will be used.
+    uint32_t
+    AssignIndexIDToThread(uint64_t thread_id);
 
     //------------------------------------------------------------------
     // Event Handling
@@ -3100,7 +3320,7 @@ public:
     GetNextEvent (lldb::EventSP &event_sp);
 
     lldb::StateType
-    WaitForProcessToStop (const TimeValue *timeout);
+    WaitForProcessToStop (const TimeValue *timeout, lldb::EventSP *event_sp_ptr = NULL);
 
     lldb::StateType
     WaitForStateChangedEvents (const TimeValue *timeout, lldb::EventSP &event_sp);
@@ -3114,8 +3334,7 @@ public:
     {
     public:
         ProcessEventHijacker (Process &process, Listener *listener) :
-            m_process (process),
-            m_listener (listener)
+            m_process (process)
         {
             m_process.HijackProcessEvents (listener);
         }
@@ -3126,7 +3345,6 @@ public:
          
     private:
         Process &m_process;
-        Listener *m_listener;
     };
     friend class ProcessEventHijacker;
     //------------------------------------------------------------------
@@ -3153,13 +3371,15 @@ public:
     void
     RestoreProcessEvents ();
 
-protected:
+private:
     //------------------------------------------------------------------
     /// This is the part of the event handling that for a process event.
     /// It decides what to do with the event and returns true if the
     /// event needs to be propagated to the user, and false otherwise.
     /// If the event is not propagated, this call will most likely set
     /// the target to executing again.
+    /// There is only one place where this call should be called, HandlePrivateEvent.
+    /// Don't call it from anywhere else...
     ///
     /// @param[in] event_ptr
     ///     This is the event we are handling.
@@ -3310,9 +3530,81 @@ public:
     ReadWriteLock &
     GetRunLock ()
     {
-        return m_run_lock;
+        // The "m_private_run_lock" causes problems for other platforms
+        // right now, so we are leaving this in for Apple builds only
+        // until we can get the kinks worked out.
+        if (Host::GetCurrentThread() == m_private_state_thread)
+            return m_private_run_lock;
+        else
+            return m_public_run_lock;
     }
-
+    
+    //------------------------------------------------------------------
+    // This is a cache of reserved and available memory address ranges
+    // for a single modification ID (see m_mod_id).  It's meant for use
+    // by IRMemoryMap, but to stick with the process.  These memory
+    // ranges happen to be unallocated in the underlying process, but we
+    // make no guarantee that at a future modification ID they won't be
+    // gone.  This is only useful if the underlying process can't
+    // allocate memory.
+    //
+    // When a memory space is determined to be available it is
+    // registered as reserved at the current modification.  If it is
+    // freed later, it is added to the free list if the modification ID
+    // hasn't changed.  Then clients can simply query the free list for
+    // the size they want.
+    //------------------------------------------------------------------
+    class ReservationCache
+    {
+    public:
+        ReservationCache (Process &process);
+        
+        //------------------------------------------------------------------
+        // Mark that a particular range of addresses is in use.  Adds it
+        // to the reserved map, implicitly tying it to the current
+        // modification ID.
+        //------------------------------------------------------------------
+        void
+        Reserve (lldb::addr_t addr, size_t size);
+        
+        //------------------------------------------------------------------
+        // Mark that a range is no longer in use.  If it's found in the
+        // reservation list, that means that the modification ID hasn't
+        // changed since it was reserved, so it can be safely added to the
+        // free list.
+        //------------------------------------------------------------------
+        void
+        Unreserve (lldb::addr_t addr);
+        
+        //------------------------------------------------------------------
+        // Try to find an unused range of the given size in the free list.
+        //------------------------------------------------------------------
+        lldb::addr_t
+        Find (size_t size);
+    private:
+        //------------------------------------------------------------------
+        // Clear all lists if the modification ID has changed.
+        //------------------------------------------------------------------
+        void CheckModID();
+        
+        typedef std::map <lldb::addr_t, size_t> ReservedMap;
+        typedef std::vector <lldb::addr_t> FreeList;
+        typedef std::map <size_t, FreeList> FreeMap;
+        
+        ReservedMap     m_reserved_cache;
+        FreeMap         m_free_cache;
+        
+        Process        &m_process;
+        ProcessModID    m_mod_id;
+    };
+    
+    ReservationCache &
+    GetReservationCache ()
+    {
+        return m_reservation_cache;
+    }
+private:
+    ReservationCache m_reservation_cache;
 protected:
     //------------------------------------------------------------------
     // NextEventAction provides a way to register an action on the next
@@ -3321,6 +3613,9 @@ protected:
     // new "NextEventAction" is added while one is already present, the
     // old action will be discarded (with HandleBeingUnshipped called 
     // after it is discarded.)
+    //
+    // If you want to resume the process as a result of a resume action,
+    // call RequestResume, don't call Resume directly.
     //------------------------------------------------------------------
     class NextEventAction
     {
@@ -3346,6 +3641,10 @@ protected:
         virtual void HandleBeingUnshipped () {}
         virtual EventActionResult HandleBeingInterrupted () = 0;
         virtual const char *GetExitString() = 0;
+        void RequestResume()
+        {
+            m_process->m_resume_requested = true;
+        }
     protected:
         Process *m_process;
     };
@@ -3421,33 +3720,47 @@ protected:
     Predicate<bool>             m_private_state_control_wait; /// This Predicate is used to signal that a control operation is complete.
     lldb::thread_t              m_private_state_thread;  // Thread ID for the thread that watches interal state events
     ProcessModID                m_mod_id;               ///< Tracks the state of the process over stops and other alterations.
+    uint32_t                    m_process_unique_id;    ///< Each lldb_private::Process class that is created gets a unique integer ID that increments with each new instance
     uint32_t                    m_thread_index_id;      ///< Each thread is created with a 1 based index that won't get re-used.
+    std::map<uint64_t, uint32_t> m_thread_id_to_index_id_map;
     int                         m_exit_status;          ///< The exit status of the process, or -1 if not set.
     std::string                 m_exit_string;          ///< A textual description of why a process exited.
-    ThreadList                  m_thread_list;          ///< The threads for this process.
+    Mutex                       m_thread_mutex;
+    ThreadList                  m_thread_list_real;     ///< The threads for this process as are known to the protocol we are debugging with
+    ThreadList                  m_thread_list;          ///< The threads for this process as the user will see them. This is usually the same as
+                                                        ///< m_thread_list_real, but might be different if there is an OS plug-in creating memory threads
     std::vector<Notifications>  m_notifications;        ///< The list of notifications that this process can deliver.
     std::vector<lldb::addr_t>   m_image_tokens;
     Listener                    &m_listener;
     BreakpointSiteList          m_breakpoint_site_list; ///< This is the list of breakpoint locations we intend to insert in the target.
-    std::auto_ptr<DynamicLoader> m_dyld_ap;
-    std::auto_ptr<DynamicCheckerFunctions> m_dynamic_checkers_ap; ///< The functions used by the expression parser to validate data that expressions use.
-    std::auto_ptr<OperatingSystem> m_os_ap;
+    std::unique_ptr<DynamicLoader> m_dyld_ap;
+    std::unique_ptr<DynamicCheckerFunctions> m_dynamic_checkers_ap; ///< The functions used by the expression parser to validate data that expressions use.
+    std::unique_ptr<OperatingSystem> m_os_ap;
     UnixSignals                 m_unix_signals;         /// This is the current signal set for this process.
     lldb::ABISP                 m_abi_sp;
     lldb::InputReaderSP         m_process_input_reader;
-    Communication 				m_stdio_communication;
-    Mutex        				m_stdio_communication_mutex;
+    Communication               m_stdio_communication;
+    Mutex                       m_stdio_communication_mutex;
     std::string                 m_stdout_data;
     std::string                 m_stderr_data;
+    Mutex                       m_profile_data_comm_mutex;
+    std::vector<std::string>    m_profile_data;
     MemoryCache                 m_memory_cache;
     AllocatedMemoryCache        m_allocated_memory_cache;
     bool                        m_should_detach;   /// Should we detach if the process object goes away with an explicit call to Kill or Detach?
-    LanguageRuntimeCollection 	m_language_runtimes;
-    std::auto_ptr<NextEventAction> m_next_event_action_ap;
+    LanguageRuntimeCollection   m_language_runtimes;
+    std::unique_ptr<NextEventAction> m_next_event_action_ap;
     std::vector<PreResumeCallbackAndBaton> m_pre_resume_actions;
-    ReadWriteLock               m_run_lock;
-    Predicate<bool>             m_currently_handling_event;
-
+    ReadWriteLock               m_public_run_lock;
+    ReadWriteLock               m_private_run_lock;
+    Predicate<bool>             m_currently_handling_event; // This predicate is set in HandlePrivateEvent while all its business is being done.
+    bool                        m_currently_handling_do_on_removals;
+    bool                        m_resume_requested;         // If m_currently_handling_event or m_currently_handling_do_on_removals are true, Resume will only request a resume, using this flag to check.
+    bool                        m_finalize_called;
+    bool                        m_clear_thread_plans_on_stop;
+    lldb::StateType             m_last_broadcast_state;   /// This helps with the Public event coalescing in ShouldBroadcastEvent.
+    bool m_destroy_in_process;
+    
     enum {
         eCanJITDontKnow= 0,
         eCanJITYes,
@@ -3461,7 +3774,7 @@ protected:
     SynchronouslyNotifyStateChanged (lldb::StateType state);
 
     void
-    SetPublicState (lldb::StateType new_state);
+    SetPublicState (lldb::StateType new_state, bool restarted);
 
     void
     SetPrivateState (lldb::StateType state);
@@ -3513,6 +3826,9 @@ protected:
     void
     AppendSTDERR (const char *s, size_t len);
     
+    void
+    BroadcastAsyncProfileData(const char *s, size_t len);
+    
     static void
     STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len);
     
@@ -3532,13 +3848,15 @@ protected:
                                 const char *bytes,
                                 size_t bytes_len);
     
+    Error
+    HaltForDestroyOrDetach(lldb::EventSP &exit_event_sp);
     
 private:
     //------------------------------------------------------------------
     // For Process only
     //------------------------------------------------------------------
     void ControlPrivateStateThread (uint32_t signal);
-
+    
     DISALLOW_COPY_AND_ASSIGN (Process);
 
 };

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/RegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/RegisterContext.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/RegisterContext.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/RegisterContext.h Thu Jun  6 19:06:43 2013
@@ -20,7 +20,7 @@
 namespace lldb_private {
 
 class RegisterContext :
-    public STD_ENABLE_SHARED_FROM_THIS(RegisterContext),
+    public std::enable_shared_from_this<RegisterContext>,
     public ExecutionContextScope
 {
 public:
@@ -45,13 +45,13 @@ public:
     GetRegisterCount () = 0;
 
     virtual const RegisterInfo *
-    GetRegisterInfoAtIndex (uint32_t reg) = 0;
+    GetRegisterInfoAtIndex (size_t reg) = 0;
 
     virtual size_t
     GetRegisterSetCount () = 0;
 
     virtual const RegisterSet *
-    GetRegisterSet (uint32_t reg_set) = 0;
+    GetRegisterSet (size_t reg_set) = 0;
 
     virtual bool
     ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0;
@@ -72,6 +72,9 @@ public:
     virtual bool
     WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) = 0;
     
+    bool
+    CopyFromRegisterContext (lldb::RegisterContextSP context);
+    
     virtual uint32_t
     ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num) = 0;
 
@@ -108,10 +111,10 @@ public:
     //------------------------------------------------------------------
     // Subclasses should not override these
     //------------------------------------------------------------------
-    lldb::tid_t
+    virtual lldb::tid_t
     GetThreadID() const;
 
-    Thread &
+    virtual Thread &
     GetThread ()
     {
         return m_thread;

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h Thu Jun  6 19:06:43 2013
@@ -38,6 +38,9 @@ public:
 
     ~SectionLoadList()
     {
+        // Call clear since this takes a lock and clears the section load list
+        // in case another thread is currently using this section load list
+        Clear();
     }
 
     bool

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h Thu Jun  6 19:06:43 2013
@@ -27,7 +27,7 @@
 namespace lldb_private {
 
 class StackFrame :
-    public STD_ENABLE_SHARED_FROM_THIS(StackFrame),
+    public std::enable_shared_from_this<StackFrame>,
     public ExecutionContextScope
 {
 public:
@@ -130,10 +130,7 @@ public:
     IsInlined ();
 
     uint32_t
-    GetFrameIndex () const
-    {
-        return m_frame_index;
-    }
+    GetFrameIndex () const;
 
     uint32_t
     GetConcreteFrameIndex () const

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h Thu Jun  6 19:06:43 2013
@@ -55,7 +55,19 @@ public:
     // Mark a stack frame as the current frame using the frame index
     bool
     SetSelectedFrameByIndex (uint32_t idx);
-
+    
+    uint32_t
+    GetVisibleStackFrameIndex(uint32_t idx)
+    {
+        if (m_current_inlined_depth < UINT32_MAX)
+            return idx - m_current_inlined_depth;
+        else
+            return idx;
+    }
+    
+    void
+    CalculateCurrentInlinedDepth ();
+    
     void
     SetDefaultFileAndLineToSelectedFrame();
 
@@ -86,7 +98,7 @@ protected:
     SetFrameAtIndex (uint32_t idx, lldb::StackFrameSP &frame_sp);
 
     static void
-    Merge (std::auto_ptr<StackFrameList>& curr_ap, 
+    Merge (std::unique_ptr<StackFrameList>& curr_ap,
            lldb::StackFrameListSP& prev_sp);
 
     void
@@ -104,6 +116,18 @@ protected:
         m_concrete_frames_fetched = UINT32_MAX;
     }
     
+    bool
+    DecrementCurrentInlinedDepth ();
+    
+    void
+    ResetCurrentInlinedDepth();
+
+    uint32_t
+    GetCurrentInlinedDepth ();
+    
+    void
+    SetCurrentInlinedDepth (uint32_t new_depth);
+    
     //------------------------------------------------------------------
     // Classes that inherit from StackFrameList can see and modify these
     //------------------------------------------------------------------
@@ -117,6 +141,8 @@ protected:
     collection m_frames;
     uint32_t m_selected_frame_idx;
     uint32_t m_concrete_frames_fetched;
+    uint32_t m_current_inlined_depth;
+    lldb::addr_t m_current_inlined_pc;
     bool m_show_inlined_frames;
 
 private:

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h Thu Jun  6 19:06:43 2013
@@ -17,12 +17,15 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/lldb-public.h"
+#include "lldb/Target/Process.h"
 
 namespace lldb_private {
 
 class StopInfo
 {
-    friend class Process;
+    friend class Process::ProcessEventData;
+    friend class ThreadPlanBase;
+    
 public:
     //------------------------------------------------------------------
     // Constructors and Destructors
@@ -37,16 +40,16 @@ public:
     bool
     IsValid () const;
 
-    Thread &
-    GetThread()
+    void
+    SetThread (const lldb::ThreadSP &thread_sp)
     {
-        return m_thread;
+        m_thread_wp = thread_sp;
     }
 
-    const Thread &
+    lldb::ThreadSP
     GetThread() const
     {
-        return m_thread;
+        return m_thread_wp.lock();
     }
 
     // The value of the StopInfo depends on the StopReason.
@@ -65,25 +68,7 @@ public:
 
     virtual lldb::StopReason
     GetStopReason () const = 0;
-    
-    // Perform any action that is associated with this stop.  This is done as the
-    // Event is removed from the event queue.
-    virtual void
-    PerformAction (Event *event_ptr)
-    {
-    }
-
-    // Stop the thread by default. Subclasses can override this to allow
-    // the thread to continue if desired.  The ShouldStop method should not do anything
-    // that might run code.  If you need to run code when deciding whether to stop
-    // at this StopInfo, that must be done in the PerformAction.  The PerformAction will
-    // always get called before the ShouldStop.
-    virtual bool
-    ShouldStop (Event *event_ptr)
-    {
-        return true;
-    }
-    
+        
     // ShouldStopSynchronous will get called before any thread plans are consulted, and if it says we should
     // resume the target, then we will just immediately resume.  This should not run any code in or resume the
     // target.
@@ -94,11 +79,20 @@ public:
         return true;
     }
 
+    void
+    OverrideShouldNotify (bool override_value)
+    {
+        m_override_should_notify = override_value ? eLazyBoolYes : eLazyBoolNo;
+    }
+    
     // If should stop returns false, check if we should notify of this event
     virtual bool
     ShouldNotify (Event *event_ptr)
     {
-        return false;
+        if (m_override_should_notify == eLazyBoolCalculate)
+            return DoShouldNotify (event_ptr);
+        else
+            return m_override_should_notify == eLazyBoolYes;
     }
 
     virtual void
@@ -121,7 +115,31 @@ public:
         else
             m_description.clear();
     }
-
+    
+    // Sometimes the thread plan logic will know that it wants a given stop to stop or not,
+    // regardless of what the ordinary logic for that StopInfo would dictate.  The main example
+    // of this is the ThreadPlanCallFunction, which for instance knows - based on how that particular
+    // expression was executed - whether it wants all breakpoints to auto-continue or not.
+    // Use OverrideShouldStop on the StopInfo to implement this.
+    
+    void
+    OverrideShouldStop (bool override_value)
+    {
+        m_override_should_stop = override_value ? eLazyBoolYes : eLazyBoolNo;
+    }
+    
+    bool
+    GetOverrideShouldStop()
+    {
+        return m_override_should_stop != eLazyBoolCalculate;
+    }
+    
+    bool
+    GetOverriddenShouldStopValue ()
+    {
+        return m_override_should_stop == eLazyBoolYes;
+    }
+    
     static lldb::StopInfoSP
     CreateStopReasonWithBreakpointSiteID (Thread &thread, lldb::break_id_t break_id);
 
@@ -144,18 +162,49 @@ public:
     static lldb::StopInfoSP
     CreateStopReasonWithException (Thread &thread, const char *description);
     
+    static lldb::StopInfoSP
+    CreateStopReasonWithExec (Thread &thread);
+
     static lldb::ValueObjectSP
     GetReturnValueObject (lldb::StopInfoSP &stop_info_sp);
 
 protected:
+    // Perform any action that is associated with this stop.  This is done as the
+    // Event is removed from the event queue.  ProcessEventData::DoOnRemoval does the job.
+ 
+    virtual void
+    PerformAction (Event *event_ptr)
+    {
+    }
+
+    virtual bool
+    DoShouldNotify (Event *event_ptr)
+    {
+        return false;
+    }
+    
+    // Stop the thread by default. Subclasses can override this to allow
+    // the thread to continue if desired.  The ShouldStop method should not do anything
+    // that might run code.  If you need to run code when deciding whether to stop
+    // at this StopInfo, that must be done in the PerformAction.
+    // The PerformAction will always get called before the ShouldStop.  This is done by the
+    // ProcessEventData::DoOnRemoval, though the ThreadPlanBase needs to consult this later on.
+    virtual bool
+    ShouldStop (Event *event_ptr)
+    {
+        return true;
+    }
+    
     //------------------------------------------------------------------
     // Classes that inherit from StackID can see and modify these
     //------------------------------------------------------------------
-    Thread &        m_thread;   // The thread corresponding to the stop reason.
+    lldb::ThreadWP  m_thread_wp;   // The thread corresponding to the stop reason.
     uint32_t        m_stop_id;  // The process stop ID for which this stop info is valid
     uint32_t        m_resume_id; // This is the resume ID when we made this stop ID.
     uint64_t        m_value;    // A generic value that can be used for things pertaining to this stop info
     std::string     m_description; // A textual description describing this stop.
+    LazyBool        m_override_should_notify;
+    LazyBool        m_override_should_stop;
     
     // This determines whether the target has run since this stop info.
     // N.B. running to evaluate a user expression does not count. 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Target.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Target.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Target.h Thu Jun  6 19:06:43 2013
@@ -12,6 +12,7 @@
 
 // C Includes
 // C++ Includes
+#include <list>
 
 // Other libraries and framework includes
 // Project includes
@@ -19,14 +20,16 @@
 #include "lldb/Breakpoint/BreakpointList.h"
 #include "lldb/Breakpoint/BreakpointLocationCollection.h"
 #include "lldb/Breakpoint/WatchpointList.h"
+#include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/Broadcaster.h"
 #include "lldb/Core/Event.h"
 #include "lldb/Core/ModuleList.h"
 #include "lldb/Core/UserSettingsController.h"
-#include "lldb/Core/SourceManager.h"
 #include "lldb/Expression/ClangPersistentVariables.h"
 #include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueEnumeration.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Target/ABI.h"
 #include "lldb/Target/ExecutionContextScope.h"
@@ -35,247 +38,272 @@
 
 namespace lldb_private {
 
+extern OptionEnumValueElement g_dynamic_value_types[];
+
+typedef enum InlineStrategy
+{
+    eInlineBreakpointsNever = 0,
+    eInlineBreakpointsHeaders,
+    eInlineBreakpointsAlways
+} InlineStrategy;
+    
+typedef enum LoadScriptFromSymFile
+{
+    eLoadScriptFromSymFileTrue,
+    eLoadScriptFromSymFileFalse,
+    eLoadScriptFromSymFileWarn
+} LoadScriptFromSymFile;
+    
 //----------------------------------------------------------------------
-// TargetInstanceSettings
+// TargetProperties
 //----------------------------------------------------------------------
-class TargetInstanceSettings : public InstanceSettings
+class TargetProperties : public Properties
 {
 public:
-    static OptionEnumValueElement g_dynamic_value_types[];
-
-    TargetInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-
-    TargetInstanceSettings (const TargetInstanceSettings &rhs);
+    TargetProperties(Target *target);
 
     virtual
-    ~TargetInstanceSettings ();
-
-    TargetInstanceSettings&
-    operator= (const TargetInstanceSettings &rhs);
-
+    ~TargetProperties();
+    
+    ArchSpec
+    GetDefaultArchitecture () const;
+    
     void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending);
-
-    bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err);
+    SetDefaultArchitecture (const ArchSpec& arch);
 
     lldb::DynamicValueType
-    GetPreferDynamicValue()
-    {
-        return (lldb::DynamicValueType) g_dynamic_value_types[m_prefer_dynamic_value].value;
-    }
+    GetPreferDynamicValue() const;
     
     bool
-    GetEnableSyntheticValue ()
-    {
-        return m_enable_synthetic_value;
-    }
-
+    GetDisableASLR () const;
+    
     void
-    SetEnableSyntheticValue (bool b)
-    {
-        m_enable_synthetic_value = b;
-    }
+    SetDisableASLR (bool b);
     
     bool
-    GetSkipPrologue()
-    {
-        return m_skip_prologue;
-    }
+    GetDisableSTDIO () const;
+    
+    void
+    SetDisableSTDIO (bool b);
+    
+    const char *
+    GetDisassemblyFlavor() const;
 
+//    void
+//    SetDisassemblyFlavor(const char *flavor);
+    
+    InlineStrategy
+    GetInlineStrategy () const;
+
+    const char *
+    GetArg0 () const;
+    
+    void
+    SetArg0 (const char *arg);
+
+    bool
+    GetRunArguments (Args &args) const;
+    
+    void
+    SetRunArguments (const Args &args);
+    
+    size_t
+    GetEnvironmentAsArgs (Args &env) const;
+    
+    bool
+    GetSkipPrologue() const;
+    
     PathMappingList &
-    GetSourcePathMap ()
-    {
-        return m_source_map;
-    }
+    GetSourcePathMap () const;
     
     FileSpecList &
-    GetExecutableSearchPaths ()
-    {
-        return m_exe_search_paths;
-    }
+    GetExecutableSearchPaths ();
+    
+    bool
+    GetEnableSyntheticValue () const;
+    
+    uint32_t
+    GetMaximumNumberOfChildrenToDisplay() const;
+    
+    uint32_t
+    GetMaximumSizeOfStringSummary() const;
 
-    const FileSpecList &
-    GetExecutableSearchPaths () const
-    {
-        return m_exe_search_paths;
-    }
+    uint32_t
+    GetMaximumMemReadSize () const;
+    
+    FileSpec
+    GetStandardInputPath () const;
+    
+    void
+    SetStandardInputPath (const char *path);
+    
+    FileSpec
+    GetStandardOutputPath () const;
+    
+    void
+    SetStandardOutputPath (const char *path);
+    
+    FileSpec
+    GetStandardErrorPath () const;
+    
+    void
+    SetStandardErrorPath (const char *path);
+    
+    bool
+    GetBreakpointsConsultPlatformAvoidList ();
+    
+    const char *
+    GetExpressionPrefixContentsAsCString ();
+    
+    bool
+    GetUseFastStepping() const;
+    
+    LoadScriptFromSymFile
+    GetLoadScriptFromSymbolFile() const;
+    
+};
+
+typedef std::shared_ptr<TargetProperties> TargetPropertiesSP;
 
+class EvaluateExpressionOptions
+{
+public:
+    static const uint32_t default_timeout = 500000;
+    EvaluateExpressionOptions() :
+        m_execution_policy(eExecutionPolicyOnlyWhenNeeded),
+        m_coerce_to_id(false),
+        m_unwind_on_error(true),
+        m_ignore_breakpoints (false),
+        m_keep_in_memory(false),
+        m_run_others(true),
+        m_use_dynamic(lldb::eNoDynamicValues),
+        m_timeout_usec(default_timeout)
+    {}
     
-    uint32_t
-    GetMaximumNumberOfChildrenToDisplay()
+    ExecutionPolicy
+    GetExecutionPolicy () const
     {
-        return m_max_children_display;
+        return m_execution_policy;
     }
-    uint32_t
-    GetMaximumSizeOfStringSummary()
+    
+    EvaluateExpressionOptions&
+    SetExecutionPolicy (ExecutionPolicy policy = eExecutionPolicyAlways)
     {
-        return m_max_strlen_length;
+        m_execution_policy = policy;
+        return *this;
     }
     
     bool
-    GetBreakpointsConsultPlatformAvoidList ()
+    DoesCoerceToId () const
     {
-        return m_breakpoints_use_platform_avoid;
+        return m_coerce_to_id;
     }
-        
-    const Args &
-    GetRunArguments () const
+    
+    EvaluateExpressionOptions&
+    SetCoerceToId (bool coerce = true)
     {
-        return m_run_args;
+        m_coerce_to_id = coerce;
+        return *this;
     }
     
-    void
-    SetRunArguments (const Args &args)
+    bool
+    DoesUnwindOnError () const
     {
-        m_run_args = args;
+        return m_unwind_on_error;
     }
     
-    void
-    GetHostEnvironmentIfNeeded ();
-    
-    size_t
-    GetEnvironmentAsArgs (Args &env);
+    EvaluateExpressionOptions&
+    SetUnwindOnError (bool unwind = false)
+    {
+        m_unwind_on_error = unwind;
+        return *this;
+    }
     
-    const char *
-    GetStandardInputPath () const
+    bool
+    DoesIgnoreBreakpoints () const
     {
-        if (m_input_path.empty())
-            return NULL;
-        return m_input_path.c_str();
+        return m_ignore_breakpoints;
     }
     
-    void
-    SetStandardInputPath (const char *path)
+    EvaluateExpressionOptions&
+    SetIgnoreBreakpoints (bool ignore = false)
     {
-        if (path && path[0])
-            m_input_path.assign (path);
-        else
-        {
-            // Make sure we deallocate memory in string...
-            std::string tmp;
-            tmp.swap (m_input_path);
-        }
+        m_ignore_breakpoints = ignore;
+        return *this;
     }
     
-    const char *
-    GetStandardOutputPath () const
+    bool
+    DoesKeepInMemory () const
     {
-        if (m_output_path.empty())
-            return NULL;
-        return m_output_path.c_str();
+        return m_keep_in_memory;
     }
     
-    void
-    SetStandardOutputPath (const char *path)
+    EvaluateExpressionOptions&
+    SetKeepInMemory (bool keep = true)
     {
-        if (path && path[0])
-            m_output_path.assign (path);
-        else
-        {
-            // Make sure we deallocate memory in string...
-            std::string tmp;
-            tmp.swap (m_output_path);
-        }
+        m_keep_in_memory = keep;
+        return *this;
     }
     
-    const char *
-    GetStandardErrorPath () const
+    lldb::DynamicValueType
+    GetUseDynamic () const
     {
-        if (m_error_path.empty())
-            return NULL;
-        return m_error_path.c_str();
+        return m_use_dynamic;
     }
     
-    void
-    SetStandardErrorPath (const char *path)
+    EvaluateExpressionOptions&
+    SetUseDynamic (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget)
     {
-        if (path && path[0])
-            m_error_path.assign (path);
-        else
-        {
-            // Make sure we deallocate memory in string...
-            std::string tmp;
-            tmp.swap (m_error_path);
-        }
+        m_use_dynamic = dynamic;
+        return *this;
     }
     
-    bool
-    GetDisableASLR () const
+    uint32_t
+    GetTimeoutUsec () const
     {
-        return m_disable_aslr;
+        return m_timeout_usec;
     }
     
-    void
-    SetDisableASLR (bool b)
+    EvaluateExpressionOptions&
+    SetTimeoutUsec (uint32_t timeout = 0)
     {
-        m_disable_aslr = b;
+        m_timeout_usec = timeout;
+        return *this;
     }
     
     bool
-    GetDisableSTDIO () const
+    GetRunOthers () const
     {
-        return m_disable_stdio;
+        return m_run_others;
     }
     
-    void
-    SetDisableSTDIO (bool b)
+    EvaluateExpressionOptions&
+    SetRunOthers (bool run_others = true)
     {
-        m_disable_stdio = b;
+        m_run_others = run_others;
+        return *this;
     }
-
-
-protected:
-
-    void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending);
-
-    const ConstString
-    CreateInstanceName ();
     
-    OptionValueFileSpec m_expr_prefix_file;
-    std::string m_expr_prefix_contents;
-    int m_prefer_dynamic_value;
-    OptionValueBoolean m_enable_synthetic_value;
-    OptionValueBoolean m_skip_prologue;
-    PathMappingList m_source_map;
-    FileSpecList m_exe_search_paths;
-    uint32_t m_max_children_display;
-    uint32_t m_max_strlen_length;
-    OptionValueBoolean m_breakpoints_use_platform_avoid;
-    typedef std::map<std::string, std::string> dictionary;
-    Args m_run_args;
-    dictionary m_env_vars;
-    std::string m_input_path;
-    std::string m_output_path;
-    std::string m_error_path;
-    bool m_disable_aslr;
-    bool m_disable_stdio;
-    bool m_inherit_host_env;
-    bool m_got_host_env;
-
-
+private:
+    ExecutionPolicy m_execution_policy;
+    bool m_coerce_to_id;
+    bool m_unwind_on_error;
+    bool m_ignore_breakpoints;
+    bool m_keep_in_memory;
+    bool m_run_others;
+    lldb::DynamicValueType m_use_dynamic;
+    uint32_t m_timeout_usec;
 };
 
 //----------------------------------------------------------------------
 // Target
 //----------------------------------------------------------------------
 class Target :
-    public STD_ENABLE_SHARED_FROM_THIS(Target),
+    public std::enable_shared_from_this<Target>,
+    public TargetProperties,
     public Broadcaster,
     public ExecutionContextScope,
-    public TargetInstanceSettings
+    public ModuleList::Notifier
 {
 public:
     friend class TargetList;
@@ -287,7 +315,9 @@ public:
     {
         eBroadcastBitBreakpointChanged  = (1 << 0),
         eBroadcastBitModulesLoaded      = (1 << 1),
-        eBroadcastBitModulesUnloaded    = (1 << 2)
+        eBroadcastBitModulesUnloaded    = (1 << 2),
+        eBroadcastBitWatchpointChanged  = (1 << 3),
+        eBroadcastBitSymbolsLoaded      = (1 << 4)
     };
     
     // These two functions fill out the Broadcaster interface:
@@ -342,8 +372,8 @@ public:
     static void
     SettingsTerminate ();
 
-    static lldb::UserSettingsControllerSP &
-    GetSettingsController ();
+//    static lldb::UserSettingsControllerSP &
+//    GetSettingsController ();
 
     static FileSpecList
     GetDefaultExecutableSearchPaths ();
@@ -354,12 +384,21 @@ public:
     static void
     SetDefaultArchitecture (const ArchSpec &arch);
 
-    void
-    UpdateInstanceName ();
+//    void
+//    UpdateInstanceName ();
 
     lldb::ModuleSP
     GetSharedModule (const ModuleSpec &module_spec,
                      Error *error_ptr = NULL);
+
+    //----------------------------------------------------------------------
+    // Settings accessors
+    //----------------------------------------------------------------------
+
+    static const TargetPropertiesSP &
+    GetGlobalProperties();
+
+
 private:
     //------------------------------------------------------------------
     /// Construct with optional file and arch.
@@ -390,6 +429,8 @@ public:
     void
     DeleteCurrentProcess ();
 
+    void
+    CleanupProcess ();
     //------------------------------------------------------------------
     /// Dump a description of this object to a Stream.
     ///
@@ -446,16 +487,16 @@ public:
     CreateBreakpoint (const FileSpecList *containingModules,
                       const FileSpec &file,
                       uint32_t line_no,
-                      bool check_inlines,
+                      LazyBool check_inlines = eLazyBoolCalculate,
                       LazyBool skip_prologue = eLazyBoolCalculate,
                       bool internal = false);
 
     // Use this to create breakpoint that matches regex against the source lines in files given in source_file_list:
     lldb::BreakpointSP
     CreateSourceRegexBreakpoint (const FileSpecList *containingModules,
-                      const FileSpecList *source_file_list,
-                      RegularExpression &source_regex,
-                      bool internal = false);
+                                 const FileSpecList *source_file_list,
+                                 RegularExpression &source_regex,
+                                 bool internal = false);
 
     // Use this to create a breakpoint from a load address
     lldb::BreakpointSP
@@ -472,10 +513,10 @@ public:
     // setting, else we use the values passed in
     lldb::BreakpointSP
     CreateFuncRegexBreakpoint (const FileSpecList *containingModules,
-                      const FileSpecList *containingSourceFiles,
-                      RegularExpression &func_regexp,
-                      LazyBool skip_prologue = eLazyBoolCalculate,
-                      bool internal = false);
+                               const FileSpecList *containingSourceFiles,
+                               RegularExpression &func_regexp,
+                               LazyBool skip_prologue = eLazyBoolCalculate,
+                               bool internal = false);
 
     // Use this to create a function breakpoint by name in containingModule, or all modules if it is NULL
     // When "skip_prologue is set to eLazyBoolCalculate, we use the current target 
@@ -522,7 +563,8 @@ public:
     lldb::WatchpointSP
     CreateWatchpoint (lldb::addr_t addr,
                       size_t size,
-                      uint32_t type,
+                      const ClangASTType *type,
+                      uint32_t kind,
                       Error &error);
 
     lldb::WatchpointSP
@@ -585,13 +627,6 @@ public:
     bool
     IgnoreWatchpointByID (lldb::watch_id_t watch_id, uint32_t ignore_count);
 
-    void
-    ModulesDidLoad (ModuleList &module_list);
-
-    void
-    ModulesDidUnload (ModuleList &module_list);
-
-    
     //------------------------------------------------------------------
     /// Get \a load_addr as a callable code load address for this target
     ///
@@ -622,13 +657,34 @@ public:
     GetOpcodeLoadAddress (lldb::addr_t load_addr, lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
 
 protected:
-    void
-    ModuleAdded (lldb::ModuleSP &module_sp);
+    //------------------------------------------------------------------
+    /// Implementing of ModuleList::Notifier.
+    //------------------------------------------------------------------
+    
+    virtual void
+    ModuleAdded (const ModuleList& module_list, const lldb::ModuleSP& module_sp);
+    
+    virtual void
+    ModuleRemoved (const ModuleList& module_list, const lldb::ModuleSP& module_sp);
+    
+    virtual void
+    ModuleUpdated (const ModuleList& module_list,
+                   const lldb::ModuleSP& old_module_sp,
+                   const lldb::ModuleSP& new_module_sp);
+    virtual void
+    WillClearList (const ModuleList& module_list);
 
+public:
+    
     void
-    ModuleUpdated (lldb::ModuleSP &old_module_sp, lldb::ModuleSP &new_module_sp);
+    ModulesDidLoad (ModuleList &module_list);
 
-public:
+    void
+    ModulesDidUnload (ModuleList &module_list);
+    
+    void
+    SymbolsDidLoad (ModuleList &module_list);
+    
     //------------------------------------------------------------------
     /// Gets the module for the main executable.
     ///
@@ -682,6 +738,14 @@ public:
     void
     SetExecutableModule (lldb::ModuleSP& module_sp, bool get_dependent_files);
 
+    bool
+    LoadScriptingResources (std::list<Error>& errors,
+                            Stream* feedback_stream = NULL,
+                            bool continue_on_error = true)
+    {
+        return m_images.LoadScriptingResourcesInTarget(this,errors,feedback_stream,continue_on_error);
+    }
+    
     //------------------------------------------------------------------
     /// Get accessor for the images for this process.
     ///
@@ -701,18 +765,17 @@ public:
     /// @return
     ///     A list of Module objects in a module list.
     //------------------------------------------------------------------
-    ModuleList&
-    GetImages ()
-    {
-        return m_images;
-    }
-
     const ModuleList&
     GetImages () const
     {
         return m_images;
     }
     
+    ModuleList&
+    GetImages ()
+    {
+        return m_images;
+    }
     
     //------------------------------------------------------------------
     /// Return whether this FileSpec corresponds to a module that should be considered for general searches.
@@ -817,7 +880,13 @@ public:
                 size_t dst_len,
                 Error &error,
                 lldb::addr_t *load_addr_ptr = NULL);
-
+    
+    size_t
+    ReadCStringFromMemory (const Address& addr, std::string &out_str, Error &error);
+    
+    size_t
+    ReadCStringFromMemory (const Address& addr, char *dst, size_t dst_max_len, Error &result_error);
+    
     size_t
     ReadScalarIntegerFromMemory (const Address& addr, 
                                  bool prefer_file_cache,
@@ -882,8 +951,6 @@ public:
     ClangASTImporter *
     GetClangASTImporter();
     
-    const char *
-    GetExpressionPrefixContentsAsCString ();
     
     // Since expressions results can persist beyond the lifetime of a process,
     // and the const expression results are available after a process is gone,
@@ -893,13 +960,8 @@ public:
     ExecutionResults
     EvaluateExpression (const char *expression,
                         StackFrame *frame,
-                        lldb_private::ExecutionPolicy execution_policy,
-                        bool coerce_to_id,
-                        bool unwind_on_error,
-                        bool keep_in_memory,
-                        lldb::DynamicValueType use_dynamic,
                         lldb::ValueObjectSP &result_valobj_sp,
-                        uint32_t single_thread_timeout_usec = 500000);
+                        const EvaluateExpressionOptions& options = EvaluateExpressionOptions());
 
     ClangPersistentVariables &
     GetPersistentVariables()
@@ -983,7 +1045,7 @@ public:
         lldb::TargetSP m_target_sp;
         StringList   m_commands;
         lldb::SymbolContextSpecifierSP m_specifier_sp;
-        std::auto_ptr<ThreadSpec> m_thread_spec_ap;
+        std::unique_ptr<ThreadSpec> m_thread_spec_ap;
         bool m_active;
         
         // Use AddStopHook to make a new empty stop hook.  The GetCommandPointer and fill it with commands,
@@ -991,7 +1053,7 @@ public:
         StopHook (lldb::TargetSP target_sp, lldb::user_id_t uid);
         friend class Target;
     };
-    typedef STD_SHARED_PTR(StopHook) StopHookSP;
+    typedef std::shared_ptr<StopHook> StopHookSP;
     
     // Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to it in new_hook.  
     // Returns the id of the new hook.        
@@ -1083,57 +1145,9 @@ public:
     }
 
     SourceManager &
-    GetSourceManager ()
-    {
-        return m_source_manager;
-    }
+    GetSourceManager ();
 
     //------------------------------------------------------------------
-    // Target::SettingsController
-    //------------------------------------------------------------------
-    class SettingsController : public UserSettingsController
-    {
-    public:
-        SettingsController ();
-        
-        virtual
-        ~SettingsController ();
-        
-        bool
-        SetGlobalVariable (const ConstString &var_name,
-                           const char *index_value,
-                           const char *value,
-                           const SettingEntry &entry,
-                           const VarSetOperationType op,
-                           Error&err);
-        
-        bool
-        GetGlobalVariable (const ConstString &var_name,
-                           StringList &value,
-                           Error &err);
-        
-        static SettingEntry global_settings_table[];
-        static SettingEntry instance_settings_table[];
-        
-        ArchSpec &
-        GetArchitecture ()
-        {
-            return m_default_architecture;
-        }
-    protected:
-        
-        lldb::InstanceSettingsSP
-        CreateInstanceSettings (const char *instance_name);
-        
-    private:
-        
-        // Class-wide settings.
-        ArchSpec m_default_architecture;
-        
-        DISALLOW_COPY_AND_ASSIGN (SettingsController);
-    };
-    
-    //------------------------------------------------------------------
     // Methods.
     //------------------------------------------------------------------
     lldb::SearchFilterSP
@@ -1145,7 +1159,7 @@ public:
     lldb::SearchFilterSP
     GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles);
 
-protected:    
+protected:
     //------------------------------------------------------------------
     // Member variables.
     //------------------------------------------------------------------
@@ -1167,12 +1181,12 @@ protected:
     bool m_valid;
     lldb::SearchFilterSP  m_search_filter_sp;
     PathMappingList m_image_search_paths;
-    std::auto_ptr<ClangASTContext> m_scratch_ast_context_ap;
-    std::auto_ptr<ClangASTSource> m_scratch_ast_source_ap;
-    std::auto_ptr<ClangASTImporter> m_ast_importer_ap;
+    std::unique_ptr<ClangASTContext> m_scratch_ast_context_ap;
+    std::unique_ptr<ClangASTSource> m_scratch_ast_source_ap;
+    std::unique_ptr<ClangASTImporter> m_ast_importer_ap;
     ClangPersistentVariables m_persistent_variables;      ///< These are the persistent variables associated with this process for the expression parser.
 
-    SourceManager m_source_manager;
+    std::unique_ptr<SourceManager> m_source_manager_ap;
 
     typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
     StopHookCollection      m_stop_hooks;

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/TargetList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/TargetList.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/TargetList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/TargetList.h Thu Jun  6 19:06:43 2013
@@ -98,7 +98,7 @@ public:
     //------------------------------------------------------------------
     Error
     CreateTarget (Debugger &debugger,
-                  const FileSpec& file_spec,
+                  const char *user_exe_path,
                   const char *triple_cstr,
                   bool get_dependent_modules,
                   const OptionGroupPlatform *platform_options,
@@ -112,7 +112,7 @@ public:
     //------------------------------------------------------------------
     Error
     CreateTarget (Debugger &debugger,
-                  const FileSpec& file_spec,
+                  const char *user_exe_path,
                   const ArchSpec& arch,
                   bool get_dependent_modules,
                   lldb::PlatformSP &platform_sp,

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h Thu Jun  6 19:06:43 2013
@@ -12,6 +12,8 @@
 
 #include "lldb/lldb-private.h"
 #include "lldb/Host/Mutex.h"
+#include "lldb/Core/Broadcaster.h"
+#include "lldb/Core/Event.h"
 #include "lldb/Core/UserID.h"
 #include "lldb/Core/UserSettingsController.h"
 #include "lldb/Target/ExecutionContextScope.h"
@@ -21,102 +23,114 @@
 
 namespace lldb_private {
 
-class ThreadInstanceSettings : public InstanceSettings
+class ThreadProperties : public Properties
 {
 public:
-
-    ThreadInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-  
-    ThreadInstanceSettings (const ThreadInstanceSettings &rhs);
-
+    ThreadProperties(bool is_global);
+    
     virtual
-    ~ThreadInstanceSettings ();
-  
-    ThreadInstanceSettings&
-    operator= (const ThreadInstanceSettings &rhs);
-  
-
-    void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending);
-
-    bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err);
-
-    RegularExpression *
-    GetSymbolsToAvoidRegexp()
-    {
-        return m_avoid_regexp_ap.get();
-    }
-
-    static const ConstString &
-    StepAvoidRegexpVarName ();
+    ~ThreadProperties();
+    
+    //------------------------------------------------------------------
+    /// The regular expression returned determines symbols that this
+    /// thread won't stop in during "step-in" operations.
+    ///
+    /// @return
+    ///    A pointer to a regular expression to compare against symbols,
+    ///    or NULL if all symbols are allowed.
+    ///
+    //------------------------------------------------------------------
+    const RegularExpression *
+    GetSymbolsToAvoidRegexp();
     
     bool
-    GetTraceEnabledState()
-    {
-        return m_trace_enabled;
-    }
-    static const ConstString &
-    GetTraceThreadVarName ();
-
-protected:
-
-    void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending);
-
-    const ConstString
-    CreateInstanceName ();
-
-private:
-
-    std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
-    bool m_trace_enabled;
+    GetTraceEnabledState() const;
 };
 
+typedef std::shared_ptr<ThreadProperties> ThreadPropertiesSP;
+
 class Thread :
-    public STD_ENABLE_SHARED_FROM_THIS(Thread),
+    public std::enable_shared_from_this<Thread>,
+    public ThreadProperties,
     public UserID,
     public ExecutionContextScope,
-    public ThreadInstanceSettings
+    public Broadcaster
 {
 public:
+    //------------------------------------------------------------------
+    /// Broadcaster event bits definitions.
+    //------------------------------------------------------------------
+    enum
+    {
+        eBroadcastBitStackChanged           = (1 << 0),
+        eBroadcastBitThreadSuspended        = (1 << 1),
+        eBroadcastBitThreadResumed          = (1 << 2),
+        eBroadcastBitSelectedFrameChanged   = (1 << 3),
+        eBroadcastBitThreadSelected         = (1 << 4)
+    };
 
-    class SettingsController : public UserSettingsController
+    static ConstString &GetStaticBroadcasterClass ();
+    
+    virtual ConstString &GetBroadcasterClass() const
+    {
+        return GetStaticBroadcasterClass();
+    }
+    
+    class ThreadEventData :
+        public EventData
     {
     public:
+        ThreadEventData (const lldb::ThreadSP thread_sp);
         
-        SettingsController ();
-
-        virtual
-        ~SettingsController ();
+        ThreadEventData (const lldb::ThreadSP thread_sp, const StackID &stack_id);
         
-        static SettingEntry global_settings_table[];
-        static SettingEntry instance_settings_table[];
-
-    protected:
-
-        lldb::InstanceSettingsSP
-        CreateInstanceSettings (const char *instance_name);
+        ThreadEventData();
+        
+        virtual ~ThreadEventData();
+        
+        static const ConstString &
+        GetFlavorString ();
 
+        virtual const ConstString &
+        GetFlavor () const
+        {
+            return ThreadEventData::GetFlavorString ();
+        }
+        
+        virtual void
+        Dump (Stream *s) const;
+    
+        static const ThreadEventData *
+        GetEventDataFromEvent (const Event *event_ptr);
+        
+        static lldb::ThreadSP
+        GetThreadFromEvent (const Event *event_ptr);
+        
+        static StackID
+        GetStackIDFromEvent (const Event *event_ptr);
+        
+        static lldb::StackFrameSP
+        GetStackFrameFromEvent (const Event *event_ptr);
+        
+        lldb::ThreadSP
+        GetThread () const
+        {
+            return m_thread_sp;
+        }
+        
+        StackID
+        GetStackID () const
+        {
+            return m_stack_id;
+        }
+    
     private:
-
-        // Class-wide settings.
-
-        DISALLOW_COPY_AND_ASSIGN (SettingsController);
+        lldb::ThreadSP m_thread_sp;
+        StackID        m_stack_id;
+    DISALLOW_COPY_AND_ASSIGN (ThreadEventData);
     };
-
-    // TODO: You shouldn't just checkpoint the register state alone, so this should get 
+    
+    // TODO: You shouldn't just checkpoint the register state alone, so this should get
     // moved to protected.  To do that ThreadStateCheckpoint needs to be returned as a token...
     class RegisterCheckpoint
     {
@@ -189,21 +203,20 @@ public:
         uint32_t           orig_stop_id;  // Dunno if I need this yet but it is an interesting bit of data.
         lldb::StopInfoSP   stop_info_sp;  // You have to restore the stop info or you might continue with the wrong signals.
         RegisterCheckpoint register_backup;  // You need to restore the registers, of course...
+        uint32_t           current_inlined_depth;
+        lldb::addr_t       current_inlined_pc;
     };
 
-    void
-    UpdateInstanceName ();
-
     static void
     SettingsInitialize ();
 
     static void
     SettingsTerminate ();
 
-    static lldb::UserSettingsControllerSP &
-    GetSettingsController ();
+    static const ThreadPropertiesSP &
+    GetGlobalProperties();
 
-    Thread (const lldb::ProcessSP &process_sp, lldb::tid_t tid);
+    Thread (Process &process, lldb::tid_t tid);
     virtual ~Thread();
 
     lldb::ProcessSP
@@ -242,23 +255,32 @@ public:
         m_resume_state = state;
     }
 
-    // This function is called on all the threads before "WillResume" in case
-    // a thread needs to change its state before the ThreadList polls all the
-    // threads to figure out which ones actually will get to run and how.
+    // This function is called on all the threads before "ShouldResume" and
+    // "WillResume" in case a thread needs to change its state before the
+    // ThreadList polls all the threads to figure out which ones actually
+    // will get to run and how.
     void
     SetupForResume ();
     
-    // Override this to do platform specific tasks before resume, but always
-    // call the Thread::WillResume at the end of your work.
+    // Do not override this function, it is for thread plan logic only
+    bool
+    ShouldResume (lldb::StateType resume_state);
 
-    virtual bool
-    WillResume (lldb::StateType resume_state);
+    // Override this to do platform specific tasks before resume.
+    virtual void
+    WillResume (lldb::StateType resume_state)
+    {
+    }
 
     // This clears generic thread state after a resume.  If you subclass this,
     // be sure to call it.
     virtual void
     DidResume ();
 
+    // This notifies the thread when a private stop occurs.
+    virtual void
+    DidStop ();
+
     virtual void
     RefreshStateAfterStop() = 0;
 
@@ -270,7 +292,7 @@ public:
 
     Vote
     ShouldReportStop (Event *event_ptr);
-
+    
     Vote
     ShouldReportRun (Event *event_ptr);
     
@@ -288,6 +310,9 @@ public:
     lldb::StopInfoSP
     GetStopInfo ();
 
+    lldb::StopReason
+    GetStopReason();
+
     // This sets the stop reason to a "blank" stop reason, so you can call functions on the thread
     // without having the called function run with whatever stop reason you stopped with.
     void
@@ -335,10 +360,30 @@ public:
     virtual lldb::StackFrameSP
     GetFrameWithConcreteFrameIndex (uint32_t unwind_idx);
     
+    bool
+    DecrementCurrentInlinedDepth()
+    {
+        return GetStackFrameList()->DecrementCurrentInlinedDepth();
+    }
+    
+    uint32_t
+    GetCurrentInlinedDepth()
+    {
+        return GetStackFrameList()->GetCurrentInlinedDepth();
+    }
+    
+    Error
+    ReturnFromFrameWithIndex (uint32_t frame_idx, lldb::ValueObjectSP return_value_sp, bool broadcast = false);
+    
+    Error
+    ReturnFromFrame (lldb::StackFrameSP frame_sp, lldb::ValueObjectSP return_value_sp, bool broadcast = false);
+    
     virtual lldb::StackFrameSP
     GetFrameWithStackID (const StackID &stack_id)
     {
-        return GetStackFrameList()->GetFrameWithStackID (stack_id);
+        if (stack_id.IsValid())
+            return GetStackFrameList()->GetFrameWithStackID (stack_id);
+        return lldb::StackFrameSP();
     }
 
     uint32_t
@@ -355,16 +400,14 @@ public:
     }
 
     uint32_t
-    SetSelectedFrame (lldb_private::StackFrame *frame)
-    {
-        return GetStackFrameList()->SetSelectedFrame(frame);
-    }
+    SetSelectedFrame (lldb_private::StackFrame *frame, bool broadcast = false);
+
 
     bool
-    SetSelectedFrameByIndex (uint32_t frame_idx)
-    {
-        return GetStackFrameList()->SetSelectedFrameByIndex(frame_idx);
-    }
+    SetSelectedFrameByIndex (uint32_t frame_idx, bool broadcast = false);
+
+    bool
+    SetSelectedFrameByIndexNoisily (uint32_t frame_idx, Stream &output_stream);
 
     void
     SetDefaultFileAndLineToSelectedFrame()
@@ -381,6 +424,30 @@ public:
     virtual void
     ClearStackFrames ();
 
+    virtual bool
+    SetBackingThread (const lldb::ThreadSP &thread_sp)
+    {
+        return false;
+    }
+    
+    virtual lldb::ThreadSP
+    GetBackingThread () const
+    {
+        return lldb::ThreadSP();
+    }
+
+    virtual void
+    ClearBackingThread ()
+    {
+        // Subclasses can use this function if a thread is actually backed by
+        // another thread. This is currently used for the OperatingSystem plug-ins
+        // where they might have a thread that is in memory, yet its registers
+        // are available through the lldb_private::Thread subclass for the current
+        // lldb_private::Process class. Since each time the process stops the backing
+        // threads for memory threads can change, we need a way to clear the backing
+        // thread for all memory threads each time we stop.
+    }
+
     void
     DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx);
 
@@ -449,8 +516,40 @@ public:
                                              bool stop_other_threads);
 
     //------------------------------------------------------------------
-    /// Queues the plan used to step through an address range, stepping into or over
-    /// function calls depending on the value of StepType.
+    /// Queues the plan used to step through an address range, stepping  over
+    /// function calls.
+    ///
+    /// @param[in] abort_other_plans
+    ///    \b true if we discard the currently queued plans and replace them with this one.
+    ///    Otherwise this plan will go on the end of the plan stack.
+    ///
+    /// @param[in] type
+    ///    Type of step to do, only eStepTypeInto and eStepTypeOver are supported by this plan.
+    ///
+    /// @param[in] range
+    ///    The address range to step through.
+    ///
+    /// @param[in] addr_context
+    ///    When dealing with stepping through inlined functions the current PC is not enough information to know
+    ///    what "step" means.  For instance a series of nested inline functions might start at the same address.
+    //     The \a addr_context provides the current symbol context the step
+    ///    is supposed to be out of.
+    //   FIXME: Currently unused.
+    ///
+    /// @param[in] stop_other_threads
+    ///    \b true if we will stop other threads while we single step this one.
+    ///
+    /// @return
+    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
+    //------------------------------------------------------------------
+    virtual ThreadPlan *
+    QueueThreadPlanForStepOverRange (bool abort_other_plans,
+                                 const AddressRange &range,
+                                 const SymbolContext &addr_context,
+                                 lldb::RunMode stop_other_threads);
+
+    //------------------------------------------------------------------
+    /// Queues the plan used to step through an address range, stepping into functions.
     ///
     /// @param[in] abort_other_plans
     ///    \b true if we discard the currently queued plans and replace them with this one.
@@ -469,17 +568,23 @@ public:
     ///    is supposed to be out of.
     //   FIXME: Currently unused.
     ///
+    /// @param[in] step_in_target
+    ///    Name if function we are trying to step into.  We will step out if we don't land in that function.
+    ///
     /// @param[in] stop_other_threads
     ///    \b true if we will stop other threads while we single step this one.
     ///
+    /// @param[in] avoid_code_without_debug_info
+    ///    If \b true we will step out if we step into code with no debug info.
+    ///
     /// @return
     ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
     //------------------------------------------------------------------
     virtual ThreadPlan *
-    QueueThreadPlanForStepRange (bool abort_other_plans,
-                                 StepType type,
+    QueueThreadPlanForStepInRange (bool abort_other_plans,
                                  const AddressRange &range,
                                  const SymbolContext &addr_context,
+                                 const char *step_in_target,
                                  lldb::RunMode stop_other_threads,
                                  bool avoid_code_without_debug_info);
 
@@ -579,7 +684,8 @@ public:
                                     Address& function,
                                     lldb::addr_t arg,
                                     bool stop_other_threads,
-                                    bool discard_on_error = false);
+                                    bool unwind_on_error = false,
+                                    bool ignore_breakpoints = true);
                                             
     //------------------------------------------------------------------
     // Thread Plan accessors:
@@ -593,11 +699,25 @@ public:
     //------------------------------------------------------------------
     ThreadPlan *
     GetCurrentPlan ();
+    
+    //------------------------------------------------------------------
+    /// Unwinds the thread stack for the innermost expression plan currently
+    /// on the thread plan stack.
+    ///
+    /// @return
+    ///     An error if the thread plan could not be unwound.
+    //------------------------------------------------------------------
+
+    Error
+    UnwindInnermostExpression();
 
 private:
     bool
     PlanIsBasePlan (ThreadPlan *plan_ptr);
     
+    void
+    BroadcastSelectedFrameChange(StackID &new_frame_id);
+    
 public:
 
     //------------------------------------------------------------------
@@ -700,6 +820,9 @@ public:
     CheckpointThreadState (ThreadStateCheckpoint &saved_state);
     
     virtual bool
+    RestoreRegisterStateFromCheckpoint (ThreadStateCheckpoint &saved_state);
+    
+    virtual bool
     RestoreThreadStateFromCheckpoint (ThreadStateCheckpoint &saved_state);
     
     void
@@ -709,27 +832,27 @@ public:
     SetTracer (lldb::ThreadPlanTracerSP &tracer_sp);
     
     //------------------------------------------------------------------
-    /// The regular expression returned determines symbols that this
-    /// thread won't stop in during "step-in" operations.
-    ///
-    /// @return
-    ///    A pointer to a regular expression to compare against symbols,
-    ///    or NULL if all symbols are allowed.
-    ///
+    // Get the thread index ID. The index ID that is guaranteed to not
+    // be re-used by a process. They start at 1 and increase with each
+    // new thread. This allows easy command line access by a unique ID
+    // that is easier to type than the actual system thread ID.
     //------------------------------------------------------------------
-    RegularExpression *
-    GetSymbolsToAvoidRegexp()
-    {
-        return ThreadInstanceSettings::GetSymbolsToAvoidRegexp();
-    }
-
-    // Get the thread index ID. The index ID that is guaranteed to not be
-    // re-used by a process. They start at 1 and increase with each new thread.
-    // This allows easy command line access by a unique ID that is easier to
-    // type than the actual system thread ID.
     uint32_t
     GetIndexID () const;
     
+    
+    //------------------------------------------------------------------
+    // The API ID is often the same as the Thread::GetID(), but not in
+    // all cases. Thread::GetID() is the user visible thread ID that
+    // clients would want to see. The API thread ID is the thread ID
+    // that is used when sending data to/from the debugging protocol.
+    //------------------------------------------------------------------
+    virtual lldb::user_id_t
+    GetProtocolID () const
+    {
+        return GetID();
+    }
+
     //------------------------------------------------------------------
     // lldb::ExecutionContextScope pure virtual functions
     //------------------------------------------------------------------
@@ -771,20 +894,72 @@ public:
     bool
     IsValid () const
     {
-        return m_destroy_called;
+        return !m_destroy_called;
     }
 
-    // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be
-    // valid.  The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right
-    // even if you have not calculated this yourself, or if it disagrees with what you might have calculated.
+    // Sets and returns a valid stop info based on the process stop ID and the
+    // current thread plan. If the thread stop ID does not match the process'
+    // stop ID, the private stop reason is not set and an invalid StopInfoSP may
+    // be returned.
+    //
+    // NOTE: This function must be called before the current thread plan is
+    // moved to the completed plan stack (in Thread::ShouldStop()).
+    //
+    // NOTE: If subclasses override this function, ensure they do not overwrite
+    // the m_actual_stop_info if it is valid.  The stop info may be a
+    // "checkpointed and restored" stop info, so if it is still around it is
+    // right even if you have not calculated this yourself, or if it disagrees
+    // with what you might have calculated.
     virtual lldb::StopInfoSP
-    GetPrivateStopReason () = 0;
+    GetPrivateStopInfo ();
+
+    //----------------------------------------------------------------------
+    // Ask the thread subclass to set its stop info.
+    //
+    // Thread subclasses should call Thread::SetStopInfo(...) with the
+    // reason the thread stopped.
+    //
+    // @return
+    //      True if Thread::SetStopInfo(...) was called, false otherwise.
+    //----------------------------------------------------------------------
+    virtual bool
+    CalculateStopInfo () = 0;
+
+    //----------------------------------------------------------------------
+    // Gets the temporary resume state for a thread.
+    //
+    // This value gets set in each thread by complex debugger logic in
+    // Thread::ShouldResume() and an appropriate thread resume state will get
+    // set in each thread every time the process is resumed prior to calling
+    // Process::DoResume(). The lldb_private::Process subclass should adhere
+    // to the thread resume state request which will be one of:
+    //
+    //  eStateRunning   - thread will resume when process is resumed
+    //  eStateStepping  - thread should step 1 instruction and stop when process
+    //                    is resumed
+    //  eStateSuspended - thread should not execute any instructions when
+    //                    process is resumed
+    //----------------------------------------------------------------------
+    lldb::StateType
+    GetTemporaryResumeState() const
+    {
+        return m_temporary_resume_state;
+    }
+
+    void
+    SetStopInfo (const lldb::StopInfoSP &stop_info_sp);
+
+    void
+    SetShouldReportStop (Vote vote);
 
 protected:
 
     friend class ThreadPlan;
     friend class ThreadList;
+    friend class ThreadEventData;
     friend class StackFrameList;
+    friend class StackFrame;
+    friend class OperatingSystem;
     
     // This is necessary to make sure thread assets get destroyed while the thread is still in good shape
     // to call virtual thread methods.  This must be called by classes that derive from Thread in their destructor.
@@ -803,32 +978,36 @@ protected:
 
     typedef std::vector<lldb::ThreadPlanSP> plan_stack;
 
-    void
-    SetStopInfo (const lldb::StopInfoSP &stop_info_sp);
-
     virtual bool
     SaveFrameZeroState (RegisterCheckpoint &checkpoint);
 
     virtual bool
     RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint);
+    
+    // register_data_sp must be a DataSP passed to ReadAllRegisterValues.
+    bool
+    ResetFrameZeroRegisters (lldb::DataBufferSP register_data_sp);
 
     virtual lldb_private::Unwind *
     GetUnwinder ();
 
-    lldb::StackFrameListSP
-    GetStackFrameList ();
-    
-    lldb::StateType GetTemporaryResumeState()
+    // Check to see whether the thread is still at the last breakpoint hit that stopped it.
+    virtual bool
+    IsStillAtLastBreakpointHit();
+
+    // Some threads are threads that are made up by OperatingSystem plugins that
+    // are threads that exist and are context switched out into memory. The
+    // OperatingSystem plug-in need a ways to know if a thread is "real" or made
+    // up.
+    virtual bool
+    IsOperatingSystemPluginThread () const
     {
-        return m_temporary_resume_state;
+        return false;
     }
     
-    lldb::StateType SetTemporaryResumeState(lldb::StateType resume_state)
-    {
-        lldb::StateType old_temp_resume_state = m_temporary_resume_state;
-        m_temporary_resume_state = resume_state;
-        return old_temp_resume_state;
-    }
+
+    lldb::StackFrameListSP
+    GetStackFrameList ();
     
     struct ThreadState
     {
@@ -841,7 +1020,9 @@ protected:
     // Classes that inherit from Process can see and modify these
     //------------------------------------------------------------------
     lldb::ProcessWP     m_process_wp;           ///< The process that owns this thread.
-    lldb::StopInfoSP    m_actual_stop_info_sp;  ///< The private stop reason for this thread
+    lldb::StopInfoSP    m_stop_info_sp;         ///< The private stop reason for this thread
+    uint32_t            m_stop_info_stop_id;    // This is the stop id for which the StopInfo is valid.  Can use this so you know that
+    // the thread's m_stop_info_sp is current and you don't have to fetch it again
     const uint32_t      m_index_id;             ///< A unique 1 based index assigned to each thread for easy UI/command line access.
     lldb::RegisterContextSP m_reg_context_sp;   ///< The register context for this thread's current register state.
     lldb::StateType     m_state;                ///< The state of our process.
@@ -855,12 +1036,10 @@ protected:
     int                 m_resume_signal;        ///< The signal that should be used when continuing this thread.
     lldb::StateType     m_resume_state;         ///< This state is used to force a thread to be suspended from outside the ThreadPlan logic.
     lldb::StateType     m_temporary_resume_state; ///< This state records what the thread was told to do by the thread plan logic for the current resume.
-                                                  /// It gets set in Thread::WillResume.
-    std::auto_ptr<lldb_private::Unwind> m_unwinder_ap;
+                                                  /// It gets set in Thread::ShoudResume.
+    std::unique_ptr<lldb_private::Unwind> m_unwinder_ap;
     bool                m_destroy_called;       // This is used internally to make sure derived Thread classes call DestroyThread.
-    uint32_t m_thread_stop_reason_stop_id;      // This is the stop id for which the StopInfo is valid.  Can use this so you know that
-                                                // the thread's m_actual_stop_info_sp is current and you don't have to fetch it again
-
+    LazyBool            m_override_should_notify;
 private:
     //------------------------------------------------------------------
     // For Thread only

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadList.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadList.h Thu Jun  6 19:06:43 2013
@@ -13,7 +13,6 @@
 #include <vector>
 
 #include "lldb/lldb-private.h"
-#include "lldb/Host/Mutex.h"
 #include "lldb/Core/UserID.h"
 
 
@@ -51,10 +50,10 @@ public:
     GetSelectedThread ();
 
     bool
-    SetSelectedThreadByID (lldb::tid_t tid);
+    SetSelectedThreadByID (lldb::tid_t tid, bool notify = false);
 
     bool
-    SetSelectedThreadByIndexID (uint32_t index_id);
+    SetSelectedThreadByIndexID (uint32_t index_id, bool notify = false);
 
     void
     Clear();
@@ -73,6 +72,15 @@ public:
 
     lldb::ThreadSP
     FindThreadByID (lldb::tid_t tid, bool can_update = true);
+    
+    lldb::ThreadSP
+    FindThreadByProtocolID (lldb::tid_t tid, bool can_update = true);
+
+    lldb::ThreadSP
+    RemoveThreadByID (lldb::tid_t tid, bool can_update = true);
+    
+    lldb::ThreadSP
+    RemoveThreadByProtocolID (lldb::tid_t tid, bool can_update = true);
 
     lldb::ThreadSP
     FindThreadByIndexID (uint32_t index_id, bool can_update = true);
@@ -92,6 +100,19 @@ public:
     void
     RefreshStateAfterStop ();
 
+    //------------------------------------------------------------------
+    /// The thread list asks tells all the threads it is about to resume.
+    /// If a thread can "resume" without having to resume the target, it
+    /// will return false for WillResume, and then the process will not be
+    /// restarted.
+    ///
+    /// @return
+    ///    \b true instructs the process to resume normally,
+    ///    \b false means start & stopped events will be generated, but
+    ///    the process will not actually run.  The thread must then return
+    ///    the correct StopInfo when asked.
+    ///
+    //------------------------------------------------------------------
     bool
     WillResume ();
 
@@ -99,6 +120,9 @@ public:
     DidResume ();
 
     void
+    DidStop ();
+
+    void
     DiscardThreadPlans();
 
     uint32_t
@@ -108,16 +132,19 @@ public:
     SetStopID (uint32_t stop_id);
 
     Mutex &
-    GetMutex ()
-    {
-        return m_threads_mutex;
-    }
+    GetMutex ();
     
     void
     Update (ThreadList &rhs);
     
 protected:
 
+    void
+    SetShouldReportStop (Vote vote);
+
+    void
+    NotifySelectedThreadChanged (lldb::tid_t tid);
+
     typedef std::vector<lldb::ThreadSP> collection;
     //------------------------------------------------------------------
     // Classes that inherit from Process can see and modify these
@@ -125,7 +152,6 @@ protected:
     Process *m_process; ///< The process that manages this thread list.
     uint32_t m_stop_id; ///< The process stop ID that this thread list is valid for.
     collection m_threads; ///< The threads for this process.
-    mutable Mutex m_threads_mutex;
     lldb::tid_t m_selected_tid;  ///< For targets that need the notion of a current thread.
 
 private:

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlan.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlan.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlan.h Thu Jun  6 19:06:43 2013
@@ -92,7 +92,8 @@ namespace lldb_private {
 //  When the target process is about to be restarted, the plan's WillResume method is called,
 //  giving the plan a chance to prepare for the run.  If WillResume returns false, then the
 //  process is not restarted.  Be sure to set an appropriate error value in the Process if
-//  you have to do this.
+//  you have to do this.  Note, ThreadPlans actually implement DoWillResume, WillResume wraps that call.
+//
 //  Next the "StopOthers" method of all the threads are polled, and if one thread's Current plan
 //  returns "true" then only that thread gets to run.  If more than one returns "true" the threads that want to run solo
 //  get run one by one round robin fashion.  Otherwise all are let to run.
@@ -115,6 +116,8 @@ namespace lldb_private {
 //  figure out what to do about the plans below it in the stack.  If the stop is recoverable, then the plan that
 //  understands it can just do what it needs to set up to restart, and then continue.
 //  Otherwise, the plan that understood the stop should call DiscardPlanStack to clean up the stack below it.
+//  Note, plans actually implement DoPlanExplainsStop, the result is cached in PlanExplainsStop so the DoPlanExplainsStop
+//  itself will only get called once per stop.
 //
 //  Master plans:
 //
@@ -331,9 +334,6 @@ public:
     virtual bool
     ValidatePlan (Stream *error) = 0;
 
-    virtual bool
-    PlanExplainsStop () = 0;
-    
     bool
     TracerExplainsStop ()
     {
@@ -347,6 +347,9 @@ public:
     lldb::StateType
     RunState ();
 
+    bool
+    PlanExplainsStop (Event *event_ptr);
+    
     virtual bool
     ShouldStop (Event *event_ptr) = 0;
     
@@ -371,9 +374,11 @@ public:
     virtual bool
     StopOthers ();
 
-    virtual bool
+    // This is the wrapper for DoWillResume that does generic ThreadPlan logic, then
+    // calls DoWillResume.
+    bool
     WillResume (lldb::StateType resume_state, bool current_plan);
-
+    
     virtual bool
     WillStop () = 0;
 
@@ -405,6 +410,13 @@ public:
     virtual bool
     MischiefManaged ();
 
+    virtual void
+    ThreadDestroyed ()
+    {
+        // Any cleanup that a plan might want to do in case the thread goes away
+        // in the middle of the plan being queued on a thread can be done here.
+    }
+
     bool
     GetPrivate ()
     {
@@ -494,11 +506,34 @@ public:
         return lldb::ValueObjectSP();
     }
     
+    // If a thread plan stores the state before it was run, then you might
+    // want to restore the state when it is done.  This will do that job.
+    // This is mostly useful for artificial plans like CallFunction plans.
+    
+    virtual bool
+    RestoreThreadState()
+    {
+        // Nothing to do in general.
+        return true;
+    }
+
+    virtual bool
+    IsVirtualStep()
+    {
+        return false;
+    }
+    
 protected:
     //------------------------------------------------------------------
     // Classes that inherit from ThreadPlan can see and modify these
     //------------------------------------------------------------------
 
+    virtual bool
+    DoWillResume (lldb::StateType resume_state, bool current_plan) { return true; };
+
+    virtual bool
+    DoPlanExplainsStop (Event *event_ptr) = 0;
+    
     // This gets the previous plan to the current plan (for forwarding requests).
     // This is mostly a formal requirement, it allows us to make the Thread's
     // GetPreviousPlan protected, but only friend ThreadPlan to thread.
@@ -509,13 +544,13 @@ protected:
         return m_thread.GetPreviousPlan (this);
     }
     
-    // This forwards the private Thread::GetPrivateStopReason which is generally what
+    // This forwards the private Thread::GetPrivateStopInfo which is generally what
     // ThreadPlan's need to know.
     
     lldb::StopInfoSP 
-    GetPrivateStopReason()
+    GetPrivateStopInfo()
     {
-        return m_thread.GetPrivateStopReason ();
+        return m_thread.GetPrivateStopInfo ();
     }
     
     void
@@ -524,6 +559,18 @@ protected:
         m_thread.SetStopInfo (stop_reason_sp);
     }
     
+    void
+    CachePlanExplainsStop (bool does_explain)
+    {
+        m_cached_plan_explains_stop = does_explain ? eLazyBoolYes : eLazyBoolNo;
+    }
+    
+    LazyBool
+    GetCachedPlanExplainsStop () const
+    {
+        return m_cached_plan_explains_stop;
+    }
+    
     virtual lldb::StateType
     GetPlanRunState () = 0;
 
@@ -540,6 +587,7 @@ private:
     ThreadPlanKind m_kind;
     std::string m_name;
     Mutex m_plan_complete_mutex;
+    LazyBool m_cached_plan_explains_stop;
     bool m_plan_complete;
     bool m_plan_private;
     bool m_okay_to_discard;

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanBase.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanBase.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanBase.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanBase.h Thu Jun  6 19:06:43 2013
@@ -35,13 +35,12 @@ public:
 
     virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
     virtual bool ValidatePlan (Stream *error);
-    virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
+    virtual Vote ShouldReportStop (Event *event_ptr);
     virtual bool StopOthers ();
     virtual lldb::StateType GetPlanRunState ();
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
-    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
 
     virtual bool OkayToDiscard()
     {
@@ -55,6 +54,8 @@ public:
     }
     
 protected:
+    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
+    virtual bool DoPlanExplainsStop (Event *event_ptr);
     ThreadPlanBase (Thread &thread);
 
 private:

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h Thu Jun  6 19:06:43 2013
@@ -27,19 +27,21 @@ class ThreadPlanCallFunction : public Th
     // return type, otherwise just pass in an invalid ClangASTType.
 public:
     ThreadPlanCallFunction (Thread &thread,
-                            Address &function,
+                            const Address &function,
                             const ClangASTType &return_type,
                             lldb::addr_t arg,
                             bool stop_other_threads,
-                            bool discard_on_error = true,
+                            bool unwind_on_error = true,
+                            bool ignore_breakpoints = false,
                             lldb::addr_t *this_arg = 0,
                             lldb::addr_t *cmd_arg = 0);
 
     ThreadPlanCallFunction (Thread &thread,
-                            Address &function,
+                            const Address &function,
                             const ClangASTType &return_type,
                             bool stop_other_threads,
-                            bool discard_on_error,
+                            bool unwind_on_error,
+                            bool ignore_breakpoints,
                             lldb::addr_t *arg1_ptr = NULL,
                             lldb::addr_t *arg2_ptr = NULL,
                             lldb::addr_t *arg3_ptr = NULL,
@@ -57,10 +59,10 @@ public:
     ValidatePlan (Stream *error);
 
     virtual bool
-    PlanExplainsStop ();
-
-    virtual bool
     ShouldStop (Event *event_ptr);
+    
+    virtual Vote
+    ShouldReportStop(Event *event_ptr);
 
     virtual bool
     StopOthers ();
@@ -113,12 +115,17 @@ public:
     
     // If the thread plan stops mid-course, this will be the stop reason that interrupted us.
     // Once DoTakedown is called, this will be the real stop reason at the end of the function call.
+    // If it hasn't been set for one or the other of these reasons, we'll return the PrivateStopReason.
     // This is needed because we want the CallFunction thread plans not to show up as the stop reason.
     // But if something bad goes wrong, it is nice to be able to tell the user what really happened.
+
     virtual lldb::StopInfoSP
     GetRealStopInfo()
     {
-        return m_real_stop_info_sp;
+        if (m_real_stop_info_sp)
+            return m_real_stop_info_sp;
+        else
+            return GetPrivateStopInfo ();
     }
     
     lldb::addr_t
@@ -127,8 +134,15 @@ public:
         return m_stop_address;
     }
 
-protected:
+    virtual bool
+    RestoreThreadState();
+
+protected:    
     void ReportRegisterState (const char *message);
+
+    virtual bool
+    DoPlanExplainsStop (Event *event_ptr);
+
 private:
 
     bool
@@ -154,8 +168,6 @@ private:
     Address                                         m_function_addr;
     Address                                         m_start_addr;
     lldb::addr_t                                    m_function_sp;
-//    Process                                        &m_process;
-//    Thread                                         &m_thread;
     Thread::RegisterCheckpoint                      m_register_backup;
     lldb::ThreadPlanSP                              m_subplan_sp;
     LanguageRuntime                                *m_cxx_language_runtime;
@@ -165,11 +177,13 @@ private:
                                                                          // thread plans, but for reporting purposes,
                                                                          // it's nice to know the real stop reason.
                                                                          // This gets set in DoTakedown.
+    StreamString                                    m_constructor_errors;
     ClangASTType                                    m_return_type;
     lldb::ValueObjectSP                             m_return_valobj_sp;  // If this contains a valid pointer, use the ABI to extract values when complete
     bool                                            m_takedown_done;    // We want to ensure we only do the takedown once.  This ensures that.
     lldb::addr_t                                    m_stop_address;     // This is the address we stopped at.  Also set in DoTakedown;
-    bool                                            m_discard_on_error;
+    bool                                            m_unwind_on_error;
+    bool                                            m_ignore_breakpoints;
 
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallFunction);
 };

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallUserExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallUserExpression.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallUserExpression.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallUserExpression.h Thu Jun  6 19:06:43 2013
@@ -29,7 +29,8 @@ public:
                                   Address &function,
                                   lldb::addr_t arg,
                                   bool stop_other_threads,
-                                  bool discard_on_error,
+                                  bool unwind_on_error,
+                                  bool ignore_breakpoints,
                                   lldb::addr_t *this_arg,
                                   lldb::addr_t *cmd_arg,
                                   ClangUserExpression::ClangUserExpressionSP &user_expression_sp);

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanRunToAddress.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanRunToAddress.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanRunToAddress.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanRunToAddress.h Thu Jun  6 19:06:43 2013
@@ -47,9 +47,6 @@ public:
     ValidatePlan (Stream *error);
 
     virtual bool
-    PlanExplainsStop ();
-
-    virtual bool
     ShouldStop (Event *event_ptr);
 
     virtual bool
@@ -68,6 +65,9 @@ public:
     MischiefManaged ();
 
 protected:
+    virtual bool
+    DoPlanExplainsStop (Event *event_ptr);
+
     void SetInitialBreakpoints();
     bool AtOurAddress();
 private:

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInRange.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInRange.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInRange.h Thu Jun  6 19:06:43 2013
@@ -32,6 +32,12 @@ public:
                            const SymbolContext &addr_context,
                            lldb::RunMode stop_others);
 
+    ThreadPlanStepInRange (Thread &thread,
+                           const AddressRange &range,
+                           const SymbolContext &addr_context,
+                           const char *step_into_function_name,
+                           lldb::RunMode stop_others);
+
     virtual
     ~ThreadPlanStepInRange ();
 
@@ -43,16 +49,25 @@ public:
 
     void SetAvoidRegexp(const char *name);
     
+    void SetStepInTarget (const char *target)
+    {
+        m_step_into_target.SetCString(target);
+    }
+    
     static ThreadPlan *
     DefaultShouldStopHereCallback (ThreadPlan *current_plan, Flags &flags, void *baton);
 
     static void
     SetDefaultFlagValue (uint32_t new_value);
-
-    virtual bool
-    PlanExplainsStop ();
+    
+    bool
+    IsVirtualStep();
 
 protected:
+    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
+
+    virtual bool
+    DoPlanExplainsStop (Event *event_ptr);
 
     virtual void
     SetFlagsToDefault ();
@@ -63,10 +78,15 @@ protected:
 private:
 
     friend ThreadPlan *
-    Thread::QueueThreadPlanForStepRange (bool abort_other_plans,
-                                         StepType type,
+    Thread::QueueThreadPlanForStepOverRange (bool abort_other_plans,
                                          const AddressRange &range,
                                          const SymbolContext &addr_context,
+                                         lldb::RunMode stop_others);
+    friend ThreadPlan *
+    Thread::QueueThreadPlanForStepInRange (bool abort_other_plans,
+                                         const AddressRange &range,
+                                         const SymbolContext &addr_context,
+                                         const char *step_in_target,
                                          lldb::RunMode stop_others,
                                          bool avoid_code_without_debug_info);
 
@@ -75,10 +95,11 @@ private:
     // from step in.
 
     static uint32_t s_default_flag_values;
-    std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
+    std::unique_ptr<RegularExpression> m_avoid_regexp_ap;
     bool m_step_past_prologue;  // FIXME: For now hard-coded to true, we could put a switch in for this if there's
                                 // demand for that.
-
+    bool m_virtual_step;        // true if we've just done a "virtual step", i.e. just moved the inline stack depth.
+    ConstString m_step_into_target;
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepInRange);
 
 };

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInstruction.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInstruction.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepInstruction.h Thu Jun  6 19:06:43 2013
@@ -27,7 +27,6 @@ public:
 
     virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
     virtual bool ValidatePlan (Stream *error);
-    virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
     virtual lldb::StateType GetPlanRunState ();
@@ -35,6 +34,8 @@ public:
     virtual bool MischiefManaged ();
 
 protected:
+    virtual bool DoPlanExplainsStop (Event *event_ptr);
+
     ThreadPlanStepInstruction (Thread &thread,
                                bool step_over,
                                bool stop_others,

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOut.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOut.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOut.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOut.h Thu Jun  6 19:06:43 2013
@@ -34,11 +34,9 @@ public:
 
     virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
     virtual bool ValidatePlan (Stream *error);
-    virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
     virtual lldb::StateType GetPlanRunState ();
-    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
     virtual void DidPush();
@@ -50,6 +48,8 @@ public:
     }
 
 protected:
+    virtual bool DoPlanExplainsStop (Event *event_ptr);
+    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
     bool QueueInlinedStepPlan (bool queue_now);
 
 private:

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverBreakpoint.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverBreakpoint.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverBreakpoint.h Thu Jun  6 19:06:43 2013
@@ -27,23 +27,26 @@ public:
     ThreadPlanStepOverBreakpoint (Thread &thread);
     virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
     virtual bool ValidatePlan (Stream *error);
-    virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
     virtual lldb::StateType GetPlanRunState ();
-    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
+    virtual void ThreadDestroyed ();
     void SetAutoContinue (bool do_it);
     virtual bool ShouldAutoContinue(Event *event_ptr);
 
 protected:
+    virtual bool DoPlanExplainsStop (Event *event_ptr);
+    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
 
+    void ReenableBreakpointSite ();
 private:
 
     lldb::addr_t m_breakpoint_addr;
     lldb::user_id_t m_breakpoint_site_id;
     bool m_auto_continue;
+    bool m_reenabled_breakpoint_site;
 
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOverBreakpoint);
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverRange.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverRange.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepOverRange.h Thu Jun  6 19:06:43 2013
@@ -34,19 +34,14 @@ public:
 
     virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
     virtual bool ShouldStop (Event *event_ptr);
-    virtual bool PlanExplainsStop ();
-
+    
 protected:
+    virtual bool DoPlanExplainsStop (Event *event_ptr);
+    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
 
 private:
 
-    friend ThreadPlan *
-    Thread::QueueThreadPlanForStepRange (bool abort_other_plans,
-                                         StepType type,
-                                         const AddressRange &range,
-                                         const SymbolContext &addr_context,
-                                         lldb::RunMode stop_others,
-                                         bool avoid_code_without_debug_info);
+    bool m_first_resume;
 
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOverRange);
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepRange.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepRange.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepRange.h Thu Jun  6 19:06:43 2013
@@ -81,6 +81,7 @@ protected:
                                                  // but can't continue, in which case we are done.
     bool                      m_first_run_event; // We want to broadcast only one running event, our first.
     lldb::BreakpointSP        m_next_branch_bp_sp;
+    bool                      m_use_fast_step;
 
 private:
     std::vector<lldb::DisassemblerSP> m_instruction_ranges;

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepThrough.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepThrough.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepThrough.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepThrough.h Thu Jun  6 19:06:43 2013
@@ -26,16 +26,17 @@ public:
 
     virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
     virtual bool ValidatePlan (Stream *error);
-    virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
     virtual lldb::StateType GetPlanRunState ();
-    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
     virtual void DidPush();
 
 protected:
+    virtual bool DoPlanExplainsStop (Event *event_ptr);
+    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
+
     ThreadPlanStepThrough (Thread &thread,
                            StackID &return_stack_id,
                            bool stop_others);

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepUntil.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepUntil.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepUntil.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanStepUntil.h Thu Jun  6 19:06:43 2013
@@ -27,15 +27,16 @@ public:
 
     virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
     virtual bool ValidatePlan (Stream *error);
-    virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
     virtual lldb::StateType GetPlanRunState ();
-    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
 
 protected:
+    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
+    virtual bool DoPlanExplainsStop (Event *event_ptr);
+
     ThreadPlanStepUntil (Thread &thread,
                          lldb::addr_t *address_list,
                          size_t num_addresses,

Modified: lldb/branches/lldb-platform-work/include/lldb/Utility/AnsiTerminal.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Utility/AnsiTerminal.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Utility/AnsiTerminal.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Utility/AnsiTerminal.h Thu Jun  6 19:06:43 2013
@@ -21,7 +21,7 @@
 #define ANSI_BG_COLOR_BLACK         40
 #define ANSI_BG_COLOR_RED           41	
 #define ANSI_BG_COLOR_GREEN         42	
-#define ANSI_BG_COLOR_YELLOW        44	
+#define ANSI_BG_COLOR_YELLOW        43	
 #define ANSI_BG_COLOR_BLUE          44	
 #define ANSI_BG_COLOR_PURPLE        45	
 #define ANSI_BG_COLOR_CYAN          46	
@@ -82,5 +82,75 @@ namespace lldb_utility {
         const char *k_ctrl_conceal	     = "8";
         const char *k_ctrl_crossed_out	 = "9";
 
+        inline std::string
+        FormatAnsiTerminalCodes(const char *format, bool do_color = true)
+        {
+            // Convert "${ansi.XXX}" tokens to ansi values or clear them if do_color is false.
+            static const struct
+            {
+                const char *name;
+                const char *value;
+            } g_color_tokens[] =
+            {
+        #define _TO_STR2(_val) #_val
+        #define _TO_STR(_val) _TO_STR2(_val)
+                { "fg.black}",        ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_BLACK)      ANSI_ESC_END },
+                { "fg.red}",          ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_RED)        ANSI_ESC_END },
+                { "fg.green}",        ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_GREEN)      ANSI_ESC_END },
+                { "fg.yellow}",       ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_YELLOW)     ANSI_ESC_END },
+                { "fg.blue}",         ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_BLUE)       ANSI_ESC_END },
+                { "fg.purple}",       ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_PURPLE)     ANSI_ESC_END },
+                { "fg.cyan}",         ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_CYAN)       ANSI_ESC_END },
+                { "fg.white}",        ANSI_ESC_START _TO_STR(ANSI_FG_COLOR_WHITE)      ANSI_ESC_END },
+                { "bg.black}",        ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_BLACK)      ANSI_ESC_END },
+                { "bg.red}",          ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_RED)        ANSI_ESC_END },
+                { "bg.green}",        ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_GREEN)      ANSI_ESC_END },
+                { "bg.yellow}",       ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_YELLOW)     ANSI_ESC_END },
+                { "bg.blue}",         ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_BLUE)       ANSI_ESC_END },
+                { "bg.purple}",       ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_PURPLE)     ANSI_ESC_END },
+                { "bg.cyan}",         ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_CYAN)       ANSI_ESC_END },
+                { "bg.white}",        ANSI_ESC_START _TO_STR(ANSI_BG_COLOR_WHITE)      ANSI_ESC_END },
+                { "normal}",          ANSI_ESC_START _TO_STR(ANSI_CTRL_NORMAL)         ANSI_ESC_END },
+                { "bold}",            ANSI_ESC_START _TO_STR(ANSI_CTRL_BOLD)           ANSI_ESC_END },
+                { "faint}",           ANSI_ESC_START _TO_STR(ANSI_CTRL_FAINT)          ANSI_ESC_END },
+                { "italic}",          ANSI_ESC_START _TO_STR(ANSI_CTRL_ITALIC)         ANSI_ESC_END },
+                { "underline}",       ANSI_ESC_START _TO_STR(ANSI_CTRL_UNDERLINE)      ANSI_ESC_END },
+                { "slow-blink}",      ANSI_ESC_START _TO_STR(ANSI_CTRL_SLOW_BLINK)     ANSI_ESC_END },
+                { "fast-blink}",      ANSI_ESC_START _TO_STR(ANSI_CTRL_FAST_BLINK)     ANSI_ESC_END },
+                { "negative}",        ANSI_ESC_START _TO_STR(ANSI_CTRL_IMAGE_NEGATIVE) ANSI_ESC_END },
+                { "conceal}",         ANSI_ESC_START _TO_STR(ANSI_CTRL_CONCEAL)        ANSI_ESC_END },
+                { "crossed-out}",     ANSI_ESC_START _TO_STR(ANSI_CTRL_CROSSED_OUT)    ANSI_ESC_END },
+        #undef _TO_STR
+        #undef _TO_STR2
+            };
+            static const char tok_hdr[] = "${ansi.";
+
+            std::string fmt;
+            for (const char *p = format; *p; ++p)
+            {
+                const char *tok_start = strstr (p, tok_hdr);
+                if (!tok_start)
+                {
+                    fmt.append (p, strlen(p));
+                    break;
+                }
+
+                fmt.append (p, tok_start - p);
+                p = tok_start;
+
+                const char *tok_str = tok_start + sizeof(tok_hdr) - 1;
+                for (size_t i = 0; i < sizeof(g_color_tokens) / sizeof(g_color_tokens[0]); ++i)
+                {
+                    if (!strncmp (tok_str, g_color_tokens[i].name, strlen(g_color_tokens[i].name)))
+                    {
+                        if (do_color)
+                            fmt.append (g_color_tokens[i].value);
+                        p = tok_str + strlen (g_color_tokens[i].name) - 1;
+                        break;
+                    }
+                }
+            }
+            return fmt;
+        }
     }
 }

Modified: lldb/branches/lldb-platform-work/include/lldb/Utility/PriorityPointerPair.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Utility/PriorityPointerPair.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Utility/PriorityPointerPair.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Utility/PriorityPointerPair.h Thu Jun  6 19:06:43 2013
@@ -30,7 +30,7 @@ public:
     typedef T& reference_type;
     typedef T* pointer_type;
     
-    typedef typename STD_SHARED_PTR(T) T_SP;
+    typedef typename std::shared_ptr<T> T_SP;
     
     PriorityPointerPair() : 
     m_high(),

Modified: lldb/branches/lldb-platform-work/include/lldb/Utility/PythonPointer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Utility/PythonPointer.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Utility/PythonPointer.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Utility/PythonPointer.h Thu Jun  6 19:06:43 2013
@@ -11,7 +11,6 @@
 #define utility_PythonPointer_h_
 
 #include <algorithm>
-#include <memory>
 
 #if defined (__APPLE__)
 #include <Python/Python.h>

Modified: lldb/branches/lldb-platform-work/include/lldb/Utility/SharingPtr.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Utility/SharingPtr.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Utility/SharingPtr.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Utility/SharingPtr.h Thu Jun  6 19:06:43 2013
@@ -198,7 +198,7 @@ template<class Y>
 SharingPtr<T>::SharingPtr(Y* p)
     : ptr_(p), cntrl_(0)
 {
-    std::auto_ptr<Y> hold(p);
+    std::unique_ptr<Y> hold(p);
     typedef imp::shared_ptr_pointer<Y*> _CntrlBlk;
     cntrl_ = new _CntrlBlk(p);
     hold.release();

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-defines.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-defines.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-defines.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-defines.h Thu Jun  6 19:06:43 2013
@@ -26,6 +26,8 @@
 // A build script phase can modify this version number if needed.
 //----------------------------------------------------------------------
 //#define LLDB_VERSION
+//#define LLDB_REVISION
+//#define LLDB_VERSION_STRING
 
 //----------------------------------------------------------------------
 // LLDB defines
@@ -77,6 +79,7 @@
 #define LLDB_INVALID_THREAD_ID          0
 #define LLDB_INVALID_FRAME_ID           UINT32_MAX
 #define LLDB_INVALID_SIGNAL_NUMBER      INT32_MAX
+#define LLDB_INVALID_OFFSET             UINT64_MAX // Must match max of lldb::offset_t
 
 //----------------------------------------------------------------------
 /// CPU Type defintions

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h Thu Jun  6 19:06:43 2013
@@ -137,6 +137,7 @@ namespace lldb {
         eDescriptionLevelBrief = 0,
         eDescriptionLevelFull,
         eDescriptionLevelVerbose,
+        eDescriptionLevelInitial,
         kNumDescriptionLevels
     } DescriptionLevel;
 
@@ -175,7 +176,9 @@ namespace lldb {
         eStopReasonWatchpoint,
         eStopReasonSignal,
         eStopReasonException,
-        eStopReasonPlanComplete
+        eStopReasonExec,        // Program was re-exec'ed
+        eStopReasonPlanComplete,
+        eStopReasonThreadExiting
     } StopReason;
 
     //----------------------------------------------------------------------
@@ -298,6 +301,20 @@ namespace lldb {
         eBreakpointEventTypeThreadChanged       = (1u << 11)
     } BreakpointEventType;
 
+    typedef enum WatchpointEventType
+    {
+        eWatchpointEventTypeInvalidType         = (1u << 0),
+        eWatchpointEventTypeAdded               = (1u << 1),
+        eWatchpointEventTypeRemoved             = (1u << 2),
+        eWatchpointEventTypeEnabled             = (1u << 6),
+        eWatchpointEventTypeDisabled            = (1u << 7),
+        eWatchpointEventTypeCommandChanged      = (1u << 8),
+        eWatchpointEventTypeConditionChanged    = (1u << 9),
+        eWatchpointEventTypeIgnoreChanged       = (1u << 10),
+        eWatchpointEventTypeThreadChanged       = (1u << 11),
+        eWatchpointEventTypeTypeChanged         = (1u << 12)
+    } WatchpointEventType;
+
 
     //----------------------------------------------------------------------
     /// Programming language type.
@@ -329,7 +346,8 @@ namespace lldb {
         eLanguageTypeObjC_plus_plus  = 0x0011,   ///< Objective-C++.
         eLanguageTypeUPC             = 0x0012,   ///< Unified Parallel C.
         eLanguageTypeD               = 0x0013,   ///< D.
-        eLanguageTypePython          = 0x0014    ///< Python.
+        eLanguageTypePython          = 0x0014,   ///< Python.
+        eNumLanguageTypes
     } LanguageType;
 
     typedef enum DynamicValueType
@@ -351,6 +369,7 @@ namespace lldb {
     typedef enum CommandArgumentType
     {
         eArgTypeAddress = 0,
+        eArgTypeAddressOrExpression,
         eArgTypeAliasName,
         eArgTypeAliasOptions,
         eArgTypeArchitecture,
@@ -361,6 +380,8 @@ namespace lldb {
         eArgTypeClassName,
         eArgTypeCommandName,
         eArgTypeCount,
+        eArgTypeDirectoryName,
+        eArgTypeDisassemblyFlavor,
         eArgTypeEndAddress,
         eArgTypeExpression,
         eArgTypeExpressionPath,
@@ -370,6 +391,7 @@ namespace lldb {
         eArgTypeFrameIndex,
         eArgTypeFullName,
         eArgTypeFunctionName,
+        eArgTypeFunctionOrSymbol,
         eArgTypeGDBFormat,
         eArgTypeIndex,
         eArgTypeLanguage,
@@ -437,6 +459,7 @@ namespace lldb {
         eSymbolTypeInvalid = 0,
         eSymbolTypeAbsolute,
         eSymbolTypeCode,
+        eSymbolTypeResolver,
         eSymbolTypeData,
         eSymbolTypeTrampoline,
         eSymbolTypeRuntime,
@@ -521,10 +544,7 @@ namespace lldb {
                                                     // methods or selectors will be searched.
         eFunctionNameTypeMethod     = (1u << 4),    // Find function by method name (C++) with no namespace or arguments
         eFunctionNameTypeSelector   = (1u << 5),    // Find function by selector name (ObjC) names
-        eFunctionNameTypeAny        = (eFunctionNameTypeFull     |
-                                       eFunctionNameTypeBase     |
-                                       eFunctionNameTypeMethod   |
-                                       eFunctionNameTypeSelector )
+        eFunctionNameTypeAny        = eFunctionNameTypeAuto // DEPRECATED: use eFunctionNameTypeAuto
     } FunctionNameType;
     
     
@@ -537,7 +557,10 @@ namespace lldb {
         eBasicTypeVoid = 1,
         eBasicTypeChar,
         eBasicTypeSignedChar,
+        eBasicTypeUnsignedChar,
         eBasicTypeWChar,
+        eBasicTypeSignedWChar,
+        eBasicTypeUnsignedWChar,
         eBasicTypeChar16,
         eBasicTypeChar32,
         eBasicTypeShort,
@@ -551,6 +574,7 @@ namespace lldb {
         eBasicTypeInt128,
         eBasicTypeUnsignedInt128,
         eBasicTypeBool,
+        eBasicTypeHalf,
         eBasicTypeFloat,
         eBasicTypeDouble,
         eBasicTypeLongDouble,
@@ -559,7 +583,9 @@ namespace lldb {
         eBasicTypeLongDoubleComplex,
         eBasicTypeObjCID,
         eBasicTypeObjCClass,
-        eBasicTypeObjCSel
+        eBasicTypeObjCSel,
+        eBasicTypeNullPtr,
+        eBasicTypeOther
     } BasicType;
 
     typedef enum TypeClass

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h Thu Jun  6 19:06:43 2013
@@ -12,22 +12,6 @@
 
 #if defined(__cplusplus)
 
-#include <ciso646>  // detect C++ lib
-
-#ifdef _LIBCPP_VERSION
-#include <memory>
-#define STD_SHARED_PTR(T) std::shared_ptr<T>
-#define STD_WEAK_PTR(T) std::weak_ptr<T>
-#define STD_ENABLE_SHARED_FROM_THIS(T) std::enable_shared_from_this<T>
-#define STD_STATIC_POINTER_CAST(T,V) std::static_pointer_cast<T>(V)
-#else
-#include <tr1/memory>
-#define STD_SHARED_PTR(T) std::tr1::shared_ptr<T>
-#define STD_WEAK_PTR(T) std::tr1::weak_ptr<T>
-#define STD_ENABLE_SHARED_FROM_THIS(T) std::tr1::enable_shared_from_this<T>
-#define STD_STATIC_POINTER_CAST(T,V) std::tr1::static_pointer_cast<T>(V)
-#endif
-
 #include "lldb/Utility/SharingPtr.h"
 
 //----------------------------------------------------------------------
@@ -62,6 +46,7 @@ class   BroadcasterManager;
 class   CPPLanguageRuntime;
 class   ClangASTContext;
 class   ClangASTImporter;
+class   ClangASTMetadata;
 class   ClangASTSource;
 class   ClangASTType;
 class   ClangNamespaceDecl;
@@ -85,6 +70,7 @@ class   Condition;
 class   Connection;
 class   ConnectionFileDescriptor;
 class   ConstString;
+class   CXXSyntheticChildren;
 class   DWARFCallFrameInfo;
 class   DWARFExpression;
 class   DataBuffer;
@@ -93,9 +79,11 @@ class   DataExtractor;
 class   Debugger;
 class   Declaration;
 class   Disassembler;
+class   DynamicLibrary;
 class   DynamicLoader;
 class   EmulateInstruction;
 class   Error;
+class   EvaluateExpressionOptions;
 class   Event;
 class   EventData;
 class   ExecutionContext;
@@ -113,18 +101,20 @@ class   Function;
 class   FunctionInfo;
 class   InlineFunctionInfo;
 class   InputReader;
-class   InstanceSettings;
 class   Instruction;
 class   InstructionList;
+class   IRExecutionUnit;
 class   LanguageRuntime;
 class   LineTable;
 class   Listener;
 class   Log;
 class   LogChannel;
 class   Mangled;
+class   Materializer;
 class   Module;
 class   ModuleList;
 class   ModuleSpec;
+class   ModuleSpecList;
 class   Mutex;
 struct  NameSearchContext;
 class   ObjCLanguageRuntime;
@@ -136,6 +126,22 @@ class   ObjectFile;
 class   OperatingSystem;
 class   Options;
 class   OptionValue;
+class   OptionValueArch;
+class   OptionValueArgs;
+class   OptionValueArray;
+class   OptionValueBoolean;
+class   OptionValueDictionary;
+class   OptionValueEnumeration;
+class   OptionValueFileSpec;
+class   OptionValueFileSpecList;
+class   OptionValueFormat;
+class   OptionValuePathMappings;
+class   OptionValueProperties;
+class   OptionValueRegex;
+class   OptionValueSInt64;
+class   OptionValueString;
+class   OptionValueUInt64;
+class   OptionValueUUID;
 class   NamedOption;
 class   PathMappingList;
 class   Platform;
@@ -147,6 +153,13 @@ class   ProcessInstanceInfo;
 class   ProcessInstanceInfoList;
 class   ProcessInstanceInfoMatch;
 class   ProcessLaunchInfo;
+class   Property;
+struct  PropertyDefinition;
+class   PythonArray;
+class   PythonDictionary;
+class   PythonInteger;
+class   PythonObject;
+class   PythonString;
 class   RegisterContext;
 class   RegisterLocation;
 class   RegisterLocationList;
@@ -154,6 +167,7 @@ class   RegisterValue;
 class   RegularExpression;
 class   Scalar;
 class   ScriptInterpreter;
+class   ScriptInterpreterLocker;
 class   ScriptInterpreterObject;
 #ifndef LLDB_DISABLE_PYTHON
 class   ScriptInterpreterPython;
@@ -163,6 +177,7 @@ class   SearchFilter;
 class   Section;
 class   SectionImpl;
 class   SectionList;
+class   Settings;
 class   SourceManager;
 class   SourceManagerImpl;
 class   StackFrame;
@@ -193,7 +208,7 @@ class   SyntheticChildren;
 class   SyntheticChildrenFrontEnd;
 class   TypeFilterImpl;
 #ifndef LLDB_DISABLE_PYTHON
-class   TypeSyntheticImpl;
+class   ScriptedSyntheticChildren;
 #endif
 class   Target;
 class   TargetList;
@@ -211,6 +226,7 @@ class   ThreadPlanTracer;
 class   ThreadSpec;
 class   TimeValue;
 class   Type;
+class   TypeCategoryMap;
 class   TypeImpl;
 class   TypeAndOrName;
 class   TypeList;
@@ -222,7 +238,6 @@ class   Unwind;
 class   UnwindAssembly;
 class   UnwindPlan;
 class   UnwindTable;
-class   UserSettingsController;
 class   VMRange;
 class   Value;
 class   TypeFormatImpl;
@@ -247,101 +262,117 @@ struct  LineEntry;
 //----------------------------------------------------------------------
 namespace lldb {
     
-    typedef STD_SHARED_PTR(lldb_private::ABI) ABISP;
-    typedef STD_SHARED_PTR(lldb_private::Baton) BatonSP;
-    typedef STD_SHARED_PTR(lldb_private::Block) BlockSP;
-    typedef STD_SHARED_PTR(lldb_private::Breakpoint) BreakpointSP;
-    typedef STD_WEAK_PTR(lldb_private::Breakpoint) BreakpointWP;
-    typedef STD_SHARED_PTR(lldb_private::BreakpointSite) BreakpointSiteSP;
-    typedef STD_WEAK_PTR(lldb_private::BreakpointSite) BreakpointSiteWP;
-    typedef STD_SHARED_PTR(lldb_private::BreakpointLocation) BreakpointLocationSP;
-    typedef STD_WEAK_PTR(lldb_private::BreakpointLocation) BreakpointLocationWP;
-    typedef STD_SHARED_PTR(lldb_private::BreakpointResolver) BreakpointResolverSP;
-    typedef STD_SHARED_PTR(lldb_private::Broadcaster) BroadcasterSP;
-    typedef STD_SHARED_PTR(lldb_private::ClangExpressionVariable) ClangExpressionVariableSP;
-    typedef STD_SHARED_PTR(lldb_private::CommandObject) CommandObjectSP;
-    typedef STD_SHARED_PTR(lldb_private::Communication) CommunicationSP;
-    typedef STD_SHARED_PTR(lldb_private::Connection) ConnectionSP;
-    typedef STD_SHARED_PTR(lldb_private::CompileUnit) CompUnitSP;
-    typedef STD_SHARED_PTR(lldb_private::DataBuffer) DataBufferSP;
-    typedef STD_SHARED_PTR(lldb_private::DataExtractor) DataExtractorSP;
-    typedef STD_SHARED_PTR(lldb_private::Debugger) DebuggerSP;
-    typedef STD_WEAK_PTR(lldb_private::Debugger) DebuggerWP;
-    typedef STD_SHARED_PTR(lldb_private::Disassembler) DisassemblerSP;
-    typedef STD_SHARED_PTR(lldb_private::DynamicLoader) DynamicLoaderSP;
-    typedef STD_SHARED_PTR(lldb_private::Event) EventSP;
-    typedef STD_SHARED_PTR(lldb_private::ExecutionContextRef) ExecutionContextRefSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeCategoryImpl) TypeCategoryImplSP;
-    typedef STD_SHARED_PTR(lldb_private::File) FileSP;
-    typedef STD_SHARED_PTR(lldb_private::Function) FunctionSP;
-    typedef STD_SHARED_PTR(lldb_private::InlineFunctionInfo) InlineFunctionInfoSP;
-    typedef STD_SHARED_PTR(lldb_private::InputReader) InputReaderSP;
-    typedef STD_SHARED_PTR(lldb_private::InstanceSettings) InstanceSettingsSP;
-    typedef STD_SHARED_PTR(lldb_private::Instruction) InstructionSP;
-    typedef STD_SHARED_PTR(lldb_private::LanguageRuntime) LanguageRuntimeSP;
-    typedef STD_SHARED_PTR(lldb_private::LineTable) LineTableSP;
-    typedef STD_SHARED_PTR(lldb_private::Listener) ListenerSP;
-    typedef STD_SHARED_PTR(lldb_private::Log) LogSP;
-    typedef STD_SHARED_PTR(lldb_private::LogChannel) LogChannelSP;
-    typedef STD_SHARED_PTR(lldb_private::Module) ModuleSP;
-    typedef STD_WEAK_PTR(lldb_private::Module) ModuleWP;
-    typedef STD_SHARED_PTR(lldb_private::ObjectFile) ObjectFileSP;
-    typedef STD_WEAK_PTR(lldb_private::ObjectFile) ObjectFileWP;
-    typedef STD_SHARED_PTR(lldb_private::OptionValue) OptionValueSP;
-    typedef STD_SHARED_PTR(lldb_private::Platform) PlatformSP;
-    typedef STD_SHARED_PTR(lldb_private::Process) ProcessSP;
-    typedef STD_SHARED_PTR(lldb_private::ProcessAttachInfo) ProcessAttachInfoSP;
-    typedef STD_SHARED_PTR(lldb_private::ProcessLaunchInfo) ProcessLaunchInfoSP;
-    typedef STD_WEAK_PTR(lldb_private::Process) ProcessWP;
-    typedef STD_SHARED_PTR(lldb_private::RegisterContext) RegisterContextSP;
-    typedef STD_SHARED_PTR(lldb_private::RegularExpression) RegularExpressionSP;
-    typedef STD_SHARED_PTR(lldb_private::Section) SectionSP;
-    typedef STD_WEAK_PTR(lldb_private::Section) SectionWP;
-    typedef STD_SHARED_PTR(lldb_private::SearchFilter) SearchFilterSP;
-    typedef STD_SHARED_PTR(lldb_private::ScriptInterpreterObject) ScriptInterpreterObjectSP;
+    typedef std::shared_ptr<lldb_private::ABI> ABISP;
+    typedef std::shared_ptr<lldb_private::Baton> BatonSP;
+    typedef std::shared_ptr<lldb_private::Block> BlockSP;
+    typedef std::shared_ptr<lldb_private::Breakpoint> BreakpointSP;
+    typedef std::weak_ptr<lldb_private::Breakpoint> BreakpointWP;
+    typedef std::shared_ptr<lldb_private::BreakpointSite> BreakpointSiteSP;
+    typedef std::weak_ptr<lldb_private::BreakpointSite> BreakpointSiteWP;
+    typedef std::shared_ptr<lldb_private::BreakpointLocation> BreakpointLocationSP;
+    typedef std::weak_ptr<lldb_private::BreakpointLocation> BreakpointLocationWP;
+    typedef std::shared_ptr<lldb_private::BreakpointResolver> BreakpointResolverSP;
+    typedef std::shared_ptr<lldb_private::Broadcaster> BroadcasterSP;
+    typedef std::shared_ptr<lldb_private::ClangExpressionVariable> ClangExpressionVariableSP;
+    typedef std::shared_ptr<lldb_private::CommandObject> CommandObjectSP;
+    typedef std::shared_ptr<lldb_private::Communication> CommunicationSP;
+    typedef std::shared_ptr<lldb_private::Connection> ConnectionSP;
+    typedef std::shared_ptr<lldb_private::CompileUnit> CompUnitSP;
+    typedef std::shared_ptr<lldb_private::DataBuffer> DataBufferSP;
+    typedef std::shared_ptr<lldb_private::DataExtractor> DataExtractorSP;
+    typedef std::shared_ptr<lldb_private::Debugger> DebuggerSP;
+    typedef std::weak_ptr<lldb_private::Debugger> DebuggerWP;
+    typedef std::shared_ptr<lldb_private::Disassembler> DisassemblerSP;
+    typedef std::shared_ptr<lldb_private::DynamicLibrary> DynamicLibrarySP;
+    typedef std::shared_ptr<lldb_private::DynamicLoader> DynamicLoaderSP;
+    typedef std::shared_ptr<lldb_private::Event> EventSP;
+    typedef std::shared_ptr<lldb_private::ExecutionContextRef> ExecutionContextRefSP;
+    typedef std::shared_ptr<lldb_private::File> FileSP;
+    typedef std::shared_ptr<lldb_private::Function> FunctionSP;
+    typedef std::shared_ptr<lldb_private::FuncUnwinders> FuncUnwindersSP;
+    typedef std::shared_ptr<lldb_private::InlineFunctionInfo> InlineFunctionInfoSP;
+    typedef std::shared_ptr<lldb_private::InputReader> InputReaderSP;
+    typedef std::shared_ptr<lldb_private::Instruction> InstructionSP;
+    typedef std::shared_ptr<lldb_private::LanguageRuntime> LanguageRuntimeSP;
+    typedef std::shared_ptr<lldb_private::LineTable> LineTableSP;
+    typedef std::shared_ptr<lldb_private::Listener> ListenerSP;
+    typedef std::shared_ptr<lldb_private::LogChannel> LogChannelSP;
+    typedef std::shared_ptr<lldb_private::Module> ModuleSP;
+    typedef std::weak_ptr<lldb_private::Module> ModuleWP;
+    typedef std::shared_ptr<lldb_private::ObjectFile> ObjectFileSP;
+    typedef std::weak_ptr<lldb_private::ObjectFile> ObjectFileWP;
+    typedef std::shared_ptr<lldb_private::OptionValue> OptionValueSP;
+    typedef std::weak_ptr<lldb_private::OptionValue> OptionValueWP;
+    typedef std::shared_ptr<lldb_private::OptionValueArch> OptionValueArchSP;
+    typedef std::shared_ptr<lldb_private::OptionValueArgs> OptionValueArgsSP;
+    typedef std::shared_ptr<lldb_private::OptionValueArray> OptionValueArraySP;
+    typedef std::shared_ptr<lldb_private::OptionValueBoolean> OptionValueBooleanSP;
+    typedef std::shared_ptr<lldb_private::OptionValueDictionary> OptionValueDictionarySP;
+    typedef std::shared_ptr<lldb_private::OptionValueFileSpec> OptionValueFileSpecSP;
+    typedef std::shared_ptr<lldb_private::OptionValueFileSpecList> OptionValueFileSpecListSP;
+    typedef std::shared_ptr<lldb_private::OptionValueFormat> OptionValueFormatSP;
+    typedef std::shared_ptr<lldb_private::OptionValuePathMappings> OptionValuePathMappingsSP;
+    typedef std::shared_ptr<lldb_private::OptionValueProperties> OptionValuePropertiesSP;
+    typedef std::shared_ptr<lldb_private::OptionValueRegex> OptionValueRegexSP;
+    typedef std::shared_ptr<lldb_private::OptionValueSInt64> OptionValueSInt64SP;
+    typedef std::shared_ptr<lldb_private::OptionValueString> OptionValueStringSP;
+    typedef std::shared_ptr<lldb_private::OptionValueUInt64> OptionValueUInt64SP;
+    typedef std::shared_ptr<lldb_private::OptionValueUUID> OptionValueUUIDSP;
+    typedef std::shared_ptr<lldb_private::Platform> PlatformSP;
+    typedef std::shared_ptr<lldb_private::Process> ProcessSP;
+    typedef std::shared_ptr<lldb_private::ProcessAttachInfo> ProcessAttachInfoSP;
+    typedef std::shared_ptr<lldb_private::ProcessLaunchInfo> ProcessLaunchInfoSP;
+    typedef std::weak_ptr<lldb_private::Process> ProcessWP;
+    typedef std::shared_ptr<lldb_private::Property> PropertySP;
+    typedef std::shared_ptr<lldb_private::RegisterContext> RegisterContextSP;
+    typedef std::shared_ptr<lldb_private::RegularExpression> RegularExpressionSP;
+    typedef std::shared_ptr<lldb_private::ScriptInterpreterObject> ScriptInterpreterObjectSP;
 #ifndef LLDB_DISABLE_PYTHON
-    typedef STD_SHARED_PTR(lldb_private::ScriptSummaryFormat) ScriptSummaryFormatSP;
+    typedef std::shared_ptr<lldb_private::ScriptSummaryFormat> ScriptSummaryFormatSP;
 #endif // #ifndef LLDB_DISABLE_PYTHON
-    typedef STD_SHARED_PTR(lldb_private::StackFrame) StackFrameSP;
-    typedef STD_WEAK_PTR(lldb_private::StackFrame) StackFrameWP;
-    typedef STD_SHARED_PTR(lldb_private::StackFrameList) StackFrameListSP;
-    typedef STD_SHARED_PTR(lldb_private::StopInfo) StopInfoSP;
-    typedef STD_SHARED_PTR(lldb_private::StoppointLocation) StoppointLocationSP;
-    typedef STD_SHARED_PTR(lldb_private::Stream) StreamSP;
-    typedef STD_SHARED_PTR(lldb_private::StringSummaryFormat) StringTypeSummaryImplSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeSummaryImpl) TypeSummaryImplSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeNameSpecifierImpl) TypeNameSpecifierImplSP;
-    typedef STD_SHARED_PTR(lldb_private::SymbolFile) SymbolFileSP;
-    typedef STD_SHARED_PTR(lldb_private::SymbolFileType) SymbolFileTypeSP;
-    typedef STD_WEAK_PTR(lldb_private::SymbolFileType) SymbolFileTypeWP;
-    typedef STD_SHARED_PTR(lldb_private::SymbolContextSpecifier) SymbolContextSpecifierSP;
-    typedef STD_SHARED_PTR(lldb_private::SyntheticChildren) SyntheticChildrenSP;
-    typedef STD_SHARED_PTR(lldb_private::SyntheticChildrenFrontEnd) SyntheticChildrenFrontEndSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeFilterImpl) TypeFilterImplSP;
+    typedef std::shared_ptr<lldb_private::Section> SectionSP;
+    typedef std::weak_ptr<lldb_private::Section> SectionWP;
+    typedef std::shared_ptr<lldb_private::SearchFilter> SearchFilterSP;
+    typedef std::shared_ptr<lldb_private::Settings> SettingsSP;
+    typedef std::shared_ptr<lldb_private::StackFrame> StackFrameSP;
+    typedef std::weak_ptr<lldb_private::StackFrame> StackFrameWP;
+    typedef std::shared_ptr<lldb_private::StackFrameList> StackFrameListSP;
+    typedef std::shared_ptr<lldb_private::StopInfo> StopInfoSP;
+    typedef std::shared_ptr<lldb_private::StoppointLocation> StoppointLocationSP;
+    typedef std::shared_ptr<lldb_private::Stream> StreamSP;
+    typedef std::weak_ptr<lldb_private::Stream> StreamWP;
+    typedef std::shared_ptr<lldb_private::StringSummaryFormat> StringTypeSummaryImplSP;
+    typedef std::shared_ptr<lldb_private::SymbolFile> SymbolFileSP;
+    typedef std::shared_ptr<lldb_private::SymbolFileType> SymbolFileTypeSP;
+    typedef std::weak_ptr<lldb_private::SymbolFileType> SymbolFileTypeWP;
+    typedef std::shared_ptr<lldb_private::SymbolContextSpecifier> SymbolContextSpecifierSP;
+    typedef std::shared_ptr<lldb_private::SyntheticChildren> SyntheticChildrenSP;
+    typedef std::shared_ptr<lldb_private::SyntheticChildrenFrontEnd> SyntheticChildrenFrontEndSP;
+    typedef std::shared_ptr<lldb_private::Target> TargetSP;
+    typedef std::weak_ptr<lldb_private::Target> TargetWP;
+    typedef std::shared_ptr<lldb_private::Thread> ThreadSP;
+    typedef std::weak_ptr<lldb_private::Thread> ThreadWP;
+    typedef std::shared_ptr<lldb_private::ThreadPlan> ThreadPlanSP;
+    typedef std::shared_ptr<lldb_private::ThreadPlanTracer> ThreadPlanTracerSP;
+    typedef std::shared_ptr<lldb_private::Type> TypeSP;
+    typedef std::weak_ptr<lldb_private::Type> TypeWP;
+    typedef std::shared_ptr<lldb_private::TypeCategoryImpl> TypeCategoryImplSP;
+    typedef std::shared_ptr<lldb_private::TypeImpl> TypeImplSP;
+    typedef std::shared_ptr<lldb_private::TypeFilterImpl> TypeFilterImplSP;
+    typedef std::shared_ptr<lldb_private::TypeFormatImpl> TypeFormatImplSP;
+    typedef std::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP;
+    typedef std::shared_ptr<lldb_private::TypeSummaryImpl> TypeSummaryImplSP;
 #ifndef LLDB_DISABLE_PYTHON
-    typedef STD_SHARED_PTR(lldb_private::TypeSyntheticImpl) TypeSyntheticImplSP;
+    typedef std::shared_ptr<lldb_private::ScriptedSyntheticChildren> ScriptedSyntheticChildrenSP;
 #endif
-    typedef STD_SHARED_PTR(lldb_private::Target) TargetSP;
-    typedef STD_WEAK_PTR(lldb_private::Target) TargetWP;
-    typedef STD_SHARED_PTR(lldb_private::Thread) ThreadSP;
-    typedef STD_WEAK_PTR(lldb_private::Thread) ThreadWP;
-    typedef STD_SHARED_PTR(lldb_private::ThreadPlan) ThreadPlanSP;
-    typedef STD_SHARED_PTR(lldb_private::ThreadPlanTracer) ThreadPlanTracerSP;
-    typedef STD_SHARED_PTR(lldb_private::Type) TypeSP;
-    typedef STD_WEAK_PTR(lldb_private::Type) TypeWP;
-    typedef STD_SHARED_PTR(lldb_private::TypeImpl) TypeImplSP;
-    typedef STD_SHARED_PTR(lldb_private::FuncUnwinders) FuncUnwindersSP;
-    typedef STD_SHARED_PTR(lldb_private::UserSettingsController) UserSettingsControllerSP;
-    typedef STD_WEAK_PTR(lldb_private::UserSettingsController) UserSettingsControllerWP;
-    typedef STD_SHARED_PTR(lldb_private::UnwindPlan) UnwindPlanSP;
+    typedef std::shared_ptr<lldb_private::UnwindPlan> UnwindPlanSP;
     typedef lldb_private::SharingPtr<lldb_private::ValueObject> ValueObjectSP;
-    typedef STD_SHARED_PTR(lldb_private::Value) ValueSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeFormatImpl) TypeFormatImplSP;
-    typedef STD_SHARED_PTR(lldb_private::ValueList) ValueListSP;
-    typedef STD_SHARED_PTR(lldb_private::Variable) VariableSP;
-    typedef STD_SHARED_PTR(lldb_private::VariableList) VariableListSP;
-    typedef STD_SHARED_PTR(lldb_private::ValueObjectList) ValueObjectListSP;
-    typedef STD_SHARED_PTR(lldb_private::Watchpoint) WatchpointSP;
+    typedef std::shared_ptr<lldb_private::Value> ValueSP;
+    typedef std::shared_ptr<lldb_private::ValueList> ValueListSP;
+    typedef std::shared_ptr<lldb_private::Variable> VariableSP;
+    typedef std::shared_ptr<lldb_private::VariableList> VariableListSP;
+    typedef std::shared_ptr<lldb_private::ValueObjectList> ValueObjectListSP;
+    typedef std::shared_ptr<lldb_private::Watchpoint> WatchpointSP;
     
 } // namespace lldb
 

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h Thu Jun  6 19:06:43 2013
@@ -59,16 +59,16 @@ typedef enum ArchitectureType
 ///
 //----------------------------------------------------------------------
 
-typedef enum SettableVariableType
-{
-    eSetVarTypeInt,
-    eSetVarTypeBoolean,
-    eSetVarTypeString,
-    eSetVarTypeArray,
-    eSetVarTypeDictionary,
-    eSetVarTypeEnum,
-    eSetVarTypeNone
-} SettableVariableType;
+//typedef enum SettableVariableType
+//{
+//    eSetVarTypeInt,
+//    eSetVarTypeBoolean,
+//    eSetVarTypeString,
+//    eSetVarTypeArray,
+//    eSetVarTypeDictionary,
+//    eSetVarTypeEnum,
+//    eSetVarTypeNone
+//} SettableVariableType;
 
 typedef enum VarSetOperationType
 {
@@ -131,6 +131,7 @@ typedef enum ExecutionResults
     eExecutionCompleted,
     eExecutionDiscarded,
     eExecutionInterrupted,
+    eExecutionHitBreakpoint,
     eExecutionTimedOut
 } ExecutionResults;
 
@@ -213,7 +214,8 @@ typedef enum FormatterChoiceCriterion
     eFormatterChoiceCriterionRegularExpressionSummary =      0x00000004,
     eFormatterChoiceCriterionRegularExpressionFilter =       0x00000004,
     eFormatterChoiceCriterionDynamicObjCDiscovery =          0x00000008,
-    eFormatterChoiceCriterionStrippedBitField =              0x00000010
+    eFormatterChoiceCriterionStrippedBitField =              0x00000010,
+    eFormatterChoiceCriterionWentToStaticValue =             0x00000020
 } FormatterChoiceCriterion;
 
 //----------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h Thu Jun  6 19:06:43 2013
@@ -17,11 +17,12 @@
 namespace lldb_private
 {
     typedef lldb::ABISP (*ABICreateInstance) (const ArchSpec &arch);
-    typedef Disassembler* (*DisassemblerCreateInstance) (const ArchSpec &arch);
+    typedef Disassembler* (*DisassemblerCreateInstance) (const ArchSpec &arch, const char *flavor);
     typedef DynamicLoader* (*DynamicLoaderCreateInstance) (Process* process, bool force);
-    typedef ObjectContainer* (*ObjectContainerCreateInstance) (const lldb::ModuleSP &module_sp, lldb::DataBufferSP& dataSP, const FileSpec *file, lldb::addr_t offset, lldb::addr_t length);
-    typedef ObjectFile* (*ObjectFileCreateInstance) (const lldb::ModuleSP &module_sp, lldb::DataBufferSP& dataSP, const FileSpec* file, lldb::addr_t offset, lldb::addr_t length);
-    typedef ObjectFile* (*ObjectFileCreateMemoryInstance) (const lldb::ModuleSP &module_sp, lldb::DataBufferSP& dataSP, const lldb::ProcessSP &process_sp, lldb::addr_t offset);
+    typedef ObjectContainer* (*ObjectContainerCreateInstance) (const lldb::ModuleSP &module_sp, lldb::DataBufferSP& data_sp, lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t offset, lldb::offset_t length);
+    typedef size_t (*ObjectFileGetModuleSpecifications) (const FileSpec &file, lldb::DataBufferSP& data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, ModuleSpecList &module_specs);
+    typedef ObjectFile* (*ObjectFileCreateInstance) (const lldb::ModuleSP &module_sp, lldb::DataBufferSP& data_sp, lldb::offset_t data_offset, const FileSpec* file, lldb::offset_t file_offset, lldb::offset_t length);
+    typedef ObjectFile* (*ObjectFileCreateMemoryInstance) (const lldb::ModuleSP &module_sp, lldb::DataBufferSP& data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t offset);
     typedef LogChannel* (*LogChannelCreateInstance) ();
     typedef EmulateInstruction * (*EmulateInstructionCreateInstance) (const ArchSpec &arch, InstructionType inst_type);
     typedef OperatingSystem* (*OperatingSystemCreateInstance) (Process *process, bool force);
@@ -29,13 +30,14 @@ namespace lldb_private
     typedef Platform* (*PlatformCreateInstance) (bool force, const ArchSpec *arch);
     typedef lldb::ProcessSP (*ProcessCreateInstance) (Target &target, Listener &listener, const FileSpec *crash_file_path);
     typedef SymbolFile* (*SymbolFileCreateInstance) (ObjectFile* obj_file);
-    typedef SymbolVendor* (*SymbolVendorCreateInstance) (const lldb::ModuleSP &module_sp);   // Module can be NULL for default system symbol vendor
+    typedef SymbolVendor* (*SymbolVendorCreateInstance) (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm);   // Module can be NULL for default system symbol vendor
     typedef bool (*BreakpointHitCallback) (void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id);
     typedef bool (*WatchpointHitCallback) (void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id);
     typedef ThreadPlan * (*ThreadPlanShouldStopHereCallback) (ThreadPlan *current_plan, Flags &flags, void *baton);
     typedef UnwindAssembly* (*UnwindAssemblyCreateInstance) (const ArchSpec &arch);
     typedef int (*ComparisonFunction)(const void *, const void *);
     typedef bool (*CommandOverrideCallback)(void *baton, const char **argv);
+    typedef void (*DebuggerInitializeCallback)(Debugger &debugger);
 
 } // namespace lldb_private
 

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-private-log.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-private-log.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-private-log.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-private-log.h Thu Jun  6 19:06:43 2013
@@ -40,6 +40,10 @@
 #define LIBLLDB_LOG_COMMANDS            (1U << 18)
 #define LIBLLDB_LOG_TYPES               (1u << 19)
 #define LIBLLDB_LOG_SYMBOLS             (1u << 20)
+#define LIBLLDB_LOG_MODULES             (1u << 21)
+#define LIBLLDB_LOG_TARGET              (1u << 22)
+#define LIBLLDB_LOG_MMAP                (1u << 23)
+#define LIBLLDB_LOG_OS                  (1u << 24)
 #define LIBLLDB_LOG_ALL                 (UINT32_MAX)
 #define LIBLLDB_LOG_DEFAULT             (LIBLLDB_LOG_PROCESS              |\
                                          LIBLLDB_LOG_THREAD               |\
@@ -49,6 +53,7 @@
                                          LIBLLDB_LOG_STEP                 |\
                                          LIBLLDB_LOG_STATE                |\
                                          LIBLLDB_LOG_SYMBOLS              |\
+                                         LIBLLDB_LOG_TARGET               |\
                                          LIBLLDB_LOG_COMMANDS)
 
 namespace lldb_private {
@@ -59,10 +64,10 @@ LogIfAllCategoriesSet (uint32_t mask, co
 void
 LogIfAnyCategoriesSet (uint32_t mask, const char *format, ...);
 
-lldb::LogSP
+Log *
 GetLogIfAllCategoriesSet (uint32_t mask);
 
-lldb::LogSP
+Log *
 GetLogIfAnyCategoriesSet (uint32_t mask);
 
 uint32_t
@@ -74,7 +79,7 @@ IsLogVerbose ();
 void
 DisableLog (const char **categories, Stream *feedback_strm);
 
-lldb::LogSP
+Log *
 EnableLog (lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm);
 
 void

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-private-types.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-private-types.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-private-types.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-private-types.h Thu Jun  6 19:06:43 2013
@@ -39,17 +39,17 @@ namespace lldb_private
     //----------------------------------------------------------------------
     typedef struct
     {
-        const char * name;          // Name of this register set
-        const char * short_name;    // A short name for this register set
+        const char *name;           // Name of this register set
+        const char *short_name;     // A short name for this register set
         size_t num_registers;       // The number of registers in REGISTERS array below
         const uint32_t *registers;  // An array of register numbers in this set
     } RegisterSet;
 
     typedef struct
     {
-        int value;
-        const char * string_value;
-        const char * usage;
+        int64_t value;
+        const char *string_value;
+        const char *usage;
     } OptionEnumValueElement;
     
     typedef struct
@@ -57,13 +57,13 @@ namespace lldb_private
         uint32_t usage_mask;                     // Used to mark options that can be used together.  If (1 << n & usage_mask) != 0
                                                  // then this option belongs to option set n.
         bool required;                           // This option is required (in the current usage level)
-        const char * long_option;                // Full name for this option.
-        char short_option;                       // Single character for this option.
+        const char *long_option;                 // Full name for this option.
+        int short_option;                        // Single character for this option.
         int option_has_arg;                      // no_argument, required_argument or optional_argument
         OptionEnumValueElement *enum_values;     // If non-NULL an array of enum values.
         uint32_t completion_type;                // Cookie the option class can use to do define the argument completion.
         lldb::CommandArgumentType argument_type; // Type of argument this option takes
-        const char *  usage_text;                // Full text explaining what this options does and what (if any) argument to
+        const char *usage_text;                  // Full text explaining what this options does and what (if any) argument to
                                                  // pass it.
     } OptionDefinition;
 

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-types.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-types.h?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-types.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-types.h Thu Jun  6 19:06:43 2013
@@ -28,7 +28,6 @@
 //  lldb::thread_arg_t      The type of the one any only thread creation argument for the host system
 //  lldb::thread_result_t   The return type that gets returned when a thread finishes.
 //  lldb::thread_func_t     The function prototype used to spawn a thread on the host system.
-//  lldb::SharedPtr         The template that wraps up the host version of a reference counted pointer (like boost::shared_ptr)
 //  #define LLDB_INVALID_PROCESS_ID ...
 //  #define LLDB_INVALID_THREAD_ID ...
 //  #define LLDB_INVALID_HOST_THREAD ...
@@ -74,6 +73,7 @@ namespace lldb
     typedef uint64_t    user_id_t;
     typedef uint64_t    pid_t;
     typedef uint64_t    tid_t;
+    typedef uint64_t    offset_t;
     typedef int32_t     break_id_t;
     typedef int32_t     watch_id_t;
     typedef void *      clang_type_t;

Modified: lldb/branches/lldb-platform-work/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lib/Makefile?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lib/Makefile (original)
+++ lldb/branches/lldb-platform-work/lib/Makefile Thu Jun  6 19:06:43 2013
@@ -24,6 +24,7 @@ USEDLIBS = lldbAPI.a \
 	lldbBreakpoint.a \
 	lldbCommands.a \
 	lldbCore.a \
+	lldbDataFormatters.a \
 	lldbExpression.a \
 	lldbHostCommon.a \
 	lldbInitAndLog.a \
@@ -40,6 +41,7 @@ USEDLIBS = lldbAPI.a \
 	lldbPluginObjectContainerBSDArchive.a \
 	lldbPluginObjectFileELF.a \
 	lldbPluginObjectFilePECOFF.a \
+	lldbPluginOperatingSystemPython.a \
 	lldbPluginPlatformGDBServer.a \
 	lldbPluginProcessGDBRemote.a \
 	lldbPluginSymbolFileDWARF.a \
@@ -57,9 +59,7 @@ USEDLIBS = lldbAPI.a \
 	clangFrontend.a \
 	clangDriver.a \
 	clangEdit.a \
-	clangIndex.a \
 	clangLex.a \
-	clangRewrite.a \
 	clangParse.a \
 	clangSema.a \
 	clangSerialization.a \
@@ -69,10 +69,18 @@ USEDLIBS = lldbAPI.a \
 	lldbPluginPlatformFreeBSD.a \
 	lldbPluginPlatformPOSIX.a
 
+# Because GCC requires RTTI enabled for lldbCore (see source/Core/Makefile) it is
+# necessary to also link the clang rewriter libraries so vtable references can
+# be resolved correctly, if we are building with GCC.
+ifeq (g++,$(shell basename $(CXX) | colrm 4))
+  USEDLIBS += clangRewriteCore.a \
+              clangRewriteFrontend.a
+endif
+
 include $(LLDB_LEVEL)/../../Makefile.config
 
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
-                   instrumentation ipo selectiondag jit mc mcjit linker
+                   instrumentation ipo irreader selectiondag jit mc mcjit linker
 
 ifeq ($(HOST_OS),Darwin)
   USEDLIBS += lldbHostMacOSX.a \
@@ -80,16 +88,16 @@ ifeq ($(HOST_OS),Darwin)
               lldbPluginDynamicLoaderDarwinKernel.a \
               lldbPluginObjectContainerUniversalMachO.a \
               lldbPluginObjectFileMachO.a \
-              lldbPluginOperatingSystemDarwinKernel.a \
               lldbPluginSymbolVendorMacOSX.a \
               lldbPluginProcessDarwin.a \
               lldbPluginProcessMachCore.a
 endif
 
 ifeq ($(HOST_OS),Linux)
-  USEDLIBS += lldbPluginProcessPOSIX.a \
+  USEDLIBS += lldbHostLinux.a \
               lldbPluginProcessLinux.a \
-              lldbHostLinux.a
+              lldbPluginProcessPOSIX.a \
+              lldbPluginDynamicLoaderMacOSX.a
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
@@ -113,6 +121,7 @@ ifeq ($(HOST_OS),Darwin)
 	LLVMLibsOptions += -framework Foundation -framework CoreFoundation
 	LLVMLibsOptions += -framework CoreServices -framework Carbon -framework Security
 	LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
+	LLVMLibsOptions += -lxml2
 	ifneq ($(EXPORTED_SYMBOL_FILE),)
 		LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(EXPORTED_SYMBOL_FILE)"
 	endif
@@ -124,7 +133,7 @@ ifeq ($(HOST_OS),Darwin)
     endif
 endif
 
-ifeq ($(HOST_OS),Linux)
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU))
     # Include everything from the .a's into the shared library.
     ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
                        -Wl,--no-whole-archive
@@ -132,6 +141,7 @@ ifeq ($(HOST_OS),Linux)
     LLVMLibsOptions += -Wl,--no-undefined
     # Link in python
     LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt
+    LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
 endif
 
 ifeq ($(HOST_OS),FreeBSD)

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj Thu Jun  6 19:06:43 2013
@@ -11,6 +11,7 @@
 			isa = PBXAggregateTarget;
 			buildConfigurationList = 26CEF3AD14FD58BF007286B2 /* Build configuration list for PBXAggregateTarget "desktop_no_xpc" */;
 			buildPhases = (
+				AF90106415AB7D2900FF120D /* CopyFiles */,
 			);
 			dependencies = (
 				26CEF3B014FD591F007286B2 /* PBXTargetDependency */,
@@ -23,6 +24,7 @@
 			isa = PBXAggregateTarget;
 			buildConfigurationList = 26CEF3B214FD592B007286B2 /* Build configuration list for PBXAggregateTarget "desktop" */;
 			buildPhases = (
+				AF90106415AB7D2900FF120D /* CopyFiles */,
 			);
 			dependencies = (
 				26CEF3BB14FD595B007286B2 /* PBXTargetDependency */,
@@ -49,21 +51,53 @@
 /* End PBXAggregateTarget section */
 
 /* Begin PBXBuildFile section */
+		260A248E15D06C50009981B0 /* OptionValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 260A248D15D06C4F009981B0 /* OptionValues.h */; };
+		260CC62E15D04377002BF2E0 /* OptionValueArgs.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62115D04377002BF2E0 /* OptionValueArgs.h */; };
+		260CC62F15D04377002BF2E0 /* OptionValueArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62215D04377002BF2E0 /* OptionValueArray.h */; };
+		260CC63015D04377002BF2E0 /* OptionValueBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62315D04377002BF2E0 /* OptionValueBoolean.h */; };
+		260CC63115D04377002BF2E0 /* OptionValueProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62415D04377002BF2E0 /* OptionValueProperties.h */; };
+		260CC63215D04377002BF2E0 /* OptionValueDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62515D04377002BF2E0 /* OptionValueDictionary.h */; };
+		260CC63315D04377002BF2E0 /* OptionValueEnumeration.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */; };
+		260CC63415D04377002BF2E0 /* OptionValueFileSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */; };
+		260CC63515D04377002BF2E0 /* OptionValueFileSpecList.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */; };
+		260CC63615D04377002BF2E0 /* OptionValueFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62915D04377002BF2E0 /* OptionValueFormat.h */; };
+		260CC63715D04377002BF2E0 /* OptionValueSInt64.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */; };
+		260CC63815D04377002BF2E0 /* OptionValueString.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62B15D04377002BF2E0 /* OptionValueString.h */; };
+		260CC63915D04377002BF2E0 /* OptionValueUInt64.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */; };
+		260CC63A15D04377002BF2E0 /* OptionValueUUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62D15D04377002BF2E0 /* OptionValueUUID.h */; };
+		260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */; };
+		260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */; };
+		260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */; };
+		260CC64B15D0440D002BF2E0 /* OptionValueProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */; };
+		260CC64C15D0440D002BF2E0 /* OptionValueDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */; };
+		260CC64D15D0440D002BF2E0 /* OptionValueEnumeration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */; };
+		260CC64E15D0440D002BF2E0 /* OptionValueFileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */; };
+		260CC64F15D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */; };
+		260CC65015D0440D002BF2E0 /* OptionValueFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */; };
+		260CC65115D0440D002BF2E0 /* OptionValueSInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */; };
+		260CC65215D0440D002BF2E0 /* OptionValueString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64515D0440D002BF2E0 /* OptionValueString.cpp */; };
+		260CC65315D0440D002BF2E0 /* OptionValueUInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */; };
+		260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */; };
+		260D9B2715EC369500960137 /* ModuleSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 260D9B2615EC369500960137 /* ModuleSpec.h */; };
 		260E07C6136FA69E00CF21D3 /* OptionGroupUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */; };
 		260E07C8136FAB9200CF21D3 /* OptionGroupFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */; };
 		261744781168585B005ADD65 /* SBType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261744771168585B005ADD65 /* SBType.cpp */; };
 		2617447A11685869005ADD65 /* SBType.h in Headers */ = {isa = PBXBuildFile; fileRef = 2617447911685869005ADD65 /* SBType.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		26274FA214030EEF006BA130 /* OperatingSystemDarwinKernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26274FA014030EEF006BA130 /* OperatingSystemDarwinKernel.cpp */; };
 		26274FA714030F79006BA130 /* DynamicLoaderDarwinKernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26274FA514030F79006BA130 /* DynamicLoaderDarwinKernel.cpp */; };
 		2628A4D513D4977900F5487A /* ThreadKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2628A4D313D4977900F5487A /* ThreadKDP.cpp */; };
 		262CFC7711A4510000946C6C /* debugserver in Resources */ = {isa = PBXBuildFile; fileRef = 26CE05A0115C31E50022F371 /* debugserver */; };
 		262D24E613FB8710002D1960 /* RegisterContextMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262D24E413FB8710002D1960 /* RegisterContextMemory.cpp */; };
+		262ED0051631FA2800879631 /* OptionGroupString.h in Headers */ = {isa = PBXBuildFile; fileRef = 262ED0041631FA2800879631 /* OptionGroupString.h */; };
+		262ED0081631FA3A00879631 /* OptionGroupString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262ED0071631FA3A00879631 /* OptionGroupString.cpp */; };
 		26368A3C126B697600E8659F /* darwin-debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26368A3B126B697600E8659F /* darwin-debug.cpp */; };
 		26368AF7126B960500E8659F /* darwin-debug in Resources */ = {isa = PBXBuildFile; fileRef = 26579F68126A25920007C5CB /* darwin-debug */; };
 		263E949F13661AEA00E7D1CE /* UnwindAssembly-x86.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */; };
+		2640E19F15DC78FD00F23B50 /* Property.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2640E19E15DC78FD00F23B50 /* Property.cpp */; };
 		2642FBAE13D003B400ED6808 /* CommunicationKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */; };
 		2642FBB013D003B400ED6808 /* ProcessKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */; };
 		2642FBB213D003B400ED6808 /* ProcessKDPLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */; };
+		26491E3B15E1DB8600CBFFC2 /* OptionValueRegex.h in Headers */ = {isa = PBXBuildFile; fileRef = 26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */; };
+		26491E3E15E1DB9F00CBFFC2 /* OptionValueRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */; };
 		264A97BF133918BC0017F0BE /* PlatformRemoteGDBServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */; };
 		264D8D5013661BD7003A368F /* UnwindAssembly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D8D4F13661BD7003A368F /* UnwindAssembly.cpp */; };
 		265205A813D3E3F700132FE2 /* RegisterContextKDP_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A213D3E3F700132FE2 /* RegisterContextKDP_arm.cpp */; };
@@ -118,6 +152,9 @@
 		26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */; };
 		267C012B136880DF006E963E /* OptionGroupValueObjectDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */; };
 		267C01371368C49C006E963E /* OptionGroupOutputFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BCFC531368B3E4006DC050 /* OptionGroupOutputFile.cpp */; };
+		268648C416531BF800F04704 /* com.apple.debugserver.posix.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */; };
+		268648C516531BF800F04704 /* com.apple.debugserver.applist.internal.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */; };
+		268648C616531BF800F04704 /* com.apple.debugserver.internal.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */; };
 		2686536C1370ACB200D186A3 /* OptionGroupBoolean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2686536B1370ACB200D186A3 /* OptionGroupBoolean.cpp */; };
 		268653701370AE7200D186A3 /* OptionGroupUInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2686536F1370AE7200D186A3 /* OptionGroupUInt64.cpp */; };
 		2689000113353DB600698AC0 /* BreakpointResolverAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D0DD5310FE555900271C65 /* BreakpointResolverAddress.cpp */; };
@@ -217,7 +254,7 @@
 		2689006913353E0E00698AC0 /* ASTStructExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 491193501226386000578B7F /* ASTStructExtractor.cpp */; };
 		2689006A13353E0E00698AC0 /* IRDynamicChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp */; };
 		2689006B13353E0E00698AC0 /* IRForTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49307AAD11DEA4D90081F992 /* IRForTarget.cpp */; };
-		2689006D13353E0E00698AC0 /* RecordingMemoryManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C98D3DB118FB96F00E575D0 /* RecordingMemoryManager.cpp */; };
+		2689006D13353E0E00698AC0 /* IRExecutionUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp */; };
 		2689006E13353E1A00698AC0 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C6EA213011581005E16B0 /* File.cpp */; };
 		2689006F13353E1A00698AC0 /* FileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FA43171301048600E71120 /* FileSpec.cpp */; };
 		2689007013353E1A00698AC0 /* Condition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1B1236C5D400C660B5 /* Condition.cpp */; };
@@ -237,7 +274,6 @@
 		2689007F13353E2200698AC0 /* CommandCompletions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C09CB74116BD98B00C7A725 /* CommandCompletions.cpp */; };
 		2689008013353E2200698AC0 /* CommandInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */; };
 		2689008113353E2200698AC0 /* CommandObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */; };
-		2689008213353E2200698AC0 /* CommandObjectCrossref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC57113B48F300DD817F /* CommandObjectCrossref.cpp */; };
 		2689008313353E2200698AC0 /* CommandObjectMultiword.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */; };
 		2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */; };
 		2689008513353E2200698AC0 /* CommandReturnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */; };
@@ -245,7 +281,6 @@
 		2689008713353E2200698AC0 /* ScriptInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */; };
 		2689008813353E2200698AC0 /* ScriptInterpreterNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2771FC1135A37500E6ADB6 /* ScriptInterpreterNone.cpp */; };
 		2689008913353E2200698AC0 /* ScriptInterpreterPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0C10F1B8DD00F91463 /* ScriptInterpreterPython.cpp */; };
-		2689008C13353E4200698AC0 /* DisassemblerLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897410F57C5600BB2B04 /* DisassemblerLLVM.cpp */; };
 		2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */; };
 		2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268A683D1321B53B000E3FB8 /* DynamicLoaderStatic.cpp */; };
 		2689009613353E4200698AC0 /* ObjectContainerBSDArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A3B4AC1181454800381BC2 /* ObjectContainerBSDArchive.cpp */; };
@@ -378,13 +413,18 @@
 		26957D9813D381C900670048 /* RegisterContextDarwin_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */; };
 		26957D9A13D381C900670048 /* RegisterContextDarwin_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9413D381C900670048 /* RegisterContextDarwin_i386.cpp */; };
 		26957D9C13D381C900670048 /* RegisterContextDarwin_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */; };
+		2697A39315E404B1003E682C /* OptionValueArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A39215E404B1003E682C /* OptionValueArch.cpp */; };
+		2697A39515E404BA003E682C /* OptionValueArch.h in Headers */ = {isa = PBXBuildFile; fileRef = 2697A39415E404BA003E682C /* OptionValueArch.h */; };
 		2697A54D133A6305004E4240 /* PlatformDarwin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A54B133A6305004E4240 /* PlatformDarwin.cpp */; };
+		2698699B15E6CBD0002415FF /* OperatingSystemPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2698699815E6CBD0002415FF /* OperatingSystemPython.cpp */; };
+		2698699D15E6CBD0002415FF /* OperatingSystemPython.h in Headers */ = {isa = PBXBuildFile; fileRef = 2698699915E6CBD0002415FF /* OperatingSystemPython.h */; };
 		26A527C114E24F5F00F3A14A /* ProcessMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BD14E24F5F00F3A14A /* ProcessMachCore.cpp */; };
 		26A527C214E24F5F00F3A14A /* ProcessMachCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A527BE14E24F5F00F3A14A /* ProcessMachCore.h */; };
 		26A527C314E24F5F00F3A14A /* ThreadMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */; };
 		26A527C414E24F5F00F3A14A /* ThreadMachCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A527C014E24F5F00F3A14A /* ThreadMachCore.h */; };
 		26A69C5F137A17A500262477 /* RegisterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C6886E137880C400407EDF /* RegisterValue.cpp */; };
-		26A7A035135E6E4200FB369E /* NamedOptionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* NamedOptionValue.cpp */; };
+		26A7A035135E6E4200FB369E /* OptionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* OptionValue.cpp */; };
+		26ACEC2815E077AE00E94760 /* Property.h in Headers */ = {isa = PBXBuildFile; fileRef = 26ACEC2715E077AE00E94760 /* Property.h */; };
 		26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */; };
 		26B1EFAF154638AF00E2DAC7 /* DWARFDeclContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B1EFAD154638AF00E2DAC7 /* DWARFDeclContext.h */; };
 		26B1FCB813381071002886E2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; };
@@ -399,12 +439,20 @@
 		26BD407F135D2AE000237D80 /* FileLineResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */; };
 		26C72C94124322890068DC16 /* SBStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C72C93124322890068DC16 /* SBStream.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		26C72C961243229A0068DC16 /* SBStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C72C951243229A0068DC16 /* SBStream.cpp */; };
+		26CA97A1172B1FD5005DC71B /* RegisterContextThreadMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */; };
+		26CA97A2172B1FD5005DC71B /* RegisterContextThreadMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 26CA97A0172B1FD5005DC71B /* RegisterContextThreadMemory.h */; };
+		26D1803E16CEBFD300EDFB5B /* KQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D1803C16CEBFD300EDFB5B /* KQueue.cpp */; };
+		26D1804216CEDF0700EDFB5B /* TimeSpecTimeout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D1804016CEDF0700EDFB5B /* TimeSpecTimeout.cpp */; };
+		26D1804516CEE12500EDFB5B /* KQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D1804416CEE12500EDFB5B /* KQueue.h */; };
+		26D1804716CEE12C00EDFB5B /* TimeSpecTimeout.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D1804616CEE12C00EDFB5B /* TimeSpecTimeout.h */; };
 		26D265A2136B40EE002EEE45 /* SharingPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 261B5A5311C3F2AD00AABD0A /* SharingPtr.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		26D265BC136B4269002EEE45 /* lldb-public.h in Headers */ = {isa = PBXBuildFile; fileRef = 26651A14133BEC76005B64B7 /* lldb-public.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		26D55235159A7DB100708D8D /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; };
 		26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */; };
 		26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */; };
 		26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */; };
+		26DAED6015D327A200E15819 /* OptionValuePathMappings.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */; };
+		26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */; };
 		26DB3E161379E7AD0080DC73 /* ABIMacOSX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */; };
 		26DB3E1C1379E7AD0080DC73 /* ABIMacOSX_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E0F1379E7AD0080DC73 /* ABIMacOSX_i386.cpp */; };
 		26DB3E1F1379E7AD0080DC73 /* ABISysV_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E131379E7AD0080DC73 /* ABISysV_x86_64.cpp */; };
@@ -442,14 +490,16 @@
 		26FFC19C14FC072100087D58 /* DYLDRendezvous.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FFC19614FC072100087D58 /* DYLDRendezvous.h */; };
 		26FFC19D14FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19714FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp */; };
 		26FFC19E14FC072100087D58 /* DynamicLoaderPOSIXDYLD.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FFC19814FC072100087D58 /* DynamicLoaderPOSIXDYLD.h */; };
+		490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9452573816262CEF00325455 /* SBDeclaration.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494260D914579144003C1C78 /* VerifyDecl.cpp */; };
 		4966DCC4148978A10028481B /* ClangExternalASTSourceCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4966DCC3148978A10028481B /* ClangExternalASTSourceCommon.cpp */; };
 		49A1CAC51430E8DE00306AC9 /* ExpressionSourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A1CAC31430E8BD00306AC9 /* ExpressionSourceCode.cpp */; };
 		49A71FE7141FFA5C00D59478 /* IRInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 496B01581406DE8900F830D5 /* IRInterpreter.cpp */; };
 		49A71FE8141FFACF00D59478 /* DataEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268ED0A4140FF54200DE830F /* DataEncoder.cpp */; };
-		49C8507C1384A786007DB519 /* ProcessDataAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C850781384A0CA007DB519 /* ProcessDataAllocator.cpp */; };
 		49D8FB3913B5598F00411094 /* ClangASTImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */; };
-		49DA65031485C92A005FF180 /* AppleObjCSymbolVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA65021485C92A005FF180 /* AppleObjCSymbolVendor.cpp */; };
+		49DA65031485C92A005FF180 /* AppleObjCTypeVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA65021485C92A005FF180 /* AppleObjCTypeVendor.cpp */; };
+		49DCF6FE170E6B4A0092F75E /* IRMemoryMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */; };
+		49DCF702170E70120092F75E /* Materializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DCF700170E70120092F75E /* Materializer.cpp */; };
 		4C6649A014EEE7F100B0316F /* StreamCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C66499F14EEE7F100B0316F /* StreamCallback.h */; };
 		4C6649A314EEE81000B0316F /* StreamCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6649A214EEE81000B0316F /* StreamCallback.cpp */; };
 		4C701C1E15ABB70C00B50001 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; };
@@ -462,20 +512,27 @@
 		4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */; };
 		4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */; };
 		4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */; };
+		4CE4F673162C971A00F75CB3 /* SBExpressionOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		4CE4F675162C973F00F75CB3 /* SBExpressionOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */; };
 		4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
 		4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CF52AF41428291E0051E832 /* SBFileSpecList.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };
 		94031A9E13CF486700DCFF3C /* InputReaderEZ.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94031A9D13CF486600DCFF3C /* InputReaderEZ.cpp */; };
-		9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9415F61713B2C0EF00A52B36 /* FormatManager.cpp */; };
+		94094C6B163B6F840083A547 /* ValueObjectCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94094C69163B6CD90083A547 /* ValueObjectCast.cpp */; };
+		94145431175E63B500284436 /* lldb-versioning.h in Headers */ = {isa = PBXBuildFile; fileRef = 94145430175D7FDE00284436 /* lldb-versioning.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		941BCC7F14E48C4000BB969C /* SBTypeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568614E355F2003A195C /* SBTypeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		941BCC8014E48C4000BB969C /* SBTypeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568714E355F2003A195C /* SBTypeFormat.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		941BCC8114E48C4000BB969C /* SBTypeSummary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568814E355F2003A195C /* SBTypeSummary.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568914E355F2003A195C /* SBTypeSynthetic.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		944372DC171F6B4300E57C32 /* RegisterContextDummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */; };
+		944372DD171F6B4300E57C32 /* RegisterContextDummy.h in Headers */ = {isa = PBXBuildFile; fileRef = 944372DB171F6B4300E57C32 /* RegisterContextDummy.h */; };
 		9443B122140C18C40013457C /* SBData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9443B121140C18C10013457C /* SBData.cpp */; };
 		9443B123140C26AB0013457C /* SBData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9443B120140C18A90013457C /* SBData.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		945759671534941F005A9070 /* PlatformPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945759651534941F005A9070 /* PlatformPOSIX.cpp */; };
 		945759681534941F005A9070 /* PlatformPOSIX.h in Headers */ = {isa = PBXBuildFile; fileRef = 945759661534941F005A9070 /* PlatformPOSIX.h */; };
 		945E8D80152F6AB40019BCCD /* StreamGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945E8D7F152F6AB40019BCCD /* StreamGDBRemote.cpp */; };
+		9452573A16262D0200325455 /* SBDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9452573916262D0200325455 /* SBDeclaration.cpp */; };
+		9456F2241616671900656F91 /* DynamicLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9456F2211616644B00656F91 /* DynamicLibrary.cpp */; };
 		94611EB213CCA4A4003A22AF /* RefCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94611EB113CCA4A4003A22AF /* RefCounter.cpp */; };
 		9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568A14E35621003A195C /* SBTypeFilter.cpp */; };
 		9461569B14E358A6003A195C /* SBTypeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568B14E35621003A195C /* SBTypeFormat.cpp */; };
@@ -483,14 +540,35 @@
 		9461569D14E358A6003A195C /* SBTypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568D14E35621003A195C /* SBTypeSynthetic.cpp */; };
 		9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */; };
 		9467E65213C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9467E65113C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp */; };
-		9470A8F01402DFFB0056FF61 /* DataVisualization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */; };
 		9475C18814E5E9FA001BFC6D /* SBTypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */; };
 		9475C18914E5EA08001BFC6D /* SBTypeCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		9475C18E14E5F834001BFC6D /* SBTypeNameSpecifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */; };
 		9475C18F14E5F858001BFC6D /* SBTypeNameSpecifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		947A1D641616476B0017C8D1 /* CommandObjectPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */; };
+		947A1D651616476B0017C8D1 /* CommandObjectPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 947A1D631616476A0017C8D1 /* CommandObjectPlugin.h */; };
 		949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */; };
 		94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */; };
 		94E829CA152D33C1006F96A3 /* lldb-platform in Resources */ = {isa = PBXBuildFile; fileRef = 26DC6A101337FE6900FF7998 /* lldb-platform */; };
+		94CB255B16B069770059775D /* CXXFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255716B069770059775D /* CXXFormatterFunctions.cpp */; };
+		94CB255C16B069770059775D /* DataVisualization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255816B069770059775D /* DataVisualization.cpp */; };
+		94CB255D16B069770059775D /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255916B069770059775D /* FormatClasses.cpp */; };
+		94CB255E16B069770059775D /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255A16B069770059775D /* FormatManager.cpp */; };
+		94CB256616B096F10059775D /* TypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256416B096F10059775D /* TypeCategory.cpp */; };
+		94CB256716B096F10059775D /* TypeCategoryMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256516B096F10059775D /* TypeCategoryMap.cpp */; };
+		94CB257016B0A4270059775D /* TypeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256D16B0A4260059775D /* TypeFormat.cpp */; };
+		94CB257116B0A4270059775D /* TypeSummary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256E16B0A4260059775D /* TypeSummary.cpp */; };
+		94CB257216B0A4270059775D /* TypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256F16B0A4270059775D /* TypeSynthetic.cpp */; };
+		94CB257416B1D3880059775D /* FormatCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB257316B1D3870059775D /* FormatCache.cpp */; };
+		94CD704D16F8DDEA00CF1E42 /* CF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD704B16F8DDEA00CF1E42 /* CF.cpp */; };
+		94CD704E16F8DDEA00CF1E42 /* Cocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD704C16F8DDEA00CF1E42 /* Cocoa.cpp */; };
+		94CD705016F8DF1C00CF1E42 /* LibCxxList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD704F16F8DF1C00CF1E42 /* LibCxxList.cpp */; };
+		94CD705216F8F5BC00CF1E42 /* LibCxxMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD705116F8F5BC00CF1E42 /* LibCxxMap.cpp */; };
+		94D0B10C16D5535900EA9C70 /* LibCxx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D0B10A16D5535900EA9C70 /* LibCxx.cpp */; };
+		94D0B10D16D5535900EA9C70 /* LibStdcpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D0B10B16D5535900EA9C70 /* LibStdcpp.cpp */; };
+		94D6A0AA16CEB55F00833B6E /* NSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D6A0A716CEB55F00833B6E /* NSArray.cpp */; };
+		94D6A0AB16CEB55F00833B6E /* NSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D6A0A816CEB55F00833B6E /* NSDictionary.cpp */; };
+		94D6A0AC16CEB55F00833B6E /* NSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D6A0A916CEB55F00833B6E /* NSSet.cpp */; };
+		94EA1D5C15E6C9B400D4171A /* PythonDataObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94EA1D5B15E6C9B400D4171A /* PythonDataObjects.cpp */; };
 		94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */; };
 		9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; };
@@ -511,6 +589,8 @@
 		9AC70390117675270086C050 /* SBInstructionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038F117675270086C050 /* SBInstructionList.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* SBInstruction.cpp */; };
 		9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* SBInstructionList.cpp */; };
+		AF254E31170CCC33007AE5C9 /* PlatformDarwinKernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF254E2F170CCC33007AE5C9 /* PlatformDarwinKernel.cpp */; };
+		AF254E32170CCC33007AE5C9 /* PlatformDarwinKernel.h in Headers */ = {isa = PBXBuildFile; fileRef = AF254E30170CCC33007AE5C9 /* PlatformDarwinKernel.h */; };
 		AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = AF90106315AB7C5700FF120D /* lldb.1 */; };
 		AFF87C87150FF669000E1742 /* com.apple.debugserver.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */; };
 		AFF87C89150FF672000E1742 /* com.apple.debugserver-secure.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C88150FF672000E1742 /* com.apple.debugserver-secure.plist */; };
@@ -518,7 +598,6 @@
 		B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */; };
 		B21EB71515CC99F100E60059 /* cxa_demangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B21EB71415CC99F100E60059 /* cxa_demangle.cpp */; settings = {COMPILER_FLAGS = "-frtti"; }; };
 		B2462247141AD37D00F3D409 /* OptionGroupWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */; };
-		B271B11413D6139300C3FEDB /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */; };
 		B27318421416AC12006039C8 /* WatchpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27318411416AC12006039C8 /* WatchpointList.cpp */; };
 		B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; };
 		B299580B14F2FA1400050A04 /* DisassemblerLLVMC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */; };
@@ -659,6 +738,9 @@
 			dstPath = /Developer/Library/Lockdown/ServiceAgents/;
 			dstSubfolderSpec = 0;
 			files = (
+				268648C416531BF800F04704 /* com.apple.debugserver.posix.plist in CopyFiles */,
+				268648C516531BF800F04704 /* com.apple.debugserver.applist.internal.plist in CopyFiles */,
+				268648C616531BF800F04704 /* com.apple.debugserver.internal.plist in CopyFiles */,
 				AFF87C87150FF669000E1742 /* com.apple.debugserver.plist in CopyFiles */,
 				AFF87C89150FF672000E1742 /* com.apple.debugserver-secure.plist in CopyFiles */,
 				AFF87C8F150FF688000E1742 /* com.apple.debugserver.applist.plist in CopyFiles */,
@@ -672,6 +754,7 @@
 		260223E8115F06E500A601A2 /* SBCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommunication.cpp; path = source/API/SBCommunication.cpp; sourceTree = "<group>"; };
 		26022531115F27FA00A601A2 /* SBFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileSpec.h; path = include/lldb/API/SBFileSpec.h; sourceTree = "<group>"; };
 		26022532115F281400A601A2 /* SBFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFileSpec.cpp; path = source/API/SBFileSpec.cpp; sourceTree = "<group>"; };
+		260A248D15D06C4F009981B0 /* OptionValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValues.h; path = include/lldb/Interpreter/OptionValues.h; sourceTree = "<group>"; };
 		260C6EA013011578005E16B0 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = include/lldb/Host/File.h; sourceTree = "<group>"; };
 		260C6EA213011581005E16B0 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; };
 		260C847110F50EFC00BB2B04 /* ThreadPlanBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanBase.cpp; path = source/Target/ThreadPlanBase.cpp; sourceTree = "<group>"; };
@@ -687,8 +770,6 @@
 		260C848310F50F0A00BB2B04 /* ThreadPlanStepThrough.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepThrough.h; path = include/lldb/Target/ThreadPlanStepThrough.h; sourceTree = "<group>"; };
 		260C848410F50F0A00BB2B04 /* ThreadPlanStepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepRange.h; path = include/lldb/Target/ThreadPlanStepRange.h; sourceTree = "<group>"; };
 		260C876910F538E700BB2B04 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
-		260C897410F57C5600BB2B04 /* DisassemblerLLVM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisassemblerLLVM.cpp; sourceTree = "<group>"; };
-		260C897510F57C5600BB2B04 /* DisassemblerLLVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisassemblerLLVM.h; sourceTree = "<group>"; };
 		260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderMacOSXDYLD.cpp; sourceTree = "<group>"; };
 		260C897B10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderMacOSXDYLD.h; sourceTree = "<group>"; };
 		260C898010F57C5600BB2B04 /* ObjectContainerUniversalMachO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectContainerUniversalMachO.cpp; sourceTree = "<group>"; };
@@ -742,6 +823,33 @@
 		260C89DF10F57C5600BB2B04 /* SymbolFileSymtab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileSymtab.h; sourceTree = "<group>"; };
 		260C89E210F57C5600BB2B04 /* SymbolVendorMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolVendorMacOSX.cpp; sourceTree = "<group>"; };
 		260C89E310F57C5600BB2B04 /* SymbolVendorMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolVendorMacOSX.h; sourceTree = "<group>"; };
+		260CC62115D04377002BF2E0 /* OptionValueArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArgs.h; path = include/lldb/Interpreter/OptionValueArgs.h; sourceTree = "<group>"; };
+		260CC62215D04377002BF2E0 /* OptionValueArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArray.h; path = include/lldb/Interpreter/OptionValueArray.h; sourceTree = "<group>"; };
+		260CC62315D04377002BF2E0 /* OptionValueBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueBoolean.h; path = include/lldb/Interpreter/OptionValueBoolean.h; sourceTree = "<group>"; };
+		260CC62415D04377002BF2E0 /* OptionValueProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueProperties.h; path = include/lldb/Interpreter/OptionValueProperties.h; sourceTree = "<group>"; };
+		260CC62515D04377002BF2E0 /* OptionValueDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueDictionary.h; path = include/lldb/Interpreter/OptionValueDictionary.h; sourceTree = "<group>"; };
+		260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueEnumeration.h; path = include/lldb/Interpreter/OptionValueEnumeration.h; sourceTree = "<group>"; };
+		260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpec.h; path = include/lldb/Interpreter/OptionValueFileSpec.h; sourceTree = "<group>"; };
+		260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpecList.h; path = include/lldb/Interpreter/OptionValueFileSpecList.h; sourceTree = "<group>"; };
+		260CC62915D04377002BF2E0 /* OptionValueFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFormat.h; path = include/lldb/Interpreter/OptionValueFormat.h; sourceTree = "<group>"; };
+		260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueSInt64.h; path = include/lldb/Interpreter/OptionValueSInt64.h; sourceTree = "<group>"; };
+		260CC62B15D04377002BF2E0 /* OptionValueString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueString.h; path = include/lldb/Interpreter/OptionValueString.h; sourceTree = "<group>"; };
+		260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUInt64.h; path = include/lldb/Interpreter/OptionValueUInt64.h; sourceTree = "<group>"; };
+		260CC62D15D04377002BF2E0 /* OptionValueUUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUUID.h; path = include/lldb/Interpreter/OptionValueUUID.h; sourceTree = "<group>"; };
+		260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArgs.cpp; path = source/Interpreter/OptionValueArgs.cpp; sourceTree = "<group>"; };
+		260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArray.cpp; path = source/Interpreter/OptionValueArray.cpp; sourceTree = "<group>"; };
+		260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueBoolean.cpp; path = source/Interpreter/OptionValueBoolean.cpp; sourceTree = "<group>"; };
+		260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueProperties.cpp; path = source/Interpreter/OptionValueProperties.cpp; sourceTree = "<group>"; };
+		260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueDictionary.cpp; path = source/Interpreter/OptionValueDictionary.cpp; sourceTree = "<group>"; };
+		260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueEnumeration.cpp; path = source/Interpreter/OptionValueEnumeration.cpp; sourceTree = "<group>"; };
+		260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpec.cpp; path = source/Interpreter/OptionValueFileSpec.cpp; sourceTree = "<group>"; };
+		260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpecLIst.cpp; path = source/Interpreter/OptionValueFileSpecLIst.cpp; sourceTree = "<group>"; };
+		260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFormat.cpp; path = source/Interpreter/OptionValueFormat.cpp; sourceTree = "<group>"; };
+		260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueSInt64.cpp; path = source/Interpreter/OptionValueSInt64.cpp; sourceTree = "<group>"; };
+		260CC64515D0440D002BF2E0 /* OptionValueString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueString.cpp; path = source/Interpreter/OptionValueString.cpp; sourceTree = "<group>"; };
+		260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUInt64.cpp; path = source/Interpreter/OptionValueUInt64.cpp; sourceTree = "<group>"; };
+		260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUUID.cpp; path = source/Interpreter/OptionValueUUID.cpp; sourceTree = "<group>"; };
+		260D9B2615EC369500960137 /* ModuleSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleSpec.h; path = include/lldb/Core/ModuleSpec.h; sourceTree = "<group>"; };
 		260E07C3136FA68900CF21D3 /* OptionGroupUUID.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUUID.h; path = include/lldb/Interpreter/OptionGroupUUID.h; sourceTree = "<group>"; };
 		260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupUUID.cpp; path = source/Interpreter/OptionGroupUUID.cpp; sourceTree = "<group>"; };
 		260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupFile.cpp; path = source/Interpreter/OptionGroupFile.cpp; sourceTree = "<group>"; };
@@ -811,20 +919,21 @@
 		26217932133BCB850083B112 /* lldb-private-enumerations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-private-enumerations.h"; path = "include/lldb/lldb-private-enumerations.h"; sourceTree = "<group>"; };
 		2623096E13D0EFFB006381D9 /* StreamBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamBuffer.h; path = include/lldb/Core/StreamBuffer.h; sourceTree = "<group>"; };
 		2626B6AD143E1BEA00EF935C /* RangeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RangeMap.h; path = include/lldb/Core/RangeMap.h; sourceTree = "<group>"; };
-		26274FA014030EEF006BA130 /* OperatingSystemDarwinKernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OperatingSystemDarwinKernel.cpp; sourceTree = "<group>"; };
-		26274FA114030EEF006BA130 /* OperatingSystemDarwinKernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperatingSystemDarwinKernel.h; sourceTree = "<group>"; };
 		26274FA514030F79006BA130 /* DynamicLoaderDarwinKernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderDarwinKernel.cpp; sourceTree = "<group>"; };
 		26274FA614030F79006BA130 /* DynamicLoaderDarwinKernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderDarwinKernel.h; sourceTree = "<group>"; };
 		2628A4D313D4977900F5487A /* ThreadKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadKDP.cpp; sourceTree = "<group>"; };
 		2628A4D413D4977900F5487A /* ThreadKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadKDP.h; sourceTree = "<group>"; };
 		262D24E413FB8710002D1960 /* RegisterContextMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMemory.cpp; path = Utility/RegisterContextMemory.cpp; sourceTree = "<group>"; };
 		262D24E513FB8710002D1960 /* RegisterContextMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMemory.h; path = Utility/RegisterContextMemory.h; sourceTree = "<group>"; };
+		262ED0041631FA2800879631 /* OptionGroupString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionGroupString.h; path = include/lldb/Interpreter/OptionGroupString.h; sourceTree = "<group>"; };
+		262ED0071631FA3A00879631 /* OptionGroupString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupString.cpp; path = source/Interpreter/OptionGroupString.cpp; sourceTree = "<group>"; };
 		263664921140A4930075843B /* Debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = Debugger.cpp; path = source/Core/Debugger.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
 		263664941140A4C10075843B /* Debugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = Debugger.h; path = include/lldb/Core/Debugger.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		26368A3B126B697600E8659F /* darwin-debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "darwin-debug.cpp"; path = "tools/darwin-debug/darwin-debug.cpp"; sourceTree = "<group>"; };
 		263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "UnwindAssembly-x86.cpp"; sourceTree = "<group>"; };
 		263E949E13661AE400E7D1CE /* UnwindAssembly-x86.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UnwindAssembly-x86.h"; sourceTree = "<group>"; };
 		263FEDA5112CC1DA00E4C208 /* ThreadSafeSTLMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeSTLMap.h; path = include/lldb/Core/ThreadSafeSTLMap.h; sourceTree = "<group>"; };
+		2640E19E15DC78FD00F23B50 /* Property.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Property.cpp; path = source/Interpreter/Property.cpp; sourceTree = "<group>"; };
 		26424E3C125986CB0016D82C /* ValueObjectConstResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResult.cpp; path = source/Core/ValueObjectConstResult.cpp; sourceTree = "<group>"; };
 		26424E3E125986D30016D82C /* ValueObjectConstResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResult.h; path = include/lldb/Core/ValueObjectConstResult.h; sourceTree = "<group>"; };
 		2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommunicationKDP.cpp; sourceTree = "<group>"; };
@@ -836,6 +945,8 @@
 		264334381110F63100CDB6C6 /* ValueObjectRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectRegister.cpp; path = source/Core/ValueObjectRegister.cpp; sourceTree = "<group>"; };
 		2643343A1110F63C00CDB6C6 /* ValueObjectRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectRegister.h; path = include/lldb/Core/ValueObjectRegister.h; sourceTree = "<group>"; };
 		264723A511FA076E00DE380C /* CleanUp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CleanUp.h; path = include/lldb/Utility/CleanUp.h; sourceTree = "<group>"; };
+		26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueRegex.h; path = include/lldb/Interpreter/OptionValueRegex.h; sourceTree = "<group>"; };
+		26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueRegex.cpp; path = source/Interpreter/OptionValueRegex.cpp; sourceTree = "<group>"; };
 		264A43BB1320B3B4005B4096 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = include/lldb/Target/Platform.h; sourceTree = "<group>"; };
 		264A43BD1320BCEB005B4096 /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Platform.cpp; path = source/Target/Platform.cpp; sourceTree = "<group>"; };
 		264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformRemoteGDBServer.cpp; path = "gdb-server/PlatformRemoteGDBServer.cpp"; sourceTree = "<group>"; };
@@ -897,6 +1008,9 @@
 		2682F16B115EDA0D00CCFF99 /* PseudoTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PseudoTerminal.h; path = include/lldb/Utility/PseudoTerminal.h; sourceTree = "<group>"; };
 		2682F284115EF3A700CCFF99 /* SBError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBError.cpp; path = source/API/SBError.cpp; sourceTree = "<group>"; };
 		2682F286115EF3BD00CCFF99 /* SBError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBError.h; path = include/lldb/API/SBError.h; sourceTree = "<group>"; };
+		268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.posix.plist; path = tools/debugserver/source/com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
+		268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.internal.plist; path = tools/debugserver/source/com.apple.debugserver.applist.internal.plist; sourceTree = "<group>"; };
+		268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.internal.plist; path = tools/debugserver/source/com.apple.debugserver.internal.plist; sourceTree = "<group>"; };
 		2686536B1370ACB200D186A3 /* OptionGroupBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupBoolean.cpp; path = source/Interpreter/OptionGroupBoolean.cpp; sourceTree = "<group>"; };
 		2686536D1370ACC600D186A3 /* OptionGroupBoolean.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupBoolean.h; path = include/lldb/Interpreter/OptionGroupBoolean.h; sourceTree = "<group>"; };
 		2686536E1370AE5A00D186A3 /* OptionGroupUInt64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUInt64.h; path = include/lldb/Interpreter/OptionGroupUInt64.h; sourceTree = "<group>"; };
@@ -933,8 +1047,12 @@
 		26957D9513D381C900670048 /* RegisterContextDarwin_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_i386.h; path = Utility/RegisterContextDarwin_i386.h; sourceTree = "<group>"; };
 		26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_x86_64.cpp; path = Utility/RegisterContextDarwin_x86_64.cpp; sourceTree = "<group>"; };
 		26957D9713D381C900670048 /* RegisterContextDarwin_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_x86_64.h; path = Utility/RegisterContextDarwin_x86_64.h; sourceTree = "<group>"; };
+		2697A39215E404B1003E682C /* OptionValueArch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArch.cpp; path = source/Interpreter/OptionValueArch.cpp; sourceTree = "<group>"; };
+		2697A39415E404BA003E682C /* OptionValueArch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArch.h; path = include/lldb/Interpreter/OptionValueArch.h; sourceTree = "<group>"; };
 		2697A54B133A6305004E4240 /* PlatformDarwin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformDarwin.cpp; sourceTree = "<group>"; };
 		2697A54C133A6305004E4240 /* PlatformDarwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformDarwin.h; sourceTree = "<group>"; };
+		2698699815E6CBD0002415FF /* OperatingSystemPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OperatingSystemPython.cpp; sourceTree = "<group>"; };
+		2698699915E6CBD0002415FF /* OperatingSystemPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperatingSystemPython.h; sourceTree = "<group>"; };
 		269FF07D12494F7D00225026 /* FuncUnwinders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FuncUnwinders.h; path = include/lldb/Symbol/FuncUnwinders.h; sourceTree = "<group>"; };
 		269FF07F12494F8E00225026 /* UnwindPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindPlan.h; path = include/lldb/Symbol/UnwindPlan.h; sourceTree = "<group>"; };
 		269FF08112494FC200225026 /* UnwindTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindTable.h; path = include/lldb/Symbol/UnwindTable.h; sourceTree = "<group>"; };
@@ -948,8 +1066,9 @@
 		26A527BE14E24F5F00F3A14A /* ProcessMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessMachCore.h; sourceTree = "<group>"; };
 		26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadMachCore.cpp; sourceTree = "<group>"; };
 		26A527C014E24F5F00F3A14A /* ThreadMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadMachCore.h; sourceTree = "<group>"; };
-		26A7A034135E6E4200FB369E /* NamedOptionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NamedOptionValue.cpp; path = source/Interpreter/NamedOptionValue.cpp; sourceTree = "<group>"; };
-		26A7A036135E6E5300FB369E /* NamedOptionValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NamedOptionValue.h; path = include/lldb/Interpreter/NamedOptionValue.h; sourceTree = "<group>"; };
+		26A7A034135E6E4200FB369E /* OptionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValue.cpp; path = source/Interpreter/OptionValue.cpp; sourceTree = "<group>"; };
+		26A7A036135E6E5300FB369E /* OptionValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValue.h; path = include/lldb/Interpreter/OptionValue.h; sourceTree = "<group>"; };
+		26ACEC2715E077AE00E94760 /* Property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Property.h; path = include/lldb/Interpreter/Property.h; sourceTree = "<group>"; };
 		26B167A41123BF5500DC7B4F /* ThreadSafeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeValue.h; path = include/lldb/Core/ThreadSafeValue.h; sourceTree = "<group>"; };
 		26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDeclContext.cpp; sourceTree = "<group>"; };
 		26B1EFAD154638AF00E2DAC7 /* DWARFDeclContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDeclContext.h; sourceTree = "<group>"; };
@@ -1225,6 +1344,8 @@
 		26C72C951243229A0068DC16 /* SBStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStream.cpp; path = source/API/SBStream.cpp; sourceTree = "<group>"; };
 		26C81CA411335651004BDC5A /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UUID.h; path = include/lldb/Core/UUID.h; sourceTree = "<group>"; };
 		26C81CA511335651004BDC5A /* UUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UUID.cpp; path = source/Core/UUID.cpp; sourceTree = "<group>"; };
+		26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextThreadMemory.cpp; path = Utility/RegisterContextThreadMemory.cpp; sourceTree = "<group>"; };
+		26CA97A0172B1FD5005DC71B /* RegisterContextThreadMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextThreadMemory.h; path = Utility/RegisterContextThreadMemory.h; sourceTree = "<group>"; };
 		26CF992414428766001E4138 /* AnsiTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnsiTerminal.h; path = include/lldb/Utility/AnsiTerminal.h; sourceTree = "<group>"; };
 		26D0DD5010FE554D00271C65 /* BreakpointResolverAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverAddress.h; path = include/lldb/Breakpoint/BreakpointResolverAddress.h; sourceTree = "<group>"; };
 		26D0DD5110FE554D00271C65 /* BreakpointResolverFileLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverFileLine.h; path = include/lldb/Breakpoint/BreakpointResolverFileLine.h; sourceTree = "<group>"; };
@@ -1232,6 +1353,10 @@
 		26D0DD5310FE555900271C65 /* BreakpointResolverAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverAddress.cpp; path = source/Breakpoint/BreakpointResolverAddress.cpp; sourceTree = "<group>"; };
 		26D0DD5410FE555900271C65 /* BreakpointResolverFileLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverFileLine.cpp; path = source/Breakpoint/BreakpointResolverFileLine.cpp; sourceTree = "<group>"; };
 		26D0DD5510FE555900271C65 /* BreakpointResolverName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverName.cpp; path = source/Breakpoint/BreakpointResolverName.cpp; sourceTree = "<group>"; };
+		26D1803C16CEBFD300EDFB5B /* KQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KQueue.cpp; path = source/Utility/KQueue.cpp; sourceTree = "<group>"; };
+		26D1804016CEDF0700EDFB5B /* TimeSpecTimeout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TimeSpecTimeout.cpp; path = source/Utility/TimeSpecTimeout.cpp; sourceTree = "<group>"; };
+		26D1804416CEE12500EDFB5B /* KQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KQueue.h; path = source/Utility/KQueue.h; sourceTree = "<group>"; };
+		26D1804616CEE12C00EDFB5B /* TimeSpecTimeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TimeSpecTimeout.h; path = source/Utility/TimeSpecTimeout.h; sourceTree = "<group>"; };
 		26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ELFHeader.cpp; sourceTree = "<group>"; };
 		26D27C9E11ED3A4E0024D721 /* ELFHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELFHeader.h; sourceTree = "<group>"; };
 		26D55234159A7DB100708D8D /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
@@ -1243,6 +1368,8 @@
 		26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = source/Host/common/SocketAddress.cpp; sourceTree = "<group>"; };
 		26D9FDC612F784E60003F2EE /* EmulateInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EmulateInstruction.h; path = include/lldb/Core/EmulateInstruction.h; sourceTree = "<group>"; };
 		26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstruction.cpp; path = source/Core/EmulateInstruction.cpp; sourceTree = "<group>"; };
+		26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValuePathMappings.h; path = include/lldb/Interpreter/OptionValuePathMappings.h; sourceTree = "<group>"; };
+		26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValuePathMappings.cpp; path = source/Interpreter/OptionValuePathMappings.cpp; sourceTree = "<group>"; };
 		26DAFD9711529BC7005A394E /* ExecutionContextScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionContextScope.h; path = include/lldb/Target/ExecutionContextScope.h; sourceTree = "<group>"; };
 		26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_arm.cpp; sourceTree = "<group>"; };
 		26DB3E081379E7AD0080DC73 /* ABIMacOSX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_arm.h; sourceTree = "<group>"; };
@@ -1269,10 +1396,8 @@
 		26DE20601161902600A093E2 /* SBBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBlock.cpp; path = source/API/SBBlock.cpp; sourceTree = "<group>"; };
 		26DE20621161904200A093E2 /* SBLineEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLineEntry.cpp; path = source/API/SBLineEntry.cpp; sourceTree = "<group>"; };
 		26DE20641161904E00A093E2 /* SBSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbol.cpp; path = source/API/SBSymbol.cpp; sourceTree = "<group>"; };
-		26DFBC50113B48D600DD817F /* CommandObjectCrossref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectCrossref.h; path = include/lldb/Interpreter/CommandObjectCrossref.h; sourceTree = "<group>"; };
 		26DFBC51113B48D600DD817F /* CommandObjectMultiword.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectMultiword.h; path = include/lldb/Interpreter/CommandObjectMultiword.h; sourceTree = "<group>"; };
 		26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectRegexCommand.h; path = include/lldb/Interpreter/CommandObjectRegexCommand.h; sourceTree = "<group>"; };
-		26DFBC57113B48F300DD817F /* CommandObjectCrossref.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectCrossref.cpp; path = source/Commands/CommandObjectCrossref.cpp; sourceTree = "<group>"; };
 		26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectMultiword.cpp; path = source/Commands/CommandObjectMultiword.cpp; sourceTree = "<group>"; };
 		26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectRegexCommand.cpp; path = source/Interpreter/CommandObjectRegexCommand.cpp; sourceTree = "<group>"; };
 		26E152231419CACA007967D0 /* ObjectFilePECOFF.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFilePECOFF.cpp; sourceTree = "<group>"; };
@@ -1339,9 +1464,9 @@
 		49A1CAC31430E8BD00306AC9 /* ExpressionSourceCode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpressionSourceCode.cpp; path = source/Expression/ExpressionSourceCode.cpp; sourceTree = "<group>"; };
 		49A8A39F11D568A300AD3B68 /* ASTResultSynthesizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTResultSynthesizer.cpp; path = source/Expression/ASTResultSynthesizer.cpp; sourceTree = "<group>"; };
 		49A8A3A311D568BF00AD3B68 /* ASTResultSynthesizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTResultSynthesizer.h; path = include/lldb/Expression/ASTResultSynthesizer.h; sourceTree = "<group>"; };
+		49B01A2D15F67B1700666829 /* TypeVendor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeVendor.h; path = include/lldb/Symbol/TypeVendor.h; sourceTree = "<group>"; };
 		49BB309511F79450001A4197 /* TaggedASTType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TaggedASTType.h; path = include/lldb/Symbol/TaggedASTType.h; sourceTree = "<group>"; };
-		49C850761384A02F007DB519 /* ProcessDataAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProcessDataAllocator.h; path = include/lldb/Expression/ProcessDataAllocator.h; sourceTree = "<group>"; };
-		49C850781384A0CA007DB519 /* ProcessDataAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessDataAllocator.cpp; path = source/Expression/ProcessDataAllocator.cpp; sourceTree = "<group>"; };
+		49C66B1C17011A43004D1922 /* IRMemoryMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IRMemoryMap.h; path = include/lldb/Expression/IRMemoryMap.h; sourceTree = "<group>"; };
 		49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRDynamicChecks.cpp; path = source/Expression/IRDynamicChecks.cpp; sourceTree = "<group>"; };
 		49CF9833122C718B007A0B96 /* IRDynamicChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRDynamicChecks.h; path = include/lldb/Expression/IRDynamicChecks.h; sourceTree = "<group>"; };
 		49D4FE821210B5FB00CDB854 /* ClangPersistentVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangPersistentVariables.h; path = include/lldb/Expression/ClangPersistentVariables.h; sourceTree = "<group>"; };
@@ -1350,8 +1475,11 @@
 		49D7072811B5AD11001AD875 /* ClangASTSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTSource.cpp; path = source/Expression/ClangASTSource.cpp; sourceTree = "<group>"; };
 		49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTImporter.cpp; path = source/Symbol/ClangASTImporter.cpp; sourceTree = "<group>"; };
 		49D8FB3713B5594900411094 /* ClangASTImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTImporter.h; path = include/lldb/Symbol/ClangASTImporter.h; sourceTree = "<group>"; };
-		49DA65021485C92A005FF180 /* AppleObjCSymbolVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCSymbolVendor.cpp; sourceTree = "<group>"; };
-		49DA65041485C942005FF180 /* AppleObjCSymbolVendor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCSymbolVendor.h; sourceTree = "<group>"; };
+		49DA65021485C92A005FF180 /* AppleObjCTypeVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCTypeVendor.cpp; sourceTree = "<group>"; };
+		49DA65041485C942005FF180 /* AppleObjCTypeVendor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCTypeVendor.h; sourceTree = "<group>"; };
+		49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRMemoryMap.cpp; path = source/Expression/IRMemoryMap.cpp; sourceTree = "<group>"; };
+		49DCF6FF170E6FD90092F75E /* Materializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Materializer.h; path = include/lldb/Expression/Materializer.h; sourceTree = "<group>"; };
+		49DCF700170E70120092F75E /* Materializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Materializer.cpp; path = source/Expression/Materializer.cpp; sourceTree = "<group>"; };
 		49E45FA911F660DC008F7B28 /* ClangASTType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTType.h; path = include/lldb/Symbol/ClangASTType.h; sourceTree = "<group>"; };
 		49E45FAD11F660FE008F7B28 /* ClangASTType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTType.cpp; path = source/Symbol/ClangASTType.cpp; sourceTree = "<group>"; };
 		49EC3E98118F90AC00B1265E /* ThreadPlanCallFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallFunction.cpp; path = source/Target/ThreadPlanCallFunction.cpp; sourceTree = "<group>"; };
@@ -1380,9 +1508,9 @@
 		4C7CF7E31295E10E00B4FBB5 /* ThreadPlanCallUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallUserExpression.h; path = include/lldb/Target/ThreadPlanCallUserExpression.h; sourceTree = "<group>"; };
 		4C7CF7E51295E12B00B4FBB5 /* ThreadPlanCallUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallUserExpression.cpp; path = source/Target/ThreadPlanCallUserExpression.cpp; sourceTree = "<group>"; };
 		4C98D3DA118FB96F00E575D0 /* ClangFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangFunction.cpp; path = source/Expression/ClangFunction.cpp; sourceTree = "<group>"; };
-		4C98D3DB118FB96F00E575D0 /* RecordingMemoryManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecordingMemoryManager.cpp; path = source/Expression/RecordingMemoryManager.cpp; sourceTree = "<group>"; };
+		4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRExecutionUnit.cpp; path = source/Expression/IRExecutionUnit.cpp; sourceTree = "<group>"; };
 		4C98D3E0118FB98F00E575D0 /* ClangFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangFunction.h; path = include/lldb/Expression/ClangFunction.h; sourceTree = "<group>"; };
-		4C98D3E1118FB98F00E575D0 /* RecordingMemoryManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RecordingMemoryManager.h; path = include/lldb/Expression/RecordingMemoryManager.h; sourceTree = "<group>"; };
+		4C98D3E1118FB98F00E575D0 /* IRExecutionUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRExecutionUnit.h; path = include/lldb/Expression/IRExecutionUnit.h; sourceTree = "<group>"; };
 		4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectApropos.cpp; path = source/Commands/CommandObjectApropos.cpp; sourceTree = "<group>"; };
 		4CA9637A11B6E99A00780E28 /* CommandObjectApropos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectApropos.h; path = source/Commands/CommandObjectApropos.h; sourceTree = "<group>"; };
 		4CAA56121422D96A001FFA01 /* BreakpointResolverFileRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverFileRegex.h; path = include/lldb/Breakpoint/BreakpointResolverFileRegex.h; sourceTree = "<group>"; };
@@ -1413,6 +1541,9 @@
 		4CCA644B13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleThreadPlanStepThroughObjCTrampoline.h; sourceTree = "<group>"; };
 		4CD0BD0C134BFAB600CB44D4 /* ValueObjectDynamicValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectDynamicValue.h; path = include/lldb/Core/ValueObjectDynamicValue.h; sourceTree = "<group>"; };
 		4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectDynamicValue.cpp; path = source/Core/ValueObjectDynamicValue.cpp; sourceTree = "<group>"; };
+		4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBExpressionOptions.h; path = include/lldb/API/SBExpressionOptions.h; sourceTree = "<group>"; };
+		4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBExpressionOptions.cpp; path = source/API/SBExpressionOptions.cpp; sourceTree = "<group>"; };
+		4CE4F676162CE1E100F75CB3 /* SBExpressionOptions.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBExpressionOptions.i; sourceTree = "<group>"; };
 		4CEDAED311754F5E00E875A6 /* ThreadPlanStepUntil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepUntil.h; path = include/lldb/Target/ThreadPlanStepUntil.h; sourceTree = "<group>"; };
 		4CF52AF41428291E0051E832 /* SBFileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileSpecList.h; path = include/lldb/API/SBFileSpecList.h; sourceTree = "<group>"; };
 		4CF52AF7142829390051E832 /* SBFileSpecList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFileSpecList.cpp; path = source/API/SBFileSpecList.cpp; sourceTree = "<group>"; };
@@ -1426,14 +1557,35 @@
 		94031A9B13CF484600DCFF3C /* InputReaderEZ.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InputReaderEZ.h; path = include/lldb/Core/InputReaderEZ.h; sourceTree = "<group>"; };
 		94031A9D13CF486600DCFF3C /* InputReaderEZ.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InputReaderEZ.cpp; path = source/Core/InputReaderEZ.cpp; sourceTree = "<group>"; };
 		94031A9F13CF5B3D00DCFF3C /* PriorityPointerPair.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PriorityPointerPair.h; path = include/lldb/Utility/PriorityPointerPair.h; sourceTree = "<group>"; };
-		9415F61613B2C0DC00A52B36 /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = FormatManager.h; path = include/lldb/Core/FormatManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
-		9415F61713B2C0EF00A52B36 /* FormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = FormatManager.cpp; path = source/Core/FormatManager.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		94094C68163B6CCC0083A547 /* ValueObjectCast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectCast.h; path = include/lldb/Core/ValueObjectCast.h; sourceTree = "<group>"; };
+		94094C69163B6CD90083A547 /* ValueObjectCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectCast.cpp; path = source/Core/ValueObjectCast.cpp; sourceTree = "<group>"; };
+		940DB8CA16EA66FB00D3C2F1 /* Gauge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Gauge.h; sourceTree = "<group>"; };
+		940DB8CE16EA670C00D3C2F1 /* Measurement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Measurement.h; sourceTree = "<group>"; };
+		940DB8D116EA671800D3C2F1 /* MemoryGauge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryGauge.cpp; sourceTree = "<group>"; };
+		940DB8D216EA671800D3C2F1 /* MemoryGauge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryGauge.h; sourceTree = "<group>"; };
+		940DB8D516EA672200D3C2F1 /* Metric.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Metric.cpp; sourceTree = "<group>"; };
+		940DB8D616EA672200D3C2F1 /* Metric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Metric.h; sourceTree = "<group>"; };
+		940DB8D916EA672D00D3C2F1 /* TestCase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestCase.cpp; sourceTree = "<group>"; };
+		940DB8DA16EA672D00D3C2F1 /* TestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestCase.h; sourceTree = "<group>"; };
+		940DB8DD16EA673800D3C2F1 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = "<group>"; };
+		940DB8DE16EA673800D3C2F1 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
+		940DB8E116EA674000D3C2F1 /* Xcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Xcode.cpp; sourceTree = "<group>"; };
+		940DB8E216EA674000D3C2F1 /* Xcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xcode.h; sourceTree = "<group>"; };
+		940DB8E616EA709400D3C2F1 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
+		94145430175D7FDE00284436 /* lldb-versioning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-versioning.h"; path = "include/lldb/lldb-versioning.h"; sourceTree = "<group>"; };
+		944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDummy.cpp; path = Utility/RegisterContextDummy.cpp; sourceTree = "<group>"; };
+		944372DB171F6B4300E57C32 /* RegisterContextDummy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDummy.h; path = Utility/RegisterContextDummy.h; sourceTree = "<group>"; };
 		9443B120140C18A90013457C /* SBData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBData.h; path = include/lldb/API/SBData.h; sourceTree = "<group>"; };
 		9443B121140C18C10013457C /* SBData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBData.cpp; path = source/API/SBData.cpp; sourceTree = "<group>"; };
 		945759651534941F005A9070 /* PlatformPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformPOSIX.cpp; path = POSIX/PlatformPOSIX.cpp; sourceTree = "<group>"; };
 		945759661534941F005A9070 /* PlatformPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformPOSIX.h; path = POSIX/PlatformPOSIX.h; sourceTree = "<group>"; };
 		945E8D7D152F6AA80019BCCD /* StreamGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamGDBRemote.h; path = include/lldb/Core/StreamGDBRemote.h; sourceTree = "<group>"; };
 		945E8D7F152F6AB40019BCCD /* StreamGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamGDBRemote.cpp; path = source/Core/StreamGDBRemote.cpp; sourceTree = "<group>"; };
+		9452573616262CD000325455 /* SBDeclaration.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBDeclaration.i; sourceTree = "<group>"; };
+		9452573816262CEF00325455 /* SBDeclaration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBDeclaration.h; path = include/lldb/API/SBDeclaration.h; sourceTree = "<group>"; };
+		9452573916262D0200325455 /* SBDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBDeclaration.cpp; path = source/API/SBDeclaration.cpp; sourceTree = "<group>"; };
+		9456F2211616644B00656F91 /* DynamicLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLibrary.cpp; sourceTree = "<group>"; };
+		9456F2231616645A00656F91 /* DynamicLibrary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DynamicLibrary.h; path = include/lldb/Host/DynamicLibrary.h; sourceTree = "<group>"; };
 		94611EAF13CCA363003A22AF /* RefCounter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RefCounter.h; path = include/lldb/Utility/RefCounter.h; sourceTree = "<group>"; };
 		94611EB113CCA4A4003A22AF /* RefCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RefCounter.cpp; path = source/Utility/RefCounter.cpp; sourceTree = "<group>"; };
 		9461568614E355F2003A195C /* SBTypeFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFilter.h; path = include/lldb/API/SBTypeFilter.h; sourceTree = "<group>"; };
@@ -1452,23 +1604,53 @@
 		9463D4CE13B179A500C230D4 /* CommandObjectType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectType.h; path = source/Commands/CommandObjectType.h; sourceTree = "<group>"; };
 		9467E65113C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeHierarchyNavigator.cpp; path = source/Symbol/TypeHierarchyNavigator.cpp; sourceTree = "<group>"; };
 		9467E65413C3D98900B3B6F3 /* TypeHierarchyNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeHierarchyNavigator.h; path = include/lldb/Symbol/TypeHierarchyNavigator.h; sourceTree = "<group>"; };
-		9470A8EE1402DF940056FF61 /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = DataVisualization.h; path = include/lldb/Core/DataVisualization.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
-		9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = DataVisualization.cpp; path = source/Core/DataVisualization.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
 		9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeCategory.h; path = include/lldb/API/SBTypeCategory.h; sourceTree = "<group>"; };
 		9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeCategory.cpp; path = source/API/SBTypeCategory.cpp; sourceTree = "<group>"; };
 		9475C18A14E5EA1C001BFC6D /* SBTypeCategory.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeCategory.i; sourceTree = "<group>"; };
 		9475C18B14E5F818001BFC6D /* SBTypeNameSpecifier.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeNameSpecifier.i; sourceTree = "<group>"; };
 		9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeNameSpecifier.h; path = include/lldb/API/SBTypeNameSpecifier.h; sourceTree = "<group>"; };
 		9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeNameSpecifier.cpp; path = source/API/SBTypeNameSpecifier.cpp; sourceTree = "<group>"; };
+		947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectPlugin.cpp; path = source/Commands/CommandObjectPlugin.cpp; sourceTree = "<group>"; };
+		947A1D631616476A0017C8D1 /* CommandObjectPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectPlugin.h; path = source/Commands/CommandObjectPlugin.h; sourceTree = "<group>"; };
 		949ADF001406F62E004833E1 /* ValueObjectConstResultImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultImpl.h; path = include/lldb/Core/ValueObjectConstResultImpl.h; sourceTree = "<group>"; };
 		949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultImpl.cpp; path = source/Core/ValueObjectConstResultImpl.cpp; sourceTree = "<group>"; };
-		94A8287514031D05006C37A8 /* FormatNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatNavigator.h; path = include/lldb/Core/FormatNavigator.h; sourceTree = "<group>"; };
-		94A9112B13D5DEF80046D8A6 /* FormatClasses.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatClasses.h; path = include/lldb/Core/FormatClasses.h; sourceTree = "<group>"; };
-		94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatClasses.cpp; path = source/Core/FormatClasses.cpp; sourceTree = "<group>"; };
 		94B6E76013D8833C005F417F /* ValueObjectSyntheticFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectSyntheticFilter.h; path = include/lldb/Core/ValueObjectSyntheticFilter.h; sourceTree = "<group>"; };
 		94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectSyntheticFilter.cpp; path = source/Core/ValueObjectSyntheticFilter.cpp; sourceTree = "<group>"; };
+		94CB255716B069770059775D /* CXXFormatterFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CXXFormatterFunctions.cpp; path = source/DataFormatters/CXXFormatterFunctions.cpp; sourceTree = "<group>"; };
+		94CB255816B069770059775D /* DataVisualization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataVisualization.cpp; path = source/DataFormatters/DataVisualization.cpp; sourceTree = "<group>"; };
+		94CB255916B069770059775D /* FormatClasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatClasses.cpp; path = source/DataFormatters/FormatClasses.cpp; sourceTree = "<group>"; };
+		94CB255A16B069770059775D /* FormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatManager.cpp; path = source/DataFormatters/FormatManager.cpp; sourceTree = "<group>"; };
+		94CB255F16B069800059775D /* CXXFormatterFunctions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CXXFormatterFunctions.h; path = include/lldb/DataFormatters/CXXFormatterFunctions.h; sourceTree = "<group>"; };
+		94CB256016B069800059775D /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataVisualization.h; path = include/lldb/DataFormatters/DataVisualization.h; sourceTree = "<group>"; };
+		94CB256116B069800059775D /* FormatClasses.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatClasses.h; path = include/lldb/DataFormatters/FormatClasses.h; sourceTree = "<group>"; };
+		94CB256216B069800059775D /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatManager.h; path = include/lldb/DataFormatters/FormatManager.h; sourceTree = "<group>"; };
+		94CB256316B069800059775D /* FormatNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatNavigator.h; path = include/lldb/DataFormatters/FormatNavigator.h; sourceTree = "<group>"; };
+		94CB256416B096F10059775D /* TypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategory.cpp; path = source/DataFormatters/TypeCategory.cpp; sourceTree = "<group>"; };
+		94CB256516B096F10059775D /* TypeCategoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategoryMap.cpp; path = source/DataFormatters/TypeCategoryMap.cpp; sourceTree = "<group>"; };
+		94CB256816B096F90059775D /* TypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeCategory.h; path = include/lldb/DataFormatters/TypeCategory.h; sourceTree = "<group>"; };
+		94CB256916B096FA0059775D /* TypeCategoryMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeCategoryMap.h; path = include/lldb/DataFormatters/TypeCategoryMap.h; sourceTree = "<group>"; };
+		94CB256A16B0A4030059775D /* TypeFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeFormat.h; path = include/lldb/DataFormatters/TypeFormat.h; sourceTree = "<group>"; };
+		94CB256B16B0A4030059775D /* TypeSummary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSummary.h; path = include/lldb/DataFormatters/TypeSummary.h; sourceTree = "<group>"; };
+		94CB256C16B0A4040059775D /* TypeSynthetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSynthetic.h; path = include/lldb/DataFormatters/TypeSynthetic.h; sourceTree = "<group>"; };
+		94CB256D16B0A4260059775D /* TypeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeFormat.cpp; path = source/DataFormatters/TypeFormat.cpp; sourceTree = "<group>"; };
+		94CB256E16B0A4260059775D /* TypeSummary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSummary.cpp; path = source/DataFormatters/TypeSummary.cpp; sourceTree = "<group>"; };
+		94CB256F16B0A4270059775D /* TypeSynthetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSynthetic.cpp; path = source/DataFormatters/TypeSynthetic.cpp; sourceTree = "<group>"; };
+		94CB257316B1D3870059775D /* FormatCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatCache.cpp; path = source/DataFormatters/FormatCache.cpp; sourceTree = "<group>"; };
+		94CB257516B1D3910059775D /* FormatCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatCache.h; path = include/lldb/DataFormatters/FormatCache.h; sourceTree = "<group>"; };
+		94CD704B16F8DDEA00CF1E42 /* CF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CF.cpp; path = source/DataFormatters/CF.cpp; sourceTree = "<group>"; };
+		94CD704C16F8DDEA00CF1E42 /* Cocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Cocoa.cpp; path = source/DataFormatters/Cocoa.cpp; sourceTree = "<group>"; };
+		94CD704F16F8DF1C00CF1E42 /* LibCxxList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxList.cpp; path = source/DataFormatters/LibCxxList.cpp; sourceTree = "<group>"; };
+		94CD705116F8F5BC00CF1E42 /* LibCxxMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxMap.cpp; path = source/DataFormatters/LibCxxMap.cpp; sourceTree = "<group>"; };
+		94D0B10A16D5535900EA9C70 /* LibCxx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxx.cpp; path = source/DataFormatters/LibCxx.cpp; sourceTree = "<group>"; };
+		94D0B10B16D5535900EA9C70 /* LibStdcpp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibStdcpp.cpp; path = source/DataFormatters/LibStdcpp.cpp; sourceTree = "<group>"; };
+		94D6A0A716CEB55F00833B6E /* NSArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSArray.cpp; path = source/DataFormatters/NSArray.cpp; sourceTree = "<group>"; };
+		94D6A0A816CEB55F00833B6E /* NSDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSDictionary.cpp; path = source/DataFormatters/NSDictionary.cpp; sourceTree = "<group>"; };
+		94D6A0A916CEB55F00833B6E /* NSSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSSet.cpp; path = source/DataFormatters/NSSet.cpp; sourceTree = "<group>"; };
+		94DB60F016EA888A00459D9E /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
 		94E367CC140C4EC4001C7A5A /* modify-python-lldb.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = "modify-python-lldb.py"; sourceTree = "<group>"; };
 		94E367CE140C4EEA001C7A5A /* python-typemaps.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-typemaps.swig"; sourceTree = "<group>"; };
+		94EA1D5A15E6C99B00D4171A /* PythonDataObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PythonDataObjects.h; path = include/lldb/Interpreter/PythonDataObjects.h; sourceTree = "<group>"; };
+		94EA1D5B15E6C9B400D4171A /* PythonDataObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PythonDataObjects.cpp; path = source/Interpreter/PythonDataObjects.cpp; sourceTree = "<group>"; };
 		94EBAC8313D9EE26009BA64E /* PythonPointer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PythonPointer.h; path = include/lldb/Utility/PythonPointer.h; sourceTree = "<group>"; };
 		94FA3DDD1405D4E500833217 /* ValueObjectConstResultChild.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultChild.h; path = include/lldb/Core/ValueObjectConstResultChild.h; sourceTree = "<group>"; };
 		94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultChild.cpp; path = source/Core/ValueObjectConstResultChild.cpp; sourceTree = "<group>"; };
@@ -1543,6 +1725,8 @@
 		9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpoint.h; path = include/lldb/API/SBBreakpoint.h; sourceTree = "<group>"; };
 		9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpointLocation.h; path = include/lldb/API/SBBreakpointLocation.h; sourceTree = "<group>"; };
 		9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointLocation.cpp; path = source/API/SBBreakpointLocation.cpp; sourceTree = "<group>"; };
+		AF254E2F170CCC33007AE5C9 /* PlatformDarwinKernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformDarwinKernel.cpp; sourceTree = "<group>"; };
+		AF254E30170CCC33007AE5C9 /* PlatformDarwinKernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformDarwinKernel.h; sourceTree = "<group>"; };
 		AF68D2541255416E002FF25B /* RegisterContextLLDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLLDB.cpp; path = Utility/RegisterContextLLDB.cpp; sourceTree = "<group>"; };
 		AF68D2551255416E002FF25B /* RegisterContextLLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLLDB.h; path = Utility/RegisterContextLLDB.h; sourceTree = "<group>"; };
 		AF68D32F1255A110002FF25B /* UnwindLLDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindLLDB.cpp; path = Utility/UnwindLLDB.cpp; sourceTree = "<group>"; };
@@ -1685,6 +1869,7 @@
 				26BC7CEB10F1B70800F91463 /* Breakpoint */,
 				26BC7D0D10F1B71D00F91463 /* Commands */,
 				26BC7C1010F1B34800F91463 /* Core */,
+				94CB255616B0683B0059775D /* DataFormatters */,
 				26BC7DBE10F1B78200F91463 /* Expression */,
 				26BC7DD010F1B7C100F91463 /* Host */,
 				26BC7DDF10F1B7E200F91463 /* Interpreter */,
@@ -1743,8 +1928,6 @@
 		260C897310F57C5600BB2B04 /* llvm */ = {
 			isa = PBXGroup;
 			children = (
-				260C897410F57C5600BB2B04 /* DisassemblerLLVM.cpp */,
-				260C897510F57C5600BB2B04 /* DisassemblerLLVM.h */,
 				B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */,
 				B299580C14F2FA1F00050A04 /* DisassemblerLLVMC.h */,
 			);
@@ -1936,11 +2119,13 @@
 				2611FEF7142D83060017FEA3 /* SBCompileUnit.i */,
 				2611FEF8142D83060017FEA3 /* SBData.i */,
 				2611FEF9142D83060017FEA3 /* SBDebugger.i */,
+				9452573616262CD000325455 /* SBDeclaration.i */,
 				2611FEFA142D83060017FEA3 /* SBError.i */,
 				2611FEFB142D83060017FEA3 /* SBEvent.i */,
 				2611FEFC142D83060017FEA3 /* SBFileSpec.i */,
 				2611FEFD142D83060017FEA3 /* SBFileSpecList.i */,
 				2611FEFE142D83060017FEA3 /* SBFrame.i */,
+				4CE4F676162CE1E100F75CB3 /* SBExpressionOptions.i */,
 				2611FEFF142D83060017FEA3 /* SBFunction.i */,
 				2611FF00142D83060017FEA3 /* SBHostOS.i */,
 				2611FF01142D83060017FEA3 /* SBInputReader.i */,
@@ -1974,15 +2159,6 @@
 			path = scripts/Python/interface;
 			sourceTree = SOURCE_ROOT;
 		};
-		26274F9F14030EEF006BA130 /* Darwin-Kernel */ = {
-			isa = PBXGroup;
-			children = (
-				26274FA014030EEF006BA130 /* OperatingSystemDarwinKernel.cpp */,
-				26274FA114030EEF006BA130 /* OperatingSystemDarwinKernel.h */,
-			);
-			path = "Darwin-Kernel";
-			sourceTree = "<group>";
-		};
 		26274FA414030F79006BA130 /* Darwin-Kernel */ = {
 			isa = PBXGroup;
 			children = (
@@ -2001,6 +2177,7 @@
 				26DE1E6A11616C2E00A093E2 /* lldb-forward.h */,
 				26651A14133BEC76005B64B7 /* lldb-public.h */,
 				26BC7C2910F1B3BC00F91463 /* lldb-types.h */,
+				94145430175D7FDE00284436 /* lldb-versioning.h */,
 				26B42C4C1187ABA50079C8C8 /* LLDB.h */,
 				9A9830FC1125FC5800A56CB0 /* SBDefines.h */,
 				26DE204211618ACA00A093E2 /* SBAddress.h */,
@@ -2025,10 +2202,14 @@
 				9443B121140C18C10013457C /* SBData.cpp */,
 				9A9830FB1125FC5800A56CB0 /* SBDebugger.h */,
 				9A9830FA1125FC5800A56CB0 /* SBDebugger.cpp */,
+				9452573816262CEF00325455 /* SBDeclaration.h */,
+				9452573916262D0200325455 /* SBDeclaration.cpp */,
 				2682F286115EF3BD00CCFF99 /* SBError.h */,
 				2682F284115EF3A700CCFF99 /* SBError.cpp */,
 				9A9830FE1125FC5800A56CB0 /* SBEvent.h */,
 				9A9830FD1125FC5800A56CB0 /* SBEvent.cpp */,
+				4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */,
+				4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */,
 				26022531115F27FA00A601A2 /* SBFileSpec.h */,
 				26022532115F281400A601A2 /* SBFileSpec.cpp */,
 				4CF52AF41428291E0051E832 /* SBFileSpecList.h */,
@@ -2089,8 +2270,8 @@
 				9A19A6AD1163BB9800E0D453 /* SBValue.cpp */,
 				9A357582116CFDEE00E8ED2F /* SBValueList.h */,
 				9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */,
-				B2A58723143119D50092BFBA /* SBWatchpoint.cpp */,
 				B2A58721143119810092BFBA /* SBWatchpoint.h */,
+				B2A58723143119D50092BFBA /* SBWatchpoint.cpp */,
 			);
 			name = API;
 			sourceTree = "<group>";
@@ -2129,6 +2310,9 @@
 			isa = PBXGroup;
 			children = (
 				AF90106315AB7C5700FF120D /* lldb.1 */,
+				268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */,
+				268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */,
+				268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */,
 				AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */,
 				AFF87C8C150FF680000E1742 /* com.apple.debugserver.applist.plist */,
 				AFF87C8A150FF677000E1742 /* com.apple.debugserver.applist.plist */,
@@ -2204,7 +2388,7 @@
 		266DFE9013FD64D200D0C574 /* OperatingSystem */ = {
 			isa = PBXGroup;
 			children = (
-				26274F9F14030EEF006BA130 /* Darwin-Kernel */,
+				2698699715E6CBD0002415FF /* Python */,
 			);
 			path = OperatingSystem;
 			sourceTree = "<group>";
@@ -2217,6 +2401,8 @@
 				26ECA04213665FED008D1F18 /* ARM_DWARF_Registers.cpp */,
 				26F996A8119B79C300412154 /* ARM_GCC_Registers.h */,
 				264723A511FA076E00DE380C /* CleanUp.h */,
+				26D1804416CEE12500EDFB5B /* KQueue.h */,
+				26D1803C16CEBFD300EDFB5B /* KQueue.cpp */,
 				94031A9F13CF5B3D00DCFF3C /* PriorityPointerPair.h */,
 				2682F16B115EDA0D00CCFF99 /* PseudoTerminal.h */,
 				2682F16A115EDA0D00CCFF99 /* PseudoTerminal.cpp */,
@@ -2229,6 +2415,8 @@
 				2660D9F611922A1300958FBD /* StringExtractor.cpp */,
 				2676A094119C93C8008A98EF /* StringExtractorGDBRemote.h */,
 				2676A093119C93C8008A98EF /* StringExtractorGDBRemote.cpp */,
+				26D1804616CEE12C00EDFB5B /* TimeSpecTimeout.h */,
+				26D1804016CEDF0700EDFB5B /* TimeSpecTimeout.cpp */,
 				94EBAC8313D9EE26009BA64E /* PythonPointer.h */,
 				B2462249141AE62200F3D409 /* Utils.h */,
 			);
@@ -2280,6 +2468,15 @@
 			path = Linux;
 			sourceTree = "<group>";
 		};
+		2698699715E6CBD0002415FF /* Python */ = {
+			isa = PBXGroup;
+			children = (
+				2698699815E6CBD0002415FF /* OperatingSystemPython.cpp */,
+				2698699915E6CBD0002415FF /* OperatingSystemPython.h */,
+			);
+			path = Python;
+			sourceTree = "<group>";
+		};
 		26A3B4AB1181454800381BC2 /* BSD-Archive */ = {
 			isa = PBXGroup;
 			children = (
@@ -2327,12 +2524,16 @@
 				26957D9513D381C900670048 /* RegisterContextDarwin_i386.h */,
 				26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */,
 				26957D9713D381C900670048 /* RegisterContextDarwin_x86_64.h */,
+				944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */,
+				944372DB171F6B4300E57C32 /* RegisterContextDummy.h */,
 				AF68D2541255416E002FF25B /* RegisterContextLLDB.cpp */,
 				AF68D2551255416E002FF25B /* RegisterContextLLDB.h */,
 				262D24E413FB8710002D1960 /* RegisterContextMemory.cpp */,
 				262D24E513FB8710002D1960 /* RegisterContextMemory.h */,
 				26E3EEF811A994E800FBADB6 /* RegisterContextMacOSXFrameBackchain.h */,
 				26E3EEF711A994E800FBADB6 /* RegisterContextMacOSXFrameBackchain.cpp */,
+				26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */,
+				26CA97A0172B1FD5005DC71B /* RegisterContextThreadMemory.h */,
 				2615DBC91208B5FC0021781D /* StopInfoMachException.h */,
 				2615DBC81208B5FC0021781D /* StopInfoMachException.cpp */,
 				26F4A21A13FBA31A0064B613 /* ThreadMemory.cpp */,
@@ -2384,8 +2585,6 @@
 				268ED0A4140FF54200DE830F /* DataEncoder.cpp */,
 				26BC7D5A10F1B77400F91463 /* DataExtractor.h */,
 				26BC7E7110F1B85900F91463 /* DataExtractor.cpp */,
-				9470A8EE1402DF940056FF61 /* DataVisualization.h */,
-				9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */,
 				263664941140A4C10075843B /* Debugger.h */,
 				263664921140A4930075843B /* Debugger.cpp */,
 				26BC7D5E10F1B77400F91463 /* Disassembler.h */,
@@ -2402,11 +2601,6 @@
 				26BC7D6310F1B77400F91463 /* FileSpecList.h */,
 				26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */,
 				26BC7D6410F1B77400F91463 /* Flags.h */,
-				94A9112B13D5DEF80046D8A6 /* FormatClasses.h */,
-				94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */,
-				9415F61613B2C0DC00A52B36 /* FormatManager.h */,
-				9415F61713B2C0EF00A52B36 /* FormatManager.cpp */,
-				94A8287514031D05006C37A8 /* FormatNavigator.h */,
 				26F7305F139D8FC900FD51C7 /* History.h */,
 				26F73061139D8FDB00FD51C7 /* History.cpp */,
 				9AA69DBB118A029E00D753A0 /* InputReader.h */,
@@ -2433,6 +2627,7 @@
 				26BC7E8210F1B85900F91463 /* ModuleChild.cpp */,
 				26BC7D6C10F1B77400F91463 /* ModuleList.h */,
 				26BC7E8310F1B85900F91463 /* ModuleList.cpp */,
+				260D9B2615EC369500960137 /* ModuleSpec.h */,
 				26651A15133BF9CC005B64B7 /* Opcode.h */,
 				26651A17133BF9DF005B64B7 /* Opcode.cpp */,
 				266DFE9813FD658300D0C574 /* OperatingSystem.h */,
@@ -2487,6 +2682,8 @@
 				26BC7E9910F1B85900F91463 /* Value.cpp */,
 				26BC7D8210F1B77400F91463 /* ValueObject.h */,
 				26BC7E9A10F1B85900F91463 /* ValueObject.cpp */,
+				94094C68163B6CCC0083A547 /* ValueObjectCast.h */,
+				94094C69163B6CD90083A547 /* ValueObjectCast.cpp */,
 				26BC7D8310F1B77400F91463 /* ValueObjectChild.h */,
 				26BC7E9B10F1B85900F91463 /* ValueObjectChild.cpp */,
 				26424E3E125986D30016D82C /* ValueObjectConstResult.h */,
@@ -2565,6 +2762,7 @@
 				9467E65113C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp */,
 				26BC7C6610F1B6E900F91463 /* TypeList.h */,
 				26BC7F2110F1B8EC00F91463 /* TypeList.cpp */,
+				49B01A2D15F67B1700666829 /* TypeVendor.h */,
 				269FF07F12494F8E00225026 /* UnwindPlan.h */,
 				961FABB91235DE1600F93A47 /* UnwindPlan.cpp */,
 				269FF08112494FC200225026 /* UnwindTable.h */,
@@ -2619,8 +2817,8 @@
 				26BC7CFB10F1B71400F91463 /* StoppointLocation.h */,
 				26BC7E1710F1B83100F91463 /* StoppointLocation.cpp */,
 				26BC7CFC10F1B71400F91463 /* Watchpoint.h */,
-				B27318431416AC43006039C8 /* WatchpointList.h */,
 				26BC7E1810F1B83100F91463 /* Watchpoint.cpp */,
+				B27318431416AC43006039C8 /* WatchpointList.h */,
 				B27318411416AC12006039C8 /* WatchpointList.cpp */,
 				B2B7CCED15D1BFB700EEFB57 /* WatchpointOptions.h */,
 				B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */,
@@ -2655,6 +2853,8 @@
 				26BC7E3610F1B84700F91463 /* CommandObjectMemory.cpp */,
 				26879CE51333F5750012C1F8 /* CommandObjectPlatform.h */,
 				26879CE71333F58B0012C1F8 /* CommandObjectPlatform.cpp */,
+				947A1D631616476A0017C8D1 /* CommandObjectPlugin.h */,
+				947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */,
 				26BC7D1F10F1B76300F91463 /* CommandObjectProcess.h */,
 				26BC7E3810F1B84700F91463 /* CommandObjectProcess.cpp */,
 				26BC7D2010F1B76300F91463 /* CommandObjectQuit.h */,
@@ -2717,14 +2917,16 @@
 				491193501226386000578B7F /* ASTStructExtractor.cpp */,
 				49CF9833122C718B007A0B96 /* IRDynamicChecks.h */,
 				49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp */,
+				49C66B1C17011A43004D1922 /* IRMemoryMap.h */,
+				49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */,
+				4C98D3E1118FB98F00E575D0 /* IRExecutionUnit.h */,
+				4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp */,
 				49307AB111DEA4F20081F992 /* IRForTarget.h */,
 				49307AAD11DEA4D90081F992 /* IRForTarget.cpp */,
 				496B015A1406DEB100F830D5 /* IRInterpreter.h */,
 				496B01581406DE8900F830D5 /* IRInterpreter.cpp */,
-				4C98D3E1118FB98F00E575D0 /* RecordingMemoryManager.h */,
-				4C98D3DB118FB96F00E575D0 /* RecordingMemoryManager.cpp */,
-				49C850761384A02F007DB519 /* ProcessDataAllocator.h */,
-				49C850781384A0CA007DB519 /* ProcessDataAllocator.cpp */,
+				49DCF6FF170E6FD90092F75E /* Materializer.h */,
+				49DCF700170E70120092F75E /* Materializer.cpp */,
 			);
 			name = Expression;
 			sourceTree = "<group>";
@@ -2736,6 +2938,7 @@
 				26BC7EE510F1B88100F91463 /* MacOSX */,
 				26BC7DD210F1B7D500F91463 /* Condition.h */,
 				266F5CBB12FC846200DFCE33 /* Config.h */,
+				9456F2231616645A00656F91 /* DynamicLibrary.h */,
 				26BC7DD310F1B7D500F91463 /* Endian.h */,
 				260C6EA013011578005E16B0 /* File.h */,
 				26FA4315130103F400E71120 /* FileSpec.h */,
@@ -2764,8 +2967,6 @@
 				26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */,
 				26BC7DE310F1B7F900F91463 /* CommandObject.h */,
 				26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */,
-				26DFBC50113B48D600DD817F /* CommandObjectCrossref.h */,
-				26DFBC57113B48F300DD817F /* CommandObjectCrossref.cpp */,
 				26DFBC51113B48D600DD817F /* CommandObjectMultiword.h */,
 				26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */,
 				26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */,
@@ -2773,8 +2974,41 @@
 				26BC7DE410F1B7F900F91463 /* CommandReturnObject.h */,
 				26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */,
 				94005E0513F45A1B001EF42D /* embedded_interpreter.py */,
-				26A7A036135E6E5300FB369E /* NamedOptionValue.h */,
-				26A7A034135E6E4200FB369E /* NamedOptionValue.cpp */,
+				26A7A036135E6E5300FB369E /* OptionValue.h */,
+				26A7A034135E6E4200FB369E /* OptionValue.cpp */,
+				260A248D15D06C4F009981B0 /* OptionValues.h */,
+				2697A39415E404BA003E682C /* OptionValueArch.h */,
+				2697A39215E404B1003E682C /* OptionValueArch.cpp */,
+				260CC62115D04377002BF2E0 /* OptionValueArgs.h */,
+				260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */,
+				260CC62215D04377002BF2E0 /* OptionValueArray.h */,
+				260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */,
+				260CC62315D04377002BF2E0 /* OptionValueBoolean.h */,
+				260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */,
+				260CC62515D04377002BF2E0 /* OptionValueDictionary.h */,
+				260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */,
+				260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */,
+				260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */,
+				260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */,
+				260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */,
+				260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */,
+				260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */,
+				260CC62915D04377002BF2E0 /* OptionValueFormat.h */,
+				260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */,
+				26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */,
+				26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */,
+				260CC62415D04377002BF2E0 /* OptionValueProperties.h */,
+				260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */,
+				26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */,
+				26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */,
+				260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */,
+				260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */,
+				260CC62B15D04377002BF2E0 /* OptionValueString.h */,
+				260CC64515D0440D002BF2E0 /* OptionValueString.cpp */,
+				260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */,
+				260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */,
+				260CC62D15D04377002BF2E0 /* OptionValueUUID.h */,
+				260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */,
 				26BC7D6D10F1B77400F91463 /* Options.h */,
 				26BC7E8610F1B85900F91463 /* Options.cpp */,
 				26D5E160135BAEB0006EA0A7 /* OptionGroupArchitecture.h */,
@@ -2789,6 +3023,8 @@
 				26BCFC531368B3E4006DC050 /* OptionGroupOutputFile.cpp */,
 				26D5E161135BB040006EA0A7 /* OptionGroupPlatform.h */,
 				26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */,
+				262ED0041631FA2800879631 /* OptionGroupString.h */,
+				262ED0071631FA3A00879631 /* OptionGroupString.cpp */,
 				2686536E1370AE5A00D186A3 /* OptionGroupUInt64.h */,
 				2686536F1370AE7200D186A3 /* OptionGroupUInt64.cpp */,
 				260E07C3136FA68900CF21D3 /* OptionGroupUUID.h */,
@@ -2796,9 +3032,13 @@
 				267C0128136880C7006E963E /* OptionGroupValueObjectDisplay.h */,
 				267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */,
 				26ED3D6F13C5638A0017D45E /* OptionGroupVariable.h */,
-				B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */,
 				26ED3D6C13C563810017D45E /* OptionGroupVariable.cpp */,
+				B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */,
 				B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */,
+				26ACEC2715E077AE00E94760 /* Property.h */,
+				2640E19E15DC78FD00F23B50 /* Property.cpp */,
+				94EA1D5A15E6C99B00D4171A /* PythonDataObjects.h */,
+				94EA1D5B15E6C9B400D4171A /* PythonDataObjects.cpp */,
 				26BC7DE510F1B7F900F91463 /* ScriptInterpreter.h */,
 				9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */,
 				9A2771FB1135A35C00E6ADB6 /* ScriptInterpreterNone.h */,
@@ -2932,6 +3172,8 @@
 		26C5577F132575C8008FD8FE /* MacOSX */ = {
 			isa = PBXGroup;
 			children = (
+				AF254E2F170CCC33007AE5C9 /* PlatformDarwinKernel.cpp */,
+				AF254E30170CCC33007AE5C9 /* PlatformDarwinKernel.h */,
 				2697A54B133A6305004E4240 /* PlatformDarwin.cpp */,
 				2697A54C133A6305004E4240 /* PlatformDarwin.h */,
 				26B7564C14F89356008D9CB3 /* PlatformiOSSimulator.cpp */,
@@ -3024,6 +3266,7 @@
 				265E9BE0115C2B8500D0DCCB /* debugserver */,
 				26F5C22510F3D956009D5894 /* Driver */,
 				2665CD0915080846002C8FAE /* install-headers */,
+				940DB8C416EA64D400D3C2F1 /* lldb-perf */,
 				26DC6A1B1337FEA400FF7998 /* lldb-platform */,
 			);
 			name = Tools;
@@ -3117,10 +3360,10 @@
 				4CCA644513B40B82003BDF98 /* AppleObjCRuntimeV1.h */,
 				4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */,
 				4CCA644713B40B82003BDF98 /* AppleObjCRuntimeV2.h */,
-				49DA65041485C942005FF180 /* AppleObjCSymbolVendor.h */,
-				49DA65021485C92A005FF180 /* AppleObjCSymbolVendor.cpp */,
 				4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */,
 				4CCA644913B40B82003BDF98 /* AppleObjCTrampolineHandler.h */,
+				49DA65041485C942005FF180 /* AppleObjCTypeVendor.h */,
+				49DA65021485C92A005FF180 /* AppleObjCTypeVendor.cpp */,
 				4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */,
 				4CCA644B13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.h */,
 			);
@@ -3152,6 +3395,7 @@
 		69A01E1A1236C5D400C660B5 /* common */ = {
 			isa = PBXGroup;
 			children = (
+				9456F2211616644B00656F91 /* DynamicLibrary.cpp */,
 				260C6EA213011581005E16B0 /* File.cpp */,
 				26FA43171301048600E71120 /* FileSpec.cpp */,
 				69A01E1B1236C5D400C660B5 /* Condition.cpp */,
@@ -3174,6 +3418,97 @@
 			name = POSIX;
 			sourceTree = "<group>";
 		};
+		940DB8C416EA64D400D3C2F1 /* lldb-perf */ = {
+			isa = PBXGroup;
+			children = (
+				940DB8C616EA654E00D3C2F1 /* darwin */,
+				940DB8C516EA654900D3C2F1 /* lib */,
+			);
+			name = "lldb-perf";
+			path = "tools/lldb-perf";
+			sourceTree = "<group>";
+		};
+		940DB8C516EA654900D3C2F1 /* lib */ = {
+			isa = PBXGroup;
+			children = (
+				940DB8CA16EA66FB00D3C2F1 /* Gauge.h */,
+				940DB8CE16EA670C00D3C2F1 /* Measurement.h */,
+				940DB8D116EA671800D3C2F1 /* MemoryGauge.cpp */,
+				940DB8D216EA671800D3C2F1 /* MemoryGauge.h */,
+				940DB8D516EA672200D3C2F1 /* Metric.cpp */,
+				940DB8D616EA672200D3C2F1 /* Metric.h */,
+				940DB8D916EA672D00D3C2F1 /* TestCase.cpp */,
+				940DB8DA16EA672D00D3C2F1 /* TestCase.h */,
+				940DB8DD16EA673800D3C2F1 /* Timer.cpp */,
+				940DB8DE16EA673800D3C2F1 /* Timer.h */,
+				940DB8E116EA674000D3C2F1 /* Xcode.cpp */,
+				940DB8E216EA674000D3C2F1 /* Xcode.h */,
+			);
+			path = lib;
+			sourceTree = "<group>";
+		};
+		940DB8C616EA654E00D3C2F1 /* darwin */ = {
+			isa = PBXGroup;
+			children = (
+				940DB8FB16EA84BF00D3C2F1 /* formatters */,
+				940DB8C716EA655400D3C2F1 /* sketch */,
+			);
+			path = darwin;
+			sourceTree = "<group>";
+		};
+		940DB8C716EA655400D3C2F1 /* sketch */ = {
+			isa = PBXGroup;
+			children = (
+				940DB8E616EA709400D3C2F1 /* main.cpp */,
+			);
+			path = sketch;
+			sourceTree = "<group>";
+		};
+		940DB8FB16EA84BF00D3C2F1 /* formatters */ = {
+			isa = PBXGroup;
+			children = (
+				94DB60F016EA888A00459D9E /* main.cpp */,
+			);
+			path = formatters;
+			sourceTree = "<group>";
+		};
+		94CB255616B0683B0059775D /* DataFormatters */ = {
+			isa = PBXGroup;
+			children = (
+				94CD704B16F8DDEA00CF1E42 /* CF.cpp */,
+				94CD704C16F8DDEA00CF1E42 /* Cocoa.cpp */,
+				94CB255F16B069800059775D /* CXXFormatterFunctions.h */,
+				94CB255716B069770059775D /* CXXFormatterFunctions.cpp */,
+				94CB256016B069800059775D /* DataVisualization.h */,
+				94CB255816B069770059775D /* DataVisualization.cpp */,
+				94CB257516B1D3910059775D /* FormatCache.h */,
+				94CB257316B1D3870059775D /* FormatCache.cpp */,
+				94CB256116B069800059775D /* FormatClasses.h */,
+				94CB255916B069770059775D /* FormatClasses.cpp */,
+				94CB256216B069800059775D /* FormatManager.h */,
+				94CB255A16B069770059775D /* FormatManager.cpp */,
+				94CB256316B069800059775D /* FormatNavigator.h */,
+				94D0B10A16D5535900EA9C70 /* LibCxx.cpp */,
+				94CD704F16F8DF1C00CF1E42 /* LibCxxList.cpp */,
+				94CD705116F8F5BC00CF1E42 /* LibCxxMap.cpp */,
+				94D0B10B16D5535900EA9C70 /* LibStdcpp.cpp */,
+				94D6A0A716CEB55F00833B6E /* NSArray.cpp */,
+				94D6A0A816CEB55F00833B6E /* NSDictionary.cpp */,
+				94D6A0A916CEB55F00833B6E /* NSSet.cpp */,
+				94CB256816B096F90059775D /* TypeCategory.h */,
+				94CB256416B096F10059775D /* TypeCategory.cpp */,
+				94CB256916B096FA0059775D /* TypeCategoryMap.h */,
+				94CB256516B096F10059775D /* TypeCategoryMap.cpp */,
+				94CB256A16B0A4030059775D /* TypeFormat.h */,
+				94CB256D16B0A4260059775D /* TypeFormat.cpp */,
+				94CB256B16B0A4030059775D /* TypeSummary.h */,
+				94CB256E16B0A4260059775D /* TypeSummary.cpp */,
+				94CB256C16B0A4040059775D /* TypeSynthetic.h */,
+				94CB256F16B0A4270059775D /* TypeSynthetic.cpp */,
+			);
+			name = DataFormatters;
+			sourceTree = "<group>";
+		};
 		EDC6D49114E5C15C001B75F8 /* launcherXPCService */ = {
 			isa = PBXGroup;
 			children = (
@@ -3200,6 +3535,7 @@
 				2668020F115FD12C008E1FE4 /* lldb-enumerations.h in Headers */,
 				26DE1E6C11616C2E00A093E2 /* lldb-forward.h in Headers */,
 				26680214115FD12C008E1FE4 /* lldb-types.h in Headers */,
+				94145431175E63B500284436 /* lldb-versioning.h in Headers */,
 				26B42C4D1187ABA50079C8C8 /* LLDB.h in Headers */,
 				26DE204311618ACA00A093E2 /* SBAddress.h in Headers */,
 				26DE205711618FC500A093E2 /* SBBlock.h in Headers */,
@@ -3212,10 +3548,12 @@
 				26DE205511618FB800A093E2 /* SBCompileUnit.h in Headers */,
 				9443B123140C26AB0013457C /* SBData.h in Headers */,
 				26680220115FD13D008E1FE4 /* SBDebugger.h in Headers */,
+				490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */,
 				26680221115FD13D008E1FE4 /* SBDefines.h in Headers */,
 				26680222115FD13D008E1FE4 /* SBError.h in Headers */,
 				26680223115FD13D008E1FE4 /* SBEvent.h in Headers */,
 				26680224115FD13D008E1FE4 /* SBFileSpec.h in Headers */,
+				4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */,
 				26680225115FD13D008E1FE4 /* SBFrame.h in Headers */,
 				26DE205311618FAC00A093E2 /* SBFunction.h in Headers */,
 				9A3576A8116E9AB700E8ED2F /* SBHostOS.h in Headers */,
@@ -3226,6 +3564,7 @@
 				26680227115FD13D008E1FE4 /* SBListener.h in Headers */,
 				26DE204F11618E9800A093E2 /* SBModule.h in Headers */,
 				2668022A115FD13D008E1FE4 /* SBProcess.h in Headers */,
+				26B8283D142D01E9002DBC64 /* SBSection.h in Headers */,
 				2668022B115FD13D008E1FE4 /* SBSourceManager.h in Headers */,
 				26C72C94124322890068DC16 /* SBStream.h in Headers */,
 				9A357671116E7B5200E8ED2F /* SBStringList.h in Headers */,
@@ -3243,11 +3582,10 @@
 				941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */,
 				9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */,
 				9A357583116CFDEE00E8ED2F /* SBValueList.h in Headers */,
+				B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */,
 				26D265A2136B40EE002EEE45 /* SharingPtr.h in Headers */,
 				26D265BC136B4269002EEE45 /* lldb-public.h in Headers */,
-				4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */,
-				26B8283D142D01E9002DBC64 /* SBSection.h in Headers */,
-				B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */,
+				4CE4F673162C971A00F75CB3 /* SBExpressionOptions.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3260,13 +3598,40 @@
 				4C6649A014EEE7F100B0316F /* StreamCallback.h in Headers */,
 				26B7564F14F89356008D9CB3 /* PlatformiOSSimulator.h in Headers */,
 				26FFC19A14FC072100087D58 /* AuxVector.h in Headers */,
+				26CA97A2172B1FD5005DC71B /* RegisterContextThreadMemory.h in Headers */,
 				26FFC19C14FC072100087D58 /* DYLDRendezvous.h in Headers */,
 				26FFC19E14FC072100087D58 /* DynamicLoaderPOSIXDYLD.h in Headers */,
+				AF254E32170CCC33007AE5C9 /* PlatformDarwinKernel.h in Headers */,
 				2694E99E14FC0BB30076DE67 /* PlatformFreeBSD.h in Headers */,
 				2694E9A514FC0BBD0076DE67 /* PlatformLinux.h in Headers */,
 				2663E379152BD1890091EC22 /* ReadWriteLock.h in Headers */,
 				945759681534941F005A9070 /* PlatformPOSIX.h in Headers */,
 				26B1EFAF154638AF00E2DAC7 /* DWARFDeclContext.h in Headers */,
+				260CC62E15D04377002BF2E0 /* OptionValueArgs.h in Headers */,
+				260CC62F15D04377002BF2E0 /* OptionValueArray.h in Headers */,
+				260CC63015D04377002BF2E0 /* OptionValueBoolean.h in Headers */,
+				260CC63115D04377002BF2E0 /* OptionValueProperties.h in Headers */,
+				260CC63215D04377002BF2E0 /* OptionValueDictionary.h in Headers */,
+				260CC63315D04377002BF2E0 /* OptionValueEnumeration.h in Headers */,
+				260CC63415D04377002BF2E0 /* OptionValueFileSpec.h in Headers */,
+				26D1804716CEE12C00EDFB5B /* TimeSpecTimeout.h in Headers */,
+				260CC63515D04377002BF2E0 /* OptionValueFileSpecList.h in Headers */,
+				260CC63615D04377002BF2E0 /* OptionValueFormat.h in Headers */,
+				26D1804516CEE12500EDFB5B /* KQueue.h in Headers */,
+				260CC63715D04377002BF2E0 /* OptionValueSInt64.h in Headers */,
+				260CC63815D04377002BF2E0 /* OptionValueString.h in Headers */,
+				260CC63915D04377002BF2E0 /* OptionValueUInt64.h in Headers */,
+				260CC63A15D04377002BF2E0 /* OptionValueUUID.h in Headers */,
+				260A248E15D06C50009981B0 /* OptionValues.h in Headers */,
+				26DAED6015D327A200E15819 /* OptionValuePathMappings.h in Headers */,
+				26ACEC2815E077AE00E94760 /* Property.h in Headers */,
+				26491E3B15E1DB8600CBFFC2 /* OptionValueRegex.h in Headers */,
+				2697A39515E404BA003E682C /* OptionValueArch.h in Headers */,
+				2698699D15E6CBD0002415FF /* OperatingSystemPython.h in Headers */,
+				260D9B2715EC369500960137 /* ModuleSpec.h in Headers */,
+				947A1D651616476B0017C8D1 /* CommandObjectPlugin.h in Headers */,
+				262ED0051631FA2800879631 /* OptionGroupString.h in Headers */,
+				944372DD171F6B4300E57C32 /* RegisterContextDummy.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3317,7 +3682,6 @@
 				26680205115FD0ED008E1FE4 /* Frameworks */,
 				261B5A7511C3FA6F00AABD0A /* Fixup Framework Headers */,
 				9A19ACE2116563A700E0D453 /* Finish swig wrapper classes (lldb) */,
-				AF90106415AB7D2900FF120D /* CopyFiles */,
 			);
 			buildRules = (
 			);
@@ -3424,7 +3788,7 @@
 		08FB7793FE84155DC02AAC07 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0450;
+				LastUpgradeCheck = 0500;
 			};
 			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
 			compatibilityVersion = "Xcode 3.2";
@@ -3508,7 +3872,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n\t/usr/bin/sed -i '' 's/\\(#include\\)[ ]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\n\t/usr/bin/sed -i '' 's|<LLDB/Utility|<LLDB|' \"$file\"\n\tTRUNCATED_VERSION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+)(\\.[0-9]+)?$/\\1/g'`\n\t/usr/bin/sed -i '' \"s|//#define LLDB_VERSION|#define LLDB_VERSION $TRUNCATED_VERSION |\" \"$file\"\ndone\n";
+			shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n\t/usr/bin/sed -i '' 's/\\(#include\\)[ ]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\n\t/usr/bin/sed -i '' 's|<LLDB/Utility|<LLDB|' \"$file\"\n\tLLDB_VERSION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\1/g'`\n    LLDB_REVISION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\3/g'`\n    LLDB_VERSION_STRING=`echo ${CURRENT_PROJECT_VERSION}`\n\t/usr/bin/sed -i '' \"s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |\" \"$file\"\n    /usr/bin/sed -i '' \"s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |\" \"$file\"\n    /usr/bin/sed -i '' \"s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \\\"$LLDB_VERSION_STRING\\\" |\" \"$file\"\ndone\n";
 		};
 		261EECA21337D399001D193C /* Build llvm and clang */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -3622,6 +3986,8 @@
 				2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */,
 				9475C18814E5E9FA001BFC6D /* SBTypeCategory.cpp in Sources */,
 				9475C18E14E5F834001BFC6D /* SBTypeNameSpecifier.cpp in Sources */,
+				9452573A16262D0200325455 /* SBDeclaration.cpp in Sources */,
+				4CE4F675162C973F00F75CB3 /* SBExpressionOptions.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3629,13 +3995,15 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				49C8507C1384A786007DB519 /* ProcessDataAllocator.cpp in Sources */,
+				9456F2241616671900656F91 /* DynamicLibrary.cpp in Sources */,
+				26D1804216CEDF0700EDFB5B /* TimeSpecTimeout.cpp in Sources */,
 				2689FFDA13353D9D00698AC0 /* lldb.cpp in Sources */,
 				2689FFDB13353DA300698AC0 /* lldb-log.cpp in Sources */,
 				2689FFEF13353DB600698AC0 /* Breakpoint.cpp in Sources */,
 				2689FFF113353DB600698AC0 /* BreakpointID.cpp in Sources */,
 				2689FFF313353DB600698AC0 /* BreakpointIDList.cpp in Sources */,
 				2689FFF513353DB600698AC0 /* BreakpointList.cpp in Sources */,
+				94CD704D16F8DDEA00CF1E42 /* CF.cpp in Sources */,
 				2689FFF713353DB600698AC0 /* BreakpointLocation.cpp in Sources */,
 				2689FFF913353DB600698AC0 /* BreakpointLocationCollection.cpp in Sources */,
 				2689FFFB13353DB600698AC0 /* BreakpointLocationList.cpp in Sources */,
@@ -3643,6 +4011,7 @@
 				2689FFFF13353DB600698AC0 /* BreakpointResolver.cpp in Sources */,
 				2689000113353DB600698AC0 /* BreakpointResolverAddress.cpp in Sources */,
 				2689000313353DB600698AC0 /* BreakpointResolverFileLine.cpp in Sources */,
+				94CD705216F8F5BC00CF1E42 /* LibCxxMap.cpp in Sources */,
 				2689000513353DB600698AC0 /* BreakpointResolverName.cpp in Sources */,
 				2689000713353DB600698AC0 /* BreakpointSite.cpp in Sources */,
 				2689000913353DB600698AC0 /* BreakpointSiteList.cpp in Sources */,
@@ -3680,6 +4049,7 @@
 				2689002F13353E0400698AC0 /* ArchSpec.cpp in Sources */,
 				2689003013353E0400698AC0 /* Baton.cpp in Sources */,
 				2689003113353E0400698AC0 /* Broadcaster.cpp in Sources */,
+				49DCF702170E70120092F75E /* Materializer.cpp in Sources */,
 				2689003213353E0400698AC0 /* Communication.cpp in Sources */,
 				2689003313353E0400698AC0 /* Connection.cpp in Sources */,
 				2689003413353E0400698AC0 /* ConnectionFileDescriptor.cpp in Sources */,
@@ -3702,12 +4072,14 @@
 				2689004513353E0400698AC0 /* ModuleChild.cpp in Sources */,
 				2689004613353E0400698AC0 /* ModuleList.cpp in Sources */,
 				2689004713353E0400698AC0 /* PluginManager.cpp in Sources */,
+				AF254E31170CCC33007AE5C9 /* PlatformDarwinKernel.cpp in Sources */,
 				2689004813353E0400698AC0 /* RegularExpression.cpp in Sources */,
 				2689004913353E0400698AC0 /* Scalar.cpp in Sources */,
 				2689004A13353E0400698AC0 /* SearchFilter.cpp in Sources */,
 				2689004B13353E0400698AC0 /* Section.cpp in Sources */,
 				2689004C13353E0400698AC0 /* SourceManager.cpp in Sources */,
 				2689004D13353E0400698AC0 /* State.cpp in Sources */,
+				94D0B10D16D5535900EA9C70 /* LibStdcpp.cpp in Sources */,
 				2689004E13353E0400698AC0 /* Stream.cpp in Sources */,
 				2689004F13353E0400698AC0 /* StreamFile.cpp in Sources */,
 				2689005013353E0400698AC0 /* StreamString.cpp in Sources */,
@@ -3738,8 +4110,9 @@
 				2689006913353E0E00698AC0 /* ASTStructExtractor.cpp in Sources */,
 				2689006A13353E0E00698AC0 /* IRDynamicChecks.cpp in Sources */,
 				2689006B13353E0E00698AC0 /* IRForTarget.cpp in Sources */,
-				2689006D13353E0E00698AC0 /* RecordingMemoryManager.cpp in Sources */,
+				2689006D13353E0E00698AC0 /* IRExecutionUnit.cpp in Sources */,
 				2689006E13353E1A00698AC0 /* File.cpp in Sources */,
+				94D6A0AB16CEB55F00833B6E /* NSDictionary.cpp in Sources */,
 				2689006F13353E1A00698AC0 /* FileSpec.cpp in Sources */,
 				2689007013353E1A00698AC0 /* Condition.cpp in Sources */,
 				2689007113353E1A00698AC0 /* Host.cpp in Sources */,
@@ -3758,7 +4131,6 @@
 				2689007F13353E2200698AC0 /* CommandCompletions.cpp in Sources */,
 				2689008013353E2200698AC0 /* CommandInterpreter.cpp in Sources */,
 				2689008113353E2200698AC0 /* CommandObject.cpp in Sources */,
-				2689008213353E2200698AC0 /* CommandObjectCrossref.cpp in Sources */,
 				2689008313353E2200698AC0 /* CommandObjectMultiword.cpp in Sources */,
 				2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in Sources */,
 				2689008513353E2200698AC0 /* CommandReturnObject.cpp in Sources */,
@@ -3766,7 +4138,6 @@
 				2689008713353E2200698AC0 /* ScriptInterpreter.cpp in Sources */,
 				2689008813353E2200698AC0 /* ScriptInterpreterNone.cpp in Sources */,
 				2689008913353E2200698AC0 /* ScriptInterpreterPython.cpp in Sources */,
-				2689008C13353E4200698AC0 /* DisassemblerLLVM.cpp in Sources */,
 				2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */,
 				2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */,
 				2689009613353E4200698AC0 /* ObjectContainerBSDArchive.cpp in Sources */,
@@ -3800,6 +4171,7 @@
 				268900C213353E5F00698AC0 /* DWARFDebugPubnamesSet.cpp in Sources */,
 				268900C313353E5F00698AC0 /* DWARFDebugRanges.cpp in Sources */,
 				268900C413353E5F00698AC0 /* DWARFDefines.cpp in Sources */,
+				94D0B10C16D5535900EA9C70 /* LibCxx.cpp in Sources */,
 				268900C513353E5F00698AC0 /* DWARFDIECollection.cpp in Sources */,
 				268900C613353E5F00698AC0 /* DWARFFormValue.cpp in Sources */,
 				268900C713353E5F00698AC0 /* DWARFLocationDescription.cpp in Sources */,
@@ -3809,6 +4181,7 @@
 				268900CB13353E5F00698AC0 /* LogChannelDWARF.cpp in Sources */,
 				268900CC13353E5F00698AC0 /* SymbolFileDWARFDebugMap.cpp in Sources */,
 				268900CD13353E5F00698AC0 /* UniqueDWARFASTType.cpp in Sources */,
+				944372DC171F6B4300E57C32 /* RegisterContextDummy.cpp in Sources */,
 				268900CE13353E5F00698AC0 /* SymbolFileSymtab.cpp in Sources */,
 				268900CF13353E5F00698AC0 /* SymbolVendorMacOSX.cpp in Sources */,
 				268900D013353E6F00698AC0 /* Block.cpp in Sources */,
@@ -3869,12 +4242,14 @@
 				2689010713353E6F00698AC0 /* ThreadPlanStepThrough.cpp in Sources */,
 				2689010813353E6F00698AC0 /* ThreadPlanStepUntil.cpp in Sources */,
 				2689010A13353E6F00698AC0 /* ThreadPlanTracer.cpp in Sources */,
+				26CA97A1172B1FD5005DC71B /* RegisterContextThreadMemory.cpp in Sources */,
 				2689010B13353E6F00698AC0 /* ThreadSpec.cpp in Sources */,
 				2689010C13353E6F00698AC0 /* UnixSignals.cpp in Sources */,
 				2689011013353E8200698AC0 /* SharingPtr.cpp in Sources */,
 				2689011113353E8200698AC0 /* StringExtractor.cpp in Sources */,
 				2689011213353E8200698AC0 /* StringExtractorGDBRemote.cpp in Sources */,
 				2689011313353E8200698AC0 /* PseudoTerminal.cpp in Sources */,
+				94D6A0AA16CEB55F00833B6E /* NSArray.cpp in Sources */,
 				26B1FCC21338115F002886E2 /* Host.mm in Sources */,
 				26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in Sources */,
 				26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in Sources */,
@@ -3888,7 +4263,7 @@
 				26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */,
 				26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */,
 				26BD407F135D2AE000237D80 /* FileLineResolver.cpp in Sources */,
-				26A7A035135E6E4200FB369E /* NamedOptionValue.cpp in Sources */,
+				26A7A035135E6E4200FB369E /* OptionValue.cpp in Sources */,
 				9A22A161135E30370024DDC3 /* EmulateInstructionARM.cpp in Sources */,
 				9A22A163135E30370024DDC3 /* EmulationStateARM.cpp in Sources */,
 				9A4F35101368A51A00823F52 /* StreamAsynchronousIO.cpp in Sources */,
@@ -3906,6 +4281,7 @@
 				26DB3E161379E7AD0080DC73 /* ABIMacOSX_arm.cpp in Sources */,
 				26DB3E1C1379E7AD0080DC73 /* ABIMacOSX_i386.cpp in Sources */,
 				26DB3E1F1379E7AD0080DC73 /* ABISysV_x86_64.cpp in Sources */,
+				26D1803E16CEBFD300EDFB5B /* KQueue.cpp in Sources */,
 				26A69C5F137A17A500262477 /* RegisterValue.cpp in Sources */,
 				2690B3711381D5C300ECFBAE /* Memory.cpp in Sources */,
 				9A9E1EFF1398086D005AC039 /* InputReaderStack.cpp in Sources */,
@@ -3918,7 +4294,6 @@
 				4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */,
 				4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */,
 				9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */,
-				9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */,
 				49D8FB3913B5598F00411094 /* ClangASTImporter.cpp in Sources */,
 				9467E65213C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp in Sources */,
 				26ED3D6D13C563810017D45E /* OptionGroupVariable.cpp in Sources */,
@@ -3935,14 +4310,11 @@
 				265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in Sources */,
 				2628A4D513D4977900F5487A /* ThreadKDP.cpp in Sources */,
 				26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */,
-				B271B11413D6139300C3FEDB /* FormatClasses.cpp in Sources */,
 				94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in Sources */,
 				262D24E613FB8710002D1960 /* RegisterContextMemory.cpp in Sources */,
 				26F4A21C13FBA31A0064B613 /* ThreadMemory.cpp in Sources */,
 				266DFE9713FD656E00D0C574 /* OperatingSystem.cpp in Sources */,
 				26954EBE1401EE8B00294D09 /* DynamicRegisterInfo.cpp in Sources */,
-				9470A8F01402DFFB0056FF61 /* DataVisualization.cpp in Sources */,
-				26274FA214030EEF006BA130 /* OperatingSystemDarwinKernel.cpp in Sources */,
 				26274FA714030F79006BA130 /* DynamicLoaderDarwinKernel.cpp in Sources */,
 				94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */,
 				949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */,
@@ -3954,7 +4326,7 @@
 				B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */,
 				49A1CAC51430E8DE00306AC9 /* ExpressionSourceCode.cpp in Sources */,
 				494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */,
-				49DA65031485C92A005FF180 /* AppleObjCSymbolVendor.cpp in Sources */,
+				49DA65031485C92A005FF180 /* AppleObjCTypeVendor.cpp in Sources */,
 				4966DCC4148978A10028481B /* ClangExternalASTSourceCommon.cpp in Sources */,
 				26A527C114E24F5F00F3A14A /* ProcessMachCore.cpp in Sources */,
 				26A527C314E24F5F00F3A14A /* ThreadMachCore.cpp in Sources */,
@@ -3970,8 +4342,44 @@
 				945759671534941F005A9070 /* PlatformPOSIX.cpp in Sources */,
 				26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */,
 				B21EB71515CC99F100E60059 /* cxa_demangle.cpp in Sources */,
+				260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */,
+				260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */,
+				260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */,
+				260CC64B15D0440D002BF2E0 /* OptionValueProperties.cpp in Sources */,
+				260CC64C15D0440D002BF2E0 /* OptionValueDictionary.cpp in Sources */,
+				49DCF6FE170E6B4A0092F75E /* IRMemoryMap.cpp in Sources */,
+				260CC64D15D0440D002BF2E0 /* OptionValueEnumeration.cpp in Sources */,
+				260CC64E15D0440D002BF2E0 /* OptionValueFileSpec.cpp in Sources */,
+				260CC64F15D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp in Sources */,
+				260CC65015D0440D002BF2E0 /* OptionValueFormat.cpp in Sources */,
+				260CC65115D0440D002BF2E0 /* OptionValueSInt64.cpp in Sources */,
+				260CC65215D0440D002BF2E0 /* OptionValueString.cpp in Sources */,
+				260CC65315D0440D002BF2E0 /* OptionValueUInt64.cpp in Sources */,
+				260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp in Sources */,
+				26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */,
 				B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */,
 				B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources */,
+				2640E19F15DC78FD00F23B50 /* Property.cpp in Sources */,
+				26491E3E15E1DB9F00CBFFC2 /* OptionValueRegex.cpp in Sources */,
+				2697A39315E404B1003E682C /* OptionValueArch.cpp in Sources */,
+				94EA1D5C15E6C9B400D4171A /* PythonDataObjects.cpp in Sources */,
+				94D6A0AC16CEB55F00833B6E /* NSSet.cpp in Sources */,
+				94CD704E16F8DDEA00CF1E42 /* Cocoa.cpp in Sources */,
+				2698699B15E6CBD0002415FF /* OperatingSystemPython.cpp in Sources */,
+				947A1D641616476B0017C8D1 /* CommandObjectPlugin.cpp in Sources */,
+				262ED0081631FA3A00879631 /* OptionGroupString.cpp in Sources */,
+				94094C6B163B6F840083A547 /* ValueObjectCast.cpp in Sources */,
+				94CB255B16B069770059775D /* CXXFormatterFunctions.cpp in Sources */,
+				94CB255C16B069770059775D /* DataVisualization.cpp in Sources */,
+				94CD705016F8DF1C00CF1E42 /* LibCxxList.cpp in Sources */,
+				94CB255D16B069770059775D /* FormatClasses.cpp in Sources */,
+				94CB255E16B069770059775D /* FormatManager.cpp in Sources */,
+				94CB256616B096F10059775D /* TypeCategory.cpp in Sources */,
+				94CB256716B096F10059775D /* TypeCategoryMap.cpp in Sources */,
+				94CB257016B0A4270059775D /* TypeFormat.cpp in Sources */,
+				94CB257116B0A4270059775D /* TypeSummary.cpp in Sources */,
+				94CB257216B0A4270059775D /* TypeSynthetic.cpp in Sources */,
+				94CB257416B1D3880059775D /* FormatCache.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4099,6 +4507,11 @@
 				);
 				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
 				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_C_LANGUAGE_STANDARD = c99;
@@ -4134,17 +4547,16 @@
 				LLDB_TOOLS_INSTALL_DIR = /usr/bin;
 				LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
-				LLVM_CONFIGURATION = "Debug+Asserts";
+				LLVM_CONFIGURATION = "Release+Asserts";
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"-flimit-debug-info",
 					"-Wparentheses",
 				);
-				SDKROOT = "";
 				STRIP_INSTALLED_PRODUCT = NO;
 				STRIP_STYLE = debugging;
-				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
 				WARNING_CFLAGS = "-Wreorder";
 			};
 			name = Debug;
@@ -4158,6 +4570,11 @@
 				"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
 				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_C_LANGUAGE_STANDARD = c99;
@@ -4194,15 +4611,14 @@
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
 				LLVM_CONFIGURATION = Release;
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"-flimit-debug-info",
 					"-Wparentheses",
 				);
-				SDKROOT = "";
 				STRIP_INSTALLED_PRODUCT = NO;
 				STRIP_STYLE = debugging;
-				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
 				WARNING_CFLAGS = "-Wreorder";
 			};
 			name = Release;
@@ -4253,9 +4669,9 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 165;
+				DYLIB_CURRENT_VERSION = 300.99.0;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4289,13 +4705,11 @@
 					Foundation,
 					"-v",
 					"-t",
-					"-Wl,-v",
 				);
 				"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
 					"-lllvmclang",
 					"-v",
 					"-t",
-					"-Wl,-v",
 					"-framework",
 					Foundation,
 				);
@@ -4312,10 +4726,10 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 165;
+				DYLIB_CURRENT_VERSION = 300.99.0;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4350,13 +4764,11 @@
 					AppKit,
 					"-v",
 					"-t",
-					"-Wl,-v",
 				);
 				"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
 					"-lllvmclang",
 					"-v",
 					"-t",
-					"-Wl,-v",
 					"-framework",
 					Foundation,
 				);
@@ -4372,7 +4784,7 @@
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				DEBUGGING_SYMBOLS = YES;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4384,7 +4796,6 @@
 				);
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CFLAGS = "";
 				OTHER_LDFLAGS = "";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -4399,10 +4810,9 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CFLAGS = "";
 				OTHER_LDFLAGS = "";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -4417,10 +4827,9 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CFLAGS = "";
 				OTHER_LDFLAGS = "";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -4432,8 +4841,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 165;
-				DYLIB_CURRENT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
+				DYLIB_CURRENT_VERSION = 300.99.0;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4442,9 +4851,7 @@
 				GCC_ENABLE_OBJC_GC = supported;
 				GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
 				HEADER_SEARCH_PATHS = /usr/include/libxml2;
-				LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a";
 				MACH_O_TYPE = staticlib;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CPLUSPLUSFLAGS = (
 					"-fno-rtti",
 					"-Wglobal-constructors",
@@ -4463,8 +4870,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 165;
-				DYLIB_CURRENT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
+				DYLIB_CURRENT_VERSION = 300.99.0;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4473,9 +4880,7 @@
 				GCC_ENABLE_OBJC_GC = supported;
 				GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
 				HEADER_SEARCH_PATHS = /usr/include/libxml2;
-				LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a";
 				MACH_O_TYPE = staticlib;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CPLUSPLUSFLAGS = (
 					"-fno-rtti",
 					"-Wglobal-constructors",
@@ -4494,8 +4899,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 165;
-				DYLIB_CURRENT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
+				DYLIB_CURRENT_VERSION = 300.99.0;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4504,9 +4909,7 @@
 				GCC_ENABLE_OBJC_GC = supported;
 				GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
 				HEADER_SEARCH_PATHS = /usr/include/libxml2;
-				LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a";
 				MACH_O_TYPE = staticlib;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CPLUSPLUSFLAGS = (
 					"-fno-rtti",
 					"-Wglobal-constructors",
@@ -4533,6 +4936,11 @@
 				);
 				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
 				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_C_LANGUAGE_STANDARD = c99;
@@ -4571,14 +4979,13 @@
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
 				LLVM_CONFIGURATION = Release;
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
+				MACOSX_DEPLOYMENT_TARGET = "";
 				OTHER_CFLAGS = (
 					"-flimit-debug-info",
 					"-Wparentheses",
 				);
-				SDKROOT = "";
 				STRIP_INSTALLED_PRODUCT = NO;
 				STRIP_STYLE = debugging;
-				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
 				WARNING_CFLAGS = "-Wreorder";
 			};
 			name = BuildAndIntegration;
@@ -4587,7 +4994,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4612,6 +5019,7 @@
 					"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
 					"-Wl,-rpath, at loader_path/../../../SharedFrameworks",
 					"-Wl,-rpath, at loader_path/../../System/Library/PrivateFrameworks",
+					"-Wl,-rpath, at loader_path/../../Library/PrivateFrameworks",
 				);
 				PRODUCT_NAME = lldb;
 				STRIP_INSTALLED_PRODUCT = YES;
@@ -4628,10 +5036,10 @@
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 165;
+				DYLIB_CURRENT_VERSION = 300.99.0;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4711,6 +5119,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Debug;
@@ -4719,6 +5128,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;
@@ -4950,7 +5360,7 @@
 		26F5C26C10F3D9A5009D5894 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4980,7 +5390,7 @@
 		26F5C26D10F3D9A5009D5894 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 165;
+				CURRENT_PROJECT_VERSION = 300.99.0;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -5004,6 +5414,387 @@
 			};
 			name = Release;
 		};
+		49BB8F341611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = "$(NATIVE_ARCH)";
+				"ARCHS[sdk=iphoneos*]" = armv7;
+				"ARCHS[sdk=macosx*]" = (
+					x86_64,
+					i386,
+				);
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					__STDC_CONSTANT_MACROS,
+					__STDC_LIMIT_MACROS,
+					LLDB_CONFIGURATION_DEBUG,
+				);
+				"GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*][arch=*]" = (
+					__STDC_CONSTANT_MACROS,
+					__STDC_LIMIT_MACROS,
+					LLDB_CONFIGURATION_DEBUG,
+					LLDB_DISABLE_PYTHON,
+					NO_XPC_SERVICES,
+				);
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
+				GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				LLDB_DISABLE_PYTHON = 0;
+				"LLDB_DISABLE_PYTHON[sdk=iphoneos*]" = 1;
+				LLDB_FRAMEWORK_INSTALL_DIR = /Applications/Xcode.app/Contents/SharedFrameworks;
+				LLDB_TOOLS_INSTALL_DIR = /usr/bin;
+				LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
+				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
+				LLVM_CONFIGURATION = "Debug+Asserts";
+				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
+				ONLY_ACTIVE_ARCH = YES;
+				OTHER_CFLAGS = (
+					"-flimit-debug-info",
+					"-Wparentheses",
+				);
+				STRIP_INSTALLED_PRODUCT = NO;
+				STRIP_STYLE = debugging;
+				WARNING_CFLAGS = "-Wreorder";
+			};
+			name = DebugClang;
+		};
+		49BB8F351611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = DebugClang;
+		};
+		49BB8F361611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = DebugClang;
+		};
+		49BB8F371611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = DebugClang;
+		};
+		49BB8F381611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				CURRENT_PROJECT_VERSION = 300.99.0;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
+				);
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				HEADER_SEARCH_PATHS = "";
+				INFOPLIST_FILE = "lldb-Info.plist";
+				INSTALL_PATH = "$(LLDB_TOOLS_INSTALL_DIR)";
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
+				LLVM_BUILD_DIR_ARCH = "$(OBJROOT)/llvm";
+				OTHER_LDFLAGS = (
+					"-sectcreate",
+					__TEXT,
+					__info_plist,
+					"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
+					"-Wl,-rpath, at loader_path/",
+				);
+				PRODUCT_NAME = lldb;
+				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
+				VERSIONING_SYSTEM = "apple-generic";
+			};
+			name = DebugClang;
+		};
+		49BB8F391611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_LINK_OBJC_RUNTIME = NO;
+				CLANG_OBJC_RUNTIME = NO;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 300.99.0;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 300.99.0;
+				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
+				);
+				FRAMEWORK_VERSION = A;
+				GCC_ENABLE_OBJC_GC = supported;
+				GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				HEADER_SEARCH_PATHS = "";
+				INFOPLIST_FILE = "resources/LLDB-Info.plist";
+				INSTALL_PATH = "$(LLDB_FRAMEWORK_INSTALL_DIR)";
+				LD_DYLIB_INSTALL_NAME = "@rpath/LLDB.framework/LLDB";
+				LIBRARY_SEARCH_PATHS = (
+					"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)",
+					"$(inherited)",
+				);
+				OTHER_CPLUSPLUSFLAGS = (
+					"-fno-rtti",
+					"-Wglobal-constructors",
+					"$(OTHER_CFLAGS)",
+				);
+				OTHER_LDFLAGS = (
+					"-framework",
+					Carbon,
+					"-framework",
+					DebugSymbols,
+					"-lpython",
+					"-lllvmclang",
+					"-framework",
+					Foundation,
+					"-v",
+					"-t",
+				);
+				"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
+					"-lllvmclang",
+					"-v",
+					"-t",
+					"-framework",
+					Foundation,
+				);
+				PRODUCT_NAME = LLDB;
+				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
+				VERSIONING_SYSTEM = "apple-generic";
+			};
+			name = DebugClang;
+		};
+		49BB8F3A1611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				INSTALL_PATH = "$(LLDB_TOOLS_INSTALL_DIR)";
+				ONLY_ACTIVE_ARCH = NO;
+				PRODUCT_NAME = "darwin-debug";
+				SKIP_INSTALL = YES;
+			};
+			name = DebugClang;
+		};
+		49BB8F3B1611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 300.99.0;
+				DYLIB_CURRENT_VERSION = 300.99.0;
+				EXECUTABLE_EXTENSION = a;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
+				);
+				GCC_ENABLE_OBJC_GC = supported;
+				GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
+				HEADER_SEARCH_PATHS = /usr/include/libxml2;
+				MACH_O_TYPE = staticlib;
+				OTHER_CPLUSPLUSFLAGS = (
+					"-fno-rtti",
+					"-Wglobal-constructors",
+					"$(OTHER_CFLAGS)",
+				);
+				OTHER_LDFLAGS = "";
+				PRODUCT_NAME = "lib$(TARGET_NAME)";
+				SKIP_INSTALL = YES;
+				STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
+				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
+				VERSIONING_SYSTEM = "apple-generic";
+			};
+			name = DebugClang;
+		};
+		49BB8F3C1611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
+				DEAD_CODE_STRIPPING = YES;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
+				);
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_CPP_RTTI = NO;
+				GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				INFOPLIST_PREPROCESSOR_DEFINITIONS = (
+					"-lobjc",
+					"-lpython",
+					"-framework",
+					DebugSymbols,
+					"-framework",
+					Carbon,
+					"-framework",
+					Foundation,
+					"-framework",
+					AppKit,
+					"-v",
+					"-t",
+					"-Wl,-v",
+				);
+				INSTALL_PATH = "$(LLDB_TOOLS_INSTALL_DIR)";
+				LIBRARY_SEARCH_PATHS = (
+					"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)",
+					"$(inherited)",
+				);
+				OTHER_LDFLAGS = (
+					"-lllvmclang",
+					"-lpython",
+					"-framework",
+					DebugSymbols,
+					"-framework",
+					Carbon,
+					"-framework",
+					Foundation,
+					"-framework",
+					AppKit,
+					"-v",
+					"-t",
+					"-Wl,-v",
+				);
+				"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
+					"-lllvmclang",
+					"-framework",
+					Foundation,
+					"-framework",
+					UIKit,
+				);
+				PRODUCT_NAME = "lldb-platform";
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				"PROVISIONING_PROFILE[sdk=macosx*]" = "";
+				SKIP_INSTALL = YES;
+				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
+			};
+			name = DebugClang;
+		};
+		49BB8F3D1611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				CLANG_LINK_OBJC_RUNTIME = NO;
+				CLANG_OBJC_RUNTIME = NO;
+				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
+				DEPLOYMENT_LOCATION = YES;
+				DSTROOT = "$(SYMROOT)";
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				INFOPLIST_FILE = "source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist";
+				INFOPLIST_PREPROCESS = YES;
+				INFOPLIST_PREPROCESSOR_DEFINITIONS = (
+					"NO0=0",
+					"YES0=1",
+					"RC_XBS=${RC_XBS}0",
+					"RC_BUILDIT=${RC_BUILDIT}0",
+				);
+				INSTALL_PATH = "/$(CONFIGURATION)/LLDB.framework/XPCServices";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
+				MACH_O_TYPE = mh_execute;
+				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
+				PROVISIONING_PROFILE = "";
+				WRAPPER_EXTENSION = xpc;
+			};
+			name = DebugClang;
+		};
+		49BB8F3E1611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				CLANG_LINK_OBJC_RUNTIME = NO;
+				CLANG_OBJC_RUNTIME = NO;
+				CODE_SIGN_ENTITLEMENTS = source/Host/macosx/launcherXPCService/LauncherXPCService.entitlements;
+				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
+				DEPLOYMENT_LOCATION = YES;
+				DSTROOT = "$(SYMROOT)";
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				INFOPLIST_FILE = "source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist";
+				INFOPLIST_PREPROCESS = YES;
+				INFOPLIST_PREPROCESSOR_DEFINITIONS = (
+					"NO0=0",
+					"YES0=1",
+					"RC_XBS=${RC_XBS}0",
+					"RC_BUILDIT=${RC_BUILDIT}0",
+				);
+				INSTALL_PATH = "/$(CONFIGURATION)/LLDB.framework/XPCServices";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
+				MACH_O_TYPE = mh_execute;
+				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
+				PROVISIONING_PROFILE = "";
+				WRAPPER_EXTENSION = xpc;
+			};
+			name = DebugClang;
+		};
+		49BB8F3F1611172B00BDD462 /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 300.99.0;
+				DEBUGGING_SYMBOLS = YES;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = macosx;
+			};
+			name = DebugClang;
+		};
 		EDC6D4A714E5C19B001B75F8 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -5200,6 +5991,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				1DEB91F008733DB70010E9CD /* Debug */,
+				49BB8F341611172B00BDD462 /* DebugClang */,
 				1DEB91F108733DB70010E9CD /* Release */,
 				268A89B211963ECA00D953EB /* BuildAndIntegration */,
 			);
@@ -5210,6 +6002,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26579F6A126A25920007C5CB /* Debug */,
+				49BB8F3A1611172B00BDD462 /* DebugClang */,
 				26579F6B126A25920007C5CB /* Release */,
 				26579F6C126A25920007C5CB /* BuildAndIntegration */,
 			);
@@ -5220,6 +6013,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26680209115FD0ED008E1FE4 /* Debug */,
+				49BB8F391611172B00BDD462 /* DebugClang */,
 				2668020A115FD0ED008E1FE4 /* Release */,
 				268A89B511963ECA00D953EB /* BuildAndIntegration */,
 			);
@@ -5230,6 +6024,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				2687EAC71508110B00DD8C2E /* Debug */,
+				49BB8F3F1611172B00BDD462 /* DebugClang */,
 				2687EAC81508110B00DD8C2E /* Release */,
 				2687EAC91508110B00DD8C2E /* BuildAndIntegration */,
 			);
@@ -5240,6 +6035,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				2689FFD513353D7A00698AC0 /* Debug */,
+				49BB8F3B1611172B00BDD462 /* DebugClang */,
 				2689FFD613353D7A00698AC0 /* Release */,
 				2689FFD713353D7A00698AC0 /* BuildAndIntegration */,
 			);
@@ -5250,6 +6046,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26CEF3AA14FD58BF007286B2 /* Debug */,
+				49BB8F361611172B00BDD462 /* DebugClang */,
 				26CEF3AB14FD58BF007286B2 /* Release */,
 				26CEF3AC14FD58BF007286B2 /* BuildAndIntegration */,
 			);
@@ -5260,6 +6057,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26CEF3B314FD592B007286B2 /* Debug */,
+				49BB8F351611172B00BDD462 /* DebugClang */,
 				26CEF3B414FD592B007286B2 /* Release */,
 				26CEF3B514FD592B007286B2 /* BuildAndIntegration */,
 			);
@@ -5270,6 +6068,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26CEF3BE14FD596A007286B2 /* Debug */,
+				49BB8F371611172B00BDD462 /* DebugClang */,
 				26CEF3BF14FD596A007286B2 /* Release */,
 				26CEF3C014FD596A007286B2 /* BuildAndIntegration */,
 			);
@@ -5280,6 +6079,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26DC6A121337FE6A00FF7998 /* Debug */,
+				49BB8F3C1611172B00BDD462 /* DebugClang */,
 				26DC6A131337FE6A00FF7998 /* Release */,
 				26DC6A141337FE6A00FF7998 /* BuildAndIntegration */,
 			);
@@ -5290,6 +6090,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26F5C26C10F3D9A5009D5894 /* Debug */,
+				49BB8F381611172B00BDD462 /* DebugClang */,
 				26F5C26D10F3D9A5009D5894 /* Release */,
 				268A89B311963ECA00D953EB /* BuildAndIntegration */,
 			);
@@ -5300,6 +6101,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				EDC6D4A714E5C19B001B75F8 /* Debug */,
+				49BB8F3D1611172B00BDD462 /* DebugClang */,
 				EDC6D4A814E5C19B001B75F8 /* Release */,
 				EDC6D4A914E5C19B001B75F8 /* BuildAndIntegration */,
 			);
@@ -5310,6 +6112,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				EDE274E914EDCE1F005B0F75 /* Debug */,
+				49BB8F3E1611172B00BDD462 /* DebugClang */,
 				EDE274EA14EDCE1F005B0F75 /* Release */,
 				EDE274EB14EDCE1F005B0F75 /* BuildAndIntegration */,
 			);

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme Thu Jun  6 19:06:43 2013
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0450"
+   LastUpgradeVersion = "0500"
    version = "1.8">
    <BuildAction
       parallelizeBuildables = "NO"
@@ -56,7 +56,6 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
-      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <BuildableProductRunnable>
          <BuildableReference

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme Thu Jun  6 19:06:43 2013
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0450"
+   LastUpgradeVersion = "0500"
    version = "1.8">
    <BuildAction
       parallelizeBuildables = "NO"
@@ -47,7 +47,6 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
-      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <BuildableProductRunnable>
          <BuildableReference

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme Thu Jun  6 19:06:43 2013
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0450"
+   LastUpgradeVersion = "0500"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -38,7 +38,6 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
-      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <AdditionalOptions>
       </AdditionalOptions>

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme Thu Jun  6 19:06:43 2013
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0450"
+   LastUpgradeVersion = "0500"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -38,7 +38,6 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
-      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <PathRunnable
          FilePath = "/Users/moi/Library/Developer/Xcode/DerivedData/Xcode-ezhudafllefyhcfivqaeslnymjsj/Build/Products/Debug/LLDB.framework/XPCServices/com.apple.lldb.launcherXPCService.xpc/Contents/MacOS/com.apple.lldb.launcherXPCService">

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme Thu Jun  6 19:06:43 2013
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0450"
+   LastUpgradeVersion = "0500"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "NO"
@@ -84,13 +84,12 @@
    <LaunchAction
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
+      launchStyle = "1"
       useCustomWorkingDirectory = "NO"
       customWorkingDirectory = "/Volumes/work/gclayton/Documents/devb/attach"
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "YES"
       debugDocumentVersioning = "YES"
-      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <BuildableProductRunnable>
          <BuildableReference

Modified: lldb/branches/lldb-platform-work/lldb.xcworkspace/contents.xcworkspacedata
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcworkspace/contents.xcworkspacedata?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcworkspace/contents.xcworkspacedata (original)
+++ lldb/branches/lldb-platform-work/lldb.xcworkspace/contents.xcworkspacedata Thu Jun  6 19:06:43 2013
@@ -7,4 +7,7 @@
    <FileRef
       location = "group:tools/debugserver/debugserver.xcodeproj">
    </FileRef>
+   <FileRef
+      location = "group:tools/lldb-perf/lldbperf.xcodeproj">
+   </FileRef>
 </Workspace>

Removed: lldb/branches/lldb-platform-work/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/llvm.zip?rev=183467&view=auto
==============================================================================
Binary file - no diff available.

Modified: lldb/branches/lldb-platform-work/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/resources/LLDB-Info.plist?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/resources/LLDB-Info.plist (original)
+++ lldb/branches/lldb-platform-work/resources/LLDB-Info.plist Thu Jun  6 19:06:43 2013
@@ -17,7 +17,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>165</string>
+	<string>300.99.0</string>
 	<key>CFBundleName</key>
 	<string>${EXECUTABLE_NAME}</string>
 </dict>

Modified: lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh Thu Jun  6 19:06:43 2013
@@ -4,27 +4,50 @@
 
 # SRC_ROOT is the root of the lldb source tree.
 # TARGET_DIR is where the lldb framework/shared library gets put.
-# CONFIG_BUILD_DIR is where the build-swig-Python-LLDB.sh  shell script 
+# CONFIG_BUILD_DIR is where the build-swig-Python-LLDB.sh  shell script
 #           put the lldb.py file it was generated from running SWIG.
 # PREFIX is the root directory used to determine where third-party modules
 #         for scripting languages should be installed.
-# debug_flag (optional) determines whether or not this script outputs 
+# debug_flag (optional) determines whether or not this script outputs
 #           additional information when running.
 
 SRC_ROOT=$1
 TARGET_DIR=$2
 CONFIG_BUILD_DIR=$3
 PYTHON_INSTALL_DIR=$4
-debug_flag=$5 
+debug_flag=$5
 SWIG=$6
+makefile_flag=$7
+dependency_flag=$8
 
-swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
+if [ -n "$makefile_flag" -a "$makefile_flag" = "-m" ]
+then
+    MakefileCalled=1
+    if [ -n "$dependency_flag" -a "$dependency_flag" = "-M" ]
+    then
+        GenerateDependencies=1
+        swig_depend_file="${TARGET_DIR}/LLDBWrapPython.cpp.d"
+        SWIG_DEPEND_OPTIONS="-MMD -MF \"${swig_depend_file}.tmp\""
+    else
+        GenerateDependencies=0
+    fi
+else
+    MakefileCalled=0
+    GenerateDependencies=0
+fi
+
+if [ $MakefileCalled -eq 0 ]
+then
+  swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
+else
+  swig_output_file=${TARGET_DIR}/LLDBWrapPython.cpp
+fi
 swig_input_file=${SRC_ROOT}/scripts/lldb.swig
 swig_python_extensions=${SRC_ROOT}/scripts/Python/python-extensions.swig
 swig_python_wrapper=${SRC_ROOT}/scripts/Python/python-wrapper.swig
 swig_python_typemaps=${SRC_ROOT}/scripts/Python/python-typemaps.swig
 
-if [ $LLDB_DISABLE_PYTHON = "1" ] ; then
+if [ "$LLDB_DISABLE_PYTHON" = "1" ] ; then
     # We don't want Python for this build, but touch the output file so we don't have to
     # conditionalize the build on this as well.
     # Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
@@ -34,7 +57,7 @@ if [ $LLDB_DISABLE_PYTHON = "1" ] ; then
 
 else
 
-if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
+if [ -n "$debug_flag" -a "$debug_flag" = "-debug" ]
 then
     Debug=1
 else
@@ -70,6 +93,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/l
 " ${SRC_ROOT}/include/lldb/API/SBDebugger.h"\
 " ${SRC_ROOT}/include/lldb/API/SBError.h"\
 " ${SRC_ROOT}/include/lldb/API/SBEvent.h"\
+" ${SRC_ROOT}/include/lldb/API/SBExpressionOptions.h"\
 " ${SRC_ROOT}/include/lldb/API/SBFileSpec.h"\
 " ${SRC_ROOT}/include/lldb/API/SBFrame.h"\
 " ${SRC_ROOT}/include/lldb/API/SBFunction.h"\
@@ -98,7 +122,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/l
 " ${SRC_ROOT}/include/lldb/API/SBTypeSynthetic.h"\
 " ${SRC_ROOT}/include/lldb/API/SBValue.h"\
 " ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
-" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"\
+" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"
 
 INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBBlock.i"\
@@ -111,8 +135,10 @@ INTERFACE_FILES="${SRC_ROOT}/scripts/Pyt
 " ${SRC_ROOT}/scripts/Python/interface/SBCompileUnit.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBData.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBDebugger.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBDeclaration.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBError.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBEvent.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBExpressionOptions.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBFileSpec.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBFrame.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBFunction.i"\
@@ -142,13 +168,13 @@ INTERFACE_FILES="${SRC_ROOT}/scripts/Pyt
 " ${SRC_ROOT}/scripts/Python/interface/SBValueList.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBWatchpoint.i"
 
-if [ $Debug == 1 ]
+if [ $Debug -eq 1 ]
 then
     echo "Header files are:"
     echo ${HEADER_FILES}
 fi
 
-if [ $Debug == 1 ]
+if [ $Debug -eq 1 ]
 then
     echo "SWIG interface files are:"
     echo ${INTERFACE_FILES}
@@ -160,20 +186,20 @@ NeedToUpdate=0
 if [ ! -f ${swig_output_file} ]
 then
     NeedToUpdate=1
-    if [ $Debug == 1 ]
+    if [ $Debug -eq 1 ]
     then
         echo "Failed to find LLDBWrapPython.cpp"
     fi
 fi
 
-if [ $NeedToUpdate == 0 ]
+if [ $NeedToUpdate -eq 0 ]
 then
     for hdrfile in ${HEADER_FILES}
     do
         if [ $hdrfile -nt ${swig_output_file} ]
         then
             NeedToUpdate=1
-            if [ $Debug == 1 ]
+            if [ $Debug -eq 1 ]
             then
                 echo "${hdrfile} is newer than ${swig_output_file}"
                 echo "swig file will need to be re-built."
@@ -183,14 +209,14 @@ then
     done
 fi
 
-if [ $NeedToUpdate == 0 ]
+if [ $NeedToUpdate -eq 0 ]
 then
     for intffile in ${INTERFACE_FILES}
     do
         if [ $intffile -nt ${swig_output_file} ]
         then
             NeedToUpdate=1
-            if [ $Debug == 1 ]
+            if [ $Debug -eq 1 ]
             then
                 echo "${intffile} is newer than ${swig_output_file}"
                 echo "swig file will need to be re-built."
@@ -200,12 +226,12 @@ then
     done
 fi
 
-if [ $NeedToUpdate == 0 ]
+if [ $NeedToUpdate -eq 0 ]
 then
     if [ ${swig_input_file} -nt ${swig_output_file} ]
     then
         NeedToUpdate=1
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "${swig_input_file} is newer than ${swig_output_file}"
             echo "swig file will need to be re-built."
@@ -213,12 +239,12 @@ then
     fi
 fi
 
-if [ $NeedToUpdate == 0 ]
+if [ $NeedToUpdate -eq 0 ]
 then
     if [ ${swig_python_extensions} -nt ${swig_output_file} ]
     then
         NeedToUpdate=1
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "${swig_python_extensions} is newer than ${swig_output_file}"
             echo "swig file will need to be re-built."
@@ -226,12 +252,12 @@ then
     fi
 fi
 
-if [ $NeedToUpdate == 0 ]
+if [ $NeedToUpdate -eq 0 ]
 then
     if [ ${swig_python_wrapper} -nt ${swig_output_file} ]
     then
         NeedToUpdate=1
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "${swig_python_wrapper} is newer than ${swig_output_file}"
             echo "swig file will need to be re-built."
@@ -239,12 +265,12 @@ then
     fi
 fi
 
-if [ $NeedToUpdate == 0 ]
+if [ $NeedToUpdate -eq 0 ]
 then
     if [ ${swig_python_typemaps} -nt ${swig_output_file} ]
     then
         NeedToUpdate=1
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "${swig_python_typemaps} is newer than ${swig_output_file}"
             echo "swig file will need to be re-built."
@@ -252,29 +278,34 @@ then
     fi
 fi
 
-os_name=`uname -s`
-python_version=`/usr/bin/python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
+python_version=`/usr/bin/env python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
 
-if [ "$os_name" == "Darwin" ]
+if [ $MakefileCalled -eq 0 ]
 then
-    framework_python_dir="${TARGET_DIR}/LLDB.framework/Resources/Python"
+    framework_python_dir="${TARGET_DIR}/LLDB.framework/Resources/Python/lldb"
 else
-    framework_python_dir="${PYTHON_INSTALL_DIR}/python${python_version}"
+    if [ -n "${PYTHON_INSTALL_DIR}" ]
+    then
+        framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False, \"${PYTHON_INSTALL_DIR}\");"`/lldb
+    else
+        framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False);"`/lldb
+    fi
 fi
 
+[ -n "${CONFIG_BUILD_DIR}" ] || CONFIG_BUILD_DIR=${framework_python_dir}
 
 if [ ! -L "${framework_python_dir}/_lldb.so" ]
 then
     NeedToUpdate=1
 fi
 
-if [ ! -f "${framework_python_dir}/lldb.py" ]
+if [ ! -f "${framework_python_dir}/__init__.py" ]
 then
     NeedToUpdate=1
 fi
 
 
-if [ $NeedToUpdate == 0 ]
+if [ $NeedToUpdate -eq 0 ]
 then
     echo "Everything is up-to-date."
     exit 0
@@ -289,7 +320,18 @@ fi
 
 # Build the SWIG C++ wrapper file for Python.
 
-$SWIG -c++ -shadow -python -I"/usr/include" -I"${SRC_ROOT}/include" -I./. -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}"
+if [ $GenerateDependencies -eq 1 ]
+then
+    if $SWIG -c++ -shadow -python -threads -I"${SRC_ROOT}/include" -I./. -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MMD -MF "${swig_depend_file}.tmp" -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}"
+    then
+        mv -f "${swig_depend_file}.tmp" "${swig_depend_file}"
+    else
+        rm -f "${swig_depend_file}.tmp"
+        exit 1
+    fi
+else
+    $SWIG -c++ -shadow -python -threads -I"${SRC_ROOT}/include" -I./. -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}" || exit $?
+fi
 
 # Implement the iterator protocol and/or eq/ne operators for some lldb objects.
 # Append global variable to lldb Python module.
@@ -304,7 +346,12 @@ fi
 
 if [ -f "${current_dir}/edit-swig-python-wrapper-file.py" ]
 then
-    python ${current_dir}/edit-swig-python-wrapper-file.py
+    if [ $MakefileCalled -eq 1 ]
+    then
+        python ${current_dir}/edit-swig-python-wrapper-file.py "${TARGET_DIR}"
+    else
+        python ${current_dir}/edit-swig-python-wrapper-file.py
+    fi
     if [ -f "${swig_output_file}.edited" ]
     then
         mv "${swig_output_file}.edited" ${swig_output_file}

Modified: lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh Thu Jun  6 19:06:43 2013
@@ -1,14 +1,14 @@
-#! /bin/sh
+#!/bin/sh
 
 # finish-swig-Python.sh
 #
 # For the Python script interpreter (external to liblldb) to be able to import
 # and use the lldb module, there must be two files, lldb.py and _lldb.so, that
 # it can find. lldb.py is generated by SWIG at the same time it generates the
-# C++ file.  _lldb.so is actually a symlink file that points to the 
+# C++ file.  _lldb.so is actually a symlink file that points to the
 # LLDB shared library/framework.
 #
-# The Python script interpreter needs to be able to automatically find 
+# The Python script interpreter needs to be able to automatically find
 # these two files. On Darwin systems it searches in the LLDB.framework, as
 # well as in all the normal Python search paths.  On non-Darwin systems
 # these files will need to be put someplace where Python will find them.
@@ -20,11 +20,11 @@
 
 # SRC_ROOT is the root of the lldb source tree.
 # TARGET_DIR is where the lldb framework/shared library gets put.
-# CONFIG_BUILD_DIR is where the build-swig-Python-LLDB.sh  shell script 
+# CONFIG_BUILD_DIR is where the build-swig-Python-LLDB.sh  shell script
 #           put the lldb.py file it was generated from running SWIG.
 # PYTHON_INSTALL_DIR is where non-Darwin systems want to put the .py and .so
 #           files so that Python can find them automatically.
-# debug_flag (optional) determines whether or not this script outputs 
+# debug_flag (optional) determines whether or not this script outputs
 #           additional information when running.
 
 SRC_ROOT=$1
@@ -32,36 +32,51 @@ TARGET_DIR=$2
 CONFIG_BUILD_DIR=$3
 PYTHON_INSTALL_DIR=$4
 debug_flag=$5
+makefile_flag=$6
 
 # If we don't want Python, then just do nothing here.
 # Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
 # set LLDB_DISABLE_PYTHON to 1.
 
-if [ ! $LLDB_DISABLE_PYTHON = "1" ] ; then
+if [ ! "$LLDB_DISABLE_PYTHON" = "1" ] ; then
 
-if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
+if [ -n "$debug_flag" -a "$debug_flag" = "-debug" ]
 then
     Debug=1
 else
     Debug=0
 fi
 
+if [ -n "$makefile_flag" -a "$makefile_flag" = "-m" ]
+then
+    MakefileCalled=1
+else
+    MakefileCalled=0
+fi
+
 OS_NAME=`uname -s`
-PYTHON_VERSION=`/usr/bin/python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
+PYTHON_VERSION=`/usr/bin/env python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
 
 
-if [ $Debug == 1 ]
+if [ $Debug -eq 1 ]
 then
     echo "The current OS is $OS_NAME"
     echo "The Python version is $PYTHON_VERSION"
 fi
 
+if [ ${OS_NAME} = "Darwin" ]
+then
+    SOEXT=".dylib"
+else
+    SOEXT=".so"
+fi
+
 #
 #  Determine where to put the files.
 
-if [ ${OS_NAME} == "Darwin" ]
+if [ $MakefileCalled -eq 0 ]
 then
-    # We are on a Darwin system, so all the lldb Python files can go 
+    # We are being built by Xcode, so all the lldb Python files can go
     # into the LLDB.framework/Resources/Python subdirectory.
 
     if [ ! -d "${TARGET_DIR}/LLDB.framework" ]
@@ -69,7 +84,7 @@ then
         echo "Error:  Unable to find LLDB.framework" >&2
         exit 1
     else
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "Found ${TARGET_DIR}/LLDB.framework."
         fi
@@ -79,19 +94,26 @@ then
 
     framework_python_dir="${TARGET_DIR}/LLDB.framework/Resources/Python/lldb"
 else
-    # We are on a non-Darwin system, so use the PYTHON_INSTALL_DIR argument,
+    # We are being built by LLVM, so use the PYTHON_INSTALL_DIR argument,
     # and append the python version directory to the end of it.  Depending on
     # the system other stuff may need to be put here as well.
 
-    framework_python_dir="${PYTHON_INSTALL_DIR}/python${PYTHON_VERSION}/lldb"
+    if [ -n "${PYTHON_INSTALL_DIR}" ]
+    then
+        framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False, \"${PYTHON_INSTALL_DIR}\");"`/lldb
+    else
+        framework_python_dir=`/usr/bin/env python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False);"`/lldb
+    fi
 fi
 
+[ -n "${CONFIG_BUILD_DIR}" ] || CONFIG_BUILD_DIR=${framework_python_dir}
+
 #
 # Look for the directory in which to put the Python files;  if it does not
 # already exist, attempt to make it.
 #
 
-if [ $Debug == 1 ]
+if [ $Debug -eq 1 ]
 then
     echo "Python files will be put in ${framework_python_dir}"
 fi
@@ -102,13 +124,13 @@ for python_dir in $python_dirs
 do
     if [ ! -d "${python_dir}" ]
     then
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "Making directory ${python_dir}"
         fi
         mkdir -p "${python_dir}"
     else
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "${python_dir} already exists."
         fi
@@ -126,27 +148,26 @@ done
 
 if [ ! -L "${framework_python_dir}/_lldb.so" ]
 then
-    if [ $Debug == 1 ]
+    if [ $Debug -eq 1 ]
     then
         echo "Creating symlink for _lldb.so"
     fi
-    if [ ${OS_NAME} == "Darwin" ]
+    cd "${framework_python_dir}"
+    if [ $MakefileCalled -eq 0 ]
     then
-        cd "${framework_python_dir}"
         ln -s "../../../LLDB" _lldb.so
     else
-        cd "${TARGET_DIR}"
-        ln -s "../LLDB" _lldb.so
+        ln -s "../../../liblldb${SOEXT}" _lldb.so
     fi
 else
-    if [ $Debug == 1 ]
+    if [ $Debug -eq 1 ]
     then
         echo "${framework_python_dir}/_lldb.so already exists."
     fi
 fi
 
 
-function create_python_package {
+create_python_package () {
     package_dir="${framework_python_dir}$1"
     package_files="$2"
     package_name=`echo $1 | tr '/' '.'`
@@ -171,14 +192,14 @@ function create_python_package {
     package_init_file="${package_dir}/__init__.py"
     if [ ! -f "${package_init_file}" ]
     then
-        echo -n "__all__ = [" > "${package_init_file}"
+        printf "__all__ = [" > "${package_init_file}"
         python_module_separator=""
         for package_file in $package_files
         do
             if [ -f "${package_file}" ]
             then
                 package_file_basename=$(basename "${package_file}")
-                echo -n "${python_module_separator}\"${package_file_basename%.*}\"" >> "${package_init_file}"
+                printf "${python_module_separator}\"${package_file_basename%.*}\"" >> "${package_init_file}"
                 python_module_separator=", "
             fi
         done
@@ -202,38 +223,11 @@ package_files="${SRC_ROOT}/examples/synt
 ${SRC_ROOT}/examples/synthetic/libcxx.py"
 create_python_package "/formatters/cpp" "${package_files}"
 
-# lldb/formatters/objc
-package_files="${SRC_ROOT}/examples/summaries/cocoa/Selector.py
-${SRC_ROOT}/examples/summaries/objc.py
-${SRC_ROOT}/examples/summaries/cocoa/Class.py
-${SRC_ROOT}/examples/summaries/cocoa/CFArray.py
-${SRC_ROOT}/examples/summaries/cocoa/CFBag.py
-${SRC_ROOT}/examples/summaries/cocoa/CFBinaryHeap.py
-${SRC_ROOT}/examples/summaries/cocoa/CFBitVector.py
-${SRC_ROOT}/examples/summaries/cocoa/CFDictionary.py
-${SRC_ROOT}/examples/summaries/cocoa/CFString.py
-${SRC_ROOT}/examples/summaries/cocoa/NSBundle.py
-${SRC_ROOT}/examples/summaries/cocoa/NSData.py
-${SRC_ROOT}/examples/summaries/cocoa/NSDate.py
-${SRC_ROOT}/examples/summaries/cocoa/NSException.py
-${SRC_ROOT}/examples/summaries/cocoa/NSIndexSet.py
-${SRC_ROOT}/examples/summaries/cocoa/NSMachPort.py
-${SRC_ROOT}/examples/summaries/cocoa/NSNotification.py
-${SRC_ROOT}/examples/summaries/cocoa/NSNumber.py
-${SRC_ROOT}/examples/summaries/cocoa/NSSet.py
-${SRC_ROOT}/examples/summaries/cocoa/NSURL.py"
-create_python_package "/formatters/objc" "${package_files}"
-
-
 # make an empty __init__.py in lldb/runtime
 # this is required for Python to recognize lldb.runtime as a valid package
 # (and hence, lldb.runtime.objc as a valid contained package)
 create_python_package "/runtime" ""
 
-# lldb/runtime/objc
-package_files="${SRC_ROOT}/examples/summaries/cocoa/objc_runtime.py"
-create_python_package "/runtime/objc" "${package_files}"
-
 # lldb/formatters
 # having these files copied here ensures that lldb/formatters is a valid package itself
 package_files="${SRC_ROOT}/examples/summaries/cocoa/cache.py
@@ -246,13 +240,18 @@ create_python_package "/formatters" "${p
 package_files="${SRC_ROOT}/examples/python/symbolication.py"
 create_python_package "/utils" "${package_files}"
 
-if [ ${OS_NAME} == "Darwin" ]
+if [ ${OS_NAME} = "Darwin" ]
 then
     # lldb/macosx
     package_files="${SRC_ROOT}/examples/python/crashlog.py
     ${SRC_ROOT}/examples/darwin/heap_find/heap.py"
     create_python_package "/macosx" "${package_files}"
 
+    # lldb/diagnose
+    package_files="${SRC_ROOT}/examples/python/diagnose_unwind.py
+    ${SRC_ROOT}/examples/python/diagnose_nsstring.py"
+    create_python_package "/diagnose" "${package_files}"
+
     # Copy files needed by lldb/macosx/heap.py to build libheap.dylib
     heap_dir="${framework_python_dir}/macosx/heap"
     if [ ! -d "${heap_dir}" ]

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i Thu Jun  6 19:06:43 2013
@@ -106,7 +106,7 @@ public:
     %pythoncode %{
         def get_range_at_index(self, idx):
             if idx < self.GetNumRanges():
-                return [self.sbblock.GetRangeStartAddress(key), self.sbblock.GetRangeEndAddress(key)]
+                return [self.GetRangeStartAddress(idx), self.GetRangeEndAddress(idx)]
             return []
 
         class ranges_access(object):
@@ -137,11 +137,11 @@ public:
         
         def get_ranges_array(self):
             '''An accessor function that returns an array object that contains all ranges in this block object.'''
-            if not hasattr(self, 'ranges'):
-                self.ranges = []
+            if not hasattr(self, 'ranges_array'):
+                self.ranges_array = []
                 for idx in range(self.num_ranges):
-                    self.ranges.append (self.get_range_at_index (idx))
-            return self.ranges
+                    self.ranges_array.append ([self.GetRangeStartAddress(idx), self.GetRangeEndAddress(idx)])
+            return self.ranges_array
         
         def get_call_site(self):
             return declaration(self.GetInlinedCallSiteFile(), self.GetInlinedCallSiteLine(), self.GetInlinedCallSiteColumn())

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpoint.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpoint.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpoint.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpoint.i Thu Jun  6 19:06:43 2013
@@ -118,6 +118,15 @@ public:
 
     bool
     IsEnabled ();
+    
+    void
+    SetOneShot (bool one_shot);
+
+    bool
+    IsOneShot ();
+    
+    bool
+    IsInternal ();
 
     uint32_t
     GetHitCount () const;
@@ -180,6 +189,12 @@ public:
     bool
     GetDescription (lldb::SBStream &description);
 
+    bool
+    operator == (const lldb::SBBreakpoint& rhs);
+           
+    bool
+    operator != (const lldb::SBBreakpoint& rhs);
+
     static bool
     EventIsBreakpointEvent (const lldb::SBEvent &event);
     

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBBroadcaster.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBBroadcaster.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBBroadcaster.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBBroadcaster.i Thu Jun  6 19:06:43 2013
@@ -57,6 +57,12 @@ public:
 
     bool
     RemoveListener (const lldb::SBListener &listener, uint32_t event_mask = UINT32_MAX);
+    
+    bool
+    operator == (const lldb::SBBroadcaster &rhs) const;
+    
+    bool
+    operator != (const lldb::SBBroadcaster &rhs) const;
 };
 
 } // namespace lldb

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandInterpreter.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandInterpreter.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandInterpreter.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandInterpreter.i Thu Jun  6 19:06:43 2013
@@ -101,6 +101,9 @@ public:
 
     lldb::SBProcess
     GetProcess ();
+    
+    lldb::SBDebugger
+    GetDebugger ();
 
     void
     SourceInitFileInHomeDirectory (lldb::SBCommandReturnObject &result);

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandReturnObject.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandReturnObject.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandReturnObject.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBCommandReturnObject.i Thu Jun  6 19:06:43 2013
@@ -36,14 +36,20 @@ public:
     GetError ();
 
     size_t
-    PutOutput (FILE *fh);
-
-    size_t
     GetOutputSize ();
 
     size_t
     GetErrorSize ();
 
+    const char *
+    GetOutput (bool only_if_no_immediate);
+    
+    const char *
+    GetError (bool if_no_immediate);
+    
+    size_t
+    PutOutput (FILE *fh);
+    
     size_t
     PutError (FILE *fh);
 
@@ -65,6 +71,9 @@ public:
     void
     AppendMessage (const char *message);
 
+    void
+    AppendWarning (const char *message);
+
     bool
     GetDescription (lldb::SBStream &description);
     
@@ -75,10 +84,16 @@ public:
     SetImmediateErrorFile (FILE *fh);
 
 	void
-	PutCString(const char* string, int len = -1);
+	PutCString(const char* string, int len);
 
-	size_t
-	Printf(const char* format, ...);
+    // wrapping the variadic Printf() with a plain Print()
+    // because it is hard to support varargs in SWIG bridgings
+    %extend {
+        void Print (const char* str)
+        {
+            self->Printf("%s", str);
+        }
+    }
 
 };
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i Thu Jun  6 19:06:43 2013
@@ -89,6 +89,12 @@ public:
     bool
     GetDescription (lldb::SBStream &description);
     
+    bool
+    operator == (const lldb::SBCompileUnit &rhs) const;
+    
+    bool
+    operator != (const lldb::SBCompileUnit &rhs) const;
+    
     %pythoncode %{
         __swig_getmethods__["file"] = GetFileSpec
         if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''')

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i Thu Jun  6 19:06:43 2013
@@ -42,50 +42,50 @@ public:
     SetByteOrder (lldb::ByteOrder endian);
 
     float
-    GetFloat (lldb::SBError& error, uint32_t offset);
+    GetFloat (lldb::SBError& error, lldb::offset_t offset);
 
     double
-    GetDouble (lldb::SBError& error, uint32_t offset);
+    GetDouble (lldb::SBError& error, lldb::offset_t offset);
 
     long double
-    GetLongDouble (lldb::SBError& error, uint32_t offset);
+    GetLongDouble (lldb::SBError& error, lldb::offset_t offset);
 
     lldb::addr_t
-    GetAddress (lldb::SBError& error, uint32_t offset);
+    GetAddress (lldb::SBError& error, lldb::offset_t offset);
 
     uint8_t
-    GetUnsignedInt8 (lldb::SBError& error, uint32_t offset);
+    GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset);
 
     uint16_t
-    GetUnsignedInt16 (lldb::SBError& error, uint32_t offset);
+    GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset);
 
     uint32_t
-    GetUnsignedInt32 (lldb::SBError& error, uint32_t offset);
+    GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset);
 
     uint64_t
-    GetUnsignedInt64 (lldb::SBError& error, uint32_t offset);
+    GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset);
 
     int8_t
-    GetSignedInt8 (lldb::SBError& error, uint32_t offset);
+    GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset);
 
     int16_t
-    GetSignedInt16 (lldb::SBError& error, uint32_t offset);
+    GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset);
 
     int32_t
-    GetSignedInt32 (lldb::SBError& error, uint32_t offset);
+    GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset);
 
     int64_t
-    GetSignedInt64 (lldb::SBError& error, uint32_t offset);
+    GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset);
 
     const char*
-    GetString (lldb::SBError& error, uint32_t offset);
+    GetString (lldb::SBError& error, lldb::offset_t offset);
 
     bool
     GetDescription (lldb::SBStream &description, lldb::addr_t base_addr);
 
     size_t
     ReadRawData (lldb::SBError& error,
-                 uint32_t offset,
+                 lldb::offset_t offset,
                  void *buf,
                  size_t size);
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBDebugger.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBDebugger.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBDebugger.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBDebugger.i Thu Jun  6 19:06:43 2013
@@ -87,7 +87,7 @@ if target:
                         #print value
                         print '%s (number of children = %d):' % (value.GetName(), value.GetNumChildren())
                         for child in value:
-                            print 'Name: ', child.GetName(), ' Value: ', child.GetValue(frame)
+                            print 'Name: ', child.GetName(), ' Value: ', child.GetValue()
 
             print 'Hit the breakpoint at main, enter to continue and wait for program to exit or \'Ctrl-D\'/\'quit\' to terminate the program'
             next = sys.stdin.readline()
@@ -122,6 +122,9 @@ public:
     static lldb::SBDebugger
     Create(bool source_init_files);
 
+    static lldb::SBDebugger
+    Create(bool source_init_files, lldb::LogOutputCallback log_callback, void *baton);
+
     static void
     Destroy (lldb::SBDebugger &debugger);
 
@@ -272,7 +275,10 @@ public:
     EnableLog (const char *channel, const char ** types);
 
     void
-    DispatchInput (void *baton, const void *data, size_t data_len);
+    SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton);
+
+    void
+    DispatchInput (const void *data, size_t data_len);
 
     void
     DispatchInputInterrupt ();

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i Thu Jun  6 19:06:43 2013
@@ -139,6 +139,9 @@ public:
 
     lldb::SBValue
     EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic, bool unwind_on_error);
+    
+    lldb::SBValue
+    EvaluateExpression (const char *expr, SBExpressionOptions &options);
 
     %feature("docstring", "
     /// Gets the lexical block that defines the stack frame. Another way to think

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i Thu Jun  6 19:06:43 2013
@@ -65,6 +65,9 @@ public:
     lldb::SBInstructionList
     GetInstructions (lldb::SBTarget target);
 
+    lldb::SBInstructionList
+    GetInstructions (lldb::SBTarget target, const char *flavor);
+
     lldb::SBAddress
     GetStartAddress ();
 
@@ -83,6 +86,12 @@ public:
     bool
     GetDescription (lldb::SBStream &description);
     
+    bool
+    operator == (const lldb::SBFunction &rhs) const;
+    
+    bool
+    operator != (const lldb::SBFunction &rhs) const;
+    
     %pythoncode %{
         def get_instructions_from_current_target (self):
             return self.GetInstructions (target)

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i Thu Jun  6 19:06:43 2013
@@ -77,6 +77,12 @@ public:
     void
     SetColumn (uint32_t column);
 
+    bool
+    operator == (const lldb::SBLineEntry &rhs) const;
+    
+    bool
+    operator != (const lldb::SBLineEntry &rhs) const;
+    
     %pythoncode %{
         __swig_getmethods__["file"] = GetFileSpec
         if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns an lldb object that represents the file (lldb.SBFileSpec) for this line entry.''')

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i Thu Jun  6 19:06:43 2013
@@ -177,6 +177,15 @@ public:
     lldb::SBSymbol
     GetSymbolAtIndex (size_t idx);
 
+    lldb::SBSymbol
+    FindSymbol (const char *name,
+                lldb::SymbolType type = eSymbolTypeAny);
+
+    lldb::SBSymbolContextList
+    FindSymbols (const char *name,
+                 lldb::SymbolType type = eSymbolTypeAny);
+             
+
     size_t
     GetNumSections ();
 
@@ -213,6 +222,8 @@ public:
     lldb::SBTypeList
     FindTypes (const char* type);
 
+    lldb::SBType
+    GetBasicType(lldb::BasicType type);
 
     %feature("docstring", "
     //------------------------------------------------------------------
@@ -237,6 +248,24 @@ public:
                          const char *name, 
                          uint32_t max_matches);
     
+    %feature("docstring", "
+    //------------------------------------------------------------------
+    /// Find the first global (or static) variable by name.
+    ///
+    /// @param[in] target
+    ///     A valid SBTarget instance representing the debuggee.
+    ///
+    /// @param[in] name
+    ///     The name of the global or static variable we are looking
+    ///     for.
+    ///
+    /// @return
+    ///     An SBValue that gets filled in with the found variable (if any).
+    //------------------------------------------------------------------
+    ") FindFirstGlobalVariable;
+    lldb::SBValue
+    FindFirstGlobalVariable (lldb::SBTarget &target, const char *name);
+             
     lldb::ByteOrder
     GetByteOrder ();
     
@@ -250,10 +279,16 @@ public:
     GetVersion (uint32_t *versions, 
                 uint32_t num_versions);
 
+    bool
+    operator == (const lldb::SBModule &rhs) const;
+             
+    bool
+    operator != (const lldb::SBModule &rhs) const;
+             
     %pythoncode %{
         class symbols_access(object):
             re_compile_type = type(re.compile('.'))
-            '''A helper object that will lazily hand out lldb.SBModule objects for a target when supplied an index, or by full or partial path.'''
+            '''A helper object that will lazily hand out lldb.SBSymbol objects for a module when supplied an index, name, or regular expression.'''
             def __init__(self, sbmodule):
                 self.sbmodule = sbmodule
         
@@ -269,9 +304,10 @@ public:
                         return self.sbmodule.GetSymbolAtIndex(key)
                 elif type(key) is str:
                     matches = []
-                    for idx in range(count):
-                        symbol = self.sbmodule.GetSymbolAtIndex(idx)
-                        if symbol.name == key or symbol.mangled == key:
+                    sc_list = self.sbmodule.FindSymbols(key)
+                    for sc in sc_list:
+                        symbol = sc.symbol
+                        if symbol:
                             matches.append(symbol)
                     return matches
                 elif isinstance(key, self.re_compile_type):
@@ -300,6 +336,10 @@ public:
             '''An accessor function that returns a symbols_access() object which allows lazy symbol access from a lldb.SBModule object.'''
             return self.symbols_access (self)
         
+        def get_compile_units_access_object (self):
+            '''An accessor function that returns a compile_units_access() object which allows lazy compile unit access from a lldb.SBModule object.'''
+            return self.compile_units_access (self)
+        
         def get_symbols_array(self):
             '''An accessor function that returns a list() that contains all symbols in a lldb.SBModule object.'''
             symbols = []
@@ -309,7 +349,7 @@ public:
 
         class sections_access(object):
             re_compile_type = type(re.compile('.'))
-            '''A helper object that will lazily hand out lldb.SBModule objects for a target when supplied an index, or by full or partial path.'''
+            '''A helper object that will lazily hand out lldb.SBSection objects for a module when supplied an index, name, or regular expression.'''
             def __init__(self, sbmodule):
                 self.sbmodule = sbmodule
         
@@ -341,18 +381,66 @@ public:
                 else:
                     print "error: unsupported item type: %s" % type(key)
                 return None
+
+        class compile_units_access(object):
+            re_compile_type = type(re.compile('.'))
+            '''A helper object that will lazily hand out lldb.SBCompileUnit objects for a module when supplied an index, full or partial path, or regular expression.'''
+            def __init__(self, sbmodule):
+                self.sbmodule = sbmodule
         
+            def __len__(self):
+                if self.sbmodule:
+                    return int(self.sbmodule.GetNumCompileUnits())
+                return 0
+        
+            def __getitem__(self, key):
+                count = len(self)
+                if type(key) is int:
+                    if key < count:
+                        return self.sbmodule.GetCompileUnitAtIndex(key)
+                elif type(key) is str:
+                    is_full_path = key[0] == '/'
+                    for idx in range(count):
+                        comp_unit = self.sbmodule.GetCompileUnitAtIndex(idx)
+                        if is_full_path:
+                            if comp_unit.file.fullpath == key:
+                                return comp_unit
+                        else:
+                            if comp_unit.file.basename == key:
+                                return comp_unit
+                elif isinstance(key, self.re_compile_type):
+                    matches = []
+                    for idx in range(count):
+                        comp_unit = self.sbmodule.GetCompileUnitAtIndex(idx)
+                        fullpath = comp_unit.file.fullpath
+                        if fullpath:
+                            re_match = key.search(fullpath)
+                            if re_match:
+                                matches.append(comp_unit)
+                    return matches
+                else:
+                    print "error: unsupported item type: %s" % type(key)
+                return None
+
         def get_sections_access_object(self):
             '''An accessor function that returns a sections_access() object which allows lazy section array access.'''
             return self.sections_access (self)
         
         def get_sections_array(self):
             '''An accessor function that returns an array object that contains all sections in this module object.'''
-            if not hasattr(self, 'sections'):
-                self.sections = []
+            if not hasattr(self, 'sections_array'):
+                self.sections_array = []
                 for idx in range(self.num_sections):
-                    self.sections.append(self.GetSectionAtIndex(idx))
-            return self.sections
+                    self.sections_array.append(self.GetSectionAtIndex(idx))
+            return self.sections_array
+
+        def get_compile_units_array(self):
+            '''An accessor function that returns an array object that contains all compile_units in this module object.'''
+            if not hasattr(self, 'compile_units_array'):
+                self.compile_units_array = []
+                for idx in range(self.GetNumCompileUnits()):
+                    self.compile_units_array.append(self.GetCompileUnitAtIndex(idx))
+            return self.compile_units_array
 
         __swig_getmethods__["symbols"] = get_symbols_array
         if _newclass: symbols = property(get_symbols_array, None, doc='''A read only property that returns a list() of lldb.SBSymbol objects contained in this module.''')
@@ -362,10 +450,16 @@ public:
 
         __swig_getmethods__["sections"] = get_sections_array
         if _newclass: sections = property(get_sections_array, None, doc='''A read only property that returns a list() of lldb.SBSection objects contained in this module.''')
-        
+
+        __swig_getmethods__["compile_units"] = get_compile_units_array
+        if _newclass: compile_units = property(get_compile_units_array, None, doc='''A read only property that returns a list() of lldb.SBCompileUnit objects contained in this module.''')
+
         __swig_getmethods__["section"] = get_sections_access_object
         if _newclass: section = property(get_sections_access_object, None, doc='''A read only property that can be used to access symbols by index ("section = module.section[0]"), name ("sections = module.section[\'main\']"), or using a regular expression ("sections = module.section[re.compile(...)]"). The return value is a single lldb.SBSection object for array access, and a list() of lldb.SBSection objects for name and regular expression access''')
 
+        __swig_getmethods__["compile_unit"] = get_compile_units_access_object
+        if _newclass: section = property(get_sections_access_object, None, doc='''A read only property that can be used to access compile units by index ("compile_unit = module.compile_unit[0]"), name ("compile_unit = module.compile_unit[\'main.cpp\']"), or using a regular expression ("compile_unit = module.compile_unit[re.compile(...)]"). The return value is a single lldb.SBCompileUnit object for array access or by full or partial path, and a list() of lldb.SBCompileUnit objects regular expressions.''')
+
         def get_uuid(self):
             return uuid.UUID (self.GetUUIDString())
         

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i Thu Jun  6 19:06:43 2013
@@ -43,7 +43,8 @@ public:
         eBroadcastBitStateChanged   = (1 << 0),
         eBroadcastBitInterrupt      = (1 << 1),
         eBroadcastBitSTDOUT         = (1 << 2),
-        eBroadcastBitSTDERR         = (1 << 3)
+        eBroadcastBitSTDERR         = (1 << 3),
+        eBroadcastBitProfileData    = (1 << 4)
     };
 
     SBProcess ();
@@ -55,6 +56,12 @@ public:
     static const char *
     GetBroadcasterClassName ();
 
+    const char *
+    GetPluginName ();
+    
+    const char *
+    GetShortPluginName ();
+    
     void
     Clear ();
 
@@ -90,6 +97,9 @@ public:
     size_t
     GetSTDERR (char *dst, size_t dst_len) const;
 
+    size_t
+    GetAsyncProfileData(char *dst, size_t dst_len) const;
+    
     void
     ReportEventState (const lldb::SBEvent &event, FILE *out) const;
 
@@ -154,11 +164,17 @@ public:
     lldb::SBThread
     GetSelectedThread () const;
 
+    %feature("autodoc", "
+    Lazily create a thread on demand through the current OperatingSystem plug-in, if the current OperatingSystem plug-in supports it.
+    ") CreateOSPluginThread;
+    lldb::SBThread
+    CreateOSPluginThread (lldb::tid_t tid, lldb::addr_t context);
+
     bool
     SetSelectedThread (const lldb::SBThread &thread);
 
     bool
-    SetSelectedThreadByID (uint32_t tid);
+    SetSelectedThreadByID (lldb::tid_t tid);
 
     bool
     SetSelectedThreadByIndexID (uint32_t index_id);
@@ -176,8 +192,17 @@ public:
     const char *
     GetExitDescription ();
 
+    %feature("autodoc", "
+    Returns the process ID of the process.
+    ") GetProcessID;
     lldb::pid_t
     GetProcessID ();
+    
+    %feature("autodoc", "
+    Returns an integer ID that is guaranteed to be unique across all process instances. This is not the process ID, just a unique integer for comparison and caching purposes.
+    ") GetUniqueID;
+    uint32_t
+    GetUniqueID();
 
     uint32_t
     GetAddressByteSize() const;
@@ -206,6 +231,16 @@ public:
     lldb::SBError
     Signal (int signal);
 
+    %feature("docstring", "
+    Returns a stop id that will increase every time the process executes.  If
+    include_expression_stops is true, then stops caused by expression evaluation
+    will cause the returned value to increase, otherwise the counter returned will
+    only increase when execution is continued explicitly by the user.  Note, the value
+    will always increase, but may increase by more than one per stop.
+    ") GetStopID;
+    uint32_t
+    GetStopID(bool include_expression_stops = false);
+    
     void
     SendAsyncInterrupt();
     
@@ -293,6 +328,12 @@ public:
     static bool
     GetRestartedFromEvent (const lldb::SBEvent &event);
 
+    static size_t
+    GetNumRestartedReasonsFromEvent (const lldb::SBEvent &event);
+    
+    static const char *
+    GetRestartedReasonAtIndexFromEvent (const lldb::SBEvent &event, size_t idx);
+
     static lldb::SBProcess
     GetProcessFromEvent (const lldb::SBEvent &event);
 
@@ -364,8 +405,9 @@ public:
         def get_process_thread_list(self):
             '''An accessor function that returns a list() that contains all threads in a lldb.SBProcess object.'''
             threads = []
-            for idx in range(self.GetNumThreads()):
-                threads.append(self.threads_access(idx))
+            accessor = self.get_threads_access_object()
+            for idx in range(len(accessor)):
+                threads.append(accessor[idx])
             return threads
         
         __swig_getmethods__["threads"] = get_process_thread_list

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i Thu Jun  6 19:06:43 2013
@@ -90,6 +90,12 @@ public:
     bool
     GetDescription (lldb::SBStream &description);
     
+    bool
+    operator == (const lldb::SBSection &rhs);
+
+    bool
+    operator != (const lldb::SBSection &rhs);
+     
     %pythoncode %{
         def get_addr(self):
             return SBAddress(self, 0)
@@ -122,7 +128,7 @@ public:
 
 private:
 
-    std::auto_ptr<lldb_private::SectionImpl> m_opaque_ap;
+    std::unique_ptr<lldb_private::SectionImpl> m_opaque_ap;
 };
 
 } // namespace lldb

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBStream.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBStream.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBStream.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBStream.i Thu Jun  6 19:06:43 2013
@@ -68,9 +68,15 @@ public:
     size_t
     GetSize();
 
-    void
-    Printf (const char *format, ...);
-
+    // wrapping the variadic Printf() with a plain Print()
+    // because it is hard to support varargs in SWIG bridgings
+    %extend {
+        void Print (const char* str)
+        {
+            self->Printf("%s", str);
+        }
+    }
+    
     void
     RedirectToFile (const char *path, bool append);
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i Thu Jun  6 19:06:43 2013
@@ -38,6 +38,9 @@ public:
     lldb::SBInstructionList
     GetInstructions (lldb::SBTarget target);
 
+    lldb::SBInstructionList
+    GetInstructions (lldb::SBTarget target, const char *flavor_string);
+
     SBAddress
     GetStartAddress ();
     
@@ -59,6 +62,12 @@ public:
     bool
     IsSynthetic();
 
+    bool
+    operator == (const lldb::SBSymbol &rhs) const;
+    
+    bool
+    operator != (const lldb::SBSymbol &rhs) const;
+    
     %pythoncode %{
         def get_instructions_from_current_target (self):
             return self.GetInstructions (target)

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i Thu Jun  6 19:06:43 2013
@@ -238,7 +238,9 @@ public:
     {
         eBroadcastBitBreakpointChanged  = (1 << 0),
         eBroadcastBitModulesLoaded      = (1 << 1),
-        eBroadcastBitModulesUnloaded    = (1 << 2)
+        eBroadcastBitModulesUnloaded    = (1 << 2),
+        eBroadcastBitWatchpointChanged  = (1 << 3),
+        eBroadcastBitSymbolsLoaded      = (1 << 4)
     };
 
     //------------------------------------------------------------------
@@ -388,6 +390,26 @@ public:
     
     lldb::SBProcess
     Launch (lldb::SBLaunchInfo &launch_info, lldb::SBError& error);
+
+    %feature("docstring", "
+    //------------------------------------------------------------------
+    /// Load a core file
+    ///
+    /// @param[in] core_file
+    ///     File path of the core dump.
+    ///
+    /// @return
+    ///      A process object for the newly created core file.
+    //------------------------------------------------------------------
+
+    For example,
+
+        process = target.LoadCore('./a.out.core')
+
+    loads a new core file and returns the process object.
+    ") LoadCore;
+    lldb::SBProcess
+    LoadCore(const char *core_file);
     
     lldb::SBProcess
     Attach (lldb::SBAttachInfo &attach_info, lldb::SBError& error);
@@ -560,6 +582,9 @@ public:
     lldb::SBTypeList
     FindTypes (const char* type);
 
+    lldb::SBType
+    GetBasicType(lldb::BasicType type);
+
     lldb::SBSourceManager
     GetSourceManager ();
 
@@ -582,6 +607,21 @@ public:
     FindGlobalVariables (const char *name, 
                          uint32_t max_matches);
 
+     %feature("docstring", "
+    //------------------------------------------------------------------
+    /// Find the first global (or static) variable by name.
+    ///
+    /// @param[in] name
+    ///     The name of the global or static variable we are looking
+    ///     for.
+    ///
+    /// @return
+    ///     An SBValue that gets filled in with the found variable (if any).
+    //------------------------------------------------------------------
+    ") FindFirstGlobalVariable;
+    lldb::SBValue
+    FindFirstGlobalVariable (const char* name);
+
     void
     Clear ();
 
@@ -685,11 +725,31 @@ public:
     ReadInstructions (lldb::SBAddress base_addr, uint32_t count);    
 
     lldb::SBInstructionList
+    ReadInstructions (lldb::SBAddress base_addr, uint32_t count, const char *flavor_string);
+
+    lldb::SBInstructionList
     GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t size);
     
+    lldb::SBInstructionList
+    GetInstructionsWithFlavor (lldb::SBAddress base_addr, const char *flavor_string, const void *buf, size_t size);
+    
+    lldb::SBSymbolContextList
+    FindSymbols (const char *name, lldb::SymbolType type = eSymbolTypeAny);
+
     bool
     GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
     
+    lldb::addr_t
+    GetStackRedZoneSize();
+
+    bool
+    operator == (const lldb::SBTarget &rhs) const;
+
+    bool
+    operator != (const lldb::SBTarget &rhs) const;
+
+    lldb::SBValue
+    EvaluateExpression (const char *expr, const lldb::SBExpressionOptions &options);
     %pythoncode %{
         class modules_access(object):
             '''A helper object that will lazily hand out lldb.SBModule objects for a target when supplied an index, or by full or partial path.'''
@@ -718,12 +778,15 @@ public:
                             if module.file.fullpath == key:
                                 return module
                     # See if the string is a UUID
-                    the_uuid = uuid.UUID(key)
-                    if the_uuid:
-                        for idx in range(num_modules):
-                            module = self.sbtarget.GetModuleAtIndex(idx)
-                            if module.uuid == the_uuid:
-                                return module
+                    try:
+                        the_uuid = uuid.UUID(key)
+                        if the_uuid:
+                            for idx in range(num_modules):
+                                module = self.sbtarget.GetModuleAtIndex(idx)
+                                if module.uuid == the_uuid:
+                                    return module
+                    except:
+                        return None
                 elif type(key) is uuid.UUID:
                     for idx in range(num_modules):
                         module = self.sbtarget.GetModuleAtIndex(idx)

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i Thu Jun  6 19:06:43 2013
@@ -46,6 +46,15 @@ public:
     SBThread (const lldb::SBThread &thread);
 
    ~SBThread();
+    
+    static bool
+    EventIsThreadEvent (const SBEvent &event);
+    
+    static SBFrame
+    GetStackFrameFromEvent (const SBEvent &event);
+    
+    static SBThread
+    GetThreadFromEvent (const SBEvent &event);
 
     bool
     IsValid() const;
@@ -79,6 +88,7 @@ public:
     /// eStopReasonWatchpoint    1     watchpoint id
     /// eStopReasonSignal        1     unix signal number
     /// eStopReasonException     N     exception data
+    /// eStopReasonExec          0
     /// eStopReasonPlanComplete  0
     //--------------------------------------------------------------------------
     ") GetStopReasonDataAtIndex;
@@ -114,6 +124,9 @@ public:
     StepInto (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
 
     void
+    StepInto (const char *target_name, lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
+
+    void
     StepOut ();
 
     void
@@ -130,6 +143,9 @@ public:
     void
     RunToAddress (lldb::addr_t addr);
 
+    SBError
+    ReturnFromFrame (SBFrame &frame, SBValue &return_value);
+
     %feature("docstring", "
     //--------------------------------------------------------------------------
     /// LLDB currently supports process centric debugging which means when any
@@ -162,6 +178,9 @@ public:
     bool
     IsSuspended();
 
+    bool
+    IsStopped();
+
     uint32_t
     GetNumFrames ();
 
@@ -180,6 +199,15 @@ public:
     bool
     GetDescription (lldb::SBStream &description) const;
     
+    bool
+    GetStatus (lldb::SBStream &status) const;
+    
+    bool
+    operator == (const lldb::SBThread &rhs) const;
+
+    bool
+    operator != (const lldb::SBThread &rhs) const;
+             
     %pythoncode %{
         class frames_access(object):
             '''A helper object that will lazily hand out frames for a thread when supplied an index.'''
@@ -239,6 +267,9 @@ public:
 
         __swig_getmethods__["is_suspended"] = IsSuspended
         if _newclass: is_suspended = property(IsSuspended, None, doc='''A read only property that returns a boolean value that indicates if this thread is suspended.''')
+
+        __swig_getmethods__["is_stopped"] = IsStopped
+        if _newclass: is_stopped = property(IsStopped, None, doc='''A read only property that returns a boolean value that indicates if this thread is stopped but not exited.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i Thu Jun  6 19:06:43 2013
@@ -65,7 +65,7 @@ public:
     %}
 
 protected:
-    std::auto_ptr<lldb_private::TypeMemberImpl> m_opaque_ap;
+    std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_ap;
 };
 
 %feature("docstring",
@@ -153,7 +153,7 @@ public:
     bool
     IsValid();
 
-    size_t
+    uint64_t
     GetByteSize();
 
     bool
@@ -161,6 +161,9 @@ public:
 
     bool
     IsReferenceType();
+    
+    bool
+    IsFunctionType ();
 
     lldb::SBType
     GetPointerType();
@@ -178,6 +181,12 @@ public:
     GetUnqualifiedType();
     
     lldb::SBType
+    GetCanonicalType();
+
+    lldb::BasicType
+    GetBasicType();
+
+    lldb::SBType
     GetBasicType (lldb::BasicType type);
 
     uint32_t
@@ -213,6 +222,12 @@ public:
     lldb::TemplateArgumentKind
     GetTemplateArgumentKind (uint32_t idx);
     
+    lldb::SBType
+    GetFunctionReturnType ();
+    
+    lldb::SBTypeList
+    GetFunctionArgumentTypes ();
+
     bool
     IsTypeComplete ();
 
@@ -237,7 +252,10 @@ public:
         
         __swig_getmethods__["is_reference"] = IsReferenceType
         if _newclass: is_reference = property(IsReferenceType, None, doc='''A read only property that returns a boolean value that indicates if this type is a reference type.''')
-
+        
+        __swig_getmethods__["is_function"] = IsFunctionType
+        if _newclass: is_reference = property(IsReferenceType, None, doc='''A read only property that returns a boolean value that indicates if this type is a function type.''')
+        
         __swig_getmethods__["num_fields"] = GetNumberOfFields
         if _newclass: num_fields = property(GetNumberOfFields, None, doc='''A read only property that returns number of fields in this type as an integer.''')
         

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i Thu Jun  6 19:06:43 2013
@@ -55,6 +55,12 @@ namespace lldb {
         bool
         GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
         
+        bool
+        operator == (lldb::SBTypeFilter &rhs);
+        
+        bool
+        operator != (lldb::SBTypeFilter &rhs);
+        
         %pythoncode %{
             __swig_getmethods__["options"] = GetOptions
             __swig_setmethods__["options"] = SetOptions

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i Thu Jun  6 19:06:43 2013
@@ -46,7 +46,13 @@ namespace lldb {
         bool
         GetDescription (lldb::SBStream &description, 
                         lldb::DescriptionLevel description_level);
-                
+        
+        bool
+        operator == (lldb::SBTypeFormat &rhs);
+
+        bool
+        operator != (lldb::SBTypeFormat &rhs);
+        
         %pythoncode %{
             __swig_getmethods__["format"] = GetFormat
             __swig_setmethods__["format"] = SetFormat

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i Thu Jun  6 19:06:43 2013
@@ -46,7 +46,13 @@ namespace lldb {
         bool
         GetDescription (lldb::SBStream &description, 
                         lldb::DescriptionLevel description_level);
-                        
+        
+        bool
+        operator == (lldb::SBTypeNameSpecifier &rhs);
+
+        bool
+        operator != (lldb::SBTypeNameSpecifier &rhs);
+        
         %pythoncode %{
             __swig_getmethods__["name"] = GetName
             if _newclass: name = property(GetName, None)

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i Thu Jun  6 19:06:43 2013
@@ -69,6 +69,12 @@ namespace lldb {
         GetDescription (lldb::SBStream &description, 
                         lldb::DescriptionLevel description_level);
         
+        bool
+        operator == (lldb::SBTypeSummary &rhs);
+        
+        bool
+        operator != (lldb::SBTypeSummary &rhs);
+        
         %pythoncode %{
             __swig_getmethods__["options"] = GetOptions
             __swig_setmethods__["options"] = SetOptions

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i Thu Jun  6 19:06:43 2013
@@ -57,6 +57,12 @@ namespace lldb {
         GetDescription (lldb::SBStream &description, 
                         lldb::DescriptionLevel description_level);
         
+        bool
+        operator == (lldb::SBTypeSynthetic &rhs);
+
+        bool
+        operator != (lldb::SBTypeSynthetic &rhs);
+        
         %pythoncode %{
             __swig_getmethods__["options"] = GetOptions
             __swig_setmethods__["options"] = SetOptions

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i Thu Jun  6 19:06:43 2013
@@ -129,9 +129,24 @@ public:
     
     lldb::SBValue
     GetNonSyntheticValue ();
+
+    lldb::DynamicValueType
+    GetPreferDynamicValue ();
+    
+    void
+    SetPreferDynamicValue (lldb::DynamicValueType use_dynamic);
+    
+    bool
+    GetPreferSyntheticValue ();
+    
+    void
+    SetPreferSyntheticValue (bool use_synthetic);
     
     bool
     IsDynamic();
+    
+    bool
+    IsSynthetic ();
 
     const char *
     GetLocation ();
@@ -222,6 +237,9 @@ public:
 
     lldb::SBValue
     CreateValueFromExpression (const char *name, const char* expression);
+    
+    lldb::SBValue
+    CreateValueFromExpression (const char *name, const char* expression, SBExpressionOptions &options);
 
     lldb::SBValue
     CreateValueFromAddress(const char* name, lldb::addr_t address, lldb::SBType type);
@@ -281,6 +299,12 @@ public:
     lldb::SBValue
     GetValueForExpressionPath(const char* expr_path);
 
+    lldb::SBDeclaration
+    GetDeclaration ();
+    
+    bool
+    MightHaveChildren ();
+
     uint32_t
     GetNumChildren ();
 
@@ -369,6 +393,9 @@ public:
 	") GetData;
     lldb::SBData
     GetData ();
+             
+    bool
+    SetData (lldb::SBData &data, lldb::SBError& error);
 
 	lldb::addr_t
 	GetLoadAddress();

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBWatchpoint.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBWatchpoint.i?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBWatchpoint.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBWatchpoint.i Thu Jun  6 19:06:43 2013
@@ -84,6 +84,16 @@ public:
     
     bool
     GetDescription (lldb::SBStream &description, DescriptionLevel level);
+
+    static bool
+    EventIsWatchpointEvent (const lldb::SBEvent &event);
+    
+    static lldb::WatchpointEventType
+    GetWatchpointEventTypeFromEvent (const lldb::SBEvent& event);
+
+    static lldb::SBWatchpoint
+    GetWatchpointFromEvent (const lldb::SBEvent& event);
+
 };
 
 } // namespace lldb

Modified: lldb/branches/lldb-platform-work/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/modify-python-lldb.py?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/modify-python-lldb.py (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/modify-python-lldb.py Thu Jun  6 19:06:43 2013
@@ -386,7 +386,7 @@ for line in content.splitlines():
                 new_content.add_line(section_iter % d[cls+'-section'])
                 new_content.add_line(compile_unit_iter % d[cls+'-compile-unit'])
                 new_content.add_line(d[cls+'-symbol-in-section'])
-            
+
             # This special purpose iterator is for SBValue only!!!
             if cls == "SBValue":
                 new_content.add_line(linked_list_iter_def)
@@ -433,5 +433,11 @@ new_content.finish()
 
 with open(output_name, 'w') as f_out:
     f_out.write(new_content.getvalue())
-    f_out.write("debugger_unique_id = 0\n")
-    f_out.write("SBDebugger.Initialize()\n")
+    f_out.write('''debugger_unique_id = 0
+SBDebugger.Initialize()
+debugger = None
+target = SBTarget()
+process = SBProcess()
+thread = SBThread()
+frame = SBFrame()''')
+

Modified: lldb/branches/lldb-platform-work/scripts/Python/python-extensions.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/python-extensions.swig?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/python-extensions.swig (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/python-extensions.swig Thu Jun  6 19:06:43 2013
@@ -25,7 +25,6 @@
                     return PyString_FromStringAndSize (desc, desc_len);
                 else
                     return PyString_FromString("");
-
         }
 }
 %extend lldb::SBBreakpoint {
@@ -41,6 +40,21 @@
                 else
                     return PyString_FromString("");
         }
+        
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
+
 }
 %extend lldb::SBBreakpointLocation {
         PyObject *lldb::SBBreakpointLocation::__str__ (){
@@ -56,6 +70,23 @@
                     return PyString_FromString("");
         }
 }
+
+%extend lldb::SBBroadcaster {
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
+}
+
 %extend lldb::SBCommandReturnObject {
         PyObject *lldb::SBCommandReturnObject::__str__ (){
                 lldb::SBStream description;
@@ -69,6 +100,19 @@
                 else
                     return PyString_FromString("");
         }
+        
+        /* the write() and flush() calls are not part of the SB API proper, and are solely for Python usage
+        they are meant to make an SBCommandReturnObject into a file-like object so that instructions of the sort
+        print >>sb_command_return_object, "something"
+        will work correctly */
+
+        void lldb::SBCommandReturnObject::write (const char* str)
+        {
+            if (str)
+                $self->Printf("%s",str);
+        }
+        void lldb::SBCommandReturnObject::flush ()
+        {}
 }
 %extend lldb::SBCompileUnit {
         PyObject *lldb::SBCompileUnit::__str__ (){
@@ -83,6 +127,19 @@
                 else
                     return PyString_FromString("");
         }
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBData {
         PyObject *lldb::SBData::__str__ (){
@@ -112,6 +169,35 @@
                     return PyString_FromString("");
         }
 }
+%extend lldb::SBDeclaration {
+        PyObject *lldb::SBDeclaration::__str__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description);
+                const char *desc = description.GetData();
+                size_t desc_len = description.GetSize();
+                if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+                    --desc_len;
+                if (desc_len > 0)
+                    return PyString_FromStringAndSize (desc, desc_len);
+                else
+                    return PyString_FromString("");
+        }
+        
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
+
+}
 %extend lldb::SBError {
         PyObject *lldb::SBError::__str__ (){
                 lldb::SBStream description;
@@ -167,6 +253,21 @@
                 else
                     return PyString_FromString("");
         }
+        
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
+
 }
 %extend lldb::SBInstruction {
         PyObject *lldb::SBInstruction::__str__ (){
@@ -209,6 +310,20 @@
                 else
                     return PyString_FromString("");
         }
+        
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBModule {
         PyObject *lldb::SBModule::__str__ (){
@@ -223,6 +338,20 @@
                 else
                     return PyString_FromString("");
         }
+        
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBProcess {
         PyObject *lldb::SBProcess::__str__ (){
@@ -251,6 +380,34 @@
                 else
                     return PyString_FromString("");
         }
+        
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
+}
+%extend lldb::SBStream {
+        /* the write() and flush() calls are not part of the SB API proper, and are solely for Python usage
+        they are meant to make an SBStream into a file-like object so that instructions of the sort
+        print >>sb_stream, "something"
+        will work correctly */
+
+        void lldb::SBStream::write (const char* str)
+        {
+            if (str)
+                $self->Printf("%s",str);
+        }
+        void lldb::SBStream::flush ()
+        {}
 }
 %extend lldb::SBSymbol {
         PyObject *lldb::SBSymbol::__str__ (){
@@ -265,6 +422,19 @@
                 else
                     return PyString_FromString("");
         }
+    %pythoncode %{
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBSymbolContext {
         PyObject *lldb::SBSymbolContext::__str__ (){
@@ -294,6 +464,7 @@
                     return PyString_FromString("");
         }
 }
+
 %extend lldb::SBTarget {
         PyObject *lldb::SBTarget::__str__ (){
                 lldb::SBStream description;
@@ -307,7 +478,22 @@
                 else
                     return PyString_FromString("");
         }
+
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
+
 %extend lldb::SBType {
         PyObject *lldb::SBType::__str__ (){
                 lldb::SBStream description;
@@ -349,6 +535,19 @@
                 else
                     return PyString_FromString("");
         }
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBTypeFormat {
         PyObject *lldb::SBTypeFormat::__str__ (){
@@ -391,6 +590,19 @@
                 else
                     return PyString_FromString("");
         }
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBTypeSummary {
         PyObject *lldb::SBTypeSummary::__str__ (){
@@ -405,6 +617,19 @@
                 else
                     return PyString_FromString("");
         }
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBTypeSynthetic {
         PyObject *lldb::SBTypeSynthetic::__str__ (){
@@ -419,6 +644,19 @@
                 else
                     return PyString_FromString("");
         }
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBThread {
         PyObject *lldb::SBThread::__str__ (){
@@ -433,6 +671,19 @@
                 else
                     return PyString_FromString("");
         }
+    %pythoncode %{ 
+        def __eq__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return False 
+            
+            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
+            
+        def __ne__(self, rhs):
+            if not isinstance(rhs, type(self)): 
+                return True 
+            
+            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
+    %}
 }
 %extend lldb::SBValue {
         PyObject *lldb::SBValue::__str__ (){
@@ -449,7 +700,7 @@
         }
 }
 %extend lldb::SBValueList {
-        PyObject *lldb::SBValueList::__repr__ (){
+        PyObject *lldb::SBValueList::__str__ (){
                 lldb::SBStream description;
                 const size_t n = $self->GetSize();
                 if (n)
@@ -467,7 +718,8 @@
                     --desc_len;
                 if (desc_len > 0)
                     return PyString_FromStringAndSize (desc, desc_len);
-                return Py_None;
+                else
+                    return PyString_FromString("");
         }
 }
 %extend lldb::SBWatchpoint {
@@ -485,6 +737,25 @@
         }
 }
 
+
+// %extend lldb::SBDebugger {
+//         // FIXME: We can't get the callback and baton
+//         PyObject *lldb::SBDebugger (){
+//             // Only call Py_XDECREF if we have a Python object (or NULL)
+//             if (LLDBSwigPythonCallPythonLogOutputCallback == $self->GetLogOutPutCallback())
+//                 Py_XDECREF($self->GetCallbackBaton());
+//         }
+// }
+// %extend lldb::SBInputReader {
+//         // FIXME: m_callback_function is private and we have no other
+//         // way to access it.
+//         PyObject *lldb::SBInputReader::__del__ (){
+//             // Only call Py_XDECREF if we have a Python object (or NULL)
+//             if (LLDBSwigPythonCallSBInputReaderCallback == $self->m_callback_function)
+//                 Py_XDECREF($self->m_callback_baton);
+//         }
+// }
+
 %pythoncode %{
 
 class declaration(object):
@@ -494,6 +765,24 @@ class declaration(object):
         self.line = line
         self.col = col
 
+class value_iter(object):
+    def __iter__(self):
+        return self
+    
+    def next(self):
+        if self.index >= self.length:
+            raise StopIteration()
+        child_sbvalue = self.sbvalue.GetChildAtIndex(self.index)
+        self.index += 1
+        return value(child_sbvalue)
+        
+    def __init__(self,value):
+        self.index = 0
+        self.sbvalue = value
+        if type(self.sbvalue) is value:
+            self.sbvalue = self.sbvalue.sbvalue
+        self.length = self.sbvalue.GetNumChildren()
+
 class value(object):
     '''A class designed to wrap lldb.SBValue() objects so the resulting object
     can be used as a variable would be in code. So if you have a Point structure
@@ -519,15 +808,23 @@ class value(object):
 
     def __getitem__(self, key):
         # Allow array access if this value has children...
+        if type(key) is value:
+            key = int(key)
         if type(key) is int:
-            return value(self.sbvalue.GetValueForExpressionPath("[%i]" % key))
-        raise TypeError
+            child_sbvalue = (self.sbvalue.GetValueForExpressionPath("[%i]" % key))
+            if child_sbvalue and child_sbvalue.IsValid():
+                return value(child_sbvalue)
+            raise IndexError("Index '%d' is out of range" % key)
+        raise TypeError("No array item of type %s" % str(type(key)))
+
+    def __iter__(self):
+        return value_iter(self.sbvalue)
 
     def __getattr__(self, name):
         child_sbvalue = self.sbvalue.GetChildMemberWithName (name)
-        if child_sbvalue:
+        if child_sbvalue and child_sbvalue.IsValid():
             return value(child_sbvalue)
-        raise AttributeError
+        raise AttributeError("Attribute '%s' is not defined" % name)
 
     def __add__(self, other):
         return int(self) + int(other)
@@ -671,10 +968,26 @@ class value(object):
     def __hex__(self):
         return '0x%x' % self.sbvalue.GetValueAsUnsigned()
 
+    def __len__(self):
+        return self.sbvalue.GetNumChildren()
+
     def __eq__(self, other):
-        return self.sbvalue.GetValueAsUnsigned() == self.sbvalue.GetValueAsUnsigned()
-                                                                    
+        if type(other) is int:
+                return int(self) == other
+        elif type(other) is str:
+                return str(self) == other
+        elif type(other) is value:
+                self_err = SBError()
+                other_err = SBError()
+                self_val = self.sbvalue.GetValueAsUnsigned(self_err)
+                if self_err.fail:
+                        raise ValueError("unable to extract value of self")
+                other_val = other.sbvalue.GetValueAsUnsigned(other_err)
+                if other_err.fail:
+                        raise ValueError("unable to extract value of other")
+                return self_val == other_val
+        raise TypeError("Unknown type %s, No equality operation defined." % str(type(other)))
+
     def __neq__(self, other):
         return not self.__eq__(other)
 %}
-

Modified: lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig Thu Jun  6 19:06:43 2013
@@ -113,6 +113,22 @@
    }
 }
 
+// For SBDebugger::DispatchInput
+%typemap(in) (const void *data, size_t data_len) {
+   if (PyString_Check($input)) {
+      $1 = static_cast<void *>(PyString_AsString($input));
+      $2 = PyString_Size($input);
+   }
+   else if(PyByteArray_Check($input)) {
+      $1 = static_cast<void *>(PyByteArray_AsString($input));
+      $2 = PyByteArray_Size($input);
+   }
+   else {
+      PyErr_SetString(PyExc_ValueError, "Expecting a string or byte array");
+      return NULL;
+   }
+}
+
 // typemap for an incoming buffer
 // See also SBProcess::ReadMemory.
 %typemap(in) (void *buf, size_t size) {
@@ -162,6 +178,7 @@
     }
   } else if ($input == Py_None) {
     $1 =  NULL;
+    $2 = 0;
   } else {
     PyErr_SetString(PyExc_TypeError,"not a list");
     return NULL;
@@ -192,6 +209,7 @@
     }
   } else if ($input == Py_None) {
     $1 =  NULL;
+    $2 = 0;
   } else {
     PyErr_SetString(PyExc_TypeError,"not a list");
     return NULL;
@@ -222,6 +240,7 @@
     }
   } else if ($input == Py_None) {
     $1 =  NULL;
+    $2 = 0;
   } else {
     PyErr_SetString(PyExc_TypeError,"not a list");
     return NULL;
@@ -252,6 +271,7 @@
     }
   } else if ($input == Py_None) {
     $1 =  NULL;
+    $2 = 0;
   } else {
     PyErr_SetString(PyExc_TypeError,"not a list");
     return NULL;
@@ -282,6 +302,7 @@
     }
   } else if ($input == Py_None) {
     $1 =  NULL;
+    $2 = 0;
   } else {
     PyErr_SetString(PyExc_TypeError,"not a list");
     return NULL;
@@ -333,3 +354,114 @@
 %typemap(freearg) (uint32_t *versions) {
     free($1);
 }
+
+// For lldb::SBInputReader::Callback
+%typemap(in) (lldb::SBInputReader::Callback callback, void *callback_baton) {
+  if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) {
+    PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
+    return NULL;
+  }
+
+  // FIXME (filcab): We can't currently check if our callback is already
+  // LLDBSwigPythonCallPythonLogOutputCallback (to DECREF the previous
+  // baton) nor can we just remove all traces of a callback, if we want to
+  // revert to a file logging mechanism.
+
+  // Don't lose the callback reference
+  Py_INCREF($input);
+  $1 = LLDBSwigPythonCallSBInputReaderCallback;
+  $2 = $input;
+}
+
+%typemap(typecheck) (lldb::SBInputReader::Callback callback, void *baton) {
+  $1 = $input == Py_None;
+  $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input));
+}
+
+// For Log::LogOutputCallback
+%typemap(in) (lldb::LogOutputCallback log_callback, void *baton) {
+  if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) {
+    PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
+    return NULL;
+  }
+
+  // FIXME (filcab): We can't currently check if our callback is already
+  // LLDBSwigPythonCallPythonLogOutputCallback (to DECREF the previous
+  // baton) nor can we just remove all traces of a callback, if we want to
+  // revert to a file logging mechanism.
+
+  // Don't lose the callback reference
+  Py_INCREF($input);
+  $1 = LLDBSwigPythonCallPythonLogOutputCallback;
+  $2 = $input;
+}
+
+%typemap(typecheck) (lldb::LogOutputCallback log_callback, void *baton) {
+  $1 = $input == Py_None;
+  $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input));
+}
+
+%typemap(in) FILE * {
+   if ($input == Py_None)
+      $1 = NULL;
+   else if (!PyFile_Check($input)) {
+      int fd = PyObject_AsFileDescriptor($input);
+      PyObject *py_mode = PyObject_GetAttrString($input, "mode");
+      if (!py_mode) {
+         PyErr_SetString(PyExc_TypeError,"not a file-like object");
+         return NULL;
+      }
+      const char *mode = PyString_AsString(py_mode);
+      if (-1 != fd && mode) {
+         FILE *f;
+         if ((f = fdopen(fd, mode)))
+            $1 = f;
+         else
+            PyErr_SetString(PyExc_TypeError, strerror(errno));
+      } else {
+         PyErr_SetString(PyExc_TypeError,"not a file-like object");
+         return NULL;
+      }
+   }
+   else
+      $1 = PyFile_AsFile($input);
+}
+
+%typemap(out) FILE * {
+   char mode[4] = {0};
+#ifdef __MACOSX__
+   int i = 0;
+   short flags = $1->_flags;
+
+   if (flags & __SRD)
+      mode[i++] = 'r';
+   else if (flags & __SWR)
+      mode[i++] = 'w';
+   else // if (flags & __SRW)
+      mode[i++] = 'a';
+#endif
+   $result = PyFile_FromFile($1, const_cast<char*>(""), mode, fclose);
+}
+
+%typemap(in) (const char* string, int len) {
+    if ($input == Py_None)
+    {
+        $1 = NULL;
+        $2 = 0;
+    }
+    else if (PyUnicode_Check($input))
+    {
+        $1 = PyString_AsString(PyUnicode_AsUTF8String($input));
+        $2 = strlen($1);
+    }
+    else if (PyString_Check($input))
+    {
+        $1 = PyString_AsString($input);
+        $2 = PyString_Size($input);
+    }
+    else
+    {
+        PyErr_SetString(PyExc_TypeError,"not a string-like object");
+        return NULL;
+    }
+}

Modified: lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig Thu Jun  6 19:06:43 2013
@@ -151,6 +151,10 @@ LLDBSwigPythonBreakpointCallbackFunction
                 
                 if (pvalue != NULL)
                 {
+                    // be very conservative here and only refuse to stop if the user
+                    // actually returned False - anything else, just stop
+                    if (pvalue == Py_False)
+                        stop_at_breakpoint = false;
                     Py_DECREF (pvalue);
                 }
                 else if (PyErr_Occurred ())
@@ -267,6 +271,8 @@ LLDBSwigPythonCallTypeScript
 {
     lldb::SBValue sb_value (valobj_sp);
 
+    retval.clear();
+
     PyObject *ValObj_PyObj = SWIG_NewPointerObj((void *) &sb_value, SWIGTYPE_p_lldb__SBValue, 0);
     
     if (ValObj_PyObj == NULL)
@@ -312,8 +318,18 @@ LLDBSwigPythonCallTypeScript
         pvalue = PyObject_CallObject (pfunc, pargs);
         Py_DECREF (pargs);
         
-        if (pvalue != NULL && pvalue != Py_None && PyString_Check(pvalue))
-            retval.assign(PyString_AsString(pvalue));
+        if (pvalue != NULL && pvalue != Py_None)
+        {
+            if (PyString_Check(pvalue))
+                retval.assign(PyString_AsString(pvalue));
+            else
+            {
+                PyObject* value_as_string = PyObject_Str(pvalue);
+                if (value_as_string && value_as_string != Py_None && PyString_Check(value_as_string))
+                    retval.assign(PyString_AsString(value_as_string));
+                Py_XDECREF(value_as_string);
+            }
+        }
         Py_XDECREF (pvalue);
         Py_INCREF (session_dict);
     }
@@ -323,26 +339,27 @@ LLDBSwigPythonCallTypeScript
 SWIGEXPORT void*
 LLDBSwigPythonCreateSyntheticProvider 
 (
-    const std::string python_class_name,
+    const char *python_class_name,
     const char *session_dictionary_name,
     const lldb::ValueObjectSP& valobj_sp
 )
 {
     PyObject* retval = NULL;
 
-    if (python_class_name.empty() || !session_dictionary_name)
+    if (python_class_name == NULL || python_class_name[0] == '\0' || !session_dictionary_name)
         Py_RETURN_NONE;
 
     // I do not want the SBValue to be deallocated when going out of scope because python
     // has ownership of it and will manage memory for this object by itself
     lldb::SBValue *valobj_sb = new lldb::SBValue(valobj_sp);
+    valobj_sb->SetPreferSyntheticValue(false);
 
     PyObject *ValObj_PyObj = SWIG_NewPointerObj((void *)valobj_sb, SWIGTYPE_p_lldb__SBValue, 0);
 
     if (ValObj_PyObj == NULL)
         Py_RETURN_NONE;
 
-    const char* python_function_name = python_class_name.c_str();
+    const char* python_function_name = python_class_name;
 
     PyObject *session_dict, *pfunc;
     PyObject *pvalue;
@@ -417,46 +434,104 @@ LLDBSwigPythonCreateSyntheticProvider
         Py_RETURN_NONE;
 }
 
-/*
-these four calls below are meant to support
-Python-based synthetic children providers
-they essentially mimic the four pure virtual
-method calls provided by the frontend class
-*/
-
-SWIGEXPORT uint32_t
-LLDBSwigPython_CalculateNumChildren
+// wrapper that calls an optional instance member of an object taking no arguments
+static PyObject*
+LLDBSwigPython_CallOptionalMember
 (
-    PyObject *implementor
+    PyObject* self,
+    char* callee_name,
+    PyObject* ret_if_not_found = Py_None,
+    bool* was_found = NULL
 )
 {
+    if (self == NULL || self == Py_None)
+    {
+        if (was_found)
+            *was_found = false;
+        Py_XINCREF(ret_if_not_found);
+        return ret_if_not_found;
+    }
 
-    static char callee_name[] = "num_children";
+    PyObject* pmeth  = PyObject_GetAttrString(self, callee_name);
 
-    if (implementor == NULL || implementor == Py_None)
-        return 0;
-    PyObject* py_return = PyObject_CallMethod(implementor, callee_name, NULL);
     if (PyErr_Occurred())
     {
-        PyErr_Print();
         PyErr_Clear();
     }
 
-    if (py_return == NULL || py_return == Py_None)
+    if (pmeth == NULL || pmeth == Py_None)
     {
-        Py_XDECREF(py_return);
-        return UINT32_MAX;
+        if (was_found)
+            *was_found = false;
+        Py_XDECREF(pmeth);
+        Py_XINCREF(ret_if_not_found);
+        return ret_if_not_found;
     }
-    long retval = PyInt_AsLong(py_return);
-    Py_DECREF(py_return);
-    if (retval >= 0)
-        return (uint32_t)retval;
+
+    if (PyCallable_Check(pmeth) == 0)
+    {
+        if (PyErr_Occurred())
+        {
+            PyErr_Clear();
+        }
+
+        Py_XDECREF(pmeth);
+        if (was_found)
+            *was_found = false;
+        Py_XINCREF(ret_if_not_found);
+        return ret_if_not_found;
+    }
+
+    if (was_found)
+        *was_found = true;
+
+    if (PyErr_Occurred())
+    {
+        PyErr_Clear();
+    }
+
+    Py_XDECREF(pmeth);
+
+    // right now we know this function exists and is callable..
+    PyObject* py_return = PyObject_CallMethod(self, callee_name, NULL);
+    
+    // if it fails, print the error but otherwise go on
     if (PyErr_Occurred())
     {
         PyErr_Print();
         PyErr_Clear();
     }
-    return 0;
+    
+    return py_return;
+}
+
+SWIGEXPORT uint32_t
+LLDBSwigPython_CalculateNumChildren
+(
+    PyObject *implementor
+)
+{
+    uint32_t ret_val = UINT32_MAX;
+
+    static char callee_name[] = "num_children";
+
+    PyObject* py_return = LLDBSwigPython_CallOptionalMember(implementor,callee_name, NULL);
+
+    if (!py_return)
+        return ret_val;
+
+    if (PyInt_Check(py_return))
+        ret_val = PyInt_AsLong(py_return);
+
+    Py_XDECREF(py_return);
+    
+    if (PyErr_Occurred())
+    {
+        PyErr_Print();
+        PyErr_Clear();
+    }
+    
+    return ret_val;
 }
 
 SWIGEXPORT PyObject*
@@ -541,64 +616,38 @@ LLDBSwigPython_UpdateSynthProviderInstan
     PyObject *implementor
 )
 {
-
     bool ret_val = false;
 
     static char callee_name[] = "update";
 
-    if (implementor == NULL || implementor == Py_None)
-        return ret_val;
-
-    // all this code is here because update is optional, so we don't want to bother trying to call it unless it's been def:ined for us
-    // other synth provider calls are mandatory, so we want to fail in a very obvious way if they are missing!
-    PyObject* pmeth  = PyObject_GetAttrString(implementor, callee_name);
-
-    if (PyErr_Occurred())
-    {
-        PyErr_Clear();
-    }
+    PyObject* py_return = LLDBSwigPython_CallOptionalMember(implementor,callee_name);
 
-    if (pmeth == NULL || pmeth == Py_None)
-    {
-        Py_XDECREF(pmeth);
-        return ret_val;
-    }
+    if (py_return == Py_True)
+        ret_val = true;
 
-    if (PyCallable_Check(pmeth) == 0)
-    {
-        if (PyErr_Occurred())
-        {
-            PyErr_Clear();
-        }
+    Py_XDECREF(py_return);
+    
+    return ret_val;
+}
 
-        Py_XDECREF(pmeth);
-        return ret_val;
-    }
+SWIGEXPORT bool
+LLDBSwigPython_MightHaveChildrenSynthProviderInstance
+(
+    PyObject *implementor
+)
+{
+    bool ret_val = false;
 
-    if (PyErr_Occurred())
-    {
-        PyErr_Clear();
-    }
+    static char callee_name[] = "has_children";
 
-    Py_XDECREF(pmeth);
+    PyObject* py_return = LLDBSwigPython_CallOptionalMember(implementor,callee_name, Py_True);
 
-    // right now we know this function exists and is callable..
-    PyObject* py_return = PyObject_CallMethod(implementor, callee_name, NULL);
-    
-    // if it fails, print the error but otherwise go on
-    if (PyErr_Occurred())
-    {
-        PyErr_Print();
-        PyErr_Clear();
-    }
-    
     if (py_return == Py_True)
         ret_val = true;
 
     Py_XDECREF(py_return);
     
     return ret_val;
-
 }
 
 SWIGEXPORT void*
@@ -617,11 +666,11 @@ LLDBSWIGPython_CastPyObjectToSBValue
     return sb_ptr;
 }
 
-// Currently, SBCommandReturnObjectReleaser wraps an std::auto_ptr to an
+// Currently, SBCommandReturnObjectReleaser wraps a unique pointer to an
 // lldb_private::CommandReturnObject. This means that the destructor for the
 // SB object will deallocate its contained CommandReturnObject. Because that
 // object is used as the real return object for Python-based commands, we want
-// it to stay around. Thus, we release the auto_ptr before returning from
+// it to stay around. Thus, we release the unique pointer before returning from
 // LLDBSwigPythonCallCommand, and to guarantee that the release will occur no
 // matter how we exit from the function, we have a releaser object whose
 // destructor does the right thing for us
@@ -742,10 +791,107 @@ LLDBSwigPythonCallCommand
     return retval;
 }
 
+SWIGEXPORT void*
+LLDBSWIGPythonCreateOSPlugin
+(
+    const char *python_class_name,
+    const char *session_dictionary_name,
+    const lldb::ProcessSP& process_sp
+)
+{
+    PyObject* retval = NULL;
+
+    if (python_class_name == NULL || python_class_name[0] == '\0' || !session_dictionary_name)
+        Py_RETURN_NONE;
+
+    // I do not want the SBValue to be deallocated when going out of scope because python
+    // has ownership of it and will manage memory for this object by itself
+    lldb::SBProcess *process_sb = new lldb::SBProcess(process_sp);
+
+    PyObject *SBProc_PyObj = SWIG_NewPointerObj((void *)process_sb, SWIGTYPE_p_lldb__SBProcess, 0);
+
+    if (SBProc_PyObj == NULL)
+        Py_RETURN_NONE;
+
+    const char* python_function_name = python_class_name;
+
+    PyObject *session_dict, *pfunc;
+    PyObject *pvalue;
+    
+    session_dict = FindSessionDictionary (session_dictionary_name);
+    if (session_dict != NULL)
+    {
+        pfunc = ResolvePythonName (python_function_name, session_dict);
+        if (pfunc != NULL)
+        {
+            // Set up the arguments and call the function.
+                
+            if (PyCallable_Check (pfunc))
+            {
+                PyObject *argList = Py_BuildValue("(O)", SBProc_PyObj);
+
+                if (PyErr_Occurred ())
+                {
+                    PyErr_Print();
+                    PyErr_Clear();
+                    return retval;
+                }
+
+                if (argList == NULL)
+                {
+                    return retval;
+                }
+
+                Py_INCREF(SBProc_PyObj);
+
+                pvalue = PyObject_CallObject(pfunc, argList);
+
+                Py_DECREF(argList);
+
+                if (pvalue != NULL)
+                {
+                    if (pvalue != Py_None)
+                        retval = pvalue;
+                    else
+                    {
+                        retval = Py_None;
+                        Py_INCREF(retval);
+                    }
+                }
+                else if (PyErr_Occurred ())
+                {
+                    PyErr_Print();
+                    PyErr_Clear();
+                }
+                Py_INCREF (session_dict);
+            }
+            else if (PyErr_Occurred())
+            {
+                PyErr_Print();
+                PyErr_Clear();
+            }
+        }
+        else if (PyErr_Occurred())
+        {
+            PyErr_Print();
+            PyErr_Clear();
+        }
+    }
+    else if (PyErr_Occurred ())
+    {
+        PyErr_Print();
+        PyErr_Clear ();
+    }
+    if (retval)
+        return retval;
+    else
+        Py_RETURN_NONE;
+}
+
 SWIGEXPORT bool
 LLDBSwigPythonCallModuleInit 
 (
-    const std::string python_module_name,
+    const char *python_module_name,
     const char *session_dictionary_name,
     lldb::DebuggerSP& debugger
 )
@@ -760,7 +906,7 @@ LLDBSwigPythonCallModuleInit
     if (DebuggerObj_PyObj == NULL)
         return retval;
         
-    if (!(python_module_name.length()) || !session_dictionary_name)
+    if (python_module_name == NULL || python_module_name[0] == '\0' || !session_dictionary_name)
         return retval;
 
     PyObject *session_dict, *pfunc;
@@ -768,7 +914,8 @@ LLDBSwigPythonCallModuleInit
     
     session_dict = FindSessionDictionary (session_dictionary_name);
     
-    std::string python_function_name_string = python_module_name + (".__lldb_init_module");
+    std::string python_function_name_string = python_module_name;
+    python_function_name_string += ".__lldb_init_module";
     const char* python_function_name = python_function_name_string.c_str();
     
     if (session_dict != NULL)
@@ -823,5 +970,97 @@ LLDBSwigPythonCallModuleInit
     }
     return retval;
 }
+%}
+
+
+%runtime %{
+// Forward declaration to be inserted at the start of LLDBWrapPython.h
+// I used runtime as a hack to make SWIG place it where it's needed.
+// This is needed to use LLDBSwigPythonCallSBInputReaderCallback in the
+// typemaps and in the extensions (SBInputReader.__del__()).
+#include "lldb/API/SBInputReader.h"
+#include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBValue.h"
+ 
+SWIGEXPORT lldb::ValueObjectSP
+LLDBSWIGPython_GetValueObjectSPFromSBValue (void* data)
+{
+    lldb::ValueObjectSP valobj_sp;
+    if (data)
+    {
+        lldb::SBValue* sb_ptr = (lldb::SBValue *)data;
+        valobj_sp = sb_ptr->GetSP();
+    }
+    return valobj_sp;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+size_t
+LLDBSwigPythonCallSBInputReaderCallback(void *baton,
+                                        lldb::SBInputReader *reader,
+                                        lldb::InputReaderAction notification,
+                                        const char*bytes,
+                                        size_t bytes_len);
+
+void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton);
+
+#ifdef __cplusplus
+}
+#endif
+%}
+
+%wrapper %{
+// For the InputReader Callback functions
+SWIGEXPORT size_t
+LLDBSwigPythonCallSBInputReaderCallback(void *baton,
+                                        lldb::SBInputReader *reader,
+                                        lldb::InputReaderAction notification,
+                                        const char*bytes,
+                                        size_t bytes_len) {
+    if (baton != Py_None) {
+        SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+    
+        PyObject *py_InputReader = SWIG_NewPointerObj(reader, SWIGTYPE_p_lldb__SBInputReader, false);
+        PyObject *py_Notification = PyInt_FromLong(notification);
+        PyObject *py_Bytes = PyBytes_FromStringAndSize(bytes, bytes_len);
+    
+        PyObject *tuple = PyTuple_Pack(3, py_InputReader, py_Notification, py_Bytes);
+        PyObject *res = PyObject_Call(reinterpret_cast<PyObject*>(baton), tuple, NULL);
+        Py_DECREF(tuple);
+        Py_DECREF(py_InputReader);
+        Py_DECREF(py_Notification);
+        Py_DECREF(py_Bytes);
+    
+        if (res == NULL) {
+          PyObject *exc = PyErr_Occurred();
+          if (exc) {
+            ::puts("\nErroring out at LLDBSwigPythonCallSBInputReaderCallback");
+            PyErr_Print();
+          }
+          return 0;
+        }
+    
+        size_t result = 0;
+        // If the callback misbehaves and returns Py_None, assume it returned 0
+        if (res != Py_None)
+          result = static_cast<size_t>(PyInt_AsSsize_t(res));
+    
+        Py_DECREF(res);
+        SWIG_PYTHON_THREAD_END_BLOCK;
+        return result;
+    }
+    return 0;
+}
 
+// For the LogOutputCallback functions
+void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton) {
+    if (baton != Py_None) {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      PyObject_CallFunction(reinterpret_cast<PyObject*>(baton), const_cast<char*>("s"), str);
+      SWIG_PYTHON_THREAD_END_BLOCK;
+    }
+}
 %}

Modified: lldb/branches/lldb-platform-work/scripts/build-llvm.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/build-llvm.pl?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/build-llvm.pl (original)
+++ lldb/branches/lldb-platform-work/scripts/build-llvm.pl Thu Jun  6 19:06:43 2013
@@ -21,88 +21,85 @@ our ($llvm_clang_basename, $llvm_clang_d
 
 our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
 
-our $llvm_revision = "152265";
-our $clang_revision = "152265";
+our $llvm_revision = "HEAD";
+our $clang_revision = "HEAD";
 
 our $SRCROOT = "$ENV{SRCROOT}";
-our $llvm_dstroot_zip = "$SRCROOT/llvm.zip";
 our @archs = split (/\s+/, $ENV{ARCHS});
 my $os_release = 11;
 
 my $original_env_path = $ENV{PATH};
 
 our %llvm_config_info = (
- 'Debug'         => { configure_options => '--disable-optimized --disable-assertions --enable-libcpp', make_options => 'DEBUG_SYMBOLS=1'},
- 'Debug+Asserts' => { configure_options => '--disable-optimized --enable-assertions --enable-libcpp' , make_options => 'DEBUG_SYMBOLS=1'},
- 'Release'       => { configure_options => '--enable-optimized --disable-assertions --enable-libcpp' , make_options => ''},
- 'Release+Debug' => { configure_options => '--enable-optimized --disable-assertions --enable-libcpp' , make_options => 'DEBUG_SYMBOLS=1'},
+    'Debug'         => { configure_options => '--disable-optimized --disable-assertions --enable-libcpp', make_options => 'DEBUG_SYMBOLS=1'},
+    'Debug+Asserts' => { configure_options => '--disable-optimized --enable-assertions --enable-libcpp' , make_options => 'DEBUG_SYMBOLS=1'},
+    'Release'       => { configure_options => '--enable-optimized --disable-assertions --enable-libcpp' , make_options => ''},
+    'Release+Debug' => { configure_options => '--enable-optimized --disable-assertions --enable-libcpp' , make_options => 'DEBUG_SYMBOLS=1'},
+    'Release+Asserts' => { configure_options => '--enable-optimized --enable-assertions --enable-libcpp' , make_options => ''},
 );
 
 our $llvm_config_href = undef;
 if (exists $llvm_config_info{"$llvm_configuration"})
 {
-	$llvm_config_href = $llvm_config_info{$llvm_configuration};
+    $llvm_config_href = $llvm_config_info{$llvm_configuration};
 }
 else
 {
-	die "Unsupported LLVM configuration: '$llvm_configuration'\n";
+    die "Unsupported LLVM configuration: '$llvm_configuration'\n";
 }
 
-our @archive_files = (  
+our @archive_files = (
     "$llvm_configuration/lib/libclang.a",
-	"$llvm_configuration/lib/libclangAnalysis.a",
-	"$llvm_configuration/lib/libclangAST.a",
-	"$llvm_configuration/lib/libclangBasic.a",
-	"$llvm_configuration/lib/libclangCodeGen.a",
+    "$llvm_configuration/lib/libclangAnalysis.a",
+    "$llvm_configuration/lib/libclangAST.a",
+    "$llvm_configuration/lib/libclangBasic.a",
+    "$llvm_configuration/lib/libclangCodeGen.a",
     "$llvm_configuration/lib/libclangEdit.a",
-	"$llvm_configuration/lib/libclangFrontend.a",
-	"$llvm_configuration/lib/libclangDriver.a",
-	"$llvm_configuration/lib/libclangIndex.a",
-	"$llvm_configuration/lib/libclangLex.a",
-	"$llvm_configuration/lib/libclangRewrite.a",
-	"$llvm_configuration/lib/libclangParse.a",
-	"$llvm_configuration/lib/libclangSema.a",
+    "$llvm_configuration/lib/libclangFrontend.a",
+    "$llvm_configuration/lib/libclangDriver.a",
+    "$llvm_configuration/lib/libclangLex.a",
+    "$llvm_configuration/lib/libclangParse.a",
+    "$llvm_configuration/lib/libclangSema.a",
     "$llvm_configuration/lib/libclangSerialization.a",
-	"$llvm_configuration/lib/libEnhancedDisassembly.a",
-	"$llvm_configuration/lib/libLLVMAnalysis.a",
-	"$llvm_configuration/lib/libLLVMArchive.a",
-	"$llvm_configuration/lib/libLLVMARMAsmParser.a",
-	"$llvm_configuration/lib/libLLVMARMAsmPrinter.a",
-	"$llvm_configuration/lib/libLLVMARMCodeGen.a",
+    "$llvm_configuration/lib/libLLVMAnalysis.a",
+    "$llvm_configuration/lib/libLLVMArchive.a",
+    "$llvm_configuration/lib/libLLVMARMAsmParser.a",
+    "$llvm_configuration/lib/libLLVMARMAsmPrinter.a",
+    "$llvm_configuration/lib/libLLVMARMCodeGen.a",
     "$llvm_configuration/lib/libLLVMARMDesc.a",
-	"$llvm_configuration/lib/libLLVMARMDisassembler.a",
-	"$llvm_configuration/lib/libLLVMARMInfo.a",
-	"$llvm_configuration/lib/libLLVMAsmParser.a",
-	"$llvm_configuration/lib/libLLVMAsmPrinter.a",
-	"$llvm_configuration/lib/libLLVMBitReader.a",
-	"$llvm_configuration/lib/libLLVMBitWriter.a",
-	"$llvm_configuration/lib/libLLVMCodeGen.a",
-	"$llvm_configuration/lib/libLLVMCore.a",
-	"$llvm_configuration/lib/libLLVMExecutionEngine.a",
-	"$llvm_configuration/lib/libLLVMInstCombine.a",
-	"$llvm_configuration/lib/libLLVMInstrumentation.a",
-	"$llvm_configuration/lib/libLLVMipa.a",
-	"$llvm_configuration/lib/libLLVMInterpreter.a",
-	"$llvm_configuration/lib/libLLVMipo.a",
-	"$llvm_configuration/lib/libLLVMJIT.a",
-	"$llvm_configuration/lib/libLLVMLinker.a",
-	"$llvm_configuration/lib/libLLVMMC.a",
-	"$llvm_configuration/lib/libLLVMMCParser.a",
-	"$llvm_configuration/lib/libLLVMMCDisassembler.a",
+    "$llvm_configuration/lib/libLLVMARMDisassembler.a",
+    "$llvm_configuration/lib/libLLVMARMInfo.a",
+    "$llvm_configuration/lib/libLLVMAsmParser.a",
+    "$llvm_configuration/lib/libLLVMAsmPrinter.a",
+    "$llvm_configuration/lib/libLLVMBitReader.a",
+    "$llvm_configuration/lib/libLLVMBitWriter.a",
+    "$llvm_configuration/lib/libLLVMCodeGen.a",
+    "$llvm_configuration/lib/libLLVMCore.a",
+    "$llvm_configuration/lib/libLLVMExecutionEngine.a",
+    "$llvm_configuration/lib/libLLVMInstCombine.a",
+    "$llvm_configuration/lib/libLLVMInstrumentation.a",
+    "$llvm_configuration/lib/libLLVMipa.a",
+    "$llvm_configuration/lib/libLLVMInterpreter.a",
+    "$llvm_configuration/lib/libLLVMipo.a",
+    "$llvm_configuration/lib/libLLVMJIT.a",
+    "$llvm_configuration/lib/libLLVMLinker.a",
+    "$llvm_configuration/lib/libLLVMMC.a",
+    "$llvm_configuration/lib/libLLVMMCParser.a",
+    "$llvm_configuration/lib/libLLVMMCDisassembler.a",
     "$llvm_configuration/lib/libLLVMMCJIT.a",
     "$llvm_configuration/lib/libLLVMObject.a",
     "$llvm_configuration/lib/libLLVMRuntimeDyld.a",
-	"$llvm_configuration/lib/libLLVMScalarOpts.a",
-	"$llvm_configuration/lib/libLLVMSelectionDAG.a",
-	"$llvm_configuration/lib/libLLVMSupport.a",
-	"$llvm_configuration/lib/libLLVMTarget.a",
-	"$llvm_configuration/lib/libLLVMTransformUtils.a",
-	"$llvm_configuration/lib/libLLVMX86AsmParser.a",
-	"$llvm_configuration/lib/libLLVMX86AsmPrinter.a",
-	"$llvm_configuration/lib/libLLVMX86CodeGen.a",
+    "$llvm_configuration/lib/libLLVMScalarOpts.a",
+    "$llvm_configuration/lib/libLLVMSelectionDAG.a",
+    "$llvm_configuration/lib/libLLVMSupport.a",
+    "$llvm_configuration/lib/libLLVMTarget.a",
+    "$llvm_configuration/lib/libLLVMTransformUtils.a",
+    "$llvm_configuration/lib/libLLVMX86AsmParser.a",
+    "$llvm_configuration/lib/libLLVMX86AsmPrinter.a",
+    "$llvm_configuration/lib/libLLVMX86CodeGen.a",
     "$llvm_configuration/lib/libLLVMX86Desc.a",
-	"$llvm_configuration/lib/libLLVMX86Disassembler.a",
-	"$llvm_configuration/lib/libLLVMX86Info.a",
+    "$llvm_configuration/lib/libLLVMX86Disassembler.a",
+    "$llvm_configuration/lib/libLLVMX86Info.a",
     "$llvm_configuration/lib/libLLVMX86Utils.a",
 );
 
@@ -111,78 +108,31 @@ if (-e "$llvm_srcroot/lib")
     print "Using existing llvm sources in: '$llvm_srcroot'\n";
     print "Using standard LLVM build directory:\n  SRC = '$llvm_srcroot'\n  DST = '$llvm_dstroot'\n";
 }
-elsif (-e $llvm_dstroot_zip)
-{
-    # Check for an old llvm source install (not the minimal zip based 
-    # install by looking for a .svn file in the llvm directory
-    chomp(my $llvm_zip_md5 = `md5 -q '$llvm_dstroot_zip'`);
-    my $llvm_zip_md5_file = "$ENV{SRCROOT}/llvm/$llvm_zip_md5";
-    if (!-e "$llvm_zip_md5_file")
-    {
-        print "Updating LLVM to use checkpoint from: '$llvm_dstroot_zip'...\n";
-        if (-d "$ENV{SRCROOT}/llvm")
-        {
-            do_command ("cd '$ENV{SRCROOT}' && rm -rf llvm", "removing old llvm repository", 1);            
-        }
-		do_command ("cd '$ENV{SRCROOT}' && unzip -q llvm.zip && touch '$llvm_zip_md5_file'", "expanding llvm.zip", 1);
-        
-    }
-    my $arch_idx = 0;
-        
-    if (!-d "${llvm_dstroot}")
-    {
-        do_command ("mkdir -p '${llvm_dstroot}'", "Creating directory '${llvm_dstroot}'", 1);
-    }
-        
-    foreach my $arch (@archs)
-    {
-        my $llvm_dstroot_arch = "${llvm_dstroot}/${arch}";
-        # Check for our symlink to our .a file
-        if (!-l "$llvm_dstroot_arch/$llvm_clang_basename")
-        {
-            # Symlink doesn't exist, make sure it isn't a normal file
-            if (-e "$llvm_dstroot_arch/$llvm_clang_basename")
-            {
-                # the .a file is a normal file which means it can't be from the 
-                # zip file, we must remove the previous arch directory
-                do_command ("rm -rf '$llvm_dstroot_arch'", "Removing old '$llvm_dstroot_arch' directory", 1);
-            }            
-            # Create a symlink to the .a file from the zip file
-            do_command ("cd '$llvm_dstroot' ; ln -s $ENV{SRCROOT}/llvm/$arch", "making llvm archive symlink", 1);
-        }
-    }
-    exit 0;
-}
 else
 {
     print "Checking out llvm sources from revision $llvm_revision...\n";
-    do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1); 
+    do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1);
     print "Checking out clang sources from revision $clang_revision...\n";
     do_command ("cd '$llvm_srcroot/tools' && svn co --quiet --revision $clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking out clang from repository", 1);
     print "Applying any local patches to LLVM/Clang...";
-    
+
     my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff");
-    
     foreach my $patch (@llvm_patches)
     {
         do_command ("cd '$llvm_srcroot' && patch -p0 < $patch");
     }
 
     my @clang_patches = bsd_glob("$ENV{SRCROOT}/scripts/clang.*.diff");
-    
     foreach my $patch (@clang_patches)
     {
         do_command ("cd '$llvm_srcroot/tools/clang' && patch -p0 < $patch");
     }
-    
-    print "Removing the llvm/test and llvm/tools/clang/test directories...\n";
-    do_command ("cd '$llvm_srcroot' && rm -rf test && rm -rf tools/clang/test ", "removing test directories", 1); 
 }
 
 # If our output file already exists then we need not generate it again.
 if (-e $llvm_clang_outfile)
 {
-	exit 0;
+    exit 0;
 }
 
 
@@ -192,249 +142,258 @@ our $debug = 1;
 
 sub parallel_guess
 {
-	my $cpus = `sysctl -n hw.availcpu`;
-	chomp ($cpus);
-	my $memsize = `sysctl -n hw.memsize`;
-	chomp ($memsize);
-	my $max_cpus_by_memory = int($memsize / (750 * 1024 * 1024));
-	return min($max_cpus_by_memory, $cpus);
+    my $cpus = `sysctl -n hw.availcpu`;
+    chomp ($cpus);
+    my $memsize = `sysctl -n hw.memsize`;
+    chomp ($memsize);
+    my $max_cpus_by_memory = int($memsize / (750 * 1024 * 1024));
+    return min($max_cpus_by_memory, $cpus);
 }
+
 sub build_llvm
 {
-	#my $extra_svn_options = $debug ? "" : "--quiet";
-	# Make the llvm build directory
+    #my $extra_svn_options = $debug ? "" : "--quiet";
+    # Make the llvm build directory
     my $arch_idx = 0;
     foreach my $arch (@archs)
     {
         my $llvm_dstroot_arch = "${llvm_dstroot}/${arch}";
 
-		# if the arch destination root exists we have already built it
-		my $do_configure = 0;
-		my $do_make = 0;
-		my $is_arm = $arch =~ /^arm/;
-        
-		my $llvm_dstroot_arch_archive = "$llvm_dstroot_arch/$llvm_clang_basename";
-		print "LLVM architecture root for ${arch} exists at '$llvm_dstroot_arch'...";
-		if (-e $llvm_dstroot_arch)
-		{
-			print "YES\n";
-			$do_configure = !-e "$llvm_dstroot_arch/config.log";
-			
-			# dstroot for llvm build exists, make sure all .a files are built
-			for my $llvm_lib (@archive_files)
-			{
-				if (!-e "$llvm_dstroot_arch/$llvm_lib")
-				{
-					print "missing archive: '$llvm_dstroot_arch/$llvm_lib'\n";
-					$do_make = 1;
-				}
-			}	
-			if (!-e $llvm_dstroot_arch_archive)
-			{
-				$do_make = 1;
-			}
-			else
-			{
-				print "LLVM architecture archive for ${arch} is '$llvm_dstroot_arch_archive'\n";
-			}		
-		}
-		else
-		{
-			print "NO\n";
-	        do_command ("mkdir -p '$llvm_dstroot_arch'", "making llvm build directory '$llvm_dstroot_arch'", 1);
-			$do_configure = 1;
-			$do_make = 1;
+        # if the arch destination root exists we have already built it
+        my $do_configure = 0;
+        my $do_make = 0;
+        my $is_arm = $arch =~ /^arm/;
+
+        my $llvm_dstroot_arch_archive = "$llvm_dstroot_arch/$llvm_clang_basename";
+        print "LLVM architecture root for ${arch} exists at '$llvm_dstroot_arch'...";
+        if (-e $llvm_dstroot_arch)
+        {
+            print "YES\n";
+            $do_configure = !-e "$llvm_dstroot_arch/config.log";
 
-			if ($is_arm)
-			{
-		        my $llvm_dstroot_arch_bin = "${llvm_dstroot_arch}/bin";
+            # dstroot for llvm build exists, make sure all .a files are built
+            for my $llvm_lib (@archive_files)
+            {
+                if (!-e "$llvm_dstroot_arch/$llvm_lib")
+                {
+                    print "missing archive: '$llvm_dstroot_arch/$llvm_lib'\n";
+                    $do_make = 1;
+                }
+            }
+            if (!-e $llvm_dstroot_arch_archive)
+            {
+                $do_make = 1;
+            }
+            else
+            {
+                print "LLVM architecture archive for ${arch} is '$llvm_dstroot_arch_archive'\n";
+            }
+        }
+        else
+        {
+            print "NO\n";
+            do_command ("mkdir -p '$llvm_dstroot_arch'", "making llvm build directory '$llvm_dstroot_arch'", 1);
+            $do_configure = 1;
+            $do_make = 1;
 
-				if (!-d $llvm_dstroot_arch_bin)
-				{
-					do_command ("mkdir -p '$llvm_dstroot_arch_bin'", "making llvm build arch bin directory '$llvm_dstroot_arch_bin'", 1);
-					my @tools = ("ar", "nm", "ranlib", "strip", "lipo", "ld", "as");
-					my $script_mode = 0755;
-					my $prog;
-					for $prog (@tools)
-					{
-					   	chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
-					   	my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
-						open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
-						print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' \"\$\@\"\n";
-						close (SCRIPT);
-					   	chmod($script_mode, $script_prog_path);
-					}
-					#  Tools that must have the "-arch" and "-sysroot" specified
-					my @arch_sysroot_tools = ("clang", "clang++", "gcc", "g++");
-					for $prog (@arch_sysroot_tools)
-					{
-					   	chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
-					   	my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
-						open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
-						print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' -arch ${arch} -isysroot '$ENV{SDKROOT}' \"\$\@\"\n";
-						close (SCRIPT);
-					   	chmod($script_mode, $script_prog_path);
-					}
-					my $new_path = "$original_env_path:$llvm_dstroot_arch_bin";
-					print "Setting new environment PATH = '$new_path'\n";
-			        $ENV{PATH} = $new_path;
-				}
-			}
-		}
-		
-		if ($do_configure)
-		{
-			# Build llvm and clang
-	        print "Configuring clang ($arch) in '$llvm_dstroot_arch'...\n";
-			my $lldb_configuration_options = "--enable-targets=x86_64,arm $llvm_config_href->{configure_options}";
+            if ($is_arm)
+            {
+                my $llvm_dstroot_arch_bin = "${llvm_dstroot_arch}/bin";
+                if (!-d $llvm_dstroot_arch_bin)
+                {
+                    do_command ("mkdir -p '$llvm_dstroot_arch_bin'", "making llvm build arch bin directory '$llvm_dstroot_arch_bin'", 1);
+                    my @tools = ("ar", "nm", "ranlib", "strip", "lipo", "ld", "as");
+                    my $script_mode = 0755;
+                    my $prog;
+                    for $prog (@tools)
+                    {
+                        chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
+                        symlink($actual_prog_path, "$llvm_dstroot_arch_bin/${prog}");
+                        my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
+                        open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
+                        print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' \"\$\@\"\n";
+                        close (SCRIPT);
+                        chmod($script_mode, $script_prog_path);
+                    }
+                    #  Tools that must have the "-arch" and "-sysroot" specified
+                    my @arch_sysroot_tools = ("clang", "clang++", "gcc", "g++");
+                    for $prog (@arch_sysroot_tools)
+                    {
+                        chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
+                        symlink($actual_prog_path, "$llvm_dstroot_arch_bin/${prog}");
+                        my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
+                        open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
+                        print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' -arch ${arch} -isysroot '$ENV{SDKROOT}' \"\$\@\"\n";
+                        close (SCRIPT);
+                        chmod($script_mode, $script_prog_path);
+                    }
+                    my $new_path = "$original_env_path:$llvm_dstroot_arch_bin";
+                    print "Setting new environment PATH = '$new_path'\n";
+                    $ENV{PATH} = $new_path;
+                }
+            }
+        }
+
+        if ($do_configure)
+        {
+            # Build llvm and clang
+            print "Configuring clang ($arch) in '$llvm_dstroot_arch'...\n";
+            my $lldb_configuration_options = "--enable-targets=x86_64,arm $llvm_config_href->{configure_options}";
 
             if ($is_arm)
             {
-                $lldb_configuration_options .= " --host=arm-apple-darwin${os_release} --target=arm-apple-darwin${os_release} --build=i686-apple-darwin${os_release}";
+                $lldb_configuration_options .= " --host=arm-apple-darwin${os_release} --target=arm-apple-darwin${os_release} --build=i686-apple-darwin${os_release} --program-prefix=\"\"";
             }
             else
             {
                 $lldb_configuration_options .= " --build=$arch-apple-darwin${os_release}";
             }
-	        do_command ("cd '$llvm_dstroot_arch' && '$llvm_srcroot/configure' $lldb_configuration_options",
-	                    "configuring llvm build", 1);			
-		}
-
-		if ($do_make)
-		{
-			# Build llvm and clang
-			my $num_cpus = parallel_guess();
-			print "Building clang using $num_cpus cpus ($arch)...\n";
+			if ($is_arm)
+			{
+				# Unset "SDKROOT" for ARM builds
+	            do_command ("cd '$llvm_dstroot_arch' && unset SDKROOT && '$llvm_srcroot/configure' $lldb_configuration_options",
+	                        "configuring llvm build", 1);				
+			}
+			else
+			{
+	            do_command ("cd '$llvm_dstroot_arch' && '$llvm_srcroot/configure' $lldb_configuration_options",
+	                        "configuring llvm build", 1);								
+			}
+        }
+
+        if ($do_make)
+        {
+            # Build llvm and clang
+            my $num_cpus = parallel_guess();
+            print "Building clang using $num_cpus cpus ($arch)...\n";
             my $extra_make_flags = '';
             if ($is_arm)
             {
-                $extra_make_flags = "UNIVERSAL=1 UNIVERSAL_ARCH=${arch} UNIVERSAL_SDK_PATH='$ENV{SDKROOT}'";
+                $extra_make_flags = "UNIVERSAL=1 UNIVERSAL_ARCH=${arch} UNIVERSAL_SDK_PATH='$ENV{SDKROOT}' SDKROOT=";
             }
-            do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus clang-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags", "making llvm and clang", 1);			
-            do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus tools-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags EDIS_VERSION=1", "making libedis", 1);			
-			# Combine all .o files from a bunch of static libraries from llvm
-			# and clang into a single .a file.
-			create_single_llvm_arhive_for_arch ($llvm_dstroot_arch, 1);
-		}
+            do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus clang-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags", "making llvm and clang", 1);
+            do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus tools-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags EDIS_VERSION=1", "making libedis", 1);
+            # Combine all .o files from a bunch of static libraries from llvm
+            # and clang into a single .a file.
+            create_single_llvm_archive_for_arch ($llvm_dstroot_arch, 1);
+        }
 
-		++$arch_idx;
-    }	
+        ++$arch_idx;
+    }
 }
 
 #----------------------------------------------------------------------
-# quote the path if needed and realpath it if the -r option was 
+# quote the path if needed and realpath it if the -r option was
 # specified
 #----------------------------------------------------------------------
 sub finalize_path
 {
-	my $path = shift;
-	# Realpath all paths that don't start with "/"
-	$path =~ /^[^\/]/ and $path = abs_path($path);
-
-	# Quote the path if asked to, or if there are special shell characters
-	# in the path name
-	my $has_double_quotes = $path =~ /["]/;
-	my $has_single_quotes = $path =~ /[']/;
-	my $needs_quotes = $path =~ /[ \$\&\*'"]/;
-	if ($needs_quotes)
-	{
-		# escape and double quotes in the path
-		$has_double_quotes and $path =~ s/"/\\"/g;
-		$path = "\"$path\"";
-	}
-	return $path;
+    my $path = shift;
+    # Realpath all paths that don't start with "/"
+    $path =~ /^[^\/]/ and $path = abs_path($path);
+
+    # Quote the path if asked to, or if there are special shell characters
+    # in the path name
+    my $has_double_quotes = $path =~ /["]/;
+    my $has_single_quotes = $path =~ /[']/;
+    my $needs_quotes = $path =~ /[ \$\&\*'"]/;
+    if ($needs_quotes)
+    {
+        # escape and double quotes in the path
+        $has_double_quotes and $path =~ s/"/\\"/g;
+        $path = "\"$path\"";
+    }
+    return $path;
 }
 
 sub do_command
 {
-	my $cmd = shift;
-	my $description = @_ ? shift : "command";
-	my $die_on_fail = @_ ? shift : undef;
-	$debug and print "% $cmd\n";
-	system ($cmd);
-	if ($? == -1) 
-	{
+    my $cmd = shift;
+    my $description = @_ ? shift : "command";
+    my $die_on_fail = @_ ? shift : undef;
+    $debug and print "% $cmd\n";
+    system ($cmd);
+    if ($? == -1)
+    {
         $debug and printf ("error: %s failed to execute: $!\n", $description);
-		$die_on_fail and $? and exit(1);
-		return $?;
+        $die_on_fail and $? and exit(1);
+        return $?;
     }
-    elsif ($? & 127) 
-	{
-        $debug and printf("error: %s child died with signal %d, %s coredump\n", 
-						  $description, 
-						  ($? & 127),  
-						  ($? & 128) ? 'with' : 'without');
-		$die_on_fail and $? and exit(1);
-		return $?;
+    elsif ($? & 127)
+    {
+        $debug and printf("error: %s child died with signal %d, %s coredump\n",
+                          $description,
+                          ($? & 127),
+                          ($? & 128) ? 'with' : 'without');
+        $die_on_fail and $? and exit(1);
+        return $?;
     }
-    else 
-	{
-		my $exit = $? >> 8;
-		if ($exit)
-		{
-			$debug and printf("error: %s child exited with value %d\n", $description, $exit);
-			$die_on_fail and exit(1);
-		}
-		return $exit;
+    else
+    {
+        my $exit = $? >> 8;
+        if ($exit)
+        {
+            $debug and printf("error: %s child exited with value %d\n", $description, $exit);
+            $die_on_fail and exit(1);
+        }
+        return $exit;
     }
 }
 
-sub create_single_llvm_arhive_for_arch
+sub create_single_llvm_archive_for_arch
 {
-	my $arch_dstroot = shift;
+    my $arch_dstroot = shift;
     my $split_into_objects = shift;
-	my @object_dirs;
-	my $object_dir;
-	my $tmp_dir = $arch_dstroot;
-	my $arch_output_file = "$arch_dstroot/$llvm_clang_basename";
+    my @object_dirs;
+    my $object_dir;
+    my $tmp_dir = $arch_dstroot;
+    my $arch_output_file = "$arch_dstroot/$llvm_clang_basename";
     -e $arch_output_file and return;
-	my $files = "$arch_dstroot/files.txt";
-	open (FILES, ">$files") or die "Can't open $! for writing...\n";
+    my $files = "$arch_dstroot/files.txt";
+    open (FILES, ">$files") or die "Can't open $! for writing...\n";
 
-	for my $path (@archive_files) 
-	{
-		my $archive_fullpath = finalize_path ("$arch_dstroot/$path");
-		if (-e $archive_fullpath)
-		{
+    for my $path (@archive_files)
+    {
+        my $archive_fullpath = finalize_path ("$arch_dstroot/$path");
+        if (-e $archive_fullpath)
+        {
             if ($split_into_objects)
             {
                 my ($archive_file, $archive_dir, $archive_ext) = fileparse($archive_fullpath, ('.a'));
-        
                 $object_dir = "$tmp_dir/$archive_file";
                 push @object_dirs, $object_dir;
-            
+
                 do_command ("cd '$tmp_dir'; mkdir '$archive_file'; cd '$archive_file'; ar -x $archive_fullpath");
-        
+
                 my @objects = bsd_glob("$object_dir/*.o");
-        
                 foreach my $object (@objects)
                 {
                     my ($o_file, $o_dir) = fileparse($object);
                     my $new_object = "$object_dir/${archive_file}-$o_file";
                     print FILES "$new_object\n";
                     do_command ("mv '$object' '$new_object'");
-                }				
+                }
             }
             else
             {
                 # just add the .a files into the file list
                 print FILES "$archive_fullpath\n";
             }
-		}
+        }
         else
         {
             print "warning: archive doesn't exist: '$archive_fullpath'\n";
         }
-	}
-	close (FILES);
+    }
+    close (FILES);
     do_command ("libtool -static -o '$arch_output_file' -filelist '$files'");
     do_command ("ranlib '$arch_output_file'");
 
-	foreach $object_dir (@object_dirs)
-	{
-		do_command ("rm -rf '$object_dir'");
-	}
-	do_command ("rm -rf '$files'");
+    foreach $object_dir (@object_dirs)
+    {
+        do_command ("rm -rf '$object_dir'");
+    }
+    do_command ("rm -rf '$files'");
 }
 
 build_llvm();

Modified: lldb/branches/lldb-platform-work/scripts/build-swig-wrapper-classes.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/build-swig-wrapper-classes.sh?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/build-swig-wrapper-classes.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/build-swig-wrapper-classes.sh Thu Jun  6 19:06:43 2013
@@ -26,20 +26,45 @@ SRC_ROOT=$1
 TARGET_DIR=$2
 CONFIG_BUILD_DIR=$3
 PREFIX=$4
-debug_flag=$5
+
+shift 4
 
 #
 # Check to see if we are in debug-mode or not.
 #
 
-if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
+if [ -n "$1" -a "$1" = "-debug" ]
 then
+    debug_flag="$1"
     Debug=1
+    shift
 else
+    debug_flag=""
     Debug=0
 fi
 
 #
+# Check to see if we were called from the Makefile system. If we were, check
+# if the caller wants swig to generate a dependency file.
+#
+
+if [ -n "$1" -a "$1" = "-m" ]
+then
+    makefile_flag="$1"
+    shift
+    if [ -n "$1" -a "$1" = "-M" ]
+    then
+        dependency_flag="$1"
+        shift
+    else
+        dependency_flag=""
+    fi
+else
+    makefile_flag=""
+    dependency_flag=""
+fi
+
+#
 # Verify that 'lldb.swig' exists.
 #
 
@@ -49,7 +74,7 @@ then
     exit 1
 fi
 
-if [ $Debug == 1 ]
+if [ $Debug -eq 1 ]
 then
     echo "Found lldb.swig file"
 fi
@@ -58,8 +83,8 @@ fi
 # Next look for swig
 #
 
-SWIG=
-if [ -f /usr/bin/swig ]
+SWIG=`which swig`
+if [ ! -x "$SWIG" -a -f /usr/bin/swig ]
 then
     SWIG=/usr/bin/swig
 else
@@ -69,7 +94,7 @@ else
     fi
 fi
 
-if [ ${SWIG}a == a ]
+if [ ${SWIG}a = a ]
 then
     echo Error: could not find the swig binary
     exit 1
@@ -87,7 +112,7 @@ cwd=${SRC_ROOT}/scripts
 
 for curlang in $languages
 do
-    if [ $Debug == 1 ]
+    if [ $Debug -eq 1 ]
     then
         echo "Current language is $curlang"
     fi
@@ -98,7 +123,7 @@ do
         continue
     else
 
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "Found $curlang sub-directory"
         fi
@@ -113,13 +138,13 @@ do
             continue
         else
 
-            if [ $Debug == 1 ]
+            if [ $Debug -eq 1 ]
             then
                 echo "Found $curlang build script."
                 echo "Executing $curlang build script..."
             fi
 
-            ./build-swig-${curlang}.sh  $SRC_ROOT $TARGET_DIR $CONFIG_BUILD_DIR "${PREFIX}" "${debug_flag}" "${SWIG}"
+            ./build-swig-${curlang}.sh  "$SRC_ROOT" "$TARGET_DIR" "$CONFIG_BUILD_DIR" "${PREFIX}" "${debug_flag}" "${SWIG}" "${makefile_flag}" "${dependency_flag}" || exit $?
         fi
     fi
 done

Removed: lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff?rev=183467&view=auto
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff (original)
+++ lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff (removed)
@@ -1,1936 +0,0 @@
-Index: include/clang/Basic/StmtNodes.td
-===================================================================
---- include/clang/Basic/StmtNodes.td	(revision 152265)
-+++ include/clang/Basic/StmtNodes.td	(working copy)
-@@ -133,7 +133,7 @@
- 
- // Obj-C Expressions.
- def ObjCStringLiteral : DStmt<Expr>;
--def ObjCNumericLiteral : DStmt<Expr>;
-+def ObjCBoxedExpr : DStmt<Expr>;
- def ObjCArrayLiteral : DStmt<Expr>;
- def ObjCDictionaryLiteral : DStmt<Expr>;
- def ObjCEncodeExpr : DStmt<Expr>;
-Index: include/clang/Basic/DiagnosticSemaKinds.td
-===================================================================
---- include/clang/Basic/DiagnosticSemaKinds.td	(revision 152265)
-+++ include/clang/Basic/DiagnosticSemaKinds.td	(working copy)
-@@ -1489,6 +1489,12 @@
-   "NSNumber must be available to use Objective-C literals">;
- def err_invalid_nsnumber_type : Error<
-   "%0 is not a valid literal type for NSNumber">;
-+def err_undeclared_nsstring : Error<
-+  "cannot box a string value because NSString has not been declared">;
-+def err_objc_illegal_boxed_expression_type : Error<
-+  "illegal type %0 used in a boxed expression">;
-+def err_objc_incomplete_boxed_expression_type : Error<
-+  "incomplete type %0 used in a boxed expression">;
- def err_undeclared_nsarray : Error<
-   "NSArray must be available to use Objective-C array literals">;
- def err_undeclared_nsdictionary : Error<
-Index: include/clang/Sema/Sema.h
-===================================================================
---- include/clang/Sema/Sema.h	(revision 152265)
-+++ include/clang/Sema/Sema.h	(working copy)
-@@ -519,9 +519,21 @@
-   /// \brief The declaration of the Objective-C NSNumber class.
-   ObjCInterfaceDecl *NSNumberDecl;
-   
-+  /// \brief Pointer to NSNumber type (NSNumber *).
-+  QualType NSNumberPointer;
-+  
-   /// \brief The Objective-C NSNumber methods used to create NSNumber literals.
-   ObjCMethodDecl *NSNumberLiteralMethods[NSAPI::NumNSNumberLiteralMethods];
-   
-+  /// \brief The declaration of the Objective-C NSString class.
-+  ObjCInterfaceDecl *NSStringDecl;
-+
-+  /// \brief Pointer to NSString type (NSString *).
-+  QualType NSStringPointer;
-+  
-+  /// \brief The declaration of the stringWithUTF8String: method.
-+  ObjCMethodDecl *StringWithUTF8StringMethod;
-+
-   /// \brief The declaration of the Objective-C NSArray class.
-   ObjCInterfaceDecl *NSArrayDecl;
- 
-@@ -3708,7 +3720,7 @@
-     
-   ExprResult BuildObjCStringLiteral(SourceLocation AtLoc, StringLiteral *S);
-   
--  /// BuildObjCNumericLiteral - builds an ObjCNumericLiteral AST node for the
-+  /// BuildObjCNumericLiteral - builds an ObjCBoxedExpr AST node for the
-   /// numeric literal expression. Type of the expression will be "NSNumber *"
-   /// or "id" if NSNumber is unavailable.
-   ExprResult BuildObjCNumericLiteral(SourceLocation AtLoc, Expr *Number);
-@@ -3716,6 +3728,13 @@
-                                   bool Value);
-   ExprResult BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements);
-   
-+  // BuildObjCBoxedExpr - builds an ObjCBoxedExpr AST node for the
-+  // '@' prefixed parenthesized expression. The type of the expression will
-+  // either be "NSNumber *" or "NSString *" depending on the type of
-+  // ValueType, which is allowed to be a built-in numeric type or
-+  // "char *" or "const char *".
-+  ExprResult BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr);
-+  
-   ExprResult BuildObjCSubscriptExpression(SourceLocation RB, Expr *BaseExpr,
-                                           Expr *IndexExpr,
-                                           ObjCMethodDecl *getterMethod,
-Index: include/clang/AST/ASTImporter.h
-===================================================================
---- include/clang/AST/ASTImporter.h	(revision 152265)
-+++ include/clang/AST/ASTImporter.h	(working copy)
-@@ -271,7 +271,8 @@
-     
-     /// \brief Determine whether the given types are structurally
-     /// equivalent.
--    bool IsStructurallyEquivalent(QualType From, QualType To);    
-+    bool IsStructurallyEquivalent(QualType From, QualType To,
-+                                  bool Complain = true);
-   };
- }
- 
-Index: include/clang/AST/Type.h
-===================================================================
---- include/clang/AST/Type.h	(revision 152265)
-+++ include/clang/AST/Type.h	(working copy)
-@@ -1714,9 +1714,9 @@
-   friend class ASTWriter;
- };
- 
--template <> inline const TypedefType *Type::getAs() const {
--  return dyn_cast<TypedefType>(this);
--}
-+/// \brief This will check for a TypedefType by removing any existing sugar
-+/// until it reaches a TypedefType or a non-sugared type.
-+template <> const TypedefType *Type::getAs() const;
- 
- // We can do canonical leaf types faster, because we don't have to
- // worry about preserving child type decoration.
-Index: include/clang/AST/RecursiveASTVisitor.h
-===================================================================
---- include/clang/AST/RecursiveASTVisitor.h	(revision 152265)
-+++ include/clang/AST/RecursiveASTVisitor.h	(working copy)
-@@ -2106,7 +2106,7 @@
- DEF_TRAVERSE_STMT(ImaginaryLiteral, { })
- DEF_TRAVERSE_STMT(StringLiteral, { })
- DEF_TRAVERSE_STMT(ObjCStringLiteral, { })
--DEF_TRAVERSE_STMT(ObjCNumericLiteral, { })
-+DEF_TRAVERSE_STMT(ObjCBoxedExpr, { })
- DEF_TRAVERSE_STMT(ObjCArrayLiteral, { })
- DEF_TRAVERSE_STMT(ObjCDictionaryLiteral, { })
-   
-Index: include/clang/AST/ExprObjC.h
-===================================================================
---- include/clang/AST/ExprObjC.h	(revision 152265)
-+++ include/clang/AST/ExprObjC.h	(working copy)
-@@ -86,43 +86,45 @@
-   child_range children() { return child_range(); }
- };
- 
--/// ObjCNumericLiteral - used for objective-c numeric literals;
--/// as in: @42 or @true (c++/objc++) or @__yes (c/objc)
--class ObjCNumericLiteral : public Expr {
--  /// Number - expression AST node for the numeric literal
--  Stmt *Number;
--  ObjCMethodDecl *ObjCNumericLiteralMethod;
--  SourceLocation AtLoc;
-+/// ObjCBoxedExpr - used for generalized expression boxing.
-+/// as in: @(strdup("hello world")) or @(random())
-+/// Also used for boxing non-parenthesized numeric literals;
-+/// as in: @42 or @true (c++/objc++) or @__yes (c/objc).
-+class ObjCBoxedExpr : public Expr {
-+  Stmt *SubExpr;
-+  ObjCMethodDecl *BoxingMethod;
-+  SourceRange Range;
- public:
--  ObjCNumericLiteral(Stmt *NL, QualType T, ObjCMethodDecl *method,
--                     SourceLocation L)
--  : Expr(ObjCNumericLiteralClass, T, VK_RValue, OK_Ordinary, 
--         false, false, false, false), Number(NL), 
--    ObjCNumericLiteralMethod(method), AtLoc(L) {}
--  explicit ObjCNumericLiteral(EmptyShell Empty)
--  : Expr(ObjCNumericLiteralClass, Empty) {}
-+  ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method,
-+                     SourceRange R)
-+  : Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary, 
-+         E->isTypeDependent(), E->isValueDependent(), 
-+         E->isInstantiationDependent(), E->containsUnexpandedParameterPack()), 
-+         SubExpr(E), BoxingMethod(method), Range(R) {}
-+  explicit ObjCBoxedExpr(EmptyShell Empty)
-+  : Expr(ObjCBoxedExprClass, Empty) {}
-   
--  Expr *getNumber() { return cast<Expr>(Number); }
--  const Expr *getNumber() const { return cast<Expr>(Number); }
-+  Expr *getSubExpr() { return cast<Expr>(SubExpr); }
-+  const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
-   
--  ObjCMethodDecl *getObjCNumericLiteralMethod() const {
--    return ObjCNumericLiteralMethod; 
-+  ObjCMethodDecl *getBoxingMethod() const {
-+    return BoxingMethod; 
-   }
--    
--  SourceLocation getAtLoc() const { return AtLoc; }
-   
-+  SourceLocation getAtLoc() const { return Range.getBegin(); }
-+  
-   SourceRange getSourceRange() const {
--    return SourceRange(AtLoc, Number->getSourceRange().getEnd());
-+    return Range;
-   }
--
-+  
-   static bool classof(const Stmt *T) {
--      return T->getStmtClass() == ObjCNumericLiteralClass;
-+    return T->getStmtClass() == ObjCBoxedExprClass;
-   }
--  static bool classof(const ObjCNumericLiteral *) { return true; }
-+  static bool classof(const ObjCBoxedExpr *) { return true; }
-   
-   // Iterators
--  child_range children() { return child_range(&Number, &Number+1); }
--    
-+  child_range children() { return child_range(&SubExpr, &SubExpr+1); }
-+  
-   friend class ASTStmtReader;
- };
- 
-Index: include/clang/AST/NSAPI.h
-===================================================================
---- include/clang/AST/NSAPI.h	(revision 152265)
-+++ include/clang/AST/NSAPI.h	(working copy)
-@@ -125,10 +125,19 @@
- 
-   /// \brief Determine the appropriate NSNumber factory method kind for a
-   /// literal of the given type.
--  static llvm::Optional<NSNumberLiteralMethodKind>
--      getNSNumberFactoryMethodKind(QualType T);
-+  llvm::Optional<NSNumberLiteralMethodKind>
-+      getNSNumberFactoryMethodKind(QualType T) const;
- 
-+  /// \brief Returns true if \param T is a typedef of "BOOL" in objective-c.
-+  bool isObjCBOOLType(QualType T) const;
-+  /// \brief Returns true if \param T is a typedef of "NSInteger" in objective-c.
-+  bool isObjCNSIntegerType(QualType T) const;
-+  /// \brief Returns true if \param T is a typedef of "NSUInteger" in objective-c.
-+  bool isObjCNSUIntegerType(QualType T) const;
-+
- private:
-+  bool isObjCTypedef(QualType T, StringRef name, IdentifierInfo *&II) const;
-+
-   ASTContext &Ctx;
- 
-   mutable IdentifierInfo *ClassIds[NumClassIds];
-@@ -144,6 +153,8 @@
-   /// \brief The Objective-C NSNumber selectors used to create NSNumber literals.
-   mutable Selector NSNumberClassSelectors[NumNSNumberLiteralMethods];
-   mutable Selector NSNumberInstanceSelectors[NumNSNumberLiteralMethods];
-+
-+  mutable IdentifierInfo *BOOLId, *NSIntegerId, *NSUIntegerId;
- };
- 
- }  // end namespace clang
-Index: include/clang/Parse/Parser.h
-===================================================================
---- include/clang/Parse/Parser.h	(revision 152265)
-+++ include/clang/Parse/Parser.h	(working copy)
-@@ -1497,6 +1497,7 @@
-   ExprResult ParseObjCBooleanLiteral(SourceLocation AtLoc, bool ArgValue);
-   ExprResult ParseObjCArrayLiteral(SourceLocation AtLoc);
-   ExprResult ParseObjCDictionaryLiteral(SourceLocation AtLoc);
-+  ExprResult ParseObjCBoxedExpr(SourceLocation AtLoc);
-   ExprResult ParseObjCEncodeExpression(SourceLocation AtLoc);
-   ExprResult ParseObjCSelectorExpression(SourceLocation AtLoc);
-   ExprResult ParseObjCProtocolExpression(SourceLocation AtLoc);
-Index: include/clang/Serialization/ASTBitCodes.h
-===================================================================
---- include/clang/Serialization/ASTBitCodes.h	(revision 152265)
-+++ include/clang/Serialization/ASTBitCodes.h	(working copy)
-@@ -1066,7 +1066,7 @@
-       /// \brief An ObjCStringLiteral record.
-       EXPR_OBJC_STRING_LITERAL,
- 
--      EXPR_OBJC_NUMERIC_LITERAL,
-+      EXPR_OBJC_BOXED_EXPRESSION,
-       EXPR_OBJC_ARRAY_LITERAL,
-       EXPR_OBJC_DICTIONARY_LITERAL,
- 
-Index: docs/LanguageExtensions.html
-===================================================================
---- docs/LanguageExtensions.html	(revision 152265)
-+++ docs/LanguageExtensions.html	(working copy)
-@@ -87,7 +87,7 @@
-     <li><a href="#objc_instancetype">Related result types</a></li>
-     <li><a href="#objc_arc">Automatic reference counting</a></li>
-     <li><a href="#objc_fixed_enum">Enumerations with a fixed underlying type</a></li>
--  </ul>
-+ </ul>
- </li>
- <li><a href="#overloading-in-c">Function Overloading in C</a></li>
- <li><a href="#complex-list-init">Initializer lists for complex numbers in C</a></li>
-Index: tools/libclang/IndexBody.cpp
-===================================================================
---- tools/libclang/IndexBody.cpp	(revision 152265)
-+++ tools/libclang/IndexBody.cpp	(working copy)
-@@ -90,13 +90,13 @@
-     return true;
-   }
- 
--  bool VisitObjCNumericLiteral(ObjCNumericLiteral *E) {
--    if (ObjCMethodDecl *MD = E->getObjCNumericLiteralMethod())
-+  bool VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
-+    if (ObjCMethodDecl *MD = E->getBoxingMethod())
-       IndexCtx.handleReference(MD, E->getLocStart(),
-                                Parent, ParentDC, E, CXIdxEntityRef_Implicit);
-     return true;
-   }
--
-+  
-   bool VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
-     if (ObjCMethodDecl *MD = E->getDictWithObjectsMethod())
-       IndexCtx.handleReference(MD, E->getLocStart(),
-Index: tools/libclang/CXCursor.cpp
-===================================================================
---- tools/libclang/CXCursor.cpp	(revision 152265)
-+++ tools/libclang/CXCursor.cpp	(working copy)
-@@ -229,7 +229,7 @@
-   case Stmt::VAArgExprClass:
-   case Stmt::ObjCArrayLiteralClass:
-   case Stmt::ObjCDictionaryLiteralClass:
--  case Stmt::ObjCNumericLiteralClass:
-+  case Stmt::ObjCBoxedExprClass:
-   case Stmt::ObjCSubscriptRefExprClass:
-     K = CXCursor_UnexposedExpr;
-     break;
-Index: lib/Rewrite/RewriteModernObjC.cpp
-===================================================================
---- lib/Rewrite/RewriteModernObjC.cpp	(revision 152265)
-+++ lib/Rewrite/RewriteModernObjC.cpp	(working copy)
-@@ -309,6 +309,10 @@
-     Stmt *RewriteAtSelector(ObjCSelectorExpr *Exp);
-     Stmt *RewriteMessageExpr(ObjCMessageExpr *Exp);
-     Stmt *RewriteObjCStringLiteral(ObjCStringLiteral *Exp);
-+    Stmt *RewriteObjCBoolLiteralExpr(ObjCBoolLiteralExpr *Exp);
-+    Stmt *RewriteObjCBoxedExpr(ObjCBoxedExpr *Exp);
-+    Stmt *RewriteObjCArrayLiteralExpr(ObjCArrayLiteral *Exp);
-+    Stmt *RewriteObjCDictionaryLiteralExpr(ObjCDictionaryLiteral *Exp);
-     Stmt *RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp);
-     void RewriteTryReturnStmts(Stmt *S);
-     void RewriteSyncReturnStmts(Stmt *S, std::string buf);
-@@ -2587,6 +2591,435 @@
-   return cast;
- }
- 
-+Stmt *RewriteModernObjC::RewriteObjCBoolLiteralExpr(ObjCBoolLiteralExpr *Exp) {
-+  unsigned IntSize =
-+    static_cast<unsigned>(Context->getTypeSize(Context->IntTy));
-+  
-+  Expr *FlagExp = IntegerLiteral::Create(*Context, 
-+                                         llvm::APInt(IntSize, Exp->getValue()), 
-+                                         Context->IntTy, Exp->getLocation());
-+  CastExpr *cast = NoTypeInfoCStyleCastExpr(Context, Context->ObjCBuiltinBoolTy,
-+                                            CK_BitCast, FlagExp);
-+  ParenExpr *PE = new (Context) ParenExpr(Exp->getLocation(), Exp->getExprLoc(), 
-+                                          cast);
-+  ReplaceStmt(Exp, PE);
-+  return PE;
-+}
-+
-+Stmt *RewriteModernObjC::RewriteObjCBoxedExpr(ObjCBoxedExpr *Exp) {
-+  // synthesize declaration of helper functions needed in this routine.
-+  if (!SelGetUidFunctionDecl)
-+    SynthSelGetUidFunctionDecl();
-+  // use objc_msgSend() for all.
-+  if (!MsgSendFunctionDecl)
-+    SynthMsgSendFunctionDecl();
-+  if (!GetClassFunctionDecl)
-+    SynthGetClassFunctionDecl();
-+  
-+  FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl;
-+  SourceLocation StartLoc = Exp->getLocStart();
-+  SourceLocation EndLoc = Exp->getLocEnd();
-+  
-+  // Synthesize a call to objc_msgSend().
-+  SmallVector<Expr*, 4> MsgExprs;
-+  SmallVector<Expr*, 4> ClsExprs;
-+  QualType argType = Context->getPointerType(Context->CharTy);
-+  
-+  // Create a call to objc_getClass("<BoxingClass>"). It will be the 1st argument.
-+  ObjCMethodDecl *BoxingMethod = Exp->getBoxingMethod();
-+  ObjCInterfaceDecl *BoxingClass = BoxingMethod->getClassInterface();
-+  
-+  IdentifierInfo *clsName = BoxingClass->getIdentifier();
-+  ClsExprs.push_back(StringLiteral::Create(*Context,
-+                                           clsName->getName(),
-+                                           StringLiteral::Ascii, false,
-+                                           argType, SourceLocation()));
-+  CallExpr *Cls = SynthesizeCallToFunctionDecl(GetClassFunctionDecl,
-+                                               &ClsExprs[0],
-+                                               ClsExprs.size(), 
-+                                               StartLoc, EndLoc);
-+  MsgExprs.push_back(Cls);
-+  
-+  // Create a call to sel_registerName("<BoxingMethod>:"), etc.
-+  // it will be the 2nd argument.
-+  SmallVector<Expr*, 4> SelExprs;
-+  SelExprs.push_back(StringLiteral::Create(*Context,
-+                                           BoxingMethod->getSelector().getAsString(),
-+                                           StringLiteral::Ascii, false,
-+                                           argType, SourceLocation()));
-+  CallExpr *SelExp = SynthesizeCallToFunctionDecl(SelGetUidFunctionDecl,
-+                                                  &SelExprs[0], SelExprs.size(),
-+                                                  StartLoc, EndLoc);
-+  MsgExprs.push_back(SelExp);
-+  
-+  // User provided sub-expression is the 3rd, and last, argument.
-+  Expr *subExpr  = Exp->getSubExpr();
-+  if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(subExpr)) {
-+    QualType type = ICE->getType();
-+    const Expr *SubExpr = ICE->IgnoreParenImpCasts();
-+    CastKind CK = CK_BitCast;
-+    if (SubExpr->getType()->isIntegralType(*Context) && type->isBooleanType())
-+      CK = CK_IntegralToBoolean;
-+    subExpr = NoTypeInfoCStyleCastExpr(Context, type, CK, subExpr);
-+  }
-+  MsgExprs.push_back(subExpr);
-+  
-+  SmallVector<QualType, 4> ArgTypes;
-+  ArgTypes.push_back(Context->getObjCIdType());
-+  ArgTypes.push_back(Context->getObjCSelType());
-+  for (ObjCMethodDecl::param_iterator PI = BoxingMethod->param_begin(),
-+       E = BoxingMethod->param_end(); PI != E; ++PI)
-+    ArgTypes.push_back((*PI)->getType());
-+  
-+  QualType returnType = Exp->getType();
-+  // Get the type, we will need to reference it in a couple spots.
-+  QualType msgSendType = MsgSendFlavor->getType();
-+  
-+  // Create a reference to the objc_msgSend() declaration.
-+  DeclRefExpr *DRE = new (Context) DeclRefExpr(MsgSendFlavor, msgSendType,
-+                                               VK_LValue, SourceLocation());
-+  
-+  CastExpr *cast = NoTypeInfoCStyleCastExpr(Context,
-+                                            Context->getPointerType(Context->VoidTy),
-+                                            CK_BitCast, DRE);
-+  
-+  // Now do the "normal" pointer to function cast.
-+  QualType castType =
-+  getSimpleFunctionType(returnType, &ArgTypes[0], ArgTypes.size(),
-+                        BoxingMethod->isVariadic());
-+  castType = Context->getPointerType(castType);
-+  cast = NoTypeInfoCStyleCastExpr(Context, castType, CK_BitCast,
-+                                  cast);
-+  
-+  // Don't forget the parens to enforce the proper binding.
-+  ParenExpr *PE = new (Context) ParenExpr(StartLoc, EndLoc, cast);
-+  
-+  const FunctionType *FT = msgSendType->getAs<FunctionType>();
-+  CallExpr *CE = new (Context) CallExpr(*Context, PE, &MsgExprs[0],
-+                                        MsgExprs.size(),
-+                                        FT->getResultType(), VK_RValue,
-+                                        EndLoc);
-+  ReplaceStmt(Exp, CE);
-+  return CE;
-+}
-+
-+Stmt *RewriteModernObjC::RewriteObjCArrayLiteralExpr(ObjCArrayLiteral *Exp) {
-+  // synthesize declaration of helper functions needed in this routine.
-+  if (!SelGetUidFunctionDecl)
-+    SynthSelGetUidFunctionDecl();
-+  // use objc_msgSend() for all.
-+  if (!MsgSendFunctionDecl)
-+    SynthMsgSendFunctionDecl();
-+  if (!GetClassFunctionDecl)
-+    SynthGetClassFunctionDecl();
-+  
-+  FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl;
-+  SourceLocation StartLoc = Exp->getLocStart();
-+  SourceLocation EndLoc = Exp->getLocEnd();
-+  
-+  // Build the expression: __NSContainer_literal(int, ...).arr
-+  QualType IntQT = Context->IntTy;
-+  QualType NSArrayFType =
-+    getSimpleFunctionType(Context->VoidTy, &IntQT, 1, true);
-+  std::string NSArrayFName("__NSContainer_literal");
-+  FunctionDecl *NSArrayFD = SynthBlockInitFunctionDecl(NSArrayFName);
-+  DeclRefExpr *NSArrayDRE = 
-+    new (Context) DeclRefExpr(NSArrayFD, NSArrayFType, VK_RValue,
-+                              SourceLocation());
-+
-+  SmallVector<Expr*, 16> InitExprs;
-+  unsigned NumElements = Exp->getNumElements();
-+  unsigned UnsignedIntSize = 
-+    static_cast<unsigned>(Context->getTypeSize(Context->UnsignedIntTy));
-+  Expr *count = IntegerLiteral::Create(*Context,
-+                                       llvm::APInt(UnsignedIntSize, NumElements),
-+                                       Context->UnsignedIntTy, SourceLocation());
-+  InitExprs.push_back(count);
-+  for (unsigned i = 0; i < NumElements; i++)
-+    InitExprs.push_back(Exp->getElement(i));
-+  Expr *NSArrayCallExpr = 
-+    new (Context) CallExpr(*Context, NSArrayDRE, &InitExprs[0], InitExprs.size(),
-+                           NSArrayFType, VK_LValue, SourceLocation());
-+  
-+  FieldDecl *ARRFD = FieldDecl::Create(*Context, 0, SourceLocation(),
-+                                    SourceLocation(),
-+                                    &Context->Idents.get("arr"),
-+                                    Context->getPointerType(Context->VoidPtrTy), 0,
-+                                    /*BitWidth=*/0, /*Mutable=*/true,
-+                                    /*HasInit=*/false);
-+  MemberExpr *ArrayLiteralME = 
-+    new (Context) MemberExpr(NSArrayCallExpr, false, ARRFD, 
-+                             SourceLocation(),
-+                             ARRFD->getType(), VK_LValue,
-+                             OK_Ordinary);
-+  QualType ConstIdT = Context->getObjCIdType().withConst();
-+  CStyleCastExpr * ArrayLiteralObjects = 
-+    NoTypeInfoCStyleCastExpr(Context, 
-+                             Context->getPointerType(ConstIdT),
-+                             CK_BitCast,
-+                             ArrayLiteralME);
-+  
-+  // Synthesize a call to objc_msgSend().
-+  SmallVector<Expr*, 32> MsgExprs;
-+  SmallVector<Expr*, 4> ClsExprs;
-+  QualType argType = Context->getPointerType(Context->CharTy);
-+  QualType expType = Exp->getType();
-+  
-+  // Create a call to objc_getClass("NSArray"). It will be th 1st argument.
-+  ObjCInterfaceDecl *Class = 
-+    expType->getPointeeType()->getAs<ObjCObjectType>()->getInterface();
-+  
-+  IdentifierInfo *clsName = Class->getIdentifier();
-+  ClsExprs.push_back(StringLiteral::Create(*Context,
-+                                           clsName->getName(),
-+                                           StringLiteral::Ascii, false,
-+                                           argType, SourceLocation()));
-+  CallExpr *Cls = SynthesizeCallToFunctionDecl(GetClassFunctionDecl,
-+                                               &ClsExprs[0],
-+                                               ClsExprs.size(), 
-+                                               StartLoc, EndLoc);
-+  MsgExprs.push_back(Cls);
-+  
-+  // Create a call to sel_registerName("arrayWithObjects:count:").
-+  // it will be the 2nd argument.
-+  SmallVector<Expr*, 4> SelExprs;
-+  ObjCMethodDecl *ArrayMethod = Exp->getArrayWithObjectsMethod();
-+  SelExprs.push_back(StringLiteral::Create(*Context,
-+                                           ArrayMethod->getSelector().getAsString(),
-+                                           StringLiteral::Ascii, false,
-+                                           argType, SourceLocation()));
-+  CallExpr *SelExp = SynthesizeCallToFunctionDecl(SelGetUidFunctionDecl,
-+                                                  &SelExprs[0], SelExprs.size(),
-+                                                  StartLoc, EndLoc);
-+  MsgExprs.push_back(SelExp);
-+  
-+  // (const id [])objects
-+  MsgExprs.push_back(ArrayLiteralObjects);
-+  
-+  // (NSUInteger)cnt
-+  Expr *cnt = IntegerLiteral::Create(*Context,
-+                                     llvm::APInt(UnsignedIntSize, NumElements),
-+                                     Context->UnsignedIntTy, SourceLocation());
-+  MsgExprs.push_back(cnt);
-+  
-+  
-+  SmallVector<QualType, 4> ArgTypes;
-+  ArgTypes.push_back(Context->getObjCIdType());
-+  ArgTypes.push_back(Context->getObjCSelType());
-+  for (ObjCMethodDecl::param_iterator PI = ArrayMethod->param_begin(),
-+       E = ArrayMethod->param_end(); PI != E; ++PI)
-+    ArgTypes.push_back((*PI)->getType());
-+  
-+  QualType returnType = Exp->getType();
-+  // Get the type, we will need to reference it in a couple spots.
-+  QualType msgSendType = MsgSendFlavor->getType();
-+  
-+  // Create a reference to the objc_msgSend() declaration.
-+  DeclRefExpr *DRE = new (Context) DeclRefExpr(MsgSendFlavor, msgSendType,
-+                                               VK_LValue, SourceLocation());
-+  
-+  CastExpr *cast = NoTypeInfoCStyleCastExpr(Context,
-+                                            Context->getPointerType(Context->VoidTy),
-+                                            CK_BitCast, DRE);
-+  
-+  // Now do the "normal" pointer to function cast.
-+  QualType castType =
-+  getSimpleFunctionType(returnType, &ArgTypes[0], ArgTypes.size(),
-+                        ArrayMethod->isVariadic());
-+  castType = Context->getPointerType(castType);
-+  cast = NoTypeInfoCStyleCastExpr(Context, castType, CK_BitCast,
-+                                  cast);
-+  
-+  // Don't forget the parens to enforce the proper binding.
-+  ParenExpr *PE = new (Context) ParenExpr(StartLoc, EndLoc, cast);
-+  
-+  const FunctionType *FT = msgSendType->getAs<FunctionType>();
-+  CallExpr *CE = new (Context) CallExpr(*Context, PE, &MsgExprs[0],
-+                                        MsgExprs.size(),
-+                                        FT->getResultType(), VK_RValue,
-+                                        EndLoc);
-+  ReplaceStmt(Exp, CE);
-+  return CE;
-+}
-+
-+Stmt *RewriteModernObjC::RewriteObjCDictionaryLiteralExpr(ObjCDictionaryLiteral *Exp) {
-+  // synthesize declaration of helper functions needed in this routine.
-+  if (!SelGetUidFunctionDecl)
-+    SynthSelGetUidFunctionDecl();
-+  // use objc_msgSend() for all.
-+  if (!MsgSendFunctionDecl)
-+    SynthMsgSendFunctionDecl();
-+  if (!GetClassFunctionDecl)
-+    SynthGetClassFunctionDecl();
-+  
-+  FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl;
-+  SourceLocation StartLoc = Exp->getLocStart();
-+  SourceLocation EndLoc = Exp->getLocEnd();
-+  
-+  // Build the expression: __NSContainer_literal(int, ...).arr
-+  QualType IntQT = Context->IntTy;
-+  QualType NSDictFType =
-+    getSimpleFunctionType(Context->VoidTy, &IntQT, 1, true);
-+  std::string NSDictFName("__NSContainer_literal");
-+  FunctionDecl *NSDictFD = SynthBlockInitFunctionDecl(NSDictFName);
-+  DeclRefExpr *NSDictDRE = 
-+    new (Context) DeclRefExpr(NSDictFD, NSDictFType, VK_RValue,
-+                              SourceLocation());
-+  
-+  SmallVector<Expr*, 16> KeyExprs;
-+  SmallVector<Expr*, 16> ValueExprs;
-+  
-+  unsigned NumElements = Exp->getNumElements();
-+  unsigned UnsignedIntSize = 
-+    static_cast<unsigned>(Context->getTypeSize(Context->UnsignedIntTy));
-+  Expr *count = IntegerLiteral::Create(*Context,
-+                                       llvm::APInt(UnsignedIntSize, NumElements),
-+                                       Context->UnsignedIntTy, SourceLocation());
-+  KeyExprs.push_back(count);
-+  ValueExprs.push_back(count);
-+  for (unsigned i = 0; i < NumElements; i++) {
-+    ObjCDictionaryElement Element = Exp->getKeyValueElement(i);
-+    KeyExprs.push_back(Element.Key);
-+    ValueExprs.push_back(Element.Value);
-+  }
-+  
-+  // (const id [])objects
-+  Expr *NSValueCallExpr = 
-+    new (Context) CallExpr(*Context, NSDictDRE, &ValueExprs[0], ValueExprs.size(),
-+                           NSDictFType, VK_LValue, SourceLocation());
-+  
-+  FieldDecl *ARRFD = FieldDecl::Create(*Context, 0, SourceLocation(),
-+                                       SourceLocation(),
-+                                       &Context->Idents.get("arr"),
-+                                       Context->getPointerType(Context->VoidPtrTy), 0,
-+                                       /*BitWidth=*/0, /*Mutable=*/true,
-+                                       /*HasInit=*/false);
-+  MemberExpr *DictLiteralValueME = 
-+    new (Context) MemberExpr(NSValueCallExpr, false, ARRFD, 
-+                             SourceLocation(),
-+                             ARRFD->getType(), VK_LValue,
-+                             OK_Ordinary);
-+  QualType ConstIdT = Context->getObjCIdType().withConst();
-+  CStyleCastExpr * DictValueObjects = 
-+    NoTypeInfoCStyleCastExpr(Context, 
-+                             Context->getPointerType(ConstIdT),
-+                             CK_BitCast,
-+                             DictLiteralValueME);
-+  // (const id <NSCopying> [])keys
-+  Expr *NSKeyCallExpr = 
-+    new (Context) CallExpr(*Context, NSDictDRE, &KeyExprs[0], KeyExprs.size(),
-+                           NSDictFType, VK_LValue, SourceLocation());
-+  
-+  MemberExpr *DictLiteralKeyME = 
-+    new (Context) MemberExpr(NSKeyCallExpr, false, ARRFD, 
-+                             SourceLocation(),
-+                             ARRFD->getType(), VK_LValue,
-+                             OK_Ordinary);
-+  
-+  CStyleCastExpr * DictKeyObjects = 
-+    NoTypeInfoCStyleCastExpr(Context, 
-+                             Context->getPointerType(ConstIdT),
-+                             CK_BitCast,
-+                             DictLiteralKeyME);
-+  
-+  
-+  
-+  // Synthesize a call to objc_msgSend().
-+  SmallVector<Expr*, 32> MsgExprs;
-+  SmallVector<Expr*, 4> ClsExprs;
-+  QualType argType = Context->getPointerType(Context->CharTy);
-+  QualType expType = Exp->getType();
-+  
-+  // Create a call to objc_getClass("NSArray"). It will be th 1st argument.
-+  ObjCInterfaceDecl *Class = 
-+  expType->getPointeeType()->getAs<ObjCObjectType>()->getInterface();
-+  
-+  IdentifierInfo *clsName = Class->getIdentifier();
-+  ClsExprs.push_back(StringLiteral::Create(*Context,
-+                                           clsName->getName(),
-+                                           StringLiteral::Ascii, false,
-+                                           argType, SourceLocation()));
-+  CallExpr *Cls = SynthesizeCallToFunctionDecl(GetClassFunctionDecl,
-+                                               &ClsExprs[0],
-+                                               ClsExprs.size(), 
-+                                               StartLoc, EndLoc);
-+  MsgExprs.push_back(Cls);
-+  
-+  // Create a call to sel_registerName("arrayWithObjects:count:").
-+  // it will be the 2nd argument.
-+  SmallVector<Expr*, 4> SelExprs;
-+  ObjCMethodDecl *DictMethod = Exp->getDictWithObjectsMethod();
-+  SelExprs.push_back(StringLiteral::Create(*Context,
-+                                           DictMethod->getSelector().getAsString(),
-+                                           StringLiteral::Ascii, false,
-+                                           argType, SourceLocation()));
-+  CallExpr *SelExp = SynthesizeCallToFunctionDecl(SelGetUidFunctionDecl,
-+                                                  &SelExprs[0], SelExprs.size(),
-+                                                  StartLoc, EndLoc);
-+  MsgExprs.push_back(SelExp);
-+  
-+  // (const id [])objects
-+  MsgExprs.push_back(DictValueObjects);
-+  
-+  // (const id <NSCopying> [])keys
-+  MsgExprs.push_back(DictKeyObjects);
-+  
-+  // (NSUInteger)cnt
-+  Expr *cnt = IntegerLiteral::Create(*Context,
-+                                     llvm::APInt(UnsignedIntSize, NumElements),
-+                                     Context->UnsignedIntTy, SourceLocation());
-+  MsgExprs.push_back(cnt);
-+  
-+  
-+  SmallVector<QualType, 8> ArgTypes;
-+  ArgTypes.push_back(Context->getObjCIdType());
-+  ArgTypes.push_back(Context->getObjCSelType());
-+  for (ObjCMethodDecl::param_iterator PI = DictMethod->param_begin(),
-+       E = DictMethod->param_end(); PI != E; ++PI) {
-+    QualType T = (*PI)->getType();
-+    if (const PointerType* PT = T->getAs<PointerType>()) {
-+      QualType PointeeTy = PT->getPointeeType();
-+      convertToUnqualifiedObjCType(PointeeTy);
-+      T = Context->getPointerType(PointeeTy);
-+    }
-+    ArgTypes.push_back(T);
-+  }
-+  
-+  QualType returnType = Exp->getType();
-+  // Get the type, we will need to reference it in a couple spots.
-+  QualType msgSendType = MsgSendFlavor->getType();
-+  
-+  // Create a reference to the objc_msgSend() declaration.
-+  DeclRefExpr *DRE = new (Context) DeclRefExpr(MsgSendFlavor, msgSendType,
-+                                               VK_LValue, SourceLocation());
-+  
-+  CastExpr *cast = NoTypeInfoCStyleCastExpr(Context,
-+                                            Context->getPointerType(Context->VoidTy),
-+                                            CK_BitCast, DRE);
-+  
-+  // Now do the "normal" pointer to function cast.
-+  QualType castType =
-+  getSimpleFunctionType(returnType, &ArgTypes[0], ArgTypes.size(),
-+                        DictMethod->isVariadic());
-+  castType = Context->getPointerType(castType);
-+  cast = NoTypeInfoCStyleCastExpr(Context, castType, CK_BitCast,
-+                                  cast);
-+  
-+  // Don't forget the parens to enforce the proper binding.
-+  ParenExpr *PE = new (Context) ParenExpr(StartLoc, EndLoc, cast);
-+  
-+  const FunctionType *FT = msgSendType->getAs<FunctionType>();
-+  CallExpr *CE = new (Context) CallExpr(*Context, PE, &MsgExprs[0],
-+                                        MsgExprs.size(),
-+                                        FT->getResultType(), VK_RValue,
-+                                        EndLoc);
-+  ReplaceStmt(Exp, CE);
-+  return CE;
-+}
-+
-+// struct __rw_objc_super { 
-+//   struct objc_object *object; struct objc_object *superClass; 
-+// };
- // struct objc_super { struct objc_object *receiver; struct objc_class *super; };
- QualType RewriteModernObjC::getSuperStructType() {
-   if (!SuperStructDecl) {
-@@ -4801,6 +5234,19 @@
- 
-   if (ObjCStringLiteral *AtString = dyn_cast<ObjCStringLiteral>(S))
-     return RewriteObjCStringLiteral(AtString);
-+  
-+  if (ObjCBoolLiteralExpr *BoolLitExpr = dyn_cast<ObjCBoolLiteralExpr>(S))
-+    return RewriteObjCBoolLiteralExpr(BoolLitExpr);
-+  
-+  if (ObjCBoxedExpr *BoxedExpr = dyn_cast<ObjCBoxedExpr>(S))
-+    return RewriteObjCBoxedExpr(BoxedExpr);
-+  
-+  if (ObjCArrayLiteral *ArrayLitExpr = dyn_cast<ObjCArrayLiteral>(S))
-+    return RewriteObjCArrayLiteralExpr(ArrayLitExpr);
-+  
-+  if (ObjCDictionaryLiteral *DictionaryLitExpr = 
-+        dyn_cast<ObjCDictionaryLiteral>(S))
-+    return RewriteObjCDictionaryLiteralExpr(DictionaryLitExpr);
- 
-   if (ObjCMessageExpr *MessExpr = dyn_cast<ObjCMessageExpr>(S)) {
- #if 0
-Index: lib/Sema/TreeTransform.h
-===================================================================
---- lib/Sema/TreeTransform.h	(revision 152265)
-+++ lib/Sema/TreeTransform.h	(working copy)
-@@ -2211,6 +2211,14 @@
-                                                 RParenLoc);
-   }
- 
-+  /// \brief Build a new Objective-C boxed expression.
-+  ///
-+  /// By default, performs semantic analysis to build the new expression.
-+  /// Subclasses may override this routine to provide different behavior.
-+  ExprResult RebuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) {
-+    return getSema().BuildObjCBoxedExpr(SR, ValueExpr);
-+  }
-+  
-   /// \brief Build a new Objective-C array literal.
-   ///
-   /// By default, performs semantic analysis to build the new expression.
-@@ -8298,8 +8306,16 @@
- 
- template<typename Derived>
- ExprResult
--TreeTransform<Derived>::TransformObjCNumericLiteral(ObjCNumericLiteral *E) {
--  return SemaRef.MaybeBindToTemporary(E);
-+TreeTransform<Derived>::TransformObjCBoxedExpr(ObjCBoxedExpr *E) {
-+  ExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
-+  if (SubExpr.isInvalid())
-+    return ExprError();
-+
-+  if (!getDerived().AlwaysRebuild() &&
-+      SubExpr.get() == E->getSubExpr())
-+    return SemaRef.Owned(E);
-+
-+  return getDerived().RebuildObjCBoxedExpr(E->getSourceRange(), SubExpr.get());
- }
- 
- template<typename Derived>
-Index: lib/Sema/SemaExprCXX.cpp
-===================================================================
---- lib/Sema/SemaExprCXX.cpp	(revision 152265)
-+++ lib/Sema/SemaExprCXX.cpp	(working copy)
-@@ -4469,8 +4469,8 @@
-       ObjCMethodDecl *D = 0;
-       if (ObjCMessageExpr *Send = dyn_cast<ObjCMessageExpr>(E)) {
-         D = Send->getMethodDecl();
--      } else if (ObjCNumericLiteral *NumLit = dyn_cast<ObjCNumericLiteral>(E)) {
--        D = NumLit->getObjCNumericLiteralMethod();
-+      } else if (ObjCBoxedExpr *BoxedExpr = dyn_cast<ObjCBoxedExpr>(E)) {
-+        D = BoxedExpr->getBoxingMethod();
-       } else if (ObjCArrayLiteral *ArrayLit = dyn_cast<ObjCArrayLiteral>(E)) {
-         D = ArrayLit->getArrayWithObjectsMethod();
-       } else if (ObjCDictionaryLiteral *DictLit
-@@ -4529,6 +4529,17 @@
-   if (RD->isInvalidDecl() || RD->isDependentContext())
-     return Owned(E);
- 
-+  if (!RD->getDefinition()) {
-+    if (RD->hasExternalLexicalStorage()) {
-+      ExternalASTSource *ext_source = RD->getASTContext().getExternalSource();
-+      if (ext_source)
-+        ext_source->CompleteType(RD);
-+    }
-+  }
-+
-+  if (!RD->getDefinition())
-+    return Owned(E);
-+
-   bool IsDecltype = ExprEvalContexts.back().IsDecltype;
-   CXXDestructorDecl *Destructor = IsDecltype ? 0 : LookupDestructor(RD);
- 
-Index: lib/Sema/SemaExceptionSpec.cpp
-===================================================================
---- lib/Sema/SemaExceptionSpec.cpp	(revision 152265)
-+++ lib/Sema/SemaExceptionSpec.cpp	(working copy)
-@@ -726,4 +726,4 @@
-                                   New->getLocation());
- }
- 
--} // end namespace clang
-+}
-Index: lib/Sema/SemaChecking.cpp
-===================================================================
---- lib/Sema/SemaChecking.cpp	(revision 152265)
-+++ lib/Sema/SemaChecking.cpp	(working copy)
-@@ -4416,12 +4416,16 @@
- 
-   // Don't consider sizes resulting from macro expansions or template argument
-   // substitution to form C89 tail-padded arrays.
--  ConstantArrayTypeLoc TL =
--    cast<ConstantArrayTypeLoc>(FD->getTypeSourceInfo()->getTypeLoc());
--  const Expr *SizeExpr = dyn_cast<IntegerLiteral>(TL.getSizeExpr());
--  if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
--    return false;
- 
-+  TypeSourceInfo *TInfo = FD->getTypeSourceInfo();
-+  if (TInfo) {
-+    ConstantArrayTypeLoc TL =
-+      cast<ConstantArrayTypeLoc>(TInfo->getTypeLoc());
-+    const Expr *SizeExpr = dyn_cast<IntegerLiteral>(TL.getSizeExpr());
-+    if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
-+      return false;
-+  }
-+
-   const RecordDecl *RD = dyn_cast<RecordDecl>(FD->getDeclContext());
-   if (!RD) return false;
-   if (RD->isUnion()) return false;
-Index: lib/Sema/SemaExprObjC.cpp
-===================================================================
---- lib/Sema/SemaExprObjC.cpp	(revision 152265)
-+++ lib/Sema/SemaExprObjC.cpp	(working copy)
-@@ -111,7 +111,7 @@
-       Ty = Context.getObjCIdType();
-     }
-   } else {
--    IdentifierInfo *NSIdent = &Context.Idents.get("NSString");
-+    IdentifierInfo *NSIdent = NSAPIObj->getNSClassId(NSAPI::ClassId_NSString);
-     NamedDecl *IF = LookupSingleName(TUScope, NSIdent, AtLoc,
-                                      LookupOrdinaryName);
-     if (ObjCInterfaceDecl *StrIF = dyn_cast_or_null<ObjCInterfaceDecl>(IF)) {
-@@ -143,41 +143,70 @@
- /// \brief Retrieve the NSNumber factory method that should be used to create
- /// an Objective-C literal for the given type.
- static ObjCMethodDecl *getNSNumberFactoryMethod(Sema &S, SourceLocation Loc,
--                                                QualType T, QualType ReturnType,
--                                                SourceRange Range) {
-+                                                QualType NumberType,
-+                                                bool isLiteral = false,
-+                                                SourceRange R = SourceRange()) {
-   llvm::Optional<NSAPI::NSNumberLiteralMethodKind> Kind 
--    = S.NSAPIObj->getNSNumberFactoryMethodKind(T);
-+    = S.NSAPIObj->getNSNumberFactoryMethodKind(NumberType);
-   
-   if (!Kind) {
--    S.Diag(Loc, diag::err_invalid_nsnumber_type)
--      << T << Range;
-+    if (isLiteral) {
-+      S.Diag(Loc, diag::err_invalid_nsnumber_type)
-+        << NumberType << R;
-+    }
-     return 0;
-   }
--    
-+  
-   // If we already looked up this method, we're done.
-   if (S.NSNumberLiteralMethods[*Kind])
-     return S.NSNumberLiteralMethods[*Kind];
-   
-   Selector Sel = S.NSAPIObj->getNSNumberLiteralSelector(*Kind,
-                                                         /*Instance=*/false);
-+
-+  ASTContext &CX = S.Context;
-   
-+  // Look up the NSNumber class, if we haven't done so already. It's cached
-+  // in the Sema instance.
-+  if (!S.NSNumberDecl) {
-+    IdentifierInfo *NSNumberId = S.NSAPIObj->getNSClassId(NSAPI::ClassId_NSNumber);
-+    if (S.getLangOptions().DebuggerObjCLiteral) {
-+      // Create a stub definition of NSNumber.
-+      S.NSNumberDecl =  ObjCInterfaceDecl::Create (CX,
-+                                                   CX.getTranslationUnitDecl(),
-+                                                   SourceLocation(),  NSNumberId,
-+                                                   0, SourceLocation());
-+    } else {
-+      // Otherwise, require a declaration of NSNumber.
-+      NamedDecl *IF = S.LookupSingleName(S.TUScope, NSNumberId,
-+                                         Loc, Sema::LookupOrdinaryName);
-+      S.NSNumberDecl = dyn_cast_or_null<ObjCInterfaceDecl>(IF);
-+      if (!S.NSNumberDecl || !S.NSNumberDecl->hasDefinition()) {
-+        S.Diag(Loc, diag::err_undeclared_nsnumber);
-+        return 0;
-+      }
-+    }
-+    
-+    // generate the pointer to NSNumber type.
-+    S.NSNumberPointer = CX.getObjCObjectPointerType(CX.getObjCInterfaceType(S.NSNumberDecl));
-+  }
-+  
-   // Look for the appropriate method within NSNumber.
-   ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel);;
-   if (!Method && S.getLangOptions().DebuggerObjCLiteral) {
-+    // create a stub definition this NSNumber factory method.
-     TypeSourceInfo *ResultTInfo = 0;
--    Method = ObjCMethodDecl::Create(S.Context, SourceLocation(), SourceLocation(), Sel,
--                           ReturnType,
--                           ResultTInfo,
--                           S.Context.getTranslationUnitDecl(),
--                           false /*Instance*/, false/*isVariadic*/,
--                           /*isSynthesized=*/false,
--                           /*isImplicitlyDeclared=*/true, /*isDefined=*/false,
--                           ObjCMethodDecl::Required,
--                           false);
-+    Method = ObjCMethodDecl::Create(CX, SourceLocation(), SourceLocation(), Sel,
-+                                    S.NSNumberPointer, ResultTInfo, S.NSNumberDecl,
-+                                    /*isInstance=*/false, /*isVariadic=*/false,
-+                                    /*isSynthesized=*/false,
-+                                    /*isImplicitlyDeclared=*/true,
-+                                    /*isDefined=*/false, ObjCMethodDecl::Required,
-+                                    /*HasRelatedResultType=*/false);
-     ParmVarDecl *value = ParmVarDecl::Create(S.Context, Method,
-                                              SourceLocation(), SourceLocation(),
--                                             &S.Context.Idents.get("value"),
--                                             T, /*TInfo=*/0, SC_None, SC_None, 0);
-+                                             &CX.Idents.get("value"),
-+                                             NumberType, /*TInfo=*/0, SC_None, SC_None, 0);
-     Method->setMethodParams(S.Context, value, ArrayRef<SourceLocation>());
-   }
- 
-@@ -202,29 +231,9 @@
-   return Method;
- }
- 
--/// BuildObjCNumericLiteral - builds an ObjCNumericLiteral AST node for the
--/// numeric literal expression. Type of the expression will be "NSNumber *"
--/// or "id" if NSNumber is unavailable.
-+/// BuildObjCNumericLiteral - builds an ObjCBoxedExpr AST node for the
-+/// numeric literal expression. Type of the expression will be "NSNumber *".
- ExprResult Sema::BuildObjCNumericLiteral(SourceLocation AtLoc, Expr *Number) {
--  // Look up the NSNumber class, if we haven't done so already.
--  if (!NSNumberDecl) {
--    NamedDecl *IF = LookupSingleName(TUScope,
--                                NSAPIObj->getNSClassId(NSAPI::ClassId_NSNumber),
--                                AtLoc, LookupOrdinaryName);
--    NSNumberDecl = dyn_cast_or_null<ObjCInterfaceDecl>(IF);
--    
--    if (!NSNumberDecl && getLangOptions().DebuggerObjCLiteral)
--      NSNumberDecl =  ObjCInterfaceDecl::Create (Context,
--                        Context.getTranslationUnitDecl(),
--                        SourceLocation(), 
--                        NSAPIObj->getNSClassId(NSAPI::ClassId_NSNumber),
--                        0, SourceLocation());
--    if (!NSNumberDecl) {
--      Diag(AtLoc, diag::err_undeclared_nsnumber);
--      return ExprError();
--    }
--  }
--  
-   // Determine the type of the literal.
-   QualType NumberType = Number->getType();
-   if (CharacterLiteral *Char = dyn_cast<CharacterLiteral>(Number)) {
-@@ -249,29 +258,29 @@
-     }
-   }
-   
--  ObjCMethodDecl *Method = 0;
-   // Look for the appropriate method within NSNumber.
-   // Construct the literal.
--  QualType Ty
--    = Context.getObjCObjectPointerType(
--                                    Context.getObjCInterfaceType(NSNumberDecl));
--  Method  = getNSNumberFactoryMethod(*this, AtLoc, 
--                                     NumberType, Ty, 
--                                     Number->getSourceRange());
--
-+  SourceRange NR(Number->getSourceRange());
-+  ObjCMethodDecl *Method = getNSNumberFactoryMethod(*this, AtLoc, NumberType,
-+                                                    true, NR);
-   if (!Method)
-     return ExprError();
- 
-   // Convert the number to the type that the parameter expects.
--  QualType ElementT = Method->param_begin()[0]->getType();
--  ExprResult ConvertedNumber = PerformImplicitConversion(Number, ElementT,
--                                                         AA_Sending);
-+  ParmVarDecl *ParamDecl = Method->param_begin()[0];
-+  InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
-+                                                                    ParamDecl);
-+  ExprResult ConvertedNumber = PerformCopyInitialization(Entity,
-+                                                         SourceLocation(),
-+                                                         Owned(Number));
-   if (ConvertedNumber.isInvalid())
-     return ExprError();
-   Number = ConvertedNumber.get();
-   
-+  // Use the effective source range of the literal, including the leading '@'.
-   return MaybeBindToTemporary(
--           new (Context) ObjCNumericLiteral(Number, Ty, Method, AtLoc));
-+           new (Context) ObjCBoxedExpr(Number, NSNumberPointer, Method,
-+                                       SourceRange(AtLoc, NR.getEnd())));
- }
- 
- ExprResult Sema::ActOnObjCBoolLiteral(SourceLocation AtLoc, 
-@@ -385,6 +394,154 @@
-            Element->getLocStart(), Element);
- }
- 
-+ExprResult Sema::BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) {
-+  if (ValueExpr->isTypeDependent()) {
-+    ObjCBoxedExpr *BoxedExpr = 
-+      new (Context) ObjCBoxedExpr(ValueExpr, Context.DependentTy, NULL, SR);
-+    return Owned(BoxedExpr);
-+  }
-+  ObjCMethodDecl *BoxingMethod = NULL;
-+  QualType BoxedType;
-+  // Convert the expression to an RValue, so we can check for pointer types...
-+  ExprResult RValue = DefaultFunctionArrayLvalueConversion(ValueExpr);
-+  if (RValue.isInvalid()) {
-+    return ExprError();
-+  }
-+  ValueExpr = RValue.get();
-+  QualType ValueType(ValueExpr->getType());
-+  if (const PointerType *PT = ValueType->getAs<PointerType>()) {
-+    QualType PointeeType = PT->getPointeeType();
-+    if (Context.hasSameUnqualifiedType(PointeeType, Context.CharTy)) {
-+      IdentifierInfo *NSStringId =
-+        NSAPIObj->getNSClassId(NSAPI::ClassId_NSString);
-+      if (getLangOptions().DebuggerObjCLiteral) {
-+        // Support boxed expressions in the debugger w/o NSString declaration.
-+        NSStringDecl = ObjCInterfaceDecl::Create(Context,
-+                                                 Context.getTranslationUnitDecl(),
-+                                                 SourceLocation(), NSStringId,
-+                                                 0, SourceLocation());
-+      }
-+      else {
-+        NamedDecl *Decl = LookupSingleName(TUScope, NSStringId,
-+                                           SR.getBegin(), LookupOrdinaryName);
-+        NSStringDecl = dyn_cast_or_null<ObjCInterfaceDecl>(Decl);
-+
-+        if (!NSStringDecl || !NSStringDecl->hasDefinition()) {
-+          Diag(SR.getBegin(), diag::err_undeclared_nsstring);
-+          return ExprError();
-+        }
-+      }
-+      assert(NSStringDecl && "NSStringDecl should not be NULL");
-+      NSStringPointer =
-+        Context.getObjCObjectPointerType(Context.getObjCInterfaceType(NSStringDecl));
-+      
-+      if (!StringWithUTF8StringMethod) {
-+        IdentifierInfo *II = &Context.Idents.get("stringWithUTF8String");
-+        Selector stringWithUTF8String = Context.Selectors.getUnarySelector(II);
-+
-+        // Look for the appropriate method within NSString.
-+        StringWithUTF8StringMethod = NSStringDecl->lookupClassMethod(stringWithUTF8String);
-+        if (!StringWithUTF8StringMethod && getLangOptions().DebuggerObjCLiteral) {
-+          // Debugger needs to work even if NSString hasn't been defined.
-+          TypeSourceInfo *ResultTInfo = 0;
-+          ObjCMethodDecl *M =
-+            ObjCMethodDecl::Create(Context, SourceLocation(), SourceLocation(),
-+                                   stringWithUTF8String, NSStringPointer,
-+                                   ResultTInfo, NSStringDecl,
-+                                   /*isInstance=*/false, /*isVariadic=*/false,
-+                                   /*isSynthesized=*/false,
-+                                   /*isImplicitlyDeclared=*/true,
-+                                   /*isDefined=*/false,
-+                                   ObjCMethodDecl::Required,
-+                                   /*HasRelatedResultType=*/false);
-+          ParmVarDecl *value =
-+            ParmVarDecl::Create(Context, M,
-+                                SourceLocation(), SourceLocation(),
-+                                &Context.Idents.get("value"),
-+                                Context.getPointerType(Context.CharTy.withConst()),
-+                                /*TInfo=*/0,
-+                                SC_None, SC_None, 0);
-+          M->setMethodParams(Context, value, ArrayRef<SourceLocation>());
-+          StringWithUTF8StringMethod = M;
-+        }
-+        assert(StringWithUTF8StringMethod &&
-+               "StringWithUTF8StringMethod should not be NULL");
-+      }
-+      
-+      BoxingMethod = StringWithUTF8StringMethod;
-+      BoxedType = NSStringPointer;
-+    }
-+  } else if (ValueType->isBuiltinType()) {
-+    // The other types we support are numeric, char and BOOL/bool. We could also
-+    // provide limited support for structure types, such as NSRange, NSRect, and
-+    // NSSize. See NSValue (NSValueGeometryExtensions) in <Foundation/NSGeometry.h>
-+    // for more details.
-+
-+    // Check for a top-level character literal.
-+    if (const CharacterLiteral *Char =
-+        dyn_cast<CharacterLiteral>(ValueExpr->IgnoreParens())) {
-+      // In C, character literals have type 'int'. That's not the type we want
-+      // to use to determine the Objective-c literal kind.
-+      switch (Char->getKind()) {
-+      case CharacterLiteral::Ascii:
-+        ValueType = Context.CharTy;
-+        break;
-+        
-+      case CharacterLiteral::Wide:
-+        ValueType = Context.getWCharType();
-+        break;
-+        
-+      case CharacterLiteral::UTF16:
-+        ValueType = Context.Char16Ty;
-+        break;
-+        
-+      case CharacterLiteral::UTF32:
-+        ValueType = Context.Char32Ty;
-+        break;
-+      }
-+    }
-+    
-+    // FIXME:  Do I need to do anything special with BoolTy expressions?
-+    
-+    // Look for the appropriate method within NSNumber.
-+    BoxingMethod = getNSNumberFactoryMethod(*this, SR.getBegin(), ValueType);
-+    BoxedType = NSNumberPointer;
-+
-+  } else if (const EnumType *ET = ValueType->getAs<EnumType>()) {
-+    if (!ET->getDecl()->isComplete()) {
-+      Diag(SR.getBegin(), diag::err_objc_incomplete_boxed_expression_type)
-+        << ValueType << ValueExpr->getSourceRange();
-+      return ExprError();
-+    }
-+
-+    BoxingMethod = getNSNumberFactoryMethod(*this, SR.getBegin(),
-+                                            ET->getDecl()->getIntegerType());
-+    BoxedType = NSNumberPointer;
-+  }
-+
-+  if (!BoxingMethod) {
-+    Diag(SR.getBegin(), diag::err_objc_illegal_boxed_expression_type)
-+      << ValueType << ValueExpr->getSourceRange();
-+    return ExprError();
-+  }
-+  
-+  // Convert the expression to the type that the parameter requires.
-+  ParmVarDecl *ParamDecl = BoxingMethod->param_begin()[0];
-+  InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
-+                                                                    ParamDecl);
-+  ExprResult ConvertedValueExpr = PerformCopyInitialization(Entity,
-+                                                            SourceLocation(),
-+                                                            Owned(ValueExpr));
-+  if (ConvertedValueExpr.isInvalid())
-+    return ExprError();
-+  ValueExpr = ConvertedValueExpr.get();
-+  
-+  ObjCBoxedExpr *BoxedExpr = 
-+    new (Context) ObjCBoxedExpr(ValueExpr, BoxedType,
-+                                      BoxingMethod, SR);
-+  return MaybeBindToTemporary(BoxedExpr);
-+}
-+
- ExprResult Sema::BuildObjCSubscriptExpression(SourceLocation RB, Expr *BaseExpr,
-                                         Expr *IndexExpr,
-                                         ObjCMethodDecl *getterMethod,
-@@ -417,21 +574,22 @@
- ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {
-   // Look up the NSArray class, if we haven't done so already.
-   if (!NSArrayDecl) {
--    NamedDecl *IF = LookupSingleName(TUScope,
--                                 NSAPIObj->getNSClassId(NSAPI::ClassId_NSArray),
--                                 SR.getBegin(),
--                                 LookupOrdinaryName);
--    NSArrayDecl = dyn_cast_or_null<ObjCInterfaceDecl>(IF);
--    if (!NSArrayDecl && getLangOptions().DebuggerObjCLiteral)
-+    if (getLangOptions().DebuggerObjCLiteral) {
-       NSArrayDecl =  ObjCInterfaceDecl::Create (Context,
-                             Context.getTranslationUnitDecl(),
-                             SourceLocation(),
-                             NSAPIObj->getNSClassId(NSAPI::ClassId_NSArray),
-                             0, SourceLocation());
--
--    if (!NSArrayDecl) {
--      Diag(SR.getBegin(), diag::err_undeclared_nsarray);
--      return ExprError();
-+    } else {
-+      NamedDecl *IF = LookupSingleName(TUScope,
-+                                   NSAPIObj->getNSClassId(NSAPI::ClassId_NSArray),
-+                                   SR.getBegin(),
-+                                   LookupOrdinaryName);
-+      NSArrayDecl = dyn_cast_or_null<ObjCInterfaceDecl>(IF);
-+      if (!NSArrayDecl) {
-+        Diag(SR.getBegin(), diag::err_undeclared_nsarray);
-+        return ExprError();
-+      }
-     }
-   }
-   
-Index: lib/Sema/Sema.cpp
-===================================================================
---- lib/Sema/Sema.cpp	(revision 152265)
-+++ lib/Sema/Sema.cpp	(working copy)
-@@ -90,7 +90,9 @@
-     PackContext(0), MSStructPragmaOn(false), VisContext(0),
-     ExprNeedsCleanups(false), LateTemplateParser(0), OpaqueParser(0),
-     IdResolver(pp), StdInitializerList(0), CXXTypeInfoDecl(0), MSVCGuidDecl(0),
--    NSNumberDecl(0), NSArrayDecl(0), ArrayWithObjectsMethod(0), 
-+    NSNumberDecl(0),
-+    NSStringDecl(0), StringWithUTF8StringMethod(0),
-+    NSArrayDecl(0), ArrayWithObjectsMethod(0), 
-     NSDictionaryDecl(0), DictionaryWithObjectsMethod(0),
-     GlobalNewDeleteDeclared(false), 
-     ObjCShouldCallSuperDealloc(false),
-Index: lib/AST/DeclObjC.cpp
-===================================================================
---- lib/AST/DeclObjC.cpp	(revision 152265)
-+++ lib/AST/DeclObjC.cpp	(working copy)
-@@ -330,6 +330,10 @@
-     LoadExternalDefinition();
- 
-   while (ClassDecl != NULL) {
-+    // FIXME: Should make sure no callers ever do this.
-+    if (!ClassDecl->hasDefinition())
-+      return 0;
-+        
-     if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance)))
-       return MethodDecl;
- 
-Index: lib/AST/ASTImporter.cpp
-===================================================================
---- lib/AST/ASTImporter.cpp	(revision 152265)
-+++ lib/AST/ASTImporter.cpp	(working copy)
-@@ -119,7 +119,8 @@
-     bool ImportTemplateArguments(const TemplateArgument *FromArgs,
-                                  unsigned NumFromArgs,
-                                SmallVectorImpl<TemplateArgument> &ToArgs);
--    bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord);
-+    bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord,
-+                           bool Complain = true);
-     bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord);
-     bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To);
-     Decl *VisitDecl(Decl *D);
-@@ -201,12 +202,16 @@
-     /// \brief Whether we're being strict about the spelling of types when 
-     /// unifying two types.
-     bool StrictTypeSpelling;
--    
-+
-+    /// \brief Whether to complain about failures.
-+    bool Complain;
-+
-     StructuralEquivalenceContext(ASTContext &C1, ASTContext &C2,
-                llvm::DenseSet<std::pair<Decl *, Decl *> > &NonEquivalentDecls,
--                                 bool StrictTypeSpelling = false)
-+                                 bool StrictTypeSpelling = false,
-+                                 bool Complain = true)
-       : C1(C1), C2(C2), NonEquivalentDecls(NonEquivalentDecls),
--        StrictTypeSpelling(StrictTypeSpelling) { }
-+        StrictTypeSpelling(StrictTypeSpelling), Complain(Complain) { }
- 
-     /// \brief Determine whether the two declarations are structurally
-     /// equivalent.
-@@ -223,10 +228,16 @@
-     
-   public:
-     DiagnosticBuilder Diag1(SourceLocation Loc, unsigned DiagID) {
-+      if (!Complain)
-+        return DiagnosticBuilder(DiagnosticBuilder::Suppress);
-+
-       return C1.getDiagnostics().Report(Loc, DiagID);
-     }
- 
-     DiagnosticBuilder Diag2(SourceLocation Loc, unsigned DiagID) {
-+      if (!Complain)
-+        return DiagnosticBuilder(DiagnosticBuilder::Suppress);
-+      
-       return C2.getDiagnostics().Report(Loc, DiagID);
-     }
-   };
-@@ -2050,10 +2061,12 @@
- }
- 
- bool ASTNodeImporter::IsStructuralMatch(RecordDecl *FromRecord, 
--                                        RecordDecl *ToRecord) {
-+                                        RecordDecl *ToRecord,
-+                                        bool Complain) {
-   StructuralEquivalenceContext Ctx(Importer.getFromContext(),
-                                    Importer.getToContext(),
--                                   Importer.getNonEquivalentDecls());
-+                                   Importer.getNonEquivalentDecls(),
-+                                   false, Complain);
-   return Ctx.IsStructurallyEquivalent(FromRecord, ToRecord);
- }
- 
-@@ -2333,7 +2346,7 @@
- 
-   // We may already have a record of the same name; try to find and match it.
-   RecordDecl *AdoptDecl = 0;
--  if (!DC->isFunctionOrMethod() && SearchName) {
-+  if (!DC->isFunctionOrMethod()) {
-     SmallVector<NamedDecl *, 4> ConflictingDecls;
-     llvm::SmallVector<NamedDecl *, 2> FoundDecls;
-     DC->localUncachedLookup(SearchName, FoundDecls);
-@@ -2349,26 +2362,32 @@
-       
-       if (RecordDecl *FoundRecord = dyn_cast<RecordDecl>(Found)) {
-         if (RecordDecl *FoundDef = FoundRecord->getDefinition()) {
--          if (!D->isCompleteDefinition() || IsStructuralMatch(D, FoundDef)) {
-+          if ((SearchName && !D->isCompleteDefinition()) ||
-+              (D->isCompleteDefinition() &&
-+               D->isAnonymousStructOrUnion()
-+                 == FoundDef->isAnonymousStructOrUnion() &&
-+               IsStructuralMatch(D, FoundDef, SearchName))) {
-             // The record types structurally match, or the "from" translation
-             // unit only had a forward declaration anyway; call it the same
-             // function.
-             // FIXME: For C++, we should also merge methods here.
-             return Importer.Imported(D, FoundDef);
-           }
--        } else {
-+        } else if (!D->isCompleteDefinition()) {
-           // We have a forward declaration of this type, so adopt that forward
-           // declaration rather than building a new one.
-           AdoptDecl = FoundRecord;
-           continue;
--        }          
-+        } else if (!SearchName) {
-+          continue;
-+        }
-       }
-       
-       ConflictingDecls.push_back(FoundDecls[I]);
-     }
-     
--    if (!ConflictingDecls.empty()) {
--      Name = Importer.HandleNameConflict(Name, DC, IDNS,
-+    if (!ConflictingDecls.empty() && SearchName) {
-+      Name = Importer.HandleNameConflict(SearchName, DC, IDNS,
-                                          ConflictingDecls.data(), 
-                                          ConflictingDecls.size());
-     }
-@@ -2393,6 +2412,8 @@
-     D2->setQualifierInfo(Importer.Import(D->getQualifierLoc()));
-     D2->setLexicalDeclContext(LexicalDC);
-     LexicalDC->addDeclInternal(D2);
-+    if (D->isAnonymousStructOrUnion())
-+      D2->setAnonymousStructOrUnion(true);
-   }
-   
-   Importer.Imported(D, D2);
-@@ -2631,12 +2652,17 @@
-   DC->localUncachedLookup(Name, FoundDecls);
-   for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
-     if (FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecls[I])) {
--      if (Importer.IsStructurallyEquivalent(D->getType(), 
--                                            FoundField->getType())) {
-+      if (Importer.IsStructurallyEquivalent(D->getType(),
-+                                            FoundField->getType(),
-+                                            Name)) {
-         Importer.Imported(D, FoundField);
-         return FoundField;
-       }
--      
-+
-+      // If there are more anonymous fields to check, continue.
-+      if (!Name && I < N-1)
-+        continue;
-+
-       Importer.ToDiag(Loc, diag::err_odr_field_type_inconsistent)
-         << Name << D->getType() << FoundField->getType();
-       Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
-@@ -4662,12 +4688,14 @@
-   return To;
- }
- 
--bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To) {
-+bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To,
-+                                           bool Complain) {
-   llvm::DenseMap<const Type *, const Type *>::iterator Pos
-    = ImportedTypes.find(From.getTypePtr());
-   if (Pos != ImportedTypes.end() && ToContext.hasSameType(Import(From), To))
-     return true;
-       
--  StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls);
-+  StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls,
-+                                   false, Complain);
-   return Ctx.IsStructurallyEquivalent(From, To);
- }
-Index: lib/AST/NSAPI.cpp
-===================================================================
---- lib/AST/NSAPI.cpp	(revision 152265)
-+++ lib/AST/NSAPI.cpp	(working copy)
-@@ -13,7 +13,7 @@
- using namespace clang;
- 
- NSAPI::NSAPI(ASTContext &ctx)
--  : Ctx(ctx), ClassIds() {
-+  : Ctx(ctx), ClassIds(), BOOLId(0), NSIntegerId(0), NSUIntegerId(0) {
- }
- 
- IdentifierInfo *NSAPI::getNSClassId(NSClassIdKindKind K) const {
-@@ -250,11 +250,22 @@
- }
- 
- llvm::Optional<NSAPI::NSNumberLiteralMethodKind>
--NSAPI::getNSNumberFactoryMethodKind(QualType T) {
-+NSAPI::getNSNumberFactoryMethodKind(QualType T) const {
-   const BuiltinType *BT = T->getAs<BuiltinType>();
-   if (!BT)
-     return llvm::Optional<NSAPI::NSNumberLiteralMethodKind>();
--  
-+
-+  const TypedefType *TDT = T->getAs<TypedefType>();
-+  if (TDT) {
-+    QualType TDTTy = QualType(TDT, 0);
-+    if (isObjCBOOLType(TDTTy))
-+      return NSAPI::NSNumberWithBool;
-+    if (isObjCNSIntegerType(TDTTy))
-+      return NSAPI::NSNumberWithInteger;
-+    if (isObjCNSUIntegerType(TDTTy))
-+      return NSAPI::NSNumberWithUnsignedInteger;
-+  }
-+
-   switch (BT->getKind()) {
-   case BuiltinType::Char_S:
-   case BuiltinType::SChar:
-@@ -309,3 +320,35 @@
-   
-   return llvm::Optional<NSAPI::NSNumberLiteralMethodKind>();
- }
-+
-+/// \brief Returns true if \param T is a typedef of "BOOL" in objective-c.
-+bool NSAPI::isObjCBOOLType(QualType T) const {
-+  return isObjCTypedef(T, "BOOL", BOOLId);
-+}
-+/// \brief Returns true if \param T is a typedef of "NSInteger" in objective-c.
-+bool NSAPI::isObjCNSIntegerType(QualType T) const {
-+  return isObjCTypedef(T, "NSInteger", NSIntegerId);
-+}
-+/// \brief Returns true if \param T is a typedef of "NSUInteger" in objective-c.
-+bool NSAPI::isObjCNSUIntegerType(QualType T) const {
-+  return isObjCTypedef(T, "NSUInteger", NSUIntegerId);
-+}
-+
-+bool NSAPI::isObjCTypedef(QualType T,
-+                          StringRef name, IdentifierInfo *&II) const {
-+  if (!Ctx.getLangOptions().ObjC1)
-+    return false;
-+  if (T.isNull())
-+    return false;
-+
-+  if (!II)
-+    II = &Ctx.Idents.get(name);
-+
-+  while (const TypedefType *TDT = T->getAs<TypedefType>()) {
-+    if (TDT->getDecl()->getDeclName().getAsIdentifierInfo() == II)
-+      return true;
-+    T = TDT->desugar();
-+  }
-+
-+  return false;
-+}
-Index: lib/AST/DeclPrinter.cpp
-===================================================================
---- lib/AST/DeclPrinter.cpp	(revision 152265)
-+++ lib/AST/DeclPrinter.cpp	(working copy)
-@@ -114,6 +114,8 @@
-       BaseType = FTy->getResultType();
-     else if (const VectorType *VTy = BaseType->getAs<VectorType>())
-       BaseType = VTy->getElementType();
-+    else if (const ReferenceType *RTy = BaseType->getAs<ReferenceType>())
-+      BaseType = RTy->getPointeeType();
-     else
-       llvm_unreachable("Unknown declarator!");
-   }
-Index: lib/AST/Type.cpp
-===================================================================
---- lib/AST/Type.cpp	(revision 152265)
-+++ lib/AST/Type.cpp	(working copy)
-@@ -288,6 +288,28 @@
-   return T;
- }
- 
-+/// \brief This will check for a TypedefType by removing any existing sugar
-+/// until it reaches a TypedefType or a non-sugared type.
-+template <> const TypedefType *Type::getAs() const {
-+  const Type *Cur = this;
-+
-+  while (true) {
-+    if (const TypedefType *TDT = dyn_cast<TypedefType>(Cur))
-+      return TDT;
-+    switch (Cur->getTypeClass()) {
-+#define ABSTRACT_TYPE(Class, Parent)
-+#define TYPE(Class, Parent) \
-+    case Class: { \
-+      const Class##Type *Ty = cast<Class##Type>(Cur); \
-+      if (!Ty->isSugared()) return 0; \
-+      Cur = Ty->desugar().getTypePtr(); \
-+      break; \
-+    }
-+#include "clang/AST/TypeNodes.def"
-+    }
-+  }
-+}
-+
- /// getUnqualifiedDesugaredType - Pull any qualifiers and syntactic
- /// sugar off the given type.  This should produce an object of the
- /// same dynamic type as the canonical type.
-Index: lib/AST/RecordLayoutBuilder.cpp
-===================================================================
---- lib/AST/RecordLayoutBuilder.cpp	(revision 152265)
-+++ lib/AST/RecordLayoutBuilder.cpp	(working copy)
-@@ -2313,6 +2313,8 @@
- ASTContext::getObjCLayout(const ObjCInterfaceDecl *D,
-                           const ObjCImplementationDecl *Impl) const {
-   // Retrieve the definition
-+  if (D->hasExternalLexicalStorage() && !D->getDefinition())
-+    getExternalSource()->CompleteType(const_cast<ObjCInterfaceDecl*>(D));
-   D = D->getDefinition();
-   assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!");
- 
-Index: lib/AST/ExprConstant.cpp
-===================================================================
---- lib/AST/ExprConstant.cpp	(revision 152265)
-+++ lib/AST/ExprConstant.cpp	(working copy)
-@@ -3054,7 +3054,7 @@
-   bool VisitUnaryAddrOf(const UnaryOperator *E);
-   bool VisitObjCStringLiteral(const ObjCStringLiteral *E)
-       { return Success(E); }
--  bool VisitObjCNumericLiteral(const ObjCNumericLiteral *E)
-+  bool VisitObjCBoxedExpr(const ObjCBoxedExpr *E)
-       { return Success(E); }    
-   bool VisitAddrLabelExpr(const AddrLabelExpr *E)
-       { return Success(E); }
-@@ -4210,7 +4210,7 @@
- /// character of a string literal.
- template<typename LValue>
- static bool EvaluateBuiltinConstantPForLValue(const LValue &LV) {
--  const Expr *E = LV.getLValueBase().dyn_cast<const Expr*>();
-+  const Expr *E = LV.getLValueBase().template dyn_cast<const Expr*>();
-   return E && isa<StringLiteral>(E) && LV.getLValueOffset().isZero();
- }
- 
-@@ -6259,7 +6259,7 @@
-   case Expr::CXXDependentScopeMemberExprClass:
-   case Expr::UnresolvedMemberExprClass:
-   case Expr::ObjCStringLiteralClass:
--  case Expr::ObjCNumericLiteralClass:
-+  case Expr::ObjCBoxedExprClass:
-   case Expr::ObjCArrayLiteralClass:
-   case Expr::ObjCDictionaryLiteralClass:
-   case Expr::ObjCEncodeExprClass:
-Index: lib/AST/ItaniumMangle.cpp
-===================================================================
---- lib/AST/ItaniumMangle.cpp	(revision 152265)
-+++ lib/AST/ItaniumMangle.cpp	(working copy)
-@@ -2374,7 +2374,7 @@
-   case Expr::ObjCProtocolExprClass:
-   case Expr::ObjCSelectorExprClass:
-   case Expr::ObjCStringLiteralClass:
--  case Expr::ObjCNumericLiteralClass:
-+  case Expr::ObjCBoxedExprClass:
-   case Expr::ObjCArrayLiteralClass:
-   case Expr::ObjCDictionaryLiteralClass:
-   case Expr::ObjCSubscriptRefExprClass:
-Index: lib/AST/StmtPrinter.cpp
-===================================================================
---- lib/AST/StmtPrinter.cpp	(revision 152265)
-+++ lib/AST/StmtPrinter.cpp	(working copy)
-@@ -1679,9 +1679,9 @@
-   VisitStringLiteral(Node->getString());
- }
- 
--void StmtPrinter::VisitObjCNumericLiteral(ObjCNumericLiteral *E) {
-+void StmtPrinter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
-   OS << "@";
--  Visit(E->getNumber());
-+  Visit(E->getSubExpr());
- }
- 
- void StmtPrinter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
-Index: lib/AST/DeclBase.cpp
-===================================================================
---- lib/AST/DeclBase.cpp	(revision 152265)
-+++ lib/AST/DeclBase.cpp	(working copy)
-@@ -1153,14 +1153,14 @@
-   
-   // If there's no external storage, just perform a normal lookup and copy
-   // the results.
--  if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage()) {
-+  if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage() && Name) {
-     lookup_result LookupResults = lookup(Name);
-     Results.insert(Results.end(), LookupResults.first, LookupResults.second);
-     return;
-   }
- 
-   // If we have a lookup table, check there first. Maybe we'll get lucky.
--  if (LookupPtr) {
-+  if (LookupPtr && Name) {
-     StoredDeclsMap::iterator Pos = LookupPtr->find(Name);
-     if (Pos != LookupPtr->end()) {
-       Results.insert(Results.end(), 
-Index: lib/AST/StmtProfile.cpp
-===================================================================
---- lib/AST/StmtProfile.cpp	(revision 152265)
-+++ lib/AST/StmtProfile.cpp	(working copy)
-@@ -982,7 +982,7 @@
-   VisitExpr(S);
- }
- 
--void StmtProfiler::VisitObjCNumericLiteral(const ObjCNumericLiteral *E) {
-+void StmtProfiler::VisitObjCBoxedExpr(const ObjCBoxedExpr *E) {
-   VisitExpr(E);
- }
- 
-Index: lib/AST/Expr.cpp
-===================================================================
---- lib/AST/Expr.cpp	(revision 152265)
-+++ lib/AST/Expr.cpp	(working copy)
-@@ -2100,7 +2100,7 @@
-   case ObjCArrayLiteralClass:
-   case ObjCBoolLiteralExprClass:
-   case ObjCDictionaryLiteralClass:
--  case ObjCNumericLiteralClass:
-+  case ObjCBoxedExprClass:
-     return CT_Can;
- 
-     // Many other things have subexpressions, so we have to test those.
-Index: lib/AST/ExprClassification.cpp
-===================================================================
---- lib/AST/ExprClassification.cpp	(revision 152265)
-+++ lib/AST/ExprClassification.cpp	(working copy)
-@@ -158,7 +158,7 @@
-   case Expr::ObjCSelectorExprClass:
-   case Expr::ObjCProtocolExprClass:
-   case Expr::ObjCStringLiteralClass:
--  case Expr::ObjCNumericLiteralClass:
-+  case Expr::ObjCBoxedExprClass:
-   case Expr::ObjCArrayLiteralClass:
-   case Expr::ObjCDictionaryLiteralClass:
-   case Expr::ObjCBoolLiteralExprClass:
-Index: lib/Lex/PPMacroExpansion.cpp
-===================================================================
---- lib/Lex/PPMacroExpansion.cpp	(revision 152265)
-+++ lib/Lex/PPMacroExpansion.cpp	(working copy)
-@@ -634,6 +634,7 @@
-            .Case("objc_subscripting", LangOpts.ObjCNonFragileABI)
-            .Case("objc_array_literals", LangOpts.ObjC2)
-            .Case("objc_dictionary_literals", LangOpts.ObjC2)
-+           .Case("objc_boxed_expressions", LangOpts.ObjC2)
-            .Case("arc_cf_code_audited", true)
-            // C11 features
-            .Case("c_alignas", LangOpts.C11)
-Index: lib/StaticAnalyzer/Core/ExprEngine.cpp
-===================================================================
---- lib/StaticAnalyzer/Core/ExprEngine.cpp	(revision 152265)
-+++ lib/StaticAnalyzer/Core/ExprEngine.cpp	(working copy)
-@@ -590,7 +590,7 @@
-     case Stmt::ObjCIsaExprClass:
-     case Stmt::ObjCProtocolExprClass:
-     case Stmt::ObjCSelectorExprClass:
--    case Expr::ObjCNumericLiteralClass:
-+    case Expr::ObjCBoxedExprClass:
-     case Stmt::ParenListExprClass:
-     case Stmt::PredefinedExprClass:
-     case Stmt::ShuffleVectorExprClass:
-Index: lib/CodeGen/CGExprScalar.cpp
-===================================================================
---- lib/CodeGen/CGExprScalar.cpp	(revision 152265)
-+++ lib/CodeGen/CGExprScalar.cpp	(working copy)
-@@ -531,8 +531,8 @@
-   Value *VisitObjCStringLiteral(const ObjCStringLiteral *E) {
-     return CGF.EmitObjCStringLiteral(E);
-   }
--  Value *VisitObjCNumericLiteral(ObjCNumericLiteral *E) {
--    return CGF.EmitObjCNumericLiteral(E);
-+  Value *VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
-+    return CGF.EmitObjCBoxedExpr(E);
-   }
-   Value *VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
-     return CGF.EmitObjCArrayLiteral(E);
-Index: lib/CodeGen/CGObjC.cpp
-===================================================================
---- lib/CodeGen/CGObjC.cpp	(revision 152265)
-+++ lib/CodeGen/CGObjC.cpp	(working copy)
-@@ -51,35 +51,36 @@
-   return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType()));
- }
- 
--/// EmitObjCNumericLiteral - This routine generates code for
--/// the appropriate +[NSNumber numberWith<Type>:] method.
-+/// EmitObjCBoxedExpr - This routine generates code to call
-+/// the appropriate expression boxing method. This will either be
-+/// one of +[NSNumber numberWith<Type>:], or +[NSString stringWithUTF8String:].
- ///
--llvm::Value *CodeGenFunction::EmitObjCNumericLiteral(const ObjCNumericLiteral *E) {
-+llvm::Value *
-+CodeGenFunction::EmitObjCBoxedExpr(const ObjCBoxedExpr *E) {
-   // Generate the correct selector for this literal's concrete type.
--  const Expr *NL = E->getNumber();
-+  const Expr *SubExpr = E->getSubExpr();
-   // Get the method.
--  const ObjCMethodDecl *Method = E->getObjCNumericLiteralMethod();
--  assert(Method && "NSNumber method is null");
--  Selector Sel = Method->getSelector();
-+  const ObjCMethodDecl *BoxingMethod = E->getBoxingMethod();
-+  assert(BoxingMethod && "BoxingMethod is null");
-+  assert(BoxingMethod->isClassMethod() && "BoxingMethod must be a class method");
-+  Selector Sel = BoxingMethod->getSelector();
-   
-   // Generate a reference to the class pointer, which will be the receiver.
--  QualType ResultType = E->getType(); // should be NSNumber *
--  const ObjCObjectPointerType *InterfacePointerType = 
--    ResultType->getAsObjCInterfacePointerType();
--  ObjCInterfaceDecl *NSNumberDecl = 
--    InterfacePointerType->getObjectType()->getInterface();
-+  // Assumes that the method was introduced in the class that should be
-+  // messaged (avoids pulling it out of the result type).
-   CGObjCRuntime &Runtime = CGM.getObjCRuntime();
--  llvm::Value *Receiver = Runtime.GetClass(Builder, NSNumberDecl);
--
--  const ParmVarDecl *argDecl = *Method->param_begin();
-+  const ObjCInterfaceDecl *ClassDecl = BoxingMethod->getClassInterface();
-+  llvm::Value *Receiver = Runtime.GetClass(Builder, ClassDecl);
-+  
-+  const ParmVarDecl *argDecl = *BoxingMethod->param_begin();
-   QualType ArgQT = argDecl->getType().getUnqualifiedType();
--  RValue RV = EmitAnyExpr(NL);
-+  RValue RV = EmitAnyExpr(SubExpr);
-   CallArgList Args;
-   Args.add(RV, ArgQT);
--
-+  
-   RValue result = Runtime.GenerateMessageSend(*this, ReturnValueSlot(), 
--                                              ResultType, Sel, Receiver, Args, 
--                                              NSNumberDecl, Method);
-+                                              BoxingMethod->getResultType(), Sel, Receiver, Args, 
-+                                              ClassDecl, BoxingMethod);
-   return Builder.CreateBitCast(result.getScalarVal(), 
-                                ConvertType(E->getType()));
- }
-Index: lib/CodeGen/CodeGenTypes.cpp
-===================================================================
---- lib/CodeGen/CodeGenTypes.cpp	(revision 152265)
-+++ lib/CodeGen/CodeGenTypes.cpp	(working copy)
-@@ -133,6 +133,14 @@
-   // when a class is translated, even though they aren't embedded by-value into
-   // the class.
-   if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD)) {
-+    if (!CRD->hasDefinition() && CRD->hasExternalLexicalStorage()) {
-+      ExternalASTSource *EAS = CRD->getASTContext().getExternalSource();
-+      if (!EAS)
-+        return false;
-+      EAS->CompleteType(const_cast<CXXRecordDecl*>(CRD));
-+      if (!CRD->hasDefinition())
-+        return false;
-+    }
-     for (CXXRecordDecl::base_class_const_iterator I = CRD->bases_begin(),
-          E = CRD->bases_end(); I != E; ++I)
-       if (!isSafeToConvert(I->getType()->getAs<RecordType>()->getDecl(),
-Index: lib/CodeGen/CodeGenFunction.h
-===================================================================
---- lib/CodeGen/CodeGenFunction.h	(revision 152265)
-+++ lib/CodeGen/CodeGenFunction.h	(working copy)
-@@ -2238,7 +2238,7 @@
- 
-   llvm::Value *EmitObjCProtocolExpr(const ObjCProtocolExpr *E);
-   llvm::Value *EmitObjCStringLiteral(const ObjCStringLiteral *E);
--  llvm::Value *EmitObjCNumericLiteral(const ObjCNumericLiteral *E);
-+  llvm::Value *EmitObjCBoxedExpr(const ObjCBoxedExpr *E);
-   llvm::Value *EmitObjCArrayLiteral(const ObjCArrayLiteral *E);
-   llvm::Value *EmitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E);
-   llvm::Value *EmitObjCCollectionLiteral(const Expr *E,
-Index: lib/Parse/ParseObjc.cpp
-===================================================================
---- lib/Parse/ParseObjc.cpp	(revision 152265)
-+++ lib/Parse/ParseObjc.cpp	(working copy)
-@@ -2067,6 +2067,10 @@
-     // Objective-C dictionary literal
-     return ParsePostfixExpressionSuffix(ParseObjCDictionaryLiteral(AtLoc));
-           
-+  case tok::l_paren:
-+    // Objective-C boxed expression
-+    return ParsePostfixExpressionSuffix(ParseObjCBoxedExpr(AtLoc));
-+          
-   default:
-     if (Tok.getIdentifierInfo() == 0)
-       return ExprError(Diag(AtLoc, diag::err_unexpected_at));
-@@ -2581,6 +2585,31 @@
-   return Owned(Actions.BuildObjCNumericLiteral(AtLoc, Lit.take()));
- }
- 
-+/// ParseObjCBoxedExpr -
-+/// objc-box-expression:
-+///       @( assignment-expression )
-+ExprResult
-+Parser::ParseObjCBoxedExpr(SourceLocation AtLoc) {
-+  if (Tok.isNot(tok::l_paren))
-+    return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@");
-+
-+  BalancedDelimiterTracker T(*this, tok::l_paren);
-+  T.consumeOpen();
-+  ExprResult ValueExpr(ParseAssignmentExpression());
-+  if (T.consumeClose())
-+    return ExprError();
-+
-+  if (ValueExpr.isInvalid())
-+    return ExprError();
-+  
-+  // Wrap the sub-expression in a parenthesized expression, to distinguish
-+  // a boxed expression from a literal.
-+  SourceLocation LPLoc = T.getOpenLocation(), RPLoc = T.getCloseLocation();
-+  ValueExpr = Actions.ActOnParenExpr(LPLoc, RPLoc, ValueExpr.take());
-+  return Owned(Actions.BuildObjCBoxedExpr(SourceRange(AtLoc, RPLoc),
-+                                          ValueExpr.take()));
-+}
-+
- ExprResult Parser::ParseObjCArrayLiteral(SourceLocation AtLoc) {
-   ExprVector ElementExprs(Actions);                   // array elements.
-   ConsumeBracket(); // consume the l_square.
-Index: lib/Serialization/ASTReaderStmt.cpp
-===================================================================
---- lib/Serialization/ASTReaderStmt.cpp	(revision 152265)
-+++ lib/Serialization/ASTReaderStmt.cpp	(working copy)
-@@ -823,12 +823,12 @@
-   E->setAtLoc(ReadSourceLocation(Record, Idx));
- }
- 
--void ASTStmtReader::VisitObjCNumericLiteral(ObjCNumericLiteral *E) {
-+void ASTStmtReader::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
-   VisitExpr(E);
-   // could be one of several IntegerLiteral, FloatLiteral, etc.
--  E->Number = Reader.ReadSubStmt();
--  E->ObjCNumericLiteralMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
--  E->AtLoc = ReadSourceLocation(Record, Idx);
-+  E->SubExpr = Reader.ReadSubStmt();
-+  E->BoxingMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);
-+  E->Range = ReadSourceRange(Record, Idx);
- }
- 
- void ASTStmtReader::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
-@@ -1893,8 +1893,8 @@
-     case EXPR_OBJC_STRING_LITERAL:
-       S = new (Context) ObjCStringLiteral(Empty);
-       break;
--    case EXPR_OBJC_NUMERIC_LITERAL:
--      S = new (Context) ObjCNumericLiteral(Empty);
-+    case EXPR_OBJC_BOXED_EXPRESSION:
-+      S = new (Context) ObjCBoxedExpr(Empty);
-       break;
-     case EXPR_OBJC_ARRAY_LITERAL:
-       S = ObjCArrayLiteral::CreateEmpty(Context,
-Index: lib/Serialization/ASTWriter.cpp
-===================================================================
---- lib/Serialization/ASTWriter.cpp	(revision 152265)
-+++ lib/Serialization/ASTWriter.cpp	(working copy)
-@@ -696,7 +696,7 @@
-   RECORD(EXPR_BLOCK_DECL_REF);
-   RECORD(EXPR_GENERIC_SELECTION);
-   RECORD(EXPR_OBJC_STRING_LITERAL);
--  RECORD(EXPR_OBJC_NUMERIC_LITERAL);
-+  RECORD(EXPR_OBJC_BOXED_EXPRESSION);
-   RECORD(EXPR_OBJC_ARRAY_LITERAL);
-   RECORD(EXPR_OBJC_DICTIONARY_LITERAL);
-   RECORD(EXPR_OBJC_ENCODE);
-Index: lib/Serialization/ASTWriterStmt.cpp
-===================================================================
---- lib/Serialization/ASTWriterStmt.cpp	(revision 152265)
-+++ lib/Serialization/ASTWriterStmt.cpp	(working copy)
-@@ -783,12 +783,12 @@
-   Code = serialization::EXPR_OBJC_STRING_LITERAL;
- }
- 
--void ASTStmtWriter::VisitObjCNumericLiteral(ObjCNumericLiteral *E) {
-+void ASTStmtWriter::VisitObjCBoxedExpr(ObjCBoxedExpr *E) {
-   VisitExpr(E);
--  Writer.AddStmt(E->getNumber());
--  Writer.AddDeclRef(E->getObjCNumericLiteralMethod(), Record);
--  Writer.AddSourceLocation(E->getAtLoc(), Record);
--  Code = serialization::EXPR_OBJC_NUMERIC_LITERAL;
-+  Writer.AddStmt(E->getSubExpr());
-+  Writer.AddDeclRef(E->getBoxingMethod(), Record);
-+  Writer.AddSourceRange(E->getSourceRange(), Record);
-+  Code = serialization::EXPR_OBJC_BOXED_EXPRESSION;
- }
- 
- void ASTStmtWriter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {

Modified: lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl (original)
+++ lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl Thu Jun  6 19:06:43 2013
@@ -771,22 +771,24 @@ sub dump_general_query_rsp
 			
 				my $reg_name = undef;
 				my $byte_size = 0;
+				my $pseudo = 0;
 				foreach (@name_and_values)
 				{
 					my ($name, $value) = split /:/;				
 					if    ($name eq "name") { $reg_name = $value; }
-					elsif ($name eq "bitsize") { $byte_size = $value / 8; last; }
+					elsif ($name eq "bitsize") { $byte_size = $value / 8; }
+					elsif ($name eq "container-regs") { $pseudo = 1; }
 				}
 				if (defined $reg_name and $byte_size > 0)
 				{
-					if    ($byte_size == 4)  {push @$registers_aref, { name => $reg_name, info => $reg32_href };}
-					elsif ($byte_size == 8)  {push @$registers_aref, { name => $reg_name, info => $reg64_href };}
-					elsif ($byte_size == 1)  {push @$registers_aref, { name => $reg_name, info => $reg8_href };}
-					elsif ($byte_size == 2)  {push @$registers_aref, { name => $reg_name, info => $reg16_href };}
-					elsif ($byte_size == 10) {push @$registers_aref, { name => $reg_name, info => $reg80_href };}
-					elsif ($byte_size == 12) {push @$registers_aref, { name => $reg_name, info => $float96_href };}
-					elsif ($byte_size == 16) {push @$registers_aref, { name => $reg_name, info => $reg128_href };}
-					elsif ($byte_size == 32) {push @$registers_aref, { name => $reg_name, info => $reg256_href };}
+					if    ($byte_size == 4)  {push @$registers_aref, { name => $reg_name, info => $reg32_href   , pseudo => $pseudo };}
+					elsif ($byte_size == 8)  {push @$registers_aref, { name => $reg_name, info => $reg64_href   , pseudo => $pseudo };}
+					elsif ($byte_size == 1)  {push @$registers_aref, { name => $reg_name, info => $reg8_href    , pseudo => $pseudo };}
+					elsif ($byte_size == 2)  {push @$registers_aref, { name => $reg_name, info => $reg16_href   , pseudo => $pseudo };}
+					elsif ($byte_size == 10) {push @$registers_aref, { name => $reg_name, info => $reg80_href   , pseudo => $pseudo };}
+					elsif ($byte_size == 12) {push @$registers_aref, { name => $reg_name, info => $float96_href , pseudo => $pseudo };}
+					elsif ($byte_size == 16) {push @$registers_aref, { name => $reg_name, info => $reg128_href  , pseudo => $pseudo };}
+					elsif ($byte_size == 32) {push @$registers_aref, { name => $reg_name, info => $reg256_href  , pseudo => $pseudo };}
 				}
 			}
 			elsif ($gen_query_rsp_len == 3 and index($gen_query_rsp, 'E') == 0)
@@ -883,12 +885,15 @@ sub dump_write_regs_cmd
     foreach my $reg_href (@$registers_aref)
     {
 		last if ($_[0] eq '#');
-        my $reg_info_href = $reg_href->{info};
-        my $reg_name = $reg_href->{name};
-        my $reg_extract = $reg_info_href->{extract};
-        my $reg_format = $reg_info_href->{format};
-        my $reg_val = &$reg_extract(\@_);
-		printf("\t%*s = $reg_format\n", $max_register_name_len, $reg_name, $reg_val);
+		if ($reg_href->{pseudo} == 0)
+		{
+            my $reg_info_href = $reg_href->{info};
+            my $reg_name = $reg_href->{name};
+            my $reg_extract = $reg_info_href->{extract};
+            my $reg_format = $reg_info_href->{format};
+            my $reg_val = &$reg_extract(\@_);
+    		printf("\t%*s = $reg_format\n", $max_register_name_len, $reg_name, $reg_val);		    
+		}
 	}			
 }
 
@@ -901,12 +906,15 @@ sub dump_read_regs_rsp
 	    foreach my $reg_href (@$registers_aref)
 	    {
 			last if ($_[0] eq '#');
-	        my $reg_info_href = $reg_href->{info};
-	        my $reg_name = $reg_href->{name};
-	        my $reg_extract = $reg_info_href->{extract};
-            my $reg_format = $reg_info_href->{format};
-            my $reg_val = &$reg_extract(\@_);
-			printf("\t%*s = $reg_format\n", $max_register_name_len, $reg_name, $reg_val);
+    		if ($reg_href->{pseudo} == 0)
+    		{
+    	        my $reg_info_href = $reg_href->{info};
+    	        my $reg_name = $reg_href->{name};
+    	        my $reg_extract = $reg_info_href->{extract};
+                my $reg_format = $reg_info_href->{format};
+                my $reg_val = &$reg_extract(\@_);
+    			printf("\t%*s = $reg_format\n", $max_register_name_len, $reg_name, $reg_val);
+			}
 		}			
 	}
 }
@@ -1237,6 +1245,10 @@ sub dump_extended_cmd
 	{
 		dump_extended_continue_cmd(splice(@_,5));
 	}
+	elsif (join('', @_[0..7]) eq 'vAttach;')
+	{
+		dump_attach_command (splice(@_,8));
+	}
 	elsif (join('', @_[0..11]) eq 'vAttachWait;')
 	{
 		dump_attach_wait_command (splice(@_,12));
@@ -1270,6 +1282,15 @@ sub dump_attach_wait_command
 }
 
 #----------------------------------------------------------------------
+# 'vAttach' command
+#----------------------------------------------------------------------
+sub dump_attach_command
+{
+	printf("attach ( pid = %i )", get_hex(\@_));
+	$extended_rsp_callback = \&dump_stop_reply_packet;
+}
+
+#----------------------------------------------------------------------
 # 'vCont' command
 #----------------------------------------------------------------------
 sub dump_extended_continue_cmd

Modified: lldb/branches/lldb-platform-work/scripts/finish-swig-wrapper-classes.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/finish-swig-wrapper-classes.sh?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/finish-swig-wrapper-classes.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/finish-swig-wrapper-classes.sh Thu Jun  6 19:06:43 2013
@@ -3,9 +3,9 @@
 # finish-swig-wrapper-classes.sh
 #
 # For each scripting language liblldb supports, we need to create the
-# appropriate Script Bridge wrapper classes for that language so that 
+# appropriate Script Bridge wrapper classes for that language so that
 # users can call Script Bridge functions from within the script interpreter.
-# 
+#
 # We use SWIG to create a C++ file containing the appropriate wrapper classes
 # and funcitons for each scripting language, before liblldb is built (thus
 # the C++ file can be compiled into liblldb.  In some cases, additional work
@@ -26,18 +26,29 @@ SRC_ROOT=$1
 TARGET_DIR=$2
 CONFIG_BUILD_DIR=$3
 PREFIX=$4
-debug_flag=$5
 
-if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
+shift 4
+
+if [ -n "$1" -a "$1" = "-debug" ]
 then
+    debug_flag=$1
     Debug=1
+    shift
 else
+    debug_flag=""
     Debug=0
 fi
 
+if [ -n "$1" -a "$1" = "-m" ]
+then
+    makefile_flag="$1"
+    shift
+else
+    makefile_flag=""
+fi
 
 #
-# For each scripting language, see if a post-processing script for that 
+# For each scripting language, see if a post-processing script for that
 # language exists, and if so, call it.
 #
 # For now the only language we support is Python, but we expect this to
@@ -48,7 +59,7 @@ cwd=${SRC_ROOT}/scripts
 
 for curlang in $languages
 do
-    if [ $Debug == 1 ]
+    if [ $Debug -eq 1 ]
     then
         echo "Current language is $curlang"
     fi
@@ -59,7 +70,7 @@ do
         continue
     else
 
-        if [ $Debug == 1 ]
+        if [ $Debug -eq 1 ]
         then
             echo "Found $curlang sub-directory"
         fi
@@ -70,14 +81,14 @@ do
 
         if [ -f $filename ]
         then
-            if [ $Debug == 1 ]
+            if [ $Debug -eq 1 ]
             then
                 echo "Found $curlang post-processing script for LLDB"
                 echo "Executing $curlang post-processing script..."
             fi
 
-            
-            ./finish-swig-${curlang}-LLDB.sh $SRC_ROOT $TARGET_DIR $CONFIG_BUILD_DIR "${PREFIX}" "${debug_flag}"
+
+            ./finish-swig-${curlang}-LLDB.sh $SRC_ROOT $TARGET_DIR $CONFIG_BUILD_DIR "${PREFIX}" "${debug_flag}" "${makefile_flag}"
         fi
     fi
 done

Modified: lldb/branches/lldb-platform-work/scripts/generate-vers.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/generate-vers.pl?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/generate-vers.pl (original)
+++ lldb/branches/lldb-platform-work/scripts/generate-vers.pl Thu Jun  6 19:06:43 2013
@@ -10,27 +10,37 @@ sub usage()
 
 open $pbxproj, $ARGV[0] or die "Couldn't open ".$ARGV[0];
 
-$current_project_version = None;
-$product_name = None;
+$lldb_version = None;
+$lldb_train = None;
+$lldb_revision = None;
+$lldb_version_string = None;
+
+$product_name = "lldb";
 
 while ($line = <$pbxproj>)
 {
   chomp ($line);
   
-  if ($current_project_version == None &&
-      $line =~ /CURRENT_PROJECT_VERSION = ([0-9]+)/)
-  {
-    $current_project_version = $1;
-  }
-  
-  if ($product_name == None &&
-      $line =~ /productName = ([^;]+)/)
+  if ($lldb_version == None &&
+      $line =~ /CURRENT_PROJECT_VERSION = ([0-9]+).([0-9]+).([0-9]+)(.[0-9])?/)
   {
-    $product_name = $1;
+    $lldb_version = $1;
+    $lldb_train = $2;
+    $lldb_revision = $3;
+    $lldb_patchlevel = $4;
+
+    if ($lldb_patchlevel != None)
+    {
+      $lldb_version_string = $lldb_version.".".$lldb_train.".".$lldb_revision.".".$lldb_patchlevel;
+    }
+    else
+    {
+      $lldb_version_string = $lldb_version.".".$lldb_train.".".$lldb_revision;
+    } 
   }
 }
 
-if (!$product_name || !$current_project_version)
+if (!$product_name || !$lldb_version_string)
 {
   print "Couldn't get needed information from the .pbxproj";
   exit(-1);
@@ -41,6 +51,6 @@ $lowercase_name = lc $product_name;
 
 close $pbxproj;
 
-$file_string = " const unsigned char liblldb_coreVersionString[] __attribute__ ((used)) = \"@(#)PROGRAM:".$uppercase_name."  PROJECT:".$lowercase_name."-".$current_project_version."\" \"\\n\"; const double liblldb_coreVersionNumber __attribute__ ((used)) = (double)".$current_project_version.".;\n";
+$file_string = " const unsigned char liblldb_coreVersionString[] __attribute__ ((used)) = \"@(#)PROGRAM:".$uppercase_name."  PROJECT:".$lowercase_name."-".$lldb_version_string."\" \"\\n\"; const double liblldb_coreVersionNumber __attribute__ ((used)) = (double)".$lldb_version.".".$lldb_train.";\n";
 
 print $file_string;

Modified: lldb/branches/lldb-platform-work/scripts/lldb.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/lldb.swig?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/lldb.swig (original)
+++ lldb/branches/lldb-platform-work/scripts/lldb.swig Thu Jun  6 19:06:43 2013
@@ -63,8 +63,10 @@ import os
 #include "lldb/API/SBCompileUnit.h"
 #include "lldb/API/SBData.h"
 #include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBDeclaration.h"
 #include "lldb/API/SBError.h"
 #include "lldb/API/SBEvent.h"
+#include "lldb/API/SBExpressionOptions.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFileSpecList.h"
 #include "lldb/API/SBFrame.h"
@@ -100,7 +102,7 @@ import os
 
 /* Various liblldb typedefs that SWIG needs to know about.  */
 #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */
-%include <stdint.h>
+%include "stdint.i"
 %include "lldb/lldb-defines.h"
 %include "lldb/lldb-enumerations.h"
 %include "lldb/lldb-forward.h"
@@ -121,8 +123,10 @@ import os
 %include "./Python/interface/SBCompileUnit.i"
 %include "./Python/interface/SBData.i"
 %include "./Python/interface/SBDebugger.i"
+%include "./Python/interface/SBDeclaration.i"
 %include "./Python/interface/SBError.i"
 %include "./Python/interface/SBEvent.i"
+%include "./Python/interface/SBExpressionOptions.i"
 %include "./Python/interface/SBFileSpec.i"
 %include "./Python/interface/SBFileSpecList.i"
 %include "./Python/interface/SBFrame.i"

Removed: lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff?rev=183467&view=auto
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff (original)
+++ lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff (removed)
@@ -1,1426 +0,0 @@
-Index: include/llvm/ADT/PointerUnion.h
-===================================================================
---- include/llvm/ADT/PointerUnion.h	(revision 152265)
-+++ include/llvm/ADT/PointerUnion.h	(working copy)
-@@ -266,7 +266,7 @@
-         ::llvm::PointerUnionTypeSelector<PT1, T, IsInnerUnion,
-           ::llvm::PointerUnionTypeSelector<PT2, T, IsInnerUnion, IsPT3 >
-                                                                    >::Return Ty;
--      return Ty(Val).is<T>();
-+      return Ty(Val).template is<T>();
-     }
-     
-     /// get<T>() - Return the value of the specified pointer type. If the
-@@ -279,7 +279,7 @@
-         ::llvm::PointerUnionTypeSelector<PT1, T, IsInnerUnion,
-           ::llvm::PointerUnionTypeSelector<PT2, T, IsInnerUnion, IsPT3 >
-                                                                    >::Return Ty;
--      return Ty(Val).get<T>();
-+      return Ty(Val).template get<T>();
-     }
-     
-     /// dyn_cast<T>() - If the current value is of the specified pointer type,
-Index: include/llvm/ADT/IntervalMap.h
-===================================================================
---- include/llvm/ADT/IntervalMap.h	(revision 152265)
-+++ include/llvm/ADT/IntervalMap.h	(working copy)
-@@ -1977,7 +1977,7 @@
-     CurSize[Nodes] = CurSize[NewNode];
-     Node[Nodes] = Node[NewNode];
-     CurSize[NewNode] = 0;
--    Node[NewNode] = this->map->newNode<NodeT>();
-+    Node[NewNode] = this->map->template newNode<NodeT>();
-     ++Nodes;
-   }
- 
-Index: utils/TableGen/X86RecognizableInstr.cpp
-===================================================================
---- utils/TableGen/X86RecognizableInstr.cpp	(revision 152265)
-+++ utils/TableGen/X86RecognizableInstr.cpp	(working copy)
-@@ -405,13 +405,13 @@
-     return FILTER_STRONG;
-     
-     
--  // Filter out artificial instructions
-+  // Filter out artificial instructions but leave in the LOCK_PREFIX so it is
-+  // printed as a separate "instruction".
-     
-   if (Name.find("_Int") != Name.npos       ||
-       Name.find("Int_") != Name.npos       ||
-       Name.find("_NOREX") != Name.npos     ||
--      Name.find("2SDL") != Name.npos       ||
--      Name == "LOCK_PREFIX")
-+      Name.find("2SDL") != Name.npos)
-     return FILTER_STRONG;
- 
-   // Filter out instructions with segment override prefixes.
-Index: lib/Target/ARM/ARMJITInfo.cpp
-===================================================================
---- lib/Target/ARM/ARMJITInfo.cpp	(revision 152265)
-+++ lib/Target/ARM/ARMJITInfo.cpp	(working copy)
-@@ -61,7 +61,7 @@
-     // concerned, so we can't just preserve the callee saved regs.
-     "stmdb sp!, {r0, r1, r2, r3, lr}\n"
- #if (defined(__VFP_FP__) && !defined(__SOFTFP__))
--    "fstmfdd sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n"
-+    "vstmdb sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n"
- #endif
-     // The LR contains the address of the stub function on entry.
-     // pass it as the argument to the C part of the callback
-@@ -85,7 +85,7 @@
-     //
- #if (defined(__VFP_FP__) && !defined(__SOFTFP__))
-     // Restore VFP caller-saved registers.
--    "fldmfdd sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n"
-+    "vldmia sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n"
- #endif
-     //
-     //      We need to exchange the values in slots 0 and 1 so we can
-Index: lib/Target/ARM/ARMInstrNEON.td
-===================================================================
---- lib/Target/ARM/ARMInstrNEON.td	(revision 152265)
-+++ lib/Target/ARM/ARMInstrNEON.td	(working copy)
-@@ -4795,12 +4795,12 @@
- 
- // Vector Swap
- def  VSWPd    : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
--                     (outs DPR:$Vd, DPR:$Vd1), (ins DPR:$Vm, DPR:$Vm1),
--                     NoItinerary, "vswp", "$Vd, $Vd1", "$Vm = $Vd, $Vm1 = $Vd1",
-+                     (outs DPR:$Vd, DPR:$Vm), (ins DPR:$in1, DPR:$in2),
-+                     NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
-                      []>;
- def  VSWPq    : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
--                     (outs QPR:$Vd, QPR:$Vd1), (ins QPR:$Vm, QPR:$Vm1),
--                     NoItinerary, "vswp", "$Vd, $Vd1", "$Vm = $Vd, $Vm1 = $Vd1",
-+                     (outs QPR:$Vd, QPR:$Vm), (ins QPR:$in1, QPR:$in2),
-+                     NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
-                      []>;
- 
- // Vector Move Operations.
-Index: lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
-===================================================================
---- lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp	(revision 152265)
-+++ lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp	(working copy)
-@@ -212,12 +212,12 @@
-   } else {
-     assert(Op.isExpr() && "unknown operand kind in printOperand");
-     // If a symbolic branch target was added as a constant expression then print
--    // that address in hex.
-+    // that address in hex. And only print 32 unsigned bits for the address.
-     const MCConstantExpr *BranchTarget = dyn_cast<MCConstantExpr>(Op.getExpr());
-     int64_t Address;
-     if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) {
-       O << "0x";
--      O.write_hex(Address);
-+      O.write_hex((uint32_t)Address);
-     }
-     else {
-       // Otherwise, just print the expression.
-Index: lib/Target/ARM/ARMInstrThumb2.td
-===================================================================
---- lib/Target/ARM/ARMInstrThumb2.td	(revision 152265)
-+++ lib/Target/ARM/ARMInstrThumb2.td	(working copy)
-@@ -3198,6 +3198,7 @@
-   let Inst{13} = target{17};
-   let Inst{21-16} = target{16-11};
-   let Inst{10-0} = target{10-0};
-+  let DecoderMethod = "DecodeT2BInstruction";
- }
- 
- let isNotDuplicable = 1, isIndirectBranch = 1 in {
-Index: lib/Target/ARM/ARMInstrThumb.td
-===================================================================
---- lib/Target/ARM/ARMInstrThumb.td	(revision 152265)
-+++ lib/Target/ARM/ARMInstrThumb.td	(working copy)
-@@ -413,11 +413,11 @@
-                   "bl${p}\t$func",
-                   [(ARMtcall tglobaladdr:$func)]>,
-              Requires<[IsThumb, IsNotIOS]> {
--    bits<22> func;
--    let Inst{26} = func{21};
-+    bits<24> func;
-+    let Inst{26} = func{23};
-     let Inst{25-16} = func{20-11};
--    let Inst{13} = 1;
--    let Inst{11} = 1;
-+    let Inst{13} = func{22};
-+    let Inst{11} = func{21};
-     let Inst{10-0} = func{10-0};
-   }
- 
-@@ -427,10 +427,11 @@
-                    "blx${p}\t$func",
-                    [(ARMcall tglobaladdr:$func)]>,
-               Requires<[IsThumb, HasV5T, IsNotIOS]> {
--    bits<21> func;
-+    bits<24> func;
-+    let Inst{26} = func{23};
-     let Inst{25-16} = func{20-11};
--    let Inst{13} = 1;
--    let Inst{11} = 1;
-+    let Inst{13} = func{22};
-+    let Inst{11} = func{21};
-     let Inst{10-1} = func{10-1};
-     let Inst{0} = 0; // func{0} is assumed zero
-   }
-Index: lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
-===================================================================
---- lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp	(revision 152265)
-+++ lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp	(working copy)
-@@ -397,39 +397,65 @@
-     return swapped;
-   }
-   case ARM::fixup_arm_thumb_bl: {
--    // The value doesn't encode the low bit (always zero) and is offset by
--    // four. The value is encoded into disjoint bit positions in the destination
--    // opcode. x = unchanged, I = immediate value bit, S = sign extension bit
--    //
--    //   BL:  xxxxxSIIIIIIIIII xxxxxIIIIIIIIIII
--    //
--    // Note that the halfwords are stored high first, low second; so we need
--    // to transpose the fixup value here to map properly.
--    unsigned isNeg = (int64_t(Value - 4) < 0) ? 1 : 0;
--    uint32_t Binary = 0;
--    Value = 0x3fffff & ((Value - 4) >> 1);
--    Binary  = (Value & 0x7ff) << 16;    // Low imm11 value.
--    Binary |= (Value & 0x1ffc00) >> 11; // High imm10 value.
--    Binary |= isNeg << 10;              // Sign bit.
--    return Binary;
-+     // The value doesn't encode the low bit (always zero) and is offset by
-+     // four. The 32-bit immediate value is encoded as
-+     //   imm32 = SignExtend(S:I1:I2:imm10:imm11:0)
-+     // where I1 = NOT(J1 ^ S) and I2 = NOT(J2 ^ S).
-+     // The value is encoded into disjoint bit positions in the destination
-+     // opcode. x = unchanged, I = immediate value bit, S = sign extension bit,
-+     // J = either J1 or J2 bit
-+     //
-+     //   BL:  xxxxxSIIIIIIIIII xxJxJIIIIIIIIIII
-+     //
-+     // Note that the halfwords are stored high first, low second; so we need
-+     // to transpose the fixup value here to map properly.
-+     uint32_t offset = (Value - 4) >> 1;
-+     uint32_t signBit = (offset & 0x800000) >> 23;
-+     uint32_t I1Bit = (offset & 0x400000) >> 22;
-+     uint32_t J1Bit = (I1Bit ^ 0x1) ^ signBit;
-+     uint32_t I2Bit = (offset & 0x200000) >> 21;
-+     uint32_t J2Bit = (I2Bit ^ 0x1) ^ signBit;
-+     uint32_t imm10Bits = (offset & 0x1FF800) >> 11;
-+     uint32_t imm11Bits = (offset & 0x000007FF);
-+ 
-+     uint32_t Binary = 0;
-+     uint32_t firstHalf = (((uint16_t)signBit << 10) | (uint16_t)imm10Bits);
-+     uint32_t secondHalf = (((uint16_t)J1Bit << 13) | ((uint16_t)J2Bit << 11) |
-+                           (uint16_t)imm11Bits);
-+     Binary |= secondHalf << 16;
-+     Binary |= firstHalf;
-+     return Binary;
-+
-   }
-   case ARM::fixup_arm_thumb_blx: {
--    // The value doesn't encode the low two bits (always zero) and is offset by
--    // four (see fixup_arm_thumb_cp). The value is encoded into disjoint bit
--    // positions in the destination opcode. x = unchanged, I = immediate value
--    // bit, S = sign extension bit, 0 = zero.
--    //
--    //   BLX: xxxxxSIIIIIIIIII xxxxxIIIIIIIIII0
--    //
--    // Note that the halfwords are stored high first, low second; so we need
--    // to transpose the fixup value here to map properly.
--    unsigned isNeg = (int64_t(Value-4) < 0) ? 1 : 0;
--    uint32_t Binary = 0;
--    Value = 0xfffff & ((Value - 2) >> 2);
--    Binary  = (Value & 0x3ff) << 17;    // Low imm10L value.
--    Binary |= (Value & 0xffc00) >> 10;  // High imm10H value.
--    Binary |= isNeg << 10;              // Sign bit.
--    return Binary;
-+     // The value doesn't encode the low two bits (always zero) and is offset by
-+     // four (see fixup_arm_thumb_cp). The 32-bit immediate value is encoded as
-+     //   imm32 = SignExtend(S:I1:I2:imm10H:imm10L:00)
-+     // where I1 = NOT(J1 ^ S) and I2 = NOT(J2 ^ S).
-+     // The value is encoded into disjoint bit positions in the destination 
-+     // opcode. x = unchanged, I = immediate value bit, S = sign extension bit, 
-+     // J = either J1 or J2 bit, 0 = zero.
-+     //
-+     //   BLX: xxxxxSIIIIIIIIII xxJxJIIIIIIIIII0
-+     //
-+     // Note that the halfwords are stored high first, low second; so we need
-+     // to transpose the fixup value here to map properly.
-+     uint32_t offset = (Value - 2) >> 2;
-+     uint32_t signBit = (offset & 0x400000) >> 22;
-+     uint32_t I1Bit = (offset & 0x200000) >> 21;
-+     uint32_t J1Bit = (I1Bit ^ 0x1) ^ signBit;
-+     uint32_t I2Bit = (offset & 0x100000) >> 20;
-+     uint32_t J2Bit = (I2Bit ^ 0x1) ^ signBit;
-+     uint32_t imm10HBits = (offset & 0xFFC00) >> 10;
-+     uint32_t imm10LBits = (offset & 0x3FF);
-+ 
-+     uint32_t Binary = 0;
-+     uint32_t firstHalf = (((uint16_t)signBit << 10) | (uint16_t)imm10HBits);
-+     uint32_t secondHalf = (((uint16_t)J1Bit << 13) | ((uint16_t)J2Bit << 11) | 
-+                           ((uint16_t)imm10LBits) << 1);
-+     Binary |= secondHalf << 16;
-+     Binary |= firstHalf;
-+     return Binary;
-   }
-   case ARM::fixup_arm_thumb_cp:
-     // Offset by 4, and don't encode the low two bits. Two bytes of that
-Index: lib/Target/ARM/Disassembler/ARMDisassembler.cpp
-===================================================================
---- lib/Target/ARM/Disassembler/ARMDisassembler.cpp	(revision 152265)
-+++ lib/Target/ARM/Disassembler/ARMDisassembler.cpp	(working copy)
-@@ -182,6 +182,8 @@
-                                uint64_t Address, const void *Decoder);
- static DecodeStatus DecodeAddrMode7Operand(llvm::MCInst &Inst, unsigned Val,
-                                uint64_t Address, const void *Decoder);
-+static DecodeStatus DecodeT2BInstruction(MCInst &Inst, unsigned Insn,
-+                               uint64_t Address, const void *Decoder);
- static DecodeStatus DecodeBranchImmInstruction(llvm::MCInst &Inst,unsigned Insn,
-                                uint64_t Address, const void *Decoder);
- static DecodeStatus DecodeAddrMode6Operand(llvm::MCInst &Inst, unsigned Val,
-@@ -1945,6 +1947,21 @@
- }
- 
- static DecodeStatus
-+DecodeT2BInstruction(MCInst &Inst, unsigned Insn,
-+                     uint64_t Address, const void *Decoder) {
-+  DecodeStatus S = MCDisassembler::Success;
-+  unsigned imm = (fieldFromInstruction32(Insn, 0, 11) << 0) |
-+                 (fieldFromInstruction32(Insn, 11, 1) << 18) |
-+                 (fieldFromInstruction32(Insn, 13, 1) << 17) |
-+                 (fieldFromInstruction32(Insn, 16, 6) << 11) |
-+                 (fieldFromInstruction32(Insn, 26, 1) << 19);
-+  if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<20>(imm<<1) + 4,
-+                                true, 4, Inst, Decoder))
-+    Inst.addOperand(MCOperand::CreateImm(SignExtend32<20>(imm << 1)));
-+  return S;
-+}
-+
-+static DecodeStatus
- DecodeBranchImmInstruction(llvm::MCInst &Inst, unsigned Insn,
-                            uint64_t Address, const void *Decoder) {
-   DecodeStatus S = MCDisassembler::Success;
-@@ -2177,6 +2194,8 @@
-     case ARM::VLD2b8wb_register:
-     case ARM::VLD2b16wb_register:
-     case ARM::VLD2b32wb_register:
-+      Inst.addOperand(MCOperand::CreateImm(0));
-+      break;
-     case ARM::VLD3d8_UPD:
-     case ARM::VLD3d16_UPD:
-     case ARM::VLD3d32_UPD:
-@@ -2245,6 +2264,16 @@
-         !Check(S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder)))
-       return MCDisassembler::Fail;
-     break;
-+  case ARM::VLD2d8wb_fixed:
-+  case ARM::VLD2d16wb_fixed:
-+  case ARM::VLD2d32wb_fixed:
-+  case ARM::VLD2b8wb_fixed:
-+  case ARM::VLD2b16wb_fixed:
-+  case ARM::VLD2b32wb_fixed:
-+  case ARM::VLD2q8wb_fixed:
-+  case ARM::VLD2q16wb_fixed:
-+  case ARM::VLD2q32wb_fixed:
-+    break;
-   }
- 
-   return S;
-@@ -2313,6 +2342,10 @@
-     case ARM::VST2b8wb_register:
-     case ARM::VST2b16wb_register:
-     case ARM::VST2b32wb_register:
-+      if (Rm == 0xF)
-+        return MCDisassembler::Fail;
-+      Inst.addOperand(MCOperand::CreateImm(0));
-+      break;
-     case ARM::VST3d8_UPD:
-     case ARM::VST3d16_UPD:
-     case ARM::VST3d32_UPD:
-@@ -2354,6 +2387,23 @@
-     case ARM::VST1q16wb_fixed:
-     case ARM::VST1q32wb_fixed:
-     case ARM::VST1q64wb_fixed:
-+    case ARM::VST1d8Twb_fixed:
-+    case ARM::VST1d16Twb_fixed:
-+    case ARM::VST1d32Twb_fixed:
-+    case ARM::VST1d64Twb_fixed:
-+    case ARM::VST1d8Qwb_fixed:
-+    case ARM::VST1d16Qwb_fixed:
-+    case ARM::VST1d32Qwb_fixed:
-+    case ARM::VST1d64Qwb_fixed:
-+    case ARM::VST2d8wb_fixed:
-+    case ARM::VST2d16wb_fixed:
-+    case ARM::VST2d32wb_fixed:
-+    case ARM::VST2q8wb_fixed:
-+    case ARM::VST2q16wb_fixed:
-+    case ARM::VST2q32wb_fixed:
-+    case ARM::VST2b8wb_fixed:
-+    case ARM::VST2b16wb_fixed:
-+    case ARM::VST2b32wb_fixed:
-       break;
-   }
- 
-@@ -2555,7 +2605,6 @@
-   unsigned Rm = fieldFromInstruction32(Insn, 0, 4);
-   unsigned align = fieldFromInstruction32(Insn, 4, 1);
-   unsigned size = 1 << fieldFromInstruction32(Insn, 6, 2);
--  unsigned pred = fieldFromInstruction32(Insn, 22, 4);
-   align *= 2*size;
- 
-   switch (Inst.getOpcode()) {
-@@ -2586,16 +2635,11 @@
-     return MCDisassembler::Fail;
-   Inst.addOperand(MCOperand::CreateImm(align));
- 
--  if (Rm == 0xD)
--    Inst.addOperand(MCOperand::CreateReg(0));
--  else if (Rm != 0xF) {
-+  if (Rm != 0xD && Rm != 0xF) {
-     if (!Check(S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder)))
-       return MCDisassembler::Fail;
-   }
- 
--  if (!Check(S, DecodePredicateOperand(Inst, pred, Address, Decoder)))
--    return MCDisassembler::Fail;
--
-   return S;
- }
- 
-@@ -2837,19 +2881,25 @@
- 
- static DecodeStatus DecodeThumbBROperand(llvm::MCInst &Inst, unsigned Val,
-                                  uint64_t Address, const void *Decoder) {
--  Inst.addOperand(MCOperand::CreateImm(SignExtend32<12>(Val << 1)));
-+   if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<12>(Val<<1) + 4,
-+                                 true, 2, Inst, Decoder))
-+     Inst.addOperand(MCOperand::CreateImm(SignExtend32<12>(Val << 1)));
-   return MCDisassembler::Success;
- }
- 
- static DecodeStatus DecodeT2BROperand(llvm::MCInst &Inst, unsigned Val,
-                                  uint64_t Address, const void *Decoder) {
--  Inst.addOperand(MCOperand::CreateImm(SignExtend32<21>(Val)));
-+   if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<21>(Val) + 4,
-+                                 true, 4, Inst, Decoder))
-+     Inst.addOperand(MCOperand::CreateImm(SignExtend32<21>(Val)));
-   return MCDisassembler::Success;
- }
- 
- static DecodeStatus DecodeThumbCmpBROperand(llvm::MCInst &Inst, unsigned Val,
-                                  uint64_t Address, const void *Decoder) {
--  Inst.addOperand(MCOperand::CreateImm(SignExtend32<7>(Val << 1)));
-+   if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<7>(Val<<1) + 4,
-+                                 true, 2, Inst, Decoder))
-+     Inst.addOperand(MCOperand::CreateImm(SignExtend32<7>(Val << 1)));
-   return MCDisassembler::Success;
- }
- 
-@@ -3162,10 +3212,25 @@
- 
- static DecodeStatus DecodeThumbBLXOffset(llvm::MCInst &Inst, unsigned Val,
-                                  uint64_t Address, const void *Decoder) {
-+  // Val is passed in as S:J1:J2:imm10H:imm10L:’0’
-+  // Note only one trailing zero not two.  Also the J1 and J2 values are from
-+  // the encoded instruction.  So here change to I1 and I2 values via:
-+  // I1 = NOT(J1 EOR S);
-+  // I2 = NOT(J2 EOR S);
-+  // and build the imm32 with two trailing zeros as documented:
-+  // imm32 = SignExtend(S:I1:I2:imm10H:imm10L:’00’, 32);
-+  unsigned S = (Val >> 23) & 1;
-+  unsigned J1 = (Val >> 22) & 1;
-+  unsigned J2 = (Val >> 21) & 1;
-+  unsigned I1 = !(J1 ^ S);
-+  unsigned I2 = !(J2 ^ S);
-+  unsigned tmp = (Val & ~0x600000) | (I1 << 22) | (I2 << 21);
-+  int imm32 = SignExtend32<25>(tmp << 1);
-+
-   if (!tryAddingSymbolicOperand(Address,
--                                (Address & ~2u) + SignExtend32<22>(Val << 1) + 4,
-+                                (Address & ~2u) + imm32 + 4,
-                                 true, 4, Inst, Decoder))
--    Inst.addOperand(MCOperand::CreateImm(SignExtend32<22>(Val << 1)));
-+    Inst.addOperand(MCOperand::CreateImm(imm32));
-   return MCDisassembler::Success;
- }
- 
-@@ -3271,15 +3336,32 @@
- static DecodeStatus
- DecodeThumbBCCTargetOperand(llvm::MCInst &Inst, unsigned Val,
-                             uint64_t Address, const void *Decoder){
--  Inst.addOperand(MCOperand::CreateImm(Val << 1));
-+  if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<8>(Val<<1) + 4,
-+                                true, 2, Inst, Decoder))
-+    Inst.addOperand(MCOperand::CreateImm(SignExtend32<8>(Val << 1)));
-   return MCDisassembler::Success;
- }
- 
- static DecodeStatus DecodeThumbBLTargetOperand(llvm::MCInst &Inst, unsigned Val,
-                                        uint64_t Address, const void *Decoder){
--  if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<22>(Val<<1) + 4,
-+  // Val is passed in as S:J1:J2:imm10:imm11
-+  // Note no trailing zero after imm11.  Also the J1 and J2 values are from
-+  // the encoded instruction.  So here change to I1 and I2 values via:
-+  // I1 = NOT(J1 EOR S);
-+  // I2 = NOT(J2 EOR S);
-+  // and build the imm32 with one trailing zero as documented:
-+  // imm32 = SignExtend(S:I1:I2:imm10:imm11:’0’, 32);
-+  unsigned S = (Val >> 23) & 1;
-+  unsigned J1 = (Val >> 22) & 1;
-+  unsigned J2 = (Val >> 21) & 1;
-+  unsigned I1 = !(J1 ^ S);
-+  unsigned I2 = !(J2 ^ S);
-+  unsigned tmp = (Val & ~0x600000) | (I1 << 22) | (I2 << 21);
-+  int imm32 = SignExtend32<25>(tmp << 1);
-+
-+  if (!tryAddingSymbolicOperand(Address, Address + imm32 + 4,
-                                 true, 4, Inst, Decoder))
--    Inst.addOperand(MCOperand::CreateImm(SignExtend32<22>(Val << 1)));
-+    Inst.addOperand(MCOperand::CreateImm(imm32));
-   return MCDisassembler::Success;
- }
- 
-Index: lib/Target/X86/Disassembler/X86Disassembler.cpp
-===================================================================
---- lib/Target/X86/Disassembler/X86Disassembler.cpp	(revision 152265)
-+++ lib/Target/X86/Disassembler/X86Disassembler.cpp	(working copy)
-@@ -322,7 +322,12 @@
- 
-   OperandType type = (OperandType)operand.type;
- 
-+  bool isBranch = false;
-+  uint64_t pcrel = 0;
-   if (type == TYPE_RELv) {
-+    isBranch = true;
-+    pcrel = insn.startLocation +
-+            insn.immediateOffset + insn.immediateSize;
-     switch (insn.displacementSize) {
-     default:
-       break;
-@@ -373,8 +378,6 @@
-     }
-   }
- 
--  bool isBranch = false;
--  uint64_t pcrel = 0;
-   switch (type) {
-   case TYPE_XMM128:
-     mcInst.addOperand(MCOperand::CreateReg(X86::XMM0 + (immediate >> 4)));
-Index: lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
-===================================================================
---- lib/Target/X86/Disassembler/X86DisassemblerDecoder.c	(revision 152265)
-+++ lib/Target/X86/Disassembler/X86DisassemblerDecoder.c	(working copy)
-@@ -312,6 +312,13 @@
-     
-     if (consumeByte(insn, &byte))
-       return -1;
-+
-+    // If the the first byte is a LOCK prefix break and let it be disassembled
-+    // as a lock "instruction", by creating an <MCInst #xxxx LOCK_PREFIX>.
-+    // FIXME there is currently no way to get the disassembler to print the
-+    // lock prefix if it is not the first byte.
-+    if (insn->readerCursor - 1 == insn->startLocation && byte == 0xf0)
-+      break;
-     
-     switch (byte) {
-     case 0xf0:  /* LOCK */
-Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
-===================================================================
---- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp	(revision 152265)
-+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp	(working copy)
-@@ -24,7 +24,8 @@
- bool RuntimeDyldMachO::
- resolveRelocation(uint8_t *LocalAddress,
-                   uint64_t FinalAddress,
--                  uint64_t Value,
-+                  uint64_t FinalSource1,
-+                  uint64_t FinalSource2,
-                   bool isPCRel,
-                   unsigned Type,
-                   unsigned Size,
-@@ -32,10 +33,20 @@
-   // This just dispatches to the proper target specific routine.
-   switch (CPUType) {
-   default: llvm_unreachable("Unsupported CPU type!");
-+  case mach::CTM_i386:
-+    return resolveI386Relocation(LocalAddress,
-+                                 FinalAddress,
-+                                 FinalSource1,
-+                                 FinalSource2,
-+                                 isPCRel,
-+                                 Type,
-+                                 Size,
-+                                 Addend);
-   case mach::CTM_x86_64:
-     return resolveX86_64Relocation(LocalAddress,
-                                    FinalAddress,
--                                   (uintptr_t)Value,
-+                                   FinalSource1,
-+                                   FinalSource2,
-                                    isPCRel,
-                                    Type,
-                                    Size,
-@@ -43,7 +54,8 @@
-   case mach::CTM_ARM:
-     return resolveARMRelocation(LocalAddress,
-                                 FinalAddress,
--                                (uintptr_t)Value,
-+                                FinalSource1,
-+                                FinalSource2,
-                                 isPCRel,
-                                 Type,
-                                 Size,
-@@ -52,19 +64,52 @@
- }
- 
- bool RuntimeDyldMachO::
-+resolveI386Relocation(uint8_t *LocalAddress,
-+                      uint64_t FinalAddress,
-+                      uint64_t FinalSource1,
-+                      uint64_t FinalSource2,
-+                      bool isPCRel,
-+                      unsigned Type,
-+                      unsigned Size,
-+                      int64_t Addend) {
-+  int64_t ValueToWrite = Addend;
-+
-+  switch (Type) {
-+  default:
-+    llvm_unreachable("Invalid relocation type!");
-+  case macho::RIT_Vanilla:
-+    ValueToWrite += FinalSource1;
-+    break;
-+  case macho::RIT_Difference:
-+  case macho::RIT_Generic_LocalDifference:
-+  case macho::RIT_Generic_PreboundLazyPointer:
-+    ValueToWrite += FinalSource1;
-+    ValueToWrite -= FinalSource2;
-+    break;
-+  }
-+
-+  if (isPCRel)
-+    ValueToWrite -= FinalAddress + 4; // see resolveX86_64Relocation
-+
-+  uint8_t *p = LocalAddress;
-+  for (unsigned i = 0; i < Size; ++i) {
-+    *p++ = (uint8_t)(ValueToWrite & 0xff);
-+    ValueToWrite >>= 8;
-+  }
-+
-+  return false;
-+}
-+
-+bool RuntimeDyldMachO::
- resolveX86_64Relocation(uint8_t *LocalAddress,
-                         uint64_t FinalAddress,
--                        uint64_t Value,
-+                        uint64_t FinalSource1,
-+                        uint64_t FinalSource2,
-                         bool isPCRel,
-                         unsigned Type,
-                         unsigned Size,
-                         int64_t Addend) {
--  // If the relocation is PC-relative, the value to be encoded is the
--  // pointer difference.
--  if (isPCRel)
--    // FIXME: It seems this value needs to be adjusted by 4 for an effective PC
--    // address. Is that expected? Only for branches, perhaps?
--    Value -= FinalAddress + 4;
-+  int64_t ValueToWrite = Addend;
- 
-   switch(Type) {
-   default:
-@@ -74,41 +119,53 @@
-   case macho::RIT_X86_64_Signed4:
-   case macho::RIT_X86_64_Signed:
-   case macho::RIT_X86_64_Unsigned:
--  case macho::RIT_X86_64_Branch: {
--    Value += Addend;
--    // Mask in the target value a byte at a time (we don't have an alignment
--    // guarantee for the target address, so this is safest).
--    uint8_t *p = (uint8_t*)LocalAddress;
--    for (unsigned i = 0; i < Size; ++i) {
--      *p++ = (uint8_t)Value;
--      Value >>= 8;
--    }
--    return false;
--  }
-+  case macho::RIT_X86_64_Branch:
-+    ValueToWrite += FinalSource1;
-+    break;
-   case macho::RIT_X86_64_GOTLoad:
-   case macho::RIT_X86_64_GOT:
-   case macho::RIT_X86_64_Subtractor:
-   case macho::RIT_X86_64_TLV:
-     return Error("Relocation type not implemented yet!");
-   }
-+
-+  // If the relocation is PC-relative, the value to be encoded is the
-+  // pointer difference.
-+  if (isPCRel)
-+    // FIXME: It seems this value needs to be adjusted by 4 for an effective PC
-+    // address. Is that expected? Only for branches, perhaps?
-+    ValueToWrite -= FinalAddress + 4;
-+
-+  // Mask in the target value a byte at a time (we don't have an alignment
-+  // guarantee for the target address, so this is safest).
-+  uint8_t *p = (uint8_t*)LocalAddress;
-+  for (unsigned i = 0; i < Size; ++i) {
-+    *p++ = (uint8_t)(ValueToWrite & 0xff);
-+    ValueToWrite >>= 8;
-+  }
-+
-+  return false;
- }
- 
- bool RuntimeDyldMachO::
- resolveARMRelocation(uint8_t *LocalAddress,
-                      uint64_t FinalAddress,
--                     uint64_t Value,
-+                     uint64_t FinalSource1,
-+                     uint64_t FinalSource2,
-                      bool isPCRel,
-                      unsigned Type,
-                      unsigned Size,
-                      int64_t Addend) {
-+  int64_t ValueToWrite = Addend;
-+
-   // If the relocation is PC-relative, the value to be encoded is the
-   // pointer difference.
-   if (isPCRel) {
--    Value -= FinalAddress;
-+    ValueToWrite -= FinalAddress;
-     // ARM PCRel relocations have an effective-PC offset of two instructions
-     // (four bytes in Thumb mode, 8 bytes in ARM mode).
-     // FIXME: For now, assume ARM mode.
--    Value -= 8;
-+    ValueToWrite -= 8;
-   }
- 
-   switch(Type) {
-@@ -119,8 +176,8 @@
-     // guarantee for the target address, so this is safest).
-     uint8_t *p = (uint8_t*)LocalAddress;
-     for (unsigned i = 0; i < Size; ++i) {
--      *p++ = (uint8_t)Value;
--      Value >>= 8;
-+      *p++ = (uint8_t)(ValueToWrite & 0xff);
-+      ValueToWrite >>= 8;
-     }
-     break;
-   }
-@@ -129,15 +186,15 @@
-     // 32-bit aligned, so we can do it all at once.
-     uint32_t *p = (uint32_t*)LocalAddress;
-     // The low two bits of the value are not encoded.
--    Value >>= 2;
-+    ValueToWrite >>= 2;
-     // Mask the value to 24 bits.
--    Value &= 0xffffff;
-+    ValueToWrite &= 0xffffff;
-     // FIXME: If the destination is a Thumb function (and the instruction
-     // is a non-predicated BL instruction), we need to change it to a BLX
-     // instruction instead.
- 
-     // Insert the value into the instruction.
--    *p = (*p & ~0xffffff) | Value;
-+    *p = (*p & ~0xffffff) | ValueToWrite;
-     break;
-   }
-   case macho::RIT_ARM_ThumbBranch22Bit:
-@@ -153,6 +210,29 @@
-   return false;
- }
- 
-+static bool
-+ResolveSectionAndOffset(const MachOObject *Obj,
-+                        SmallVectorImpl<unsigned> &SectionMap,
-+                        const MachOObject::LoadCommandInfo *SegmentLCI,
-+                        InMemoryStruct<macho::SegmentLoadCommand> &SegmentLC,
-+                        uint64_t Address,
-+                        unsigned &SectionID,
-+                        uint64_t &Offset)
-+{
-+  for (unsigned SI = 0, SE = SegmentLC->NumSections; SI < SE; ++SI) {
-+    InMemoryStruct<macho::Section> CandidateSection;
-+    Obj->ReadSection(*SegmentLCI, SI, CandidateSection);
-+    if (Address >= CandidateSection->Address &&
-+        Address < CandidateSection->Address + CandidateSection->Size) {
-+      SectionID = SectionMap[SI];
-+      Offset = Address - CandidateSection->Address;
-+      return true;
-+    }
-+  }
-+
-+  return false;
-+}
-+
- bool RuntimeDyldMachO::
- loadSegment32(const MachOObject *Obj,
-               const MachOObject::LoadCommandInfo *SegmentLCI,
-@@ -210,6 +290,7 @@
- 
-   // Process the relocations for each section we're loading.
-   Relocations.grow(Relocations.size() + SegmentLC->NumSections);
-+  RelocationSources.grow(RelocationSources.size() + SegmentLC->NumSections);
-   for (unsigned SectNum = 0; SectNum != SegmentLC->NumSections; ++SectNum) {
-     InMemoryStruct<macho::Section> Sect;
-     Obj->ReadSection(*SegmentLCI, SectNum, Sect);
-@@ -218,51 +299,135 @@
-     for (unsigned j = 0; j != Sect->NumRelocationTableEntries; ++j) {
-       InMemoryStruct<macho::RelocationEntry> RE;
-       Obj->ReadRelocationEntry(Sect->RelocationTableOffset, j, RE);
--      if (RE->Word0 & macho::RF_Scattered)
--        return Error("NOT YET IMPLEMENTED: scattered relocations.");
--      // Word0 of the relocation is the offset into the section where the
--      // relocation should be applied. We need to translate that into an
--      // offset into a function since that's our atom.
--      uint32_t Offset = RE->Word0;
--      bool isExtern = (RE->Word1 >> 27) & 1;
--
--      // FIXME: Get the relocation addend from the target address.
--      // FIXME: VERY imporant for internal relocations.
--
--      // Figure out the source symbol of the relocation. If isExtern is true,
--      // this relocation references the symbol table, otherwise it references
--      // a section in the same object, numbered from 1 through NumSections
--      // (SectionBases is [0, NumSections-1]).
--      uint32_t SourceNum = RE->Word1 & 0xffffff; // 24-bit value
--      if (!isExtern) {
--        assert(SourceNum > 0 && "Invalid relocation section number!");
--        unsigned SectionID = SectionMap[SourceNum - 1];
-+      if (RE->Word0 & macho::RF_Scattered) {
-+        // The lower 24 bits of Word0 of the scattered relocation is the offset
-+        // into the section where the relocation should be applied, i.e., the
-+        // current section.
-+        uint32_t OffsetInTarget = RE->Word0 & 0x00ffffff;
-         unsigned TargetID = SectionMap[SectNum];
--        DEBUG(dbgs() << "Internal relocation at Section #"
--                     << TargetID << " + " << Offset
--                     << " from Section #"
--                     << SectionID << " (Word1: "
--                     << format("0x%x", RE->Word1) << ")\n");
--
--        // Store the relocation information. It will get resolved when
--        // the section addresses are assigned.
--        Relocations[SectionID].push_back(RelocationEntry(TargetID,
--                                                         Offset,
--                                                         RE->Word1,
--                                                         0 /*Addend*/));
-+        // Word1 of the scattered relocation is a file offset which needs to
-+        // be resolved into Section+Offset form.  This gives the address of the
-+        // source.
-+        unsigned Source1ID;
-+        uint64_t Source1Offset;
-+        if (!ResolveSectionAndOffset(Obj,
-+                                     SectionMap,
-+                                     SegmentLCI,
-+                                     SegmentLC,
-+                                     RE->Word1,
-+                                     Source1ID,
-+                                     Source1Offset))
-+          return Error("couldn't find scattered relocation value in sections");
-+        // This relocation may have a paired relocation entry. If it does, set
-+        // the source/offset information for it correctly.
-+        unsigned Source2ID = SectionOffset::NoSectionID;
-+        uint64_t Source2Offset = 0;
-+        if (j + 1 < Sect->NumRelocationTableEntries) {
-+          InMemoryStruct<macho::RelocationEntry> PairRE;
-+          Obj->ReadRelocationEntry(Sect->RelocationTableOffset, j+1, PairRE);
-+          if ((PairRE->Word0 & macho::RF_Scattered) &&
-+              ((PairRE->Word0 & 0x0f000000) >> 24) == macho::RIT_Pair) {
-+            if (!ResolveSectionAndOffset(Obj,
-+                                         SectionMap,
-+                                         SegmentLCI,
-+                                         SegmentLC,
-+                                         PairRE->Word1,
-+                                         Source2ID,
-+                                         Source2Offset))
-+              return Error("couldn't find scattered relocation value in sections");
-+            ++j;
-+          }
-+        }
-+        if (Source2ID == SectionOffset::NoSectionID)
-+          DEBUG(dbgs() << "Scattered relocation at Section #"
-+                       << TargetID << " + " << OffsetInTarget
-+                       << " from Section #" << Source1ID
-+                       << "+" << Source1Offset
-+                       << " (Word0: "
-+                       << format("0x%x", RE->Word0) << ")\n");
-+        else
-+          DEBUG(dbgs() << "Scattered relocation at Section #"
-+                       << TargetID << " + " << OffsetInTarget
-+                       << " from Section #" << Source1ID
-+                       << "+" << Source1Offset
-+                       << " and Section #" << Source2ID
-+                       << "+" << Source2Offset
-+                       << " (Word0: "
-+                       << format("0x%x", RE->Word0) << ")\n");
-+        uint32_t RelocationIndex = Relocations[TargetID].size();
-+        // FIXME: Get the relocation addend from the target address.
-+        // FIXME: VERY imporant for internal relocations.
-+        RelocationEntry TranslatedRE(OffsetInTarget,
-+                                     Source1ID,
-+                                     Source1Offset,
-+                                     Source2ID,
-+                                     Source2Offset,
-+                                     RE->Word1,
-+                                     0 /*Addend*/);
-+        Relocations[TargetID].push_back(TranslatedRE);
-+        RelocationSources[Source1ID].push_back(RelocationSource(TargetID,
-+                                                                RelocationIndex,
-+                                                                0));
-+        if (Source2ID != SectionOffset::NoSectionID)
-+          RelocationSources[Source2ID].push_back(RelocationSource(TargetID,
-+                                                                  RelocationIndex,
-+                                                                  1));
-       } else {
--        StringRef SourceName = SymbolNames[SourceNum];
--
--        // Now store the relocation information. Associate it with the source
--        // symbol. Just add it to the unresolved list and let the general
--        // path post-load resolve it if we know where the symbol is.
--        UnresolvedRelocations[SourceName].push_back(RelocationEntry(SectNum,
--                                                                    Offset,
--                                                                    RE->Word1,
--                                                                 0 /*Addend*/));
--        DEBUG(dbgs() << "Relocation at Section #" << SectNum << " + " << Offset
--              << " from '" << SourceName << "(Word1: "
--              << format("0x%x", RE->Word1) << ")\n");
-+        // Word0 of the relocation is the offset into the section where the
-+        // relocation should be applied, i.e., the current section. We need
-+        // to translate that into an offset into a function since that's our atom.
-+        uint32_t OffsetInTarget = RE->Word0;
-+        bool isExtern = (RE->Word1 >> 27) & 1;
-+  
-+        // FIXME: Get the relocation addend from the target address.
-+        // FIXME: VERY imporant for internal relocations.
-+  
-+        // Figure out the source symbol of the relocation. If isExtern is true,
-+        // this relocation references the symbol table, otherwise it references
-+        // a section in the same object, numbered from 1 through NumSections
-+        // (SectionBases is [0, NumSections-1]).
-+        uint32_t SourceNum_OneBased = RE->Word1 & 0xffffff; // 24-bit value
-+        if (!isExtern) {
-+          assert(SourceNum_OneBased > 0 && "Invalid relocation section number!");
-+          unsigned SourceID = SectionMap[SourceNum_OneBased - 1];
-+          unsigned TargetID = SectionMap[SectNum];
-+          DEBUG(dbgs() << "Internal relocation at Section #"
-+                       << TargetID << " + " << OffsetInTarget
-+                       << " from Section #"
-+                       << SourceID << " (Word1: "
-+                       << format("0x%x", RE->Word1) << ")\n");
-+  
-+          // Store the relocation information. It will get resolved when
-+          // the section addresses are assigned.
-+          uint32_t RelocationIndex = Relocations[TargetID].size();
-+          Relocations[TargetID].push_back(RelocationEntry(OffsetInTarget,
-+                                                          SourceID,
-+                                                          SectionOffset::NoSectionID,
-+                                                          RE->Word1,
-+                                                          0 /*Addend*/));
-+          RelocationSources[SourceID].push_back(RelocationSource(TargetID,
-+                                                                 RelocationIndex,
-+                                                                 0));
-+        } else {
-+          StringRef SourceName = SymbolNames[SourceNum_OneBased];
-+  
-+          // Now store the relocation information. Associate it with the source
-+          // symbol. Just add it to the unresolved list and let the general
-+          // path post-load resolve it if we know where the symbol is.
-+          unsigned TargetID = SectionMap[SectNum];
-+          uint32_t RelocationIndex = Relocations[TargetID].size();
-+          Relocations[TargetID].push_back(RelocationEntry(OffsetInTarget,
-+                                                          SectionOffset::UnresolvedSourceID,
-+                                                          SectionOffset::NoSectionID,
-+                                                          RE->Word1,
-+                                                          0 /*Addend*/));
-+          UnresolvedRelocations[SourceName].push_back(RelocationSource(TargetID,
-+                                                                       RelocationIndex,
-+                                                                       0));
-+          DEBUG(dbgs() << "Relocation at Section #" << SectNum << " + " << OffsetInTarget
-+                << " from '" << SourceName << "' (Word1: "
-+                << format("0x%x", RE->Word1) << ")\n");
-+        }
-       }
-     }
-   }
-@@ -332,6 +497,7 @@
- 
-   // Process the relocations for each section we're loading.
-   Relocations.grow(Relocations.size() + Segment64LC->NumSections);
-+  RelocationSources.grow(RelocationSources.size() + Segment64LC->NumSections);
-   for (unsigned SectNum = 0; SectNum != Segment64LC->NumSections; ++SectNum) {
-     InMemoryStruct<macho::Section64> Sect;
-     Obj->ReadSection64(*SegmentLCI, SectNum, Sect);
-@@ -341,11 +507,11 @@
-       InMemoryStruct<macho::RelocationEntry> RE;
-       Obj->ReadRelocationEntry(Sect->RelocationTableOffset, j, RE);
-       if (RE->Word0 & macho::RF_Scattered)
--        return Error("NOT YET IMPLEMENTED: scattered relocations.");
-+        return Error("scattered relocations don't exist on 64-bit platforms");
-       // Word0 of the relocation is the offset into the section where the
-       // relocation should be applied. We need to translate that into an
-       // offset into a function since that's our atom.
--      uint32_t Offset = RE->Word0;
-+      uint32_t OffsetInTarget = RE->Word0;
-       bool isExtern = (RE->Word1 >> 27) & 1;
- 
-       // FIXME: Get the relocation addend from the target address.
-@@ -355,34 +521,45 @@
-       // this relocation references the symbol table, otherwise it references
-       // a section in the same object, numbered from 1 through NumSections
-       // (SectionBases is [0, NumSections-1]).
--      uint32_t SourceNum = RE->Word1 & 0xffffff; // 24-bit value
-+      uint32_t SourceNum_OneBased = RE->Word1 & 0xffffff; // 24-bit value
-       if (!isExtern) {
--        assert(SourceNum > 0 && "Invalid relocation section number!");
--        unsigned SectionID = SectionMap[SourceNum - 1];
-+        assert(SourceNum_OneBased > 0 && "Invalid relocation section number!");
-+        unsigned SourceID = SectionMap[SourceNum_OneBased - 1];
-         unsigned TargetID = SectionMap[SectNum];
-         DEBUG(dbgs() << "Internal relocation at Section #"
--                     << TargetID << " + " << Offset
-+                     << TargetID << " + " << OffsetInTarget
-                      << " from Section #"
--                     << SectionID << " (Word1: "
-+                     << SourceID << " (Word1: "
-                      << format("0x%x", RE->Word1) << ")\n");
- 
-         // Store the relocation information. It will get resolved when
-         // the section addresses are assigned.
--        Relocations[SectionID].push_back(RelocationEntry(TargetID,
--                                                         Offset,
--                                                         RE->Word1,
--                                                         0 /*Addend*/));
-+        uint32_t RelocationIndex = Relocations[TargetID].size();
-+        Relocations[TargetID].push_back(RelocationEntry(OffsetInTarget,
-+                                                        SourceID,
-+                                                        SectionOffset::NoSectionID,
-+                                                        RE->Word1,
-+                                                        0 /*Addend*/));
-+        RelocationSources[SourceID].push_back(RelocationSource(TargetID,
-+                                                               RelocationIndex,
-+                                                               0));
-       } else {
--        StringRef SourceName = SymbolNames[SourceNum];
-+        StringRef SourceName = SymbolNames[SourceNum_OneBased];
- 
-         // Now store the relocation information. Associate it with the source
-         // symbol. Just add it to the unresolved list and let the general
-         // path post-load resolve it if we know where the symbol is.
--        UnresolvedRelocations[SourceName].push_back(RelocationEntry(SectNum,
--                                                                    Offset,
--                                                                    RE->Word1,
--                                                                 0 /*Addend*/));
--        DEBUG(dbgs() << "Relocation at Section #" << SectNum << " + " << Offset
-+        unsigned TargetID = SectionMap[SectNum];
-+        uint32_t RelocationIndex = Relocations[TargetID].size();
-+        Relocations[TargetID].push_back(RelocationEntry(OffsetInTarget,
-+                                                        SectionOffset::UnresolvedSourceID,
-+                                                        SectionOffset::NoSectionID,
-+                                                        RE->Word1,
-+                                                        0 /*Addend*/));
-+        UnresolvedRelocations[SourceName].push_back(RelocationSource(TargetID,
-+                                                                     RelocationIndex,
-+                                                                     0));
-+        DEBUG(dbgs() << "Relocation at Section #" << SectNum << " + " << OffsetInTarget
-               << " from '" << SourceName << "(Word1: "
-               << format("0x%x", RE->Word1) << ")\n");
-       }
-@@ -468,18 +645,22 @@
-   if (Loc == SymbolTable.end())
-     return;
- 
--  RelocationList &Relocs = UnresolvedRelocations[Name];
-+  RelocationSourceList &SourcesForSymbol = UnresolvedRelocations[Name];
-   DEBUG(dbgs() << "Resolving symbol '" << Name << "'\n");
--  for (int i = 0, e = Relocs.size(); i != e; ++i) {
--    // Change the relocation to be section relative rather than symbol
--    // relative and move it to the resolved relocation list.
--    RelocationEntry Entry = Relocs[i];
--    Entry.Addend += Loc->second.second;
--    Relocations[Loc->second.first].push_back(Entry);
-+  for (int i = 0, e = SourcesForSymbol.size(); i != e; ++i) {
-+    // Find the relocation entry corresponding to this source and fill
-+    // in its source information with the resolved information from this
-+    // symbol.
-+    RelocationSource &Source = SourcesForSymbol[i];
-+    RelocationEntry &Entry = Relocations[Source.SectionID][Source.Index];
-+    Entry.Sources[Source.SourceIdx].Offset = Loc->second.second;
-+    Entry.Sources[Source.SourceIdx].ID = Loc->second.first;
-+    // Now create a relocation source in the pointed-to section.
-+    RelocationSources[Loc->second.first].push_back(Source);
-   }
-   // FIXME: Keep a worklist of the relocations we've added so that we can
-   // resolve more selectively later.
--  Relocs.clear();
-+  SourcesForSymbol.clear();
- }
- 
- bool RuntimeDyldMachO::loadObject(MemoryBuffer *InputBuffer) {
-@@ -575,6 +756,56 @@
-   return false;
- }
- 
-+bool RuntimeDyldMachO::resolveRelocationEntry(unsigned SectionID,
-+                                              RelocationEntry &RE)
-+{
-+  uint8_t *Target = (uint8_t*)Sections[SectionID].base() + RE.Offset;
-+  uint64_t FinalTarget = SectionLoadAddress[SectionID] + RE.Offset;
-+
-+  uint64_t FinalSource1 = 0;
-+  uint64_t FinalSource2 = 0;
-+
-+  if (RE.Sources[0].ID == SectionOffset::UnresolvedSourceID ||
-+      RE.Sources[1].ID == SectionOffset::UnresolvedSourceID)
-+    return false;
-+
-+  FinalSource1 = SectionLoadAddress[RE.Sources[0].ID] + RE.Sources[0].Offset;
-+  if (RE.Sources[1].ID != SectionOffset::NoSectionID)
-+    FinalSource2 = SectionLoadAddress[RE.Sources[1].ID] + RE.Sources[1].Offset;
-+
-+  bool isPCRel = RE.isPCRel();
-+  unsigned Type = RE.type();
-+  unsigned Size = RE.length();
-+
-+  if (RE.Sources[1].ID == SectionOffset::NoSectionID)
-+    DEBUG(dbgs() << "Resolving relocation at Section #" << SectionID
-+          << " + " << RE.Offset << " (" << format("%p", Target) << ")"
-+          << " from Section #" << RE.Sources[0].ID << "+" << RE.Sources[0].Offset
-+          << " (" << format("0x%llx", FinalSource1) << ")"
-+          << " (" << (isPCRel ? "pcrel" : "absolute")
-+          << ", type: " << Type << ", Size: " << Size << ", Addend: "
-+          << RE.Addend << ").\n");
-+  else
-+    DEBUG(dbgs() << "Resolving relocation at Section #" << SectionID
-+          << " + " << RE.Offset << " (" << format("%p", Target) << ")"
-+          << " from Section #" << RE.Sources[0].ID << "+" << RE.Sources[0].Offset
-+          << " (" << format("0x%llx", FinalSource1) << ")"
-+          << " and Section #" << RE.Sources[1].ID << "+" << RE.Sources[1].Offset
-+          << " (" << format("0x%llx", FinalSource2) << ")"
-+          << " (" << (isPCRel ? "pcrel" : "absolute")
-+          << ", type: " << Type << ", Size: " << Size << ", Addend: "
-+          << RE.Addend << ").\n");
-+
-+  return resolveRelocation(Target,
-+                           FinalTarget,
-+                           FinalSource1,
-+                           FinalSource2,
-+                           isPCRel,
-+                           Type,
-+                           Size,
-+                           RE.Addend);
-+}
-+
- // Assign an address to a symbol name and resolve all the relocations
- // associated with it.
- void RuntimeDyldMachO::reassignSectionAddress(unsigned SectionID,
-@@ -590,30 +821,17 @@
- 
-   SectionLoadAddress[SectionID] = Addr;
- 
--  RelocationList &Relocs = Relocations[SectionID];
--  for (unsigned i = 0, e = Relocs.size(); i != e; ++i) {
--    RelocationEntry &RE = Relocs[i];
--    uint8_t *Target = (uint8_t*)Sections[RE.SectionID].base() + RE.Offset;
--    uint64_t FinalTarget = (uint64_t)SectionLoadAddress[RE.SectionID] + RE.Offset;
--    bool isPCRel = (RE.Data >> 24) & 1;
--    unsigned Type = (RE.Data >> 28) & 0xf;
--    unsigned Size = 1 << ((RE.Data >> 25) & 3);
--
--    DEBUG(dbgs() << "Resolving relocation at Section #" << RE.SectionID
--          << " + " << RE.Offset << " (" << format("%p", Target) << ")"
--          << " from Section #" << SectionID << " (" << format("%p", Addr) << ")"
--          << "(" << (isPCRel ? "pcrel" : "absolute")
--          << ", type: " << Type << ", Size: " << Size << ", Addend: "
--          << RE.Addend << ").\n");
--
--    resolveRelocation(Target,
--                      FinalTarget,
--                      Addr,
--                      isPCRel,
--                      Type,
--                      Size,
--                      RE.Addend);
-+  RelocationList &RelocsForSection = Relocations[SectionID];
-+  for (unsigned i = 0, e = RelocsForSection.size(); i != e; ++i) {
-+    RelocationEntry &RE = RelocsForSection[i];
-+    resolveRelocationEntry(SectionID, RE);
-   }
-+  RelocationSourceList &SourcesForSection = RelocationSources[SectionID];
-+  for (unsigned i = 0, e = SourcesForSection.size(); i != e; ++i) {
-+    RelocationSource &R = SourcesForSection[i];
-+    RelocationEntry &RE = Relocations[R.SectionID][R.Index];
-+    resolveRelocationEntry(R.SectionID, RE);
-+  }
- }
- 
- bool RuntimeDyldMachO::isKnownFormat(const MemoryBuffer *InputBuffer) {
-Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
-===================================================================
---- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h	(revision 152265)
-+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h	(working copy)
-@@ -26,48 +26,183 @@
- namespace llvm {
- class RuntimeDyldMachO : public RuntimeDyldImpl {
- 
--  // For each symbol, keep a list of relocations based on it. Anytime
--  // its address is reassigned (the JIT re-compiled the function, e.g.),
--  // the relocations get re-resolved.
--  // The symbol (or section) the relocation is sourced from is the Key
--  // in the relocation list where it's stored.
-+  // For each section, keep a list of relocatable pieces of data that
-+  // reside in it.  If the section moves, or the sections whose
-+  // locations the data depends on move, re-resolve the relocations
-+  // based on that movement.
-+  //
-+  // RelocationEntry structures correspond to one or two Mach-O
-+  // relocation_info or scattered_relocation_info structures --
-+  // usually one, but two iff the original has a paired structure
-+  // following it.
-+  //
-+  // To facilitate updating a relocation when its sources move, we
-+  // also keep RelocationSource structures associated with the sections
-+  // whose location the data depends on.
-+
-+  // FIXME: Use SymbolLoc for this instead.  Where should the enum live?
-+  struct SectionOffset {
-+    uint64_t    Offset;     // Offset of the location into its section.
-+    unsigned    ID;         // The section the location is contained in.
-+
-+    enum {
-+      NoSectionID        = 0xffff0000,
-+      UnresolvedSourceID = 0xffffffff
-+    };
-+  };
-+
-   struct RelocationEntry {
--    unsigned    SectionID;  // Section the relocation is contained in.
--    uint64_t    Offset;     // Offset into the section for the relocation.
--    uint32_t    Data;       // Second word of the raw macho relocation entry.
--    int64_t     Addend;     // Addend encoded in the instruction itself, if any,
--                            // plus the offset into the source section for
--                            // the symbol once the relocation is resolvable.
-+    SectionOffset Sources[2]; // The section/offset pairs this relocation
-+                              // refers to.
-+                              // If the original Mach-O relocation entries used
-+                              // relocation_info, this data is computed from
-+                              // r_symbolnum and the offsets are locked to 0.
-+                              // (The only offset is determined by the addend.)
-+                              // If the original Mach-O relocation entries used
-+                              // scattered_relocation_info, this data, including
-+                              // offsets, is computed by looking r_value up in
-+                              // the section table.
- 
--    RelocationEntry(unsigned id, uint64_t offset, uint32_t data, int64_t addend)
--      : SectionID(id), Offset(offset), Data(data), Addend(addend) {}
-+    uint64_t      Offset;     // The offset of the data to be relocated.
-+                              // We don't use a SectionOffset because this
-+                              // RelocationEntry is already associated with the
-+                              // proper Section.
-+
-+    int64_t       Addend;     // Addend encoded in the instruction itself, if any,
-+                              // plus the offset into the source section for
-+                              // the symbol once the relocation is resolvable.
-+
-+    uint32_t      Data;       // If the original Mach-O relocation entry was a
-+                              // relocation_info, the bitfield { r_symbolnum,
-+                              // r_pcrel, r_length, r_extern, r_type }.
-+                              // If the original Mach-O relocation entry was a
-+                              // scattered_relocation_info, the bitfield
-+                              // { r_address, r_type, r_length, r_pcrel,
-+                              // r_scattered }.
-+
-+    bool          Scattered;  // True iff this relocation is scattered.
-+
-+    bool isPCRel()
-+    {
-+      if (Scattered)
-+        return (Data & 0x40000000) >> 30;
-+      else
-+        return (Data & 0x01000000) >> 24;
-+    }
-+
-+    uint8_t type()
-+    {
-+      if (Scattered)
-+        return (Data & 0x0f000000) >> 24;
-+      else
-+        return (Data & 0xf0000000) >> 28;
-+    }
-+
-+    // Returns the decoded version of the length field
-+    uint8_t length()
-+    {
-+      if (Scattered)
-+        return 1 << ((Data & 0x30000000) >> 28);
-+      else
-+        return 1 << ((Data & 0x0e000000) >> 25);
-+    }
-+
-+    // Used with an ordinary relocation entry, where the source_offsets are not
-+    // known yet.
-+    RelocationEntry(uint64_t offset,      // See the Offset field.
-+                    unsigned source_id0,  // The section ID for the first source.
-+                    unsigned source_id1,  // The section ID for the second source.
-+                    uint32_t data,        // See the Data field.
-+                    int64_t addend)       // See the Addend field.
-+      : Offset(offset),
-+        Addend(addend),
-+        Data(data),
-+        Scattered(false) {
-+      Sources[0].ID = source_id0;
-+      Sources[0].Offset = 0;
-+      Sources[1].ID = source_id1;
-+      Sources[1].Offset = 0;
-+    }
-+  
-+    // Used with a scattered relocation entry, where the source_offsets can be
-+    // derived from the value.
-+    RelocationEntry(uint64_t offset,      // See the Offset field.
-+                    unsigned source_id0,  // The section ID for the first source.
-+                    uint64_t source_off0, // The offset for the first source.
-+                    unsigned source_id1,  // The section ID for the second source.
-+                    uint64_t source_off1, // The offset for the second source.
-+                    uint32_t data,        // See the Data field.
-+                    int64_t addend)       // See the Addend field.
-+      : Offset(offset),
-+        Addend(addend),
-+        Data(data), 
-+        Scattered(true) {
-+      Sources[0].ID = source_id0;
-+      Sources[0].Offset = source_off0;
-+      Sources[1].ID = source_id1;
-+      Sources[1].Offset = source_off1;
-+    }
-   };
-   typedef SmallVector<RelocationEntry, 4> RelocationList;
--  // Relocations to sections already loaded. Indexed by SectionID which is the
--  // source of the address. The target where the address will be writen is
--  // SectionID/Offset in the relocation itself.
-+
-+  // For each section, keep a list of sources that are used by relocations in
-+  // other sections.  Whenever a relocation gets created, create one or two
-+  // corresponding relocation sources.  Whenever relocations are re-resolved
-+  // for a section, also re-resolve the relocations corresponding to that
-+  // section's relocation targets.
-+  struct RelocationSource {
-+    unsigned    SectionID;      // Section whose RelocationList contains the relocation.
-+    uint32_t    Index : 24;     // Index of the RelocatonEntry in that RelocationList.
-+    uint8_t     SourceIdx : 1;  // Index of this source in the RelocationEntry's Sources.
-+
-+    RelocationSource(unsigned id,
-+                     uint32_t index,
-+                     uint8_t source_idx)
-+      : SectionID(id),
-+        Index(index),
-+        SourceIdx(source_idx) {}
-+  };
-+  typedef SmallVector<RelocationSource, 4> RelocationSourceList;
-+
-+  // Relocations which refer to already-loaded section. Indexed by SectionID
-+  // which is the section containing the relocatable data.
-   IndexedMap<RelocationList> Relocations;
-+  // Targets corresponding to Relocations.
-+  IndexedMap<RelocationSourceList> RelocationSources;
-   // Relocations to symbols that are not yet resolved. Must be external
-   // relocations by definition. Indexed by symbol name.
--  StringMap<RelocationList> UnresolvedRelocations;
-+  StringMap<RelocationSourceList> UnresolvedRelocations;
- 
-+  bool resolveRelocationEntry(unsigned SectionID,
-+                              RelocationEntry &RE);
-   bool resolveRelocation(uint8_t *LocalAddress,
-                          uint64_t FinalAddress,
--                         uint64_t Value,
-+                         uint64_t FinalSource1,
-+                         uint64_t FinalSource2,
-                          bool isPCRel,
-                          unsigned Type,
-                          unsigned Size,
-                          int64_t Addend);
-+  bool resolveI386Relocation(uint8_t *LocalAddress,
-+                             uint64_t FinalAddress,
-+                             uint64_t FinalSource1,
-+                             uint64_t FinalSource2,
-+                             bool isPCRel,
-+                             unsigned Type,
-+                             unsigned Size,
-+                             int64_t Addend);
-   bool resolveX86_64Relocation(uint8_t *LocalAddress,
-                                uint64_t FinalAddress,
--                               uint64_t Value,
-+                               uint64_t FinalSource1,
-+                               uint64_t FinalSource2,
-                                bool isPCRel,
-                                unsigned Type,
-                                unsigned Size,
-                                int64_t Addend);
-   bool resolveARMRelocation(uint8_t *LocalAddress,
-                             uint64_t FinalAddress,
--                            uint64_t Value,
-+                            uint64_t FinalSource1,
-+                            uint64_t FinalSource2,
-                             bool isPCRel,
-                             unsigned Type,
-                             unsigned Size,
-Index: lib/MC/MCDisassembler/Disassembler.cpp
-===================================================================
---- lib/MC/MCDisassembler/Disassembler.cpp	(revision 152265)
-+++ lib/MC/MCDisassembler/Disassembler.cpp	(working copy)
-@@ -15,7 +15,9 @@
- #include "llvm/MC/MCDisassembler.h"
- #include "llvm/MC/MCInst.h"
- #include "llvm/MC/MCInstPrinter.h"
-+#include "llvm/MC/MCInstrInfo.h"
- #include "llvm/MC/MCRegisterInfo.h"
-+#include "llvm/MC/MCSubtargetInfo.h"
- #include "llvm/Support/MemoryObject.h"
- #include "llvm/Support/TargetRegistry.h"
- #include "llvm/Support/TargetSelect.h"
-@@ -86,7 +88,7 @@
-   LLVMDisasmContext *DC = new LLVMDisasmContext(TripleName, DisInfo, TagType,
-                                                 GetOpInfo, SymbolLookUp,
-                                                 TheTarget, MAI, MRI,
--                                                Ctx, DisAsm, IP);
-+                                                STI, Ctx, DisAsm, IP);
-   assert(DC && "Allocation failure!");
- 
-   return DC;
-Index: lib/MC/MCDisassembler/Disassembler.h
-===================================================================
---- lib/MC/MCDisassembler/Disassembler.h	(revision 152265)
-+++ lib/MC/MCDisassembler/Disassembler.h	(working copy)
-@@ -29,6 +29,7 @@
- class MCDisassembler;
- class MCInstPrinter; 
- class MCRegisterInfo;
-+class MCSubtargetInfo;
- class Target;
- 
- //
-@@ -61,6 +62,8 @@
-   llvm::OwningPtr<const llvm::MCAsmInfo> MAI;
-   // The register information for the target architecture.
-   llvm::OwningPtr<const llvm::MCRegisterInfo> MRI;
-+  // The subtarget information for the target architecture.
-+  llvm::OwningPtr<const llvm::MCSubtargetInfo> MSI;
-   // The assembly context for creating symbols and MCExprs.
-   llvm::OwningPtr<const llvm::MCContext> Ctx;
-   // The disassembler for the target architecture.
-@@ -78,6 +81,7 @@
-                     LLVMSymbolLookupCallback symbolLookUp,
-                     const Target *theTarget, const MCAsmInfo *mAI,
-                     const MCRegisterInfo *mRI,
-+                    const MCSubtargetInfo *mSI,
-                     llvm::MCContext *ctx, const MCDisassembler *disAsm,
-                     MCInstPrinter *iP) : TripleName(tripleName),
-                     DisInfo(disInfo), TagType(tagType), GetOpInfo(getOpInfo),
-@@ -85,6 +89,7 @@
-                     CommentStream(CommentsToEmit) {
-     MAI.reset(mAI);
-     MRI.reset(mRI);
-+    MSI.reset(mSI);
-     Ctx.reset(ctx);
-     DisAsm.reset(disAsm);
-     IP.reset(iP);

Modified: lldb/branches/lldb-platform-work/source/API/SBAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBAddress.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBAddress.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBAddress.cpp Thu Jun  6 19:06:43 2013
@@ -115,14 +115,17 @@ SBAddress::GetFileAddress () const
 lldb::addr_t
 SBAddress::GetLoadAddress (const SBTarget &target) const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     lldb::addr_t addr = LLDB_INVALID_ADDRESS;
     TargetSP target_sp (target.GetSP());
-    if (m_opaque_ap.get())
+    if (target_sp)
     {
-        Mutex::Locker api_locker (target_sp->GetAPIMutex());
-        addr = m_opaque_ap->GetLoadAddress (target_sp.get());
+        if (m_opaque_ap.get())
+        {
+            Mutex::Locker api_locker (target_sp->GetAPIMutex());
+            addr = m_opaque_ap->GetLoadAddress (target_sp.get());
+        }
     }
     
     if (log)
@@ -130,7 +133,7 @@ SBAddress::GetLoadAddress (const SBTarge
         if (addr == LLDB_INVALID_ADDRESS)
             log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS", target_sp.get());
         else
-            log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%llx", target_sp.get(), addr);
+            log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64, target_sp.get(), addr);
     }
 
     return addr;
@@ -182,7 +185,7 @@ lldb::addr_t
 SBAddress::GetOffset ()
 {
     if (m_opaque_ap.get())
-        m_opaque_ap->GetOffset();
+        return m_opaque_ap->GetOffset();
     return 0;
 }
 

Modified: lldb/branches/lldb-platform-work/source/API/SBBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBBlock.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBBlock.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBBlock.cpp Thu Jun  6 19:06:43 2013
@@ -183,7 +183,7 @@ SBBlock::GetDescription (SBStream &descr
     if (m_opaque_ptr)
     {
         lldb::user_id_t id = m_opaque_ptr->GetID();
-        strm.Printf ("Block: {id: %llu} ", id);
+        strm.Printf ("Block: {id: %" PRIu64 "} ", id);
         if (IsInlined())
         {
             strm.Printf (" (inlined, '%s') ", GetInlinedName());
@@ -299,7 +299,12 @@ SBBlock::GetVariables (lldb::SBFrame& fr
                         if (add_variable)
                         {
                             if (frame_sp)
-                                value_list.Append (frame_sp->GetValueObjectForFrameVariable (variable_sp, use_dynamic));
+                            {
+                                lldb::ValueObjectSP valobj_sp(frame_sp->GetValueObjectForFrameVariable (variable_sp,eNoDynamicValues));
+                                SBValue value_sb;
+                                value_sb.SetSP(valobj_sp, use_dynamic);
+                                value_list.Append (value_sb);
+                            }
                         }
                     }
                 }

Modified: lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp Thu Jun  6 19:06:43 2013
@@ -100,10 +100,18 @@ SBBreakpoint::operator == (const lldb::S
     return false;
 }
 
+bool
+SBBreakpoint::operator != (const lldb::SBBreakpoint& rhs)
+{
+    if (m_opaque_sp && rhs.m_opaque_sp)
+        return m_opaque_sp.get() != rhs.m_opaque_sp.get();
+    return (m_opaque_sp && !rhs.m_opaque_sp) || (rhs.m_opaque_sp && !m_opaque_sp);
+}
+
 break_id_t
 SBBreakpoint::GetID () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     break_id_t break_id = LLDB_INVALID_BREAK_ID;
     if (m_opaque_sp)
@@ -210,7 +218,7 @@ SBBreakpoint::GetLocationAtIndex (uint32
 void
 SBBreakpoint::SetEnabled (bool enable)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBBreakpoint(%p)::SetEnabled (enabled=%i)", m_opaque_sp.get(), enable);
@@ -235,9 +243,48 @@ SBBreakpoint::IsEnabled ()
 }
 
 void
+SBBreakpoint::SetOneShot (bool one_shot)
+{
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+    if (log)
+        log->Printf ("SBBreakpoint(%p)::SetOneShot (one_shot=%i)", m_opaque_sp.get(), one_shot);
+
+    if (m_opaque_sp)
+    {
+        Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+        m_opaque_sp->SetOneShot (one_shot);
+    }
+}
+
+bool
+SBBreakpoint::IsOneShot () const
+{
+    if (m_opaque_sp)
+    {
+        Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+        return m_opaque_sp->IsOneShot();
+    }
+    else
+        return false;
+}
+
+bool
+SBBreakpoint::IsInternal ()
+{
+    if (m_opaque_sp)
+    {
+        Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
+        return m_opaque_sp->IsInternal();
+    }
+    else
+        return false;
+}
+
+void
 SBBreakpoint::SetIgnoreCount (uint32_t count)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBBreakpoint(%p)::SetIgnoreCount (count=%u)", m_opaque_sp.get(), count);
@@ -280,7 +327,7 @@ SBBreakpoint::GetHitCount () const
         count = m_opaque_sp->GetHitCount();
     }
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::GetHitCount () => %u", m_opaque_sp.get(), count);
 
@@ -297,7 +344,7 @@ SBBreakpoint::GetIgnoreCount () const
         count = m_opaque_sp->GetIgnoreCount();
     }
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::GetIgnoreCount () => %u", m_opaque_sp.get(), count);
 
@@ -312,9 +359,9 @@ SBBreakpoint::SetThreadID (tid_t tid)
         Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
         m_opaque_sp->SetThreadID (tid);
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4llx)", m_opaque_sp.get(), tid);
+        log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4" PRIx64 ")", m_opaque_sp.get(), tid);
 
 }
 
@@ -328,16 +375,16 @@ SBBreakpoint::GetThreadID ()
         tid = m_opaque_sp->GetThreadID();
     }
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::GetThreadID () => 0x%4.4llx", m_opaque_sp.get(), tid);
+        log->Printf ("SBBreakpoint(%p)::GetThreadID () => 0x%4.4" PRIx64, m_opaque_sp.get(), tid);
     return tid;
 }
 
 void
 SBBreakpoint::SetThreadIndex (uint32_t index)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::SetThreadIndex (%u)", m_opaque_sp.get(), index);
     if (m_opaque_sp)
@@ -358,7 +405,7 @@ SBBreakpoint::GetThreadIndex() const
         if (thread_spec != NULL)
             thread_idx = thread_spec->GetIndex();
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u", m_opaque_sp.get(), thread_idx);
 
@@ -369,7 +416,7 @@ SBBreakpoint::GetThreadIndex() const
 void
 SBBreakpoint::SetThreadName (const char *thread_name)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::SetThreadName (%s)", m_opaque_sp.get(), thread_name);
 
@@ -391,7 +438,7 @@ SBBreakpoint::GetThreadName () const
         if (thread_spec != NULL)
             name = thread_spec->GetName();
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::GetThreadName () => %s", m_opaque_sp.get(), name);
 
@@ -401,7 +448,7 @@ SBBreakpoint::GetThreadName () const
 void
 SBBreakpoint::SetQueueName (const char *queue_name)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::SetQueueName (%s)", m_opaque_sp.get(), queue_name);
     if (m_opaque_sp)
@@ -422,7 +469,7 @@ SBBreakpoint::GetQueueName () const
         if (thread_spec)
             name = thread_spec->GetQueueName();
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBreakpoint(%p)::GetQueueName () => %s", m_opaque_sp.get(), name);
 
@@ -438,9 +485,9 @@ SBBreakpoint::GetNumResolvedLocations()
         Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
         num_resolved = m_opaque_sp->GetNumResolvedLocations();
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %zu", m_opaque_sp.get(), num_resolved);
+        log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %" PRIu64, m_opaque_sp.get(), (uint64_t)num_resolved);
     return num_resolved;
 }
 
@@ -453,9 +500,9 @@ SBBreakpoint::GetNumLocations() const
         Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
         num_locs = m_opaque_sp->GetNumLocations();
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::GetNumLocations () => %zu", m_opaque_sp.get(), num_locs);
+        log->Printf ("SBBreakpoint(%p)::GetNumLocations () => %" PRIu64, m_opaque_sp.get(), (uint64_t)num_locs);
     return num_locs;
 }
 
@@ -469,7 +516,7 @@ SBBreakpoint::GetDescription (SBStream &
         m_opaque_sp->GetResolverDescription (s.get());
         m_opaque_sp->GetFilterDescription (s.get());
         const size_t num_locations = m_opaque_sp->GetNumLocations ();
-        s.Printf(", locations = %zu", num_locations);
+        s.Printf(", locations = %" PRIu64, (uint64_t)num_locations);
         return true;
     }
     s.Printf ("No value");
@@ -518,7 +565,7 @@ SBBreakpoint::PrivateBreakpointHitCallba
 void
 SBBreakpoint::SetCallback (BreakpointHitCallback callback, void *baton)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (log)
         log->Printf ("SBBreakpoint(%p)::SetCallback (callback=%p, baton=%p)", m_opaque_sp.get(), callback, baton);

Modified: lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp Thu Jun  6 19:06:43 2013
@@ -36,7 +36,7 @@ SBBreakpointLocation::SBBreakpointLocati
 SBBreakpointLocation::SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp) :
     m_opaque_sp (break_loc_sp)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
     {
@@ -296,7 +296,7 @@ SBBreakpointLocation::GetID ()
 SBBreakpoint
 SBBreakpointLocation::GetBreakpoint ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     //if (log)
     //    log->Printf ("SBBreakpointLocation::GetBreakpoint ()");

Modified: lldb/branches/lldb-platform-work/source/API/SBBroadcaster.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBBroadcaster.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBBroadcaster.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBBroadcaster.cpp Thu Jun  6 19:06:43 2013
@@ -29,7 +29,7 @@ SBBroadcaster::SBBroadcaster (const char
     m_opaque_ptr (NULL)
 {
     m_opaque_ptr = m_opaque_sp.get();
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
 
     if (log)
         log->Printf ("SBBroadcaster::SBBroadcaster (name=\"%s\") => SBBroadcaster(%p)",
@@ -40,7 +40,7 @@ SBBroadcaster::SBBroadcaster (lldb_priva
     m_opaque_sp (owns ? broadcaster : NULL),
     m_opaque_ptr (broadcaster)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
 
     if (log)
         log->Printf ("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns=%i) => SBBroadcaster(%p)", 
@@ -72,7 +72,7 @@ SBBroadcaster::~SBBroadcaster()
 void
 SBBroadcaster::BroadcastEventByType (uint32_t event_type, bool unique)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, unique=%i)", m_opaque_ptr, event_type, unique);
@@ -89,7 +89,7 @@ SBBroadcaster::BroadcastEventByType (uin
 void
 SBBroadcaster::BroadcastEvent (const SBEvent &event, bool unique)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)", m_opaque_ptr, event.get(), unique);
@@ -107,7 +107,7 @@ SBBroadcaster::BroadcastEvent (const SBE
 void
 SBBroadcaster::AddInitialEventsToListener (const SBListener &listener, uint32_t requested_events)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBBroadcaster(%p)::AddInitialEventsToListener (SBListener(%p), event_mask=0x%8.8x)", m_opaque_ptr, listener.get(), requested_events);
     if (m_opaque_ptr)

Modified: lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp Thu Jun  6 19:06:43 2013
@@ -7,16 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/lldb-types.h"
-#include "lldb/Interpreter/Args.h"
 #include "lldb/Core/SourceManager.h"
 #include "lldb/Core/Listener.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandObjectMultiword.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Target/Target.h"
 
 #include "lldb/API/SBBroadcaster.h"
-#include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBCommandReturnObject.h"
 #include "lldb/API/SBCommandInterpreter.h"
 #include "lldb/API/SBProcess.h"
@@ -28,11 +29,39 @@
 using namespace lldb;
 using namespace lldb_private;
 
+class CommandPluginInterfaceImplementation : public CommandObjectParsed
+{
+public:
+    CommandPluginInterfaceImplementation (CommandInterpreter &interpreter,
+                                          const char *name,
+                                          lldb::SBCommandPluginInterface* backend,
+                                          const char *help = NULL,
+                                          const char *syntax = NULL,
+                                          uint32_t flags = 0) :
+    CommandObjectParsed (interpreter, name, help, syntax, flags),
+    m_backend(backend) {}
+    
+    virtual bool
+    IsRemovable() const { return true; }
+    
+protected:
+    virtual bool
+    DoExecute (Args& command, CommandReturnObject &result)
+    {
+        SBCommandReturnObject sb_return(&result);
+        SBCommandInterpreter sb_interpreter(&m_interpreter);
+        SBDebugger debugger_sb(m_interpreter.GetDebugger().shared_from_this());
+        bool ret = m_backend->DoExecute (debugger_sb,(char**)command.GetArgumentVector(), sb_return);
+        sb_return.Release();
+        return ret;
+    }
+    lldb::SBCommandPluginInterface* m_backend;
+};
 
 SBCommandInterpreter::SBCommandInterpreter (CommandInterpreter *interpreter) :
     m_opaque_ptr (interpreter)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
@@ -81,7 +110,7 @@ SBCommandInterpreter::AliasExists (const
 lldb::ReturnStatus
 SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnObject &result, bool add_to_history)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", SBCommandReturnObject(%p), add_to_history=%i)", 
@@ -90,10 +119,6 @@ SBCommandInterpreter::HandleCommand (con
     result.Clear();
     if (command_line && m_opaque_ptr)
     {
-        TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
-        Mutex::Locker api_locker;
-        if (target_sp)
-            api_locker.Lock(target_sp->GetAPIMutex());
         m_opaque_ptr->HandleCommand (command_line, add_to_history ? eLazyBoolYes : eLazyBoolNo, result.ref());
     }
     else
@@ -123,7 +148,7 @@ SBCommandInterpreter::HandleCompletion (
                                         int max_return_elements,
                                         SBStringList &matches)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     int num_completions = 0;
     
     // Sanity check the arguments that are passed in:
@@ -139,7 +164,7 @@ SBCommandInterpreter::HandleCompletion (
         return 0;
         
     if (log)
-        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %lld, last char at: %lld, match_start_point: %d, max_return_elements: %d)",
+        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %" PRId64 ", last char at: %" PRId64 ", match_start_point: %d, max_return_elements: %d)",
                      m_opaque_ptr, current_line, (uint64_t) (cursor - current_line), (uint64_t) (last_char - current_line), match_start_point, max_return_elements);
                      
     if (m_opaque_ptr)
@@ -208,7 +233,7 @@ SBCommandInterpreter::GetProcess ()
             sb_process.SetSP(process_sp);
         }
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)", 
@@ -218,6 +243,22 @@ SBCommandInterpreter::GetProcess ()
     return sb_process;
 }
 
+SBDebugger
+SBCommandInterpreter::GetDebugger ()
+{
+    SBDebugger sb_debugger;
+    if (m_opaque_ptr)
+        sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    
+    if (log)
+        log->Printf ("SBCommandInterpreter(%p)::GetDebugger () => SBDebugger(%p)",
+                     m_opaque_ptr, sb_debugger.get());
+    
+    
+    return sb_debugger;
+}
+
 CommandInterpreter *
 SBCommandInterpreter::get ()
 {
@@ -254,7 +295,7 @@ SBCommandInterpreter::SourceInitFileInHo
         result->AppendError ("SBCommandInterpreter is not valid");
         result->SetStatus (eReturnStatusFailed);
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory (&SBCommandReturnObject(%p))", 
@@ -279,7 +320,7 @@ SBCommandInterpreter::SourceInitFileInCu
         result->AppendError ("SBCommandInterpreter is not valid");
         result->SetStatus (eReturnStatusFailed);
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory (&SBCommandReturnObject(%p))", 
@@ -289,7 +330,7 @@ SBCommandInterpreter::SourceInitFileInCu
 SBBroadcaster
 SBCommandInterpreter::GetBroadcaster ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBBroadcaster broadcaster (m_opaque_ptr, false);
 
@@ -368,3 +409,82 @@ SBCommandInterpreter::InitializeSWIG ()
     }
 }
 
+lldb::SBCommand
+SBCommandInterpreter::AddMultiwordCommand (const char* name, const char* help)
+{
+    CommandObjectMultiword *new_command = new CommandObjectMultiword(*m_opaque_ptr,name,help);
+    new_command->SetRemovable (true);
+    lldb::CommandObjectSP new_command_sp(new_command);
+    if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+        return lldb::SBCommand(new_command_sp);
+    return lldb::SBCommand();
+}
+
+lldb::SBCommand
+SBCommandInterpreter::AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const char* help)
+{
+    lldb::CommandObjectSP new_command_sp;
+    new_command_sp.reset(new CommandPluginInterfaceImplementation(*m_opaque_ptr,name,impl,help));
+
+    if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+        return lldb::SBCommand(new_command_sp);
+    return lldb::SBCommand();
+}
+
+SBCommand::SBCommand ()
+{}
+
+SBCommand::SBCommand (lldb::CommandObjectSP cmd_sp) : m_opaque_sp (cmd_sp)
+{}
+
+bool
+SBCommand::IsValid ()
+{
+    return (bool)m_opaque_sp;
+}
+
+const char*
+SBCommand::GetName ()
+{
+    if (IsValid ())
+        return m_opaque_sp->GetCommandName ();
+    return NULL;
+}
+
+const char*
+SBCommand::GetHelp ()
+{
+    if (IsValid ())
+        return m_opaque_sp->GetHelp ();
+    return NULL;
+}
+
+lldb::SBCommand
+SBCommand::AddMultiwordCommand (const char* name, const char* help)
+{
+    if (!IsValid ())
+        return lldb::SBCommand();
+    if (m_opaque_sp->IsMultiwordObject() == false)
+        return lldb::SBCommand();
+    CommandObjectMultiword *new_command = new CommandObjectMultiword(m_opaque_sp->GetCommandInterpreter(),name,help);
+    new_command->SetRemovable (true);
+    lldb::CommandObjectSP new_command_sp(new_command);
+    if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
+        return lldb::SBCommand(new_command_sp);
+    return lldb::SBCommand();
+}
+
+lldb::SBCommand
+SBCommand::AddCommand (const char* name, lldb::SBCommandPluginInterface *impl, const char* help)
+{
+    if (!IsValid ())
+        return lldb::SBCommand();
+    if (m_opaque_sp->IsMultiwordObject() == false)
+        return lldb::SBCommand();
+    lldb::CommandObjectSP new_command_sp;
+    new_command_sp.reset(new CommandPluginInterfaceImplementation(m_opaque_sp->GetCommandInterpreter(),name,impl,help));
+    if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
+        return lldb::SBCommand(new_command_sp);
+    return lldb::SBCommand();
+}
+

Modified: lldb/branches/lldb-platform-work/source/API/SBCommandReturnObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBCommandReturnObject.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBCommandReturnObject.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBCommandReturnObject.cpp Thu Jun  6 19:06:43 2013
@@ -68,7 +68,7 @@ SBCommandReturnObject::IsValid() const
 const char *
 SBCommandReturnObject::GetOutput ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (m_opaque_ap.get())
     {
@@ -88,7 +88,7 @@ SBCommandReturnObject::GetOutput ()
 const char *
 SBCommandReturnObject::GetError ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (m_opaque_ap.get())
     {
@@ -190,6 +190,13 @@ SBCommandReturnObject::AppendMessage (co
         m_opaque_ap->AppendMessage (message);
 }
 
+void
+SBCommandReturnObject::AppendWarning (const char *message)
+{
+    if (m_opaque_ap.get())
+        m_opaque_ap->AppendWarning (message);
+}
+
 CommandReturnObject *
 SBCommandReturnObject::operator ->() const
 {
@@ -261,7 +268,7 @@ SBCommandReturnObject::SetImmediateOutpu
     if (m_opaque_ap.get())
         m_opaque_ap->SetImmediateOutputFile (fh);
 }
-    
+
 void
 SBCommandReturnObject::SetImmediateErrorFile (FILE *fh)
 {
@@ -274,10 +281,40 @@ SBCommandReturnObject::PutCString(const
 {
     if (m_opaque_ap.get())
     {
-        m_opaque_ap->AppendMessage(string, len);
+        if (len == 0 || string == NULL || *string == 0)
+        {
+            return;
+        }
+        else if (len > 0)
+        {
+            std::string buffer(string, len);
+            m_opaque_ap->AppendMessage(buffer.c_str());
+        }
+        else
+            m_opaque_ap->AppendMessage(string);
     }
 }
 
+const char *
+SBCommandReturnObject::GetOutput (bool only_if_no_immediate)
+{
+    if (!m_opaque_ap.get())
+        return NULL;
+    if (only_if_no_immediate == false || m_opaque_ap->GetImmediateOutputStream().get() == NULL)
+        return GetOutput();
+    return NULL;
+}
+
+const char *
+SBCommandReturnObject::GetError (bool only_if_no_immediate)
+{
+    if (!m_opaque_ap.get())
+        return NULL;
+    if (only_if_no_immediate == false || m_opaque_ap->GetImmediateErrorStream().get() == NULL)
+        return GetError();
+    return NULL;
+}
+
 size_t
 SBCommandReturnObject::Printf(const char* format, ...)
 {

Modified: lldb/branches/lldb-platform-work/source/API/SBCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBCommunication.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBCommunication.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBCommunication.cpp Thu Jun  6 19:06:43 2013
@@ -28,7 +28,7 @@ SBCommunication::SBCommunication(const c
     m_opaque (new Communication (broadcaster_name)),
     m_opaque_owned (true)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBCommunication::SBCommunication (broadcaster_name=\"%s\") => "
@@ -79,7 +79,7 @@ SBCommunication::Connect (const char *ur
 ConnectionStatus
 SBCommunication::AdoptFileDesriptor (int fd, bool owns_fd)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     ConnectionStatus status = eConnectionStatusNoConnection;
     if (m_opaque)
@@ -107,7 +107,7 @@ SBCommunication::AdoptFileDesriptor (int
 ConnectionStatus
 SBCommunication::Disconnect ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     ConnectionStatus status= eConnectionStatusNoConnection;
     if (m_opaque)
@@ -123,7 +123,7 @@ SBCommunication::Disconnect ()
 bool
 SBCommunication::IsConnected () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     bool result = false;
     if (m_opaque)
         result = m_opaque->IsConnected ();
@@ -137,10 +137,13 @@ SBCommunication::IsConnected () const
 size_t
 SBCommunication::Read (void *dst, size_t dst_len, uint32_t timeout_usec, ConnectionStatus &status)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%zu, timeout_usec=%u, &status)...", 
-                     m_opaque, dst, dst_len, timeout_usec);
+        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status)...",
+                     m_opaque,
+                     dst,
+                     (uint64_t)dst_len,
+                     timeout_usec);
     size_t bytes_read = 0;
     if (m_opaque)
         bytes_read = m_opaque->Read (dst, dst_len, timeout_usec, status, NULL);
@@ -148,9 +151,13 @@ SBCommunication::Read (void *dst, size_t
         status = eConnectionStatusNoConnection;
 
     if (log)
-        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%zu, timeout_usec=%u, &status=%s) => %zu", 
-                     m_opaque, dst, dst_len, timeout_usec, Communication::ConnectionStatusAsCString (status),
-                     bytes_read);
+        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status=%s) => %" PRIu64,
+                     m_opaque,
+                     dst,
+                     (uint64_t)dst_len,
+                     timeout_usec,
+                     Communication::ConnectionStatusAsCString (status),
+                     (uint64_t)bytes_read);
     return bytes_read;
 }
 
@@ -164,10 +171,10 @@ SBCommunication::Write (const void *src,
     else
         status = eConnectionStatusNoConnection;
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBCommunication(%p)::Write (src=%p, src_len=%zu, &status=%s) => %zu", 
-                     m_opaque, src, src_len, Communication::ConnectionStatusAsCString (status), bytes_written);
+        log->Printf ("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64 ", &status=%s) => %" PRIu64,
+                     m_opaque, src, (uint64_t)src_len, Communication::ConnectionStatusAsCString (status), (uint64_t)bytes_written);
 
     return 0;
 }
@@ -175,13 +182,12 @@ SBCommunication::Write (const void *src,
 bool
 SBCommunication::ReadThreadStart ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     bool success = false;
     if (m_opaque)
         success = m_opaque->StartReadThread ();
 
-    log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
     if (log)
         log->Printf ("SBCommunication(%p)::ReadThreadStart () => %i", m_opaque, success);
 
@@ -192,7 +198,7 @@ SBCommunication::ReadThreadStart ()
 bool
 SBCommunication::ReadThreadStop ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBCommunication(%p)::ReadThreadStop ()...", m_opaque);
 
@@ -212,7 +218,7 @@ SBCommunication::ReadThreadIsRunning ()
     bool result = false;
     if (m_opaque)
         result = m_opaque->ReadThreadIsRunning ();
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBCommunication(%p)::ReadThreadIsRunning () => %i", m_opaque, result);
     return result;
@@ -225,7 +231,7 @@ SBCommunication::SetReadThreadBytesRecei
     void *callback_baton
 )
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     bool result = false;
     if (m_opaque)
@@ -246,7 +252,7 @@ SBCommunication::GetBroadcaster ()
 {
     SBBroadcaster broadcaster (m_opaque, false);
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",

Modified: lldb/branches/lldb-platform-work/source/API/SBCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBCompileUnit.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBCompileUnit.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBCompileUnit.cpp Thu Jun  6 19:06:43 2013
@@ -71,7 +71,7 @@ SBCompileUnit::GetNumLineEntries () cons
 SBLineEntry
 SBCompileUnit::GetLineEntryAtIndex (uint32_t idx) const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBLineEntry sb_line_entry;
     if (m_opaque_ptr)
@@ -106,7 +106,7 @@ SBCompileUnit::FindLineEntryIndex (uint3
 uint32_t
 SBCompileUnit::FindLineEntryIndex (uint32_t start_idx, uint32_t line, SBFileSpec *inline_file_spec, bool exact) const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     uint32_t index = UINT32_MAX;
     if (m_opaque_ptr)
@@ -157,7 +157,7 @@ SBCompileUnit::GetNumSupportFiles () con
 SBFileSpec
 SBCompileUnit::GetSupportFileAtIndex (uint32_t idx) const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBFileSpec sb_file_spec;
     if (m_opaque_ptr)

Modified: lldb/branches/lldb-platform-work/source/API/SBData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBData.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBData.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBData.cpp Thu Jun  6 19:06:43 2013
@@ -86,7 +86,7 @@ SBData::IsValid()
 uint8_t
 SBData::GetAddressByteSize ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     uint8_t value = 0;
     if (m_opaque_sp.get())
         value = m_opaque_sp->GetAddressByteSize();
@@ -99,7 +99,7 @@ SBData::GetAddressByteSize ()
 void
 SBData::SetAddressByteSize (uint8_t addr_byte_size)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (m_opaque_sp.get())
         m_opaque_sp->SetAddressByteSize(addr_byte_size);
     if (log)
@@ -116,7 +116,7 @@ SBData::Clear ()
 size_t
 SBData::GetByteSize ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     size_t value = 0;
     if (m_opaque_sp.get())
         value = m_opaque_sp->GetByteSize();
@@ -129,7 +129,7 @@ SBData::GetByteSize ()
 lldb::ByteOrder
 SBData::GetByteOrder ()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     lldb::ByteOrder value = eByteOrderInvalid;
     if (m_opaque_sp.get())
         value = m_opaque_sp->GetByteOrder();
@@ -142,7 +142,7 @@ SBData::GetByteOrder ()
 void
 SBData::SetByteOrder (lldb::ByteOrder endian)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (m_opaque_sp.get())
         m_opaque_sp->SetByteOrder(endian);
     if (log)
@@ -151,9 +151,9 @@ SBData::SetByteOrder (lldb::ByteOrder en
 
 
 float
-SBData::GetFloat (lldb::SBError& error, uint32_t offset)
+SBData::GetFloat (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     float value = 0;
     if (!m_opaque_sp.get())
     {
@@ -167,15 +167,15 @@ SBData::GetFloat (lldb::SBError& error,
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetFloat (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => "
                      "(%f)", error.get(), offset, value);
     return value;
 }
 
 double
-SBData::GetDouble (lldb::SBError& error, uint32_t offset)
+SBData::GetDouble (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     double value = 0;
     if (!m_opaque_sp.get())
     {
@@ -189,15 +189,15 @@ SBData::GetDouble (lldb::SBError& error,
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetDouble (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
                      "(%f)", error.get(), offset, value);
     return value;
 }
 
 long double
-SBData::GetLongDouble (lldb::SBError& error, uint32_t offset)
+SBData::GetLongDouble (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     long double value = 0;
     if (!m_opaque_sp.get())
     {
@@ -211,15 +211,15 @@ SBData::GetLongDouble (lldb::SBError& er
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetLongDouble (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
                      "(%Lf)", error.get(), offset, value);
     return value;
 }
 
 lldb::addr_t
-SBData::GetAddress (lldb::SBError& error, uint32_t offset)
+SBData::GetAddress (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     lldb::addr_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -233,15 +233,15 @@ SBData::GetAddress (lldb::SBError& error
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetAddress (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
                      "(%p)", error.get(), offset, (void*)value);
     return value;
 }
 
 uint8_t
-SBData::GetUnsignedInt8 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     uint8_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -255,15 +255,15 @@ SBData::GetUnsignedInt8 (lldb::SBError&
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
                      "(%c)", error.get(), offset, value);
     return value;
 }
 
 uint16_t
-SBData::GetUnsignedInt16 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     uint16_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -277,15 +277,15 @@ SBData::GetUnsignedInt16 (lldb::SBError&
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
                      "(%hd)", error.get(), offset, value);
     return value;
 }
 
 uint32_t
-SBData::GetUnsignedInt32 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     uint32_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -299,15 +299,15 @@ SBData::GetUnsignedInt32 (lldb::SBError&
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
                      "(%d)", error.get(), offset, value);
     return value;
 }
 
 uint64_t
-SBData::GetUnsignedInt64 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     uint64_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -321,15 +321,15 @@ SBData::GetUnsignedInt64 (lldb::SBError&
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%d) => "
-                     "(%lld)", error.get(), offset, value);
+        log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
+                     "(%" PRId64 ")", error.get(), offset, value);
     return value;
 }
 
 int8_t
-SBData::GetSignedInt8 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     int8_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -343,15 +343,15 @@ SBData::GetSignedInt8 (lldb::SBError& er
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
                      "(%c)", error.get(), offset, value);
     return value;
 }
 
 int16_t
-SBData::GetSignedInt16 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     int16_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -365,15 +365,15 @@ SBData::GetSignedInt16 (lldb::SBError& e
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
                      "(%hd)", error.get(), offset, value);
     return value;
 }
 
 int32_t
-SBData::GetSignedInt32 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     int32_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -387,15 +387,15 @@ SBData::GetSignedInt32 (lldb::SBError& e
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
                      "(%d)", error.get(), offset, value);
     return value;
 }
 
 int64_t
-SBData::GetSignedInt64 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     int64_t value = 0;
     if (!m_opaque_sp.get())
     {
@@ -409,15 +409,15 @@ SBData::GetSignedInt64 (lldb::SBError& e
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%d) => "
-                     "(%lld)", error.get(), offset, value);
+        log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
+                     "(%" PRId64 ")", error.get(), offset, value);
     return value;
 }
 
 const char*
-SBData::GetString (lldb::SBError& error, uint32_t offset)
+SBData::GetString (lldb::SBError& error, lldb::offset_t offset)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     const char* value = 0;
     if (!m_opaque_sp.get())
     {
@@ -431,7 +431,7 @@ SBData::GetString (lldb::SBError& error,
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::GetString (error=%p,offset=%d) => "
+        log->Printf ("SBData::GetString (error=%p,offset=%" PRIu64 ") => "
                      "(%p)", error.get(), offset, value);
     return value;
 }
@@ -461,11 +461,11 @@ SBData::GetDescription (lldb::SBStream &
 
 size_t
 SBData::ReadRawData (lldb::SBError& error,
-                     uint32_t offset,
+                     lldb::offset_t offset,
                      void *buf,
                      size_t size)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     void* ok = NULL;
     if (!m_opaque_sp.get())
     {
@@ -479,7 +479,7 @@ SBData::ReadRawData (lldb::SBError& erro
             error.SetErrorString("unable to read data");
     }
     if (log)
-        log->Printf ("SBData::ReadRawData (error=%p,offset=%d,buf=%p,size=%lu) => "
+        log->Printf ("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%lu) => "
                      "(%p)", error.get(), offset, buf, size, ok);
     return ok ? size : 0;
 }
@@ -491,7 +491,7 @@ SBData::SetData (lldb::SBError& error,
                  lldb::ByteOrder endian,
                  uint8_t addr_size)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (!m_opaque_sp.get())
         m_opaque_sp.reset(new DataExtractor(buf, size, endian, addr_size));
     else
@@ -504,7 +504,7 @@ SBData::SetData (lldb::SBError& error,
 bool
 SBData::Append (const SBData& rhs)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     bool value = false;
     if (m_opaque_sp.get() && rhs.m_opaque_sp.get())
         value = m_opaque_sp.get()->Append(*rhs.m_opaque_sp);
@@ -613,7 +613,7 @@ SBData::CreateDataFromDoubleArray (lldb:
 bool
 SBData::SetDataFromCString (const char* data)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (!data)
     {
@@ -642,7 +642,7 @@ SBData::SetDataFromCString (const char*
 bool
 SBData::SetDataFromUInt64Array (uint64_t* array, size_t array_len)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (!array || array_len == 0)
     {
@@ -671,7 +671,7 @@ SBData::SetDataFromUInt64Array (uint64_t
 bool
 SBData::SetDataFromUInt32Array (uint32_t* array, size_t array_len)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (!array || array_len == 0)
     {
@@ -700,7 +700,7 @@ SBData::SetDataFromUInt32Array (uint32_t
 bool
 SBData::SetDataFromSInt64Array (int64_t* array, size_t array_len)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (!array || array_len == 0)
     {
@@ -729,7 +729,7 @@ SBData::SetDataFromSInt64Array (int64_t*
 bool
 SBData::SetDataFromSInt32Array (int32_t* array, size_t array_len)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (!array || array_len == 0)
     {
@@ -758,7 +758,7 @@ SBData::SetDataFromSInt32Array (int32_t*
 bool
 SBData::SetDataFromDoubleArray (double* array, size_t array_len)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (!array || array_len == 0)
     {

Modified: lldb/branches/lldb-platform-work/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBDebugger.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBDebugger.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBDebugger.cpp Thu Jun  6 19:06:43 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBDebugger.h"
 
 #include "lldb/lldb-private.h"
@@ -33,9 +35,9 @@
 #include "lldb/API/SBTypeSynthetic.h"
 
 
-#include "lldb/Core/DataVisualization.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/State.h"
+#include "lldb/DataFormatters/DataVisualization.h"
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/OptionGroupPlatform.h"
@@ -48,7 +50,7 @@ using namespace lldb_private;
 void
 SBDebugger::Initialize ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBDebugger::Initialize ()");
@@ -67,7 +69,7 @@ SBDebugger::Terminate ()
 void
 SBDebugger::Clear ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBDebugger(%p)::Clear ()", m_opaque_sp.get());
@@ -94,7 +96,7 @@ SBDebugger
 SBDebugger::Create(bool source_init_files, lldb::LogOutputCallback callback, void *baton)
 
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBDebugger debugger;
     debugger.reset(Debugger::CreateInstance(callback, baton));
@@ -125,7 +127,7 @@ SBDebugger::Create(bool source_init_file
 void
 SBDebugger::Destroy (SBDebugger &debugger)
 {
-    LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (log)
     {
@@ -147,7 +149,7 @@ SBDebugger::MemoryPressureDetected ()
     // non-mandatory. We have seen deadlocks with this function when called
     // so we need to safeguard against this until we can determine what is
     // causing the deadlocks.
-    LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     const bool mandatory = false;
     if (log)
@@ -229,7 +231,7 @@ SBDebugger::SkipAppInitFiles (bool b)
 void
 SBDebugger::SetInputFileHandle (FILE *fh, bool transfer_ownership)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBDebugger(%p)::SetInputFileHandle (fh=%p, transfer_ownership=%i)", m_opaque_sp.get(),
@@ -242,7 +244,7 @@ SBDebugger::SetInputFileHandle (FILE *fh
 void
 SBDebugger::SetOutputFileHandle (FILE *fh, bool transfer_ownership)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
 
     if (log)
@@ -256,7 +258,7 @@ SBDebugger::SetOutputFileHandle (FILE *f
 void
 SBDebugger::SetErrorFileHandle (FILE *fh, bool transfer_ownership)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
 
     if (log)
@@ -291,10 +293,24 @@ SBDebugger::GetErrorFileHandle ()
     return NULL;
 }
 
+void
+SBDebugger::SaveInputTerminalState()
+{
+    if (m_opaque_sp)
+        m_opaque_sp->SaveInputTerminalState();
+}
+
+void
+SBDebugger::RestoreInputTerminalState()
+{
+    if (m_opaque_sp)
+        m_opaque_sp->RestoreInputTerminalState();
+
+}
 SBCommandInterpreter
 SBDebugger::GetCommandInterpreter ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBCommandInterpreter sb_interpreter;
     if (m_opaque_sp)
@@ -348,7 +364,7 @@ SBDebugger::HandleCommand (const char *c
 SBListener
 SBDebugger::GetListener ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBListener sb_listener;
     if (m_opaque_sp)
@@ -476,7 +492,7 @@ SBDebugger::StateAsCString (StateType st
 bool
 SBDebugger::StateIsRunningState (StateType state)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     const bool result = lldb_private::StateIsRunningState (state);
     if (log)
@@ -489,7 +505,7 @@ SBDebugger::StateIsRunningState (StateTy
 bool
 SBDebugger::StateIsStoppedState (StateType state)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     const bool result = lldb_private::StateIsStoppedState (state, false);
     if (log)
@@ -511,12 +527,11 @@ SBDebugger::CreateTarget (const char *fi
     if (m_opaque_sp)
     {
         sb_error.Clear();
-        FileSpec filename_spec (filename, true);
         OptionGroupPlatform platform_options (false);
         platform_options.SetPlatformName (platform_name);
         
         sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
-                                                                    filename_spec, 
+                                                                    filename, 
                                                                     target_triple, 
                                                                     add_dependent_modules, 
                                                                     &platform_options,
@@ -530,7 +545,7 @@ SBDebugger::CreateTarget (const char *fi
         sb_error.SetErrorString("invalid target");
     }
     
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         log->Printf ("SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, platform_name=%s, add_dependent_modules=%u, error=%s) => SBTarget(%p)", 
@@ -554,11 +569,9 @@ SBDebugger::CreateTargetWithFileAndTarge
     TargetSP target_sp;
     if (m_opaque_sp)
     {
-        FileSpec file_spec (filename, true);
-        TargetSP target_sp;
         const bool add_dependent_modules = true;
         Error error (m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
-                                                                file_spec, 
+                                                                filename, 
                                                                 target_triple, 
                                                                 add_dependent_modules, 
                                                                 NULL,
@@ -566,7 +579,7 @@ SBDebugger::CreateTargetWithFileAndTarge
         sb_target.SetSP (target_sp);
     }
     
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndTargetTriple (filename=\"%s\", triple=%s) => SBTarget(%p)", 
@@ -579,18 +592,17 @@ SBDebugger::CreateTargetWithFileAndTarge
 SBTarget
 SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *arch_cstr)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBTarget sb_target;
     TargetSP target_sp;
     if (m_opaque_sp)
     {
-        FileSpec file (filename, true);
         Error error;
         const bool add_dependent_modules = true;
 
-        error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
-                                                           file, 
+        error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
+                                                           filename, 
                                                            arch_cstr, 
                                                            add_dependent_modules, 
                                                            NULL, 
@@ -619,14 +631,13 @@ SBDebugger::CreateTarget (const char *fi
     TargetSP target_sp;
     if (m_opaque_sp)
     {
-        FileSpec file (filename, true);
         ArchSpec arch = Target::GetDefaultArchitecture ();
         Error error;
         const bool add_dependent_modules = true;
 
         PlatformSP platform_sp(m_opaque_sp->GetPlatformList().GetSelectedPlatform());
         error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
-                                                           file, 
+                                                           filename, 
                                                            arch, 
                                                            add_dependent_modules, 
                                                            platform_sp,
@@ -638,7 +649,7 @@ SBDebugger::CreateTarget (const char *fi
             sb_target.SetSP (target_sp);
         }
     }
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         log->Printf ("SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)", 
@@ -665,7 +676,7 @@ SBDebugger::DeleteTarget (lldb::SBTarget
         }
     }
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         log->Printf ("SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i", m_opaque_sp.get(), target.m_opaque_sp.get(), result);
@@ -752,7 +763,7 @@ SBDebugger::GetNumTargets ()
 SBTarget
 SBDebugger::GetSelectedTarget ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBTarget sb_target;
     TargetSP target_sp;
@@ -777,7 +788,7 @@ SBDebugger::GetSelectedTarget ()
 void
 SBDebugger::SetSelectedTarget (SBTarget &sb_target)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     TargetSP target_sp (sb_target.GetSP());
     if (m_opaque_sp)
@@ -794,13 +805,22 @@ SBDebugger::SetSelectedTarget (SBTarget
 }
 
 void
-SBDebugger::DispatchInput (void *baton, const void *data, size_t data_len)
+SBDebugger::DispatchInput (void* baton, const void *data, size_t data_len)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    DispatchInput (data,data_len);
+}
+
+void
+SBDebugger::DispatchInput (const void *data, size_t data_len)
+{
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
-        log->Printf ("SBDebugger(%p)::DispatchInput (baton=%p, data=\"%.*s\", size_t=%zu)", m_opaque_sp.get(),
-                     baton, (int) data_len, (const char *) data, data_len);
+        log->Printf ("SBDebugger(%p)::DispatchInput (data=\"%.*s\", size_t=%" PRIu64 ")",
+                     m_opaque_sp.get(),
+                     (int) data_len,
+                     (const char *) data,
+                     (uint64_t)data_len);
 
     if (m_opaque_sp)
         m_opaque_sp->DispatchInput ((const char *) data, data_len);
@@ -823,7 +843,7 @@ SBDebugger::DispatchInputEndOfFile ()
 bool
 SBDebugger::InputReaderIsTopReader (const lldb::SBInputReader &reader)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBDebugger(%p)::InputReaderIsTopReader (SBInputReader(%p))", m_opaque_sp.get(), &reader);
@@ -841,7 +861,7 @@ SBDebugger::InputReaderIsTopReader (cons
 void
 SBDebugger::PushInputReader (SBInputReader &reader)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBDebugger(%p)::PushInputReader (SBInputReader(%p))", m_opaque_sp.get(), &reader);
@@ -860,7 +880,7 @@ SBDebugger::PushInputReader (SBInputRead
 void
 SBDebugger::NotifyTopInputReader (InputReaderAction notification)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBDebugger(%p)::NotifyTopInputReader (%d)", m_opaque_sp.get(), notification);
@@ -917,16 +937,23 @@ SBDebugger::GetInstanceName()
 SBError
 SBDebugger::SetInternalVariable (const char *var_name, const char *value, const char *debugger_instance_name)
 {
-    UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
-
-    Error err = root_settings_controller->SetVariable (var_name, 
-                                                       value, 
-                                                       eVarSetOperationAssign, 
-                                                       true,
-                                                       debugger_instance_name);
     SBError sb_error;
-    sb_error.SetError (err);
-
+    DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName (ConstString(debugger_instance_name)));
+    Error error;
+    if (debugger_sp)
+    {
+        ExecutionContext exe_ctx (debugger_sp->GetCommandInterpreter().GetExecutionContext());
+        error = debugger_sp->SetPropertyValue (&exe_ctx,
+                                               eVarSetOperationAssign,
+                                               var_name,
+                                               value);
+    }
+    else
+    {
+        error.SetErrorStringWithFormat ("invalid debugger instance name '%s'", debugger_instance_name);
+    }
+    if (error.Fail())
+        sb_error.SetError(error);
     return sb_error;
 }
 
@@ -934,25 +961,29 @@ SBStringList
 SBDebugger::GetInternalVariableValue (const char *var_name, const char *debugger_instance_name)
 {
     SBStringList ret_value;
-    SettableVariableType var_type;
-    Error err;
-
-    UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
-
-    StringList value = root_settings_controller->GetVariable (var_name, var_type, debugger_instance_name, err);
-    
-    if (err.Success())
-    {
-        for (unsigned i = 0; i != value.GetSize(); ++i)
-            ret_value.AppendString (value.GetStringAtIndex(i));
-    }
-    else
+    DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName (ConstString(debugger_instance_name)));
+    Error error;
+    if (debugger_sp)
     {
-        ret_value.AppendString (err.AsCString());
+        ExecutionContext exe_ctx (debugger_sp->GetCommandInterpreter().GetExecutionContext());
+        lldb::OptionValueSP value_sp (debugger_sp->GetPropertyValue (&exe_ctx,
+                                                                     var_name,
+                                                                     false,
+                                                                     error));
+        if (value_sp)
+        {
+            StreamString value_strm;
+            value_sp->DumpValue (&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
+            const std::string &value_str = value_strm.GetString();
+            if (!value_str.empty())
+            {
+                StringList string_list;
+                string_list.SplitIntoLines(value_str.c_str(), value_str.size());
+                return SBStringList(&string_list);
+            }
+        }
     }
-
-
-    return ret_value;
+    return SBStringList();
 }
 
 uint32_t
@@ -973,7 +1004,7 @@ SBDebugger::SetTerminalWidth (uint32_t t
 const char *
 SBDebugger::GetPrompt() const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     if (log)
         log->Printf ("SBDebugger(%p)::GetPrompt () => \"%s\"", m_opaque_sp.get(), 
@@ -1026,6 +1057,22 @@ SBDebugger::GetUseExternalEditor ()
 }
 
 bool
+SBDebugger::SetUseColor (bool value)
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->SetUseColor (value);
+    return false;
+}
+
+bool
+SBDebugger::GetUseColor () const
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->GetUseColor ();
+    return false;
+}
+
+bool
 SBDebugger::GetDescription (SBStream &description)
 {
     Stream &strm = description.ref();
@@ -1034,7 +1081,7 @@ SBDebugger::GetDescription (SBStream &de
     {
         const char *name = m_opaque_sp->GetInstanceName().AsCString();
         user_id_t id = m_opaque_sp->GetID();
-        strm.Printf ("Debugger (instance: \"%s\", id: %llu)", name, id);
+        strm.Printf ("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
     }
     else
         strm.PutCString ("No value");

Modified: lldb/branches/lldb-platform-work/source/API/SBError.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBError.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBError.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBError.cpp Thu Jun  6 19:06:43 2013
@@ -70,7 +70,7 @@ SBError::Clear ()
 bool
 SBError::Fail () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     bool ret_value = false;
     if (m_opaque_ap.get())
@@ -85,7 +85,7 @@ SBError::Fail () const
 bool
 SBError::Success () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     bool ret_value = true;
     if (m_opaque_ap.get())
         ret_value = m_opaque_ap->Success();
@@ -99,7 +99,7 @@ SBError::Success () const
 uint32_t
 SBError::GetError () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     uint32_t err = 0;
     if (m_opaque_ap.get())
@@ -115,7 +115,7 @@ SBError::GetError () const
 ErrorType
 SBError::GetType () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     ErrorType err_type = eErrorTypeInvalid;
     if (m_opaque_ap.get())
         err_type = m_opaque_ap->GetType();

Modified: lldb/branches/lldb-platform-work/source/API/SBEvent.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBEvent.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBEvent.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBEvent.cpp Thu Jun  6 19:06:43 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBEvent.h"
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBStream.h"
@@ -79,7 +81,7 @@ SBEvent::GetDataFlavor ()
 uint32_t
 SBEvent::GetType () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     const Event *lldb_event = get();
     uint32_t event_type = 0;
@@ -137,7 +139,7 @@ SBEvent::BroadcasterMatchesRef (const SB
         success = lldb_event->BroadcasterIs (broadcaster.get());
 
     // For logging, this gets a little chatty so only enable this when verbose logging is on
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
     if (log)
         log->Printf ("SBEvent(%p)::BroadcasterMatchesRef (SBBroadcaster(%p): %s) => %i", 
                      get(),
@@ -201,7 +203,7 @@ SBEvent::IsValid() const
 const char *
 SBEvent::GetCStringFromEvent (const SBEvent &event)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBEvent(%p)::GetCStringFromEvent () => \"%s\"", 

Modified: lldb/branches/lldb-platform-work/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBFileSpec.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBFileSpec.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBFileSpec.cpp Thu Jun  6 19:06:43 2013
@@ -28,7 +28,7 @@ SBFileSpec::SBFileSpec () :
 SBFileSpec::SBFileSpec (const SBFileSpec &rhs) :
     m_opaque_ap()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (rhs.m_opaque_ap.get())
         m_opaque_ap.reset (new FileSpec (rhs.get()));
@@ -51,7 +51,7 @@ SBFileSpec::SBFileSpec (const char *path
 SBFileSpec::SBFileSpec (const char *path, bool resolve) :
     m_opaque_ap(new FileSpec (path, resolve))
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBFileSpec::SBFileSpec (path=\"%s\", resolve=%i) => SBFileSpec(%p)", path, 
@@ -82,7 +82,7 @@ SBFileSpec::IsValid() const
 bool
 SBFileSpec::Exists () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     bool result = false;
     if (m_opaque_ap.get())
@@ -115,7 +115,7 @@ SBFileSpec::GetFilename() const
     if (m_opaque_ap.get())
         s = m_opaque_ap->GetFilename().AsCString();
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         if (s)
@@ -133,7 +133,7 @@ SBFileSpec::GetDirectory() const
     const char *s = NULL;
     if (m_opaque_ap.get())
         s = m_opaque_ap->GetDirectory().AsCString();
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         if (s)
@@ -147,15 +147,15 @@ SBFileSpec::GetDirectory() const
 uint32_t
 SBFileSpec::GetPath (char *dst_path, size_t dst_len) const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     uint32_t result = 0;
     if (m_opaque_ap.get())
         result = m_opaque_ap->GetPath (dst_path, dst_len);
 
     if (log)
-        log->Printf ("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%zu) => %u", 
-                     m_opaque_ap.get(), result, dst_path, dst_len, result);
+        log->Printf ("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%" PRIu64 ") => %u",
+                     m_opaque_ap.get(), result, dst_path, (uint64_t)dst_len, result);
 
     if (result == 0 && dst_path && dst_len > 0)
         *dst_path = '\0';

Modified: lldb/branches/lldb-platform-work/source/API/SBFileSpecList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBFileSpecList.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBFileSpecList.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBFileSpecList.cpp Thu Jun  6 19:06:43 2013
@@ -30,7 +30,7 @@ SBFileSpecList::SBFileSpecList () :
 SBFileSpecList::SBFileSpecList (const SBFileSpecList &rhs) :
     m_opaque_ap()
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (rhs.m_opaque_ap.get())
         m_opaque_ap.reset (new FileSpecList (*(rhs.get())));

Modified: lldb/branches/lldb-platform-work/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBFrame.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBFrame.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBFrame.cpp Thu Jun  6 19:06:43 2013
@@ -24,6 +24,8 @@
 #include "lldb/Expression/ClangUserExpression.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/Function.h"
+#include "lldb/Symbol/Symbol.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Symbol/Variable.h"
@@ -38,6 +40,7 @@
 #include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBValue.h"
 #include "lldb/API/SBAddress.h"
+#include "lldb/API/SBExpressionOptions.h"
 #include "lldb/API/SBStream.h"
 #include "lldb/API/SBSymbolContext.h"
 #include "lldb/API/SBThread.h"
@@ -54,7 +57,7 @@ SBFrame::SBFrame () :
 SBFrame::SBFrame (const StackFrameSP &lldb_object_sp) :
     m_opaque_sp (new ExecutionContextRef (lldb_object_sp))
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
     {
@@ -106,23 +109,34 @@ SBFrame::IsValid() const
 SBSymbolContext
 SBFrame::GetSymbolContext (uint32_t resolve_scope) const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBSymbolContext sb_sym_ctx;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext (resolve_scope));
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext (resolve_scope));
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetVariables () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetSymbolContext () => error: process is running", frame);
+                log->Printf ("SBFrame::GetSymbolContext () => error: process is running");
         }
     }
 
@@ -136,25 +150,36 @@ SBFrame::GetSymbolContext (uint32_t reso
 SBModule
 SBFrame::GetModule () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBModule sb_module;
     ModuleSP module_sp;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            module_sp = frame->GetSymbolContext (eSymbolContextModule).module_sp;
-            sb_module.SetSP (module_sp);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                module_sp = frame->GetSymbolContext (eSymbolContextModule).module_sp;
+                sb_module.SetSP (module_sp);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetModule () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetModule () => error: process is running", frame);
+                log->Printf ("SBFrame::GetModule () => error: process is running");
         }
     }
 
@@ -168,23 +193,34 @@ SBFrame::GetModule () const
 SBCompileUnit
 SBFrame::GetCompileUnit () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBCompileUnit sb_comp_unit;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_comp_unit.reset (frame->GetSymbolContext (eSymbolContextCompUnit).comp_unit);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_comp_unit.reset (frame->GetSymbolContext (eSymbolContextCompUnit).comp_unit);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetCompileUnit () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetCompileUnit () => error: process is running", frame);
+                log->Printf ("SBFrame::GetCompileUnit () => error: process is running");
         }
     }
     if (log)
@@ -197,23 +233,34 @@ SBFrame::GetCompileUnit () const
 SBFunction
 SBFrame::GetFunction () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBFunction sb_function;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_function.reset(frame->GetSymbolContext (eSymbolContextFunction).function);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_function.reset(frame->GetSymbolContext (eSymbolContextFunction).function);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetFunction () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetFunction () => error: process is running", frame);
+                log->Printf ("SBFrame::GetFunction () => error: process is running");
         }
     }
     if (log)
@@ -226,23 +273,34 @@ SBFrame::GetFunction () const
 SBSymbol
 SBFrame::GetSymbol () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBSymbol sb_symbol;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_symbol.reset(frame->GetSymbolContext (eSymbolContextSymbol).symbol);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_symbol.reset(frame->GetSymbolContext (eSymbolContextSymbol).symbol);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetSymbol () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetSymbol () => error: process is running", frame);
+                log->Printf ("SBFrame::GetSymbol () => error: process is running");
         }
     }
     if (log)
@@ -254,18 +312,29 @@ SBFrame::GetSymbol () const
 SBBlock
 SBFrame::GetBlock () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBBlock sb_block;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_block.SetPtr (frame->GetSymbolContext (eSymbolContextBlock).block);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_block.SetPtr (frame->GetSymbolContext (eSymbolContextBlock).block);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetBlock () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
@@ -283,22 +352,33 @@ SBBlock
 SBFrame::GetFrameBlock () const
 {
     SBBlock sb_block;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (frame && target)
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_block.SetPtr(frame->GetFrameBlock ());
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_block.SetPtr(frame->GetFrameBlock ());
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetFrameBlock () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetFrameBlock () => error: process is running", frame);
+                log->Printf ("SBFrame::GetFrameBlock () => error: process is running");
         }
     }
     if (log)
@@ -310,23 +390,34 @@ SBFrame::GetFrameBlock () const
 SBLineEntry
 SBFrame::GetLineEntry () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBLineEntry sb_line_entry;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_line_entry.SetLineEntry (frame->GetSymbolContext (eSymbolContextLineEntry).line_entry);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_line_entry.SetLineEntry (frame->GetSymbolContext (eSymbolContextLineEntry).line_entry);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetLineEntry () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetLineEntry () => error: process is running", frame);
+                log->Printf ("SBFrame::GetLineEntry () => error: process is running");
         }
     }
     if (log)
@@ -345,7 +436,7 @@ SBFrame::GetFrameID () const
     if (frame)
         frame_idx = frame->GetFrameIndex ();
     
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
         log->Printf ("SBFrame(%p)::GetFrameID () => %u", 
                      frame, frame_idx);
@@ -355,28 +446,39 @@ SBFrame::GetFrameID () const
 addr_t
 SBFrame::GetPC () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     addr_t addr = LLDB_INVALID_ADDRESS;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress (target);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress (target);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetPC () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetPC () => error: process is running", frame);
+                log->Printf ("SBFrame::GetPC () => error: process is running");
         }
     }
 
     if (log)
-        log->Printf ("SBFrame(%p)::GetPC () => 0x%llx", frame, addr);
+        log->Printf ("SBFrame(%p)::GetPC () => 0x%" PRIx64, frame, addr);
 
     return addr;
 }
@@ -384,28 +486,39 @@ SBFrame::GetPC () const
 bool
 SBFrame::SetPC (addr_t new_pc)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     bool ret_val = false;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            ret_val = frame->GetRegisterContext()->SetPC (new_pc);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                ret_val = frame->GetRegisterContext()->SetPC (new_pc);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::SetPC () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::SetPC () => error: process is running", frame);
+                log->Printf ("SBFrame::SetPC () => error: process is running");
         }
     }
 
     if (log)
-        log->Printf ("SBFrame(%p)::SetPC (new_pc=0x%llx) => %i", 
+        log->Printf ("SBFrame(%p)::SetPC (new_pc=0x%" PRIx64 ") => %i",
                      frame, new_pc, ret_val);
 
     return ret_val;
@@ -414,27 +527,38 @@ SBFrame::SetPC (addr_t new_pc)
 addr_t
 SBFrame::GetSP () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     addr_t addr = LLDB_INVALID_ADDRESS;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            addr = frame->GetRegisterContext()->GetSP();
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                addr = frame->GetRegisterContext()->GetSP();
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetSP () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetSP () => error: process is running", frame);
+                log->Printf ("SBFrame::GetSP () => error: process is running");
         }
     }
     if (log)
-        log->Printf ("SBFrame(%p)::GetSP () => 0x%llx", frame, addr);
+        log->Printf ("SBFrame(%p)::GetSP () => 0x%" PRIx64, frame, addr);
 
     return addr;
 }
@@ -443,28 +567,39 @@ SBFrame::GetSP () const
 addr_t
 SBFrame::GetFP () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     addr_t addr = LLDB_INVALID_ADDRESS;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            addr = frame->GetRegisterContext()->GetFP();
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                addr = frame->GetRegisterContext()->GetFP();
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetFP () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetFP () => error: process is running", frame);
+                log->Printf ("SBFrame::GetFP () => error: process is running");
         }
     }
 
     if (log)
-        log->Printf ("SBFrame(%p)::GetFP () => 0x%llx", frame, addr);
+        log->Printf ("SBFrame(%p)::GetFP () => 0x%" PRIx64, frame, addr);
     return addr;
 }
 
@@ -472,23 +607,34 @@ SBFrame::GetFP () const
 SBAddress
 SBFrame::GetPCAddress () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBAddress sb_addr;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
     StackFrame *frame = exe_ctx.GetFramePtr();
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            sb_addr.SetAddress (&frame->GetFrameCodeAddress());
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_addr.SetAddress (&frame->GetFrameCodeAddress());
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetPCAddress () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetPCAddress () => error: process is running", frame);
+                log->Printf ("SBFrame::GetPCAddress () => error: process is running");
         }
     }
     if (log)
@@ -521,29 +667,47 @@ lldb::SBValue
 SBFrame::GetValueForVariablePath (const char *var_path, DynamicValueType use_dynamic)
 {
     SBValue sb_value;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    if (var_path == NULL || var_path[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::GetValueForVariablePath called with empty variable path.");
+        return sb_value;
+    }
+    
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target && var_path && var_path[0])
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            VariableSP var_sp;
-            Error error;
-            ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path, 
-                                                                              use_dynamic,
-                                                                              StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
-                                                                              var_sp,
-                                                                              error));
-            sb_value.SetSP(value_sp);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                VariableSP var_sp;
+                Error error;
+                ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path,
+                                                                                  eNoDynamicValues,
+                                                                                  StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
+                                                                                  var_sp,
+                                                                                  error));
+                sb_value.SetSP(value_sp, use_dynamic);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetValueForVariablePath () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
-            LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::GetValueForVariablePath () => error: process is running", frame);
+                log->Printf ("SBFrame::GetValueForVariablePath () => error: process is running");
         }
     }
     return sb_value;
@@ -568,47 +732,66 @@ SBFrame::FindVariable (const char *name)
 SBValue
 SBFrame::FindVariable (const char *name, lldb::DynamicValueType use_dynamic)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     VariableSP var_sp;
     SBValue sb_value;
+
+    if (name == NULL || name[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::FindVariable called with empty name");
+        return sb_value;
+    }
+    
     ValueObjectSP value_sp;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target && name && name[0])
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            VariableList variable_list;
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
-
-            if (sc.block)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                const bool can_create = true;
-                const bool get_parent_variables = true;
-                const bool stop_if_block_is_inlined_function = true;
-                
-                if (sc.block->AppendVariables (can_create, 
-                                               get_parent_variables,
-                                               stop_if_block_is_inlined_function,
-                                               &variable_list))
+                VariableList variable_list;
+                SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
+
+                if (sc.block)
                 {
-                    var_sp = variable_list.FindVariable (ConstString(name));
+                    const bool can_create = true;
+                    const bool get_parent_variables = true;
+                    const bool stop_if_block_is_inlined_function = true;
+                    
+                    if (sc.block->AppendVariables (can_create, 
+                                                   get_parent_variables,
+                                                   stop_if_block_is_inlined_function,
+                                                   &variable_list))
+                    {
+                        var_sp = variable_list.FindVariable (ConstString(name));
+                    }
                 }
-            }
 
-            if (var_sp)
+                if (var_sp)
+                {
+                    value_sp = frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues);
+                    sb_value.SetSP(value_sp, use_dynamic);
+                }
+            }
+            else
             {
-                value_sp = frame->GetValueObjectForFrameVariable(var_sp, use_dynamic);
-                sb_value.SetSP(value_sp);
+                if (log)
+                    log->Printf ("SBFrame::FindVariable () => error: could not reconstruct frame object for this SBFrame.");
             }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::FindVariable () => error: process is running", frame);
+                log->Printf ("SBFrame::FindVariable () => error: process is running");
         }
     }
     
@@ -637,121 +820,139 @@ SBFrame::FindValue (const char *name, Va
 SBValue
 SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueType use_dynamic)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBValue sb_value;
+    
+    if (name == NULL || name[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::FindValue called with empty name.");
+        return sb_value;
+    }
+    
     ValueObjectSP value_sp;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target && name && name[0])
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-        
-            switch (value_type)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-            case eValueTypeVariableGlobal:      // global variable
-            case eValueTypeVariableStatic:      // static variable
-            case eValueTypeVariableArgument:    // function argument variables
-            case eValueTypeVariableLocal:       // function local variables
+                switch (value_type)
                 {
-                    VariableList *variable_list = frame->GetVariableList(true);
+                case eValueTypeVariableGlobal:      // global variable
+                case eValueTypeVariableStatic:      // static variable
+                case eValueTypeVariableArgument:    // function argument variables
+                case eValueTypeVariableLocal:       // function local variables
+                    {
+                        VariableList *variable_list = frame->GetVariableList(true);
 
-                    SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
+                        SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
 
-                    const bool can_create = true;
-                    const bool get_parent_variables = true;
-                    const bool stop_if_block_is_inlined_function = true;
-
-                    if (sc.block && sc.block->AppendVariables (can_create, 
-                                                               get_parent_variables,
-                                                               stop_if_block_is_inlined_function,
-                                                               variable_list))
-                    {
-                        ConstString const_name(name);
-                        const uint32_t num_variables = variable_list->GetSize();
-                        for (uint32_t i = 0; i < num_variables; ++i)
+                        const bool can_create = true;
+                        const bool get_parent_variables = true;
+                        const bool stop_if_block_is_inlined_function = true;
+
+                        if (sc.block && sc.block->AppendVariables (can_create, 
+                                                                   get_parent_variables,
+                                                                   stop_if_block_is_inlined_function,
+                                                                   variable_list))
                         {
-                            VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
-                            if (variable_sp && 
-                                variable_sp->GetScope() == value_type &&
-                                variable_sp->GetName() == const_name)
+                            ConstString const_name(name);
+                            const uint32_t num_variables = variable_list->GetSize();
+                            for (uint32_t i = 0; i < num_variables; ++i)
                             {
-                                value_sp = frame->GetValueObjectForFrameVariable (variable_sp, use_dynamic);
-                                sb_value.SetSP (value_sp);
-                                break;
+                                VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
+                                if (variable_sp && 
+                                    variable_sp->GetScope() == value_type &&
+                                    variable_sp->GetName() == const_name)
+                                {
+                                    value_sp = frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues);
+                                    sb_value.SetSP (value_sp, use_dynamic);
+                                    break;
+                                }
                             }
                         }
                     }
-                }
-                break;
+                    break;
 
-            case eValueTypeRegister:            // stack frame register value
-                {
-                    RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                    if (reg_ctx)
+                case eValueTypeRegister:            // stack frame register value
                     {
-                        const uint32_t num_regs = reg_ctx->GetRegisterCount();
-                        for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx)
+                        RegisterContextSP reg_ctx (frame->GetRegisterContext());
+                        if (reg_ctx)
                         {
-                            const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
-                            if (reg_info && 
-                                ((reg_info->name && strcasecmp (reg_info->name, name) == 0) ||
-                                 (reg_info->alt_name && strcasecmp (reg_info->alt_name, name) == 0)))
+                            const uint32_t num_regs = reg_ctx->GetRegisterCount();
+                            for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx)
                             {
-                                value_sp = ValueObjectRegister::Create (frame, reg_ctx, reg_idx);
-                                sb_value.SetSP (value_sp);
-                                break;
+                                const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
+                                if (reg_info && 
+                                    ((reg_info->name && strcasecmp (reg_info->name, name) == 0) ||
+                                     (reg_info->alt_name && strcasecmp (reg_info->alt_name, name) == 0)))
+                                {
+                                    value_sp = ValueObjectRegister::Create (frame, reg_ctx, reg_idx);
+                                    sb_value.SetSP (value_sp);
+                                    break;
+                                }
                             }
                         }
                     }
-                }
-                break;
+                    break;
 
-            case eValueTypeRegisterSet:         // A collection of stack frame register values
-                {
-                    RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                    if (reg_ctx)
+                case eValueTypeRegisterSet:         // A collection of stack frame register values
                     {
-                        const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
-                        for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
+                        RegisterContextSP reg_ctx (frame->GetRegisterContext());
+                        if (reg_ctx)
                         {
-                            const RegisterSet *reg_set = reg_ctx->GetRegisterSet (set_idx);
-                            if (reg_set && 
-                                ((reg_set->name && strcasecmp (reg_set->name, name) == 0) ||
-                                 (reg_set->short_name && strcasecmp (reg_set->short_name, name) == 0)))
+                            const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
+                            for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
                             {
-                                value_sp = ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx);
-                                sb_value.SetSP (value_sp);
-                                break;
+                                const RegisterSet *reg_set = reg_ctx->GetRegisterSet (set_idx);
+                                if (reg_set && 
+                                    ((reg_set->name && strcasecmp (reg_set->name, name) == 0) ||
+                                     (reg_set->short_name && strcasecmp (reg_set->short_name, name) == 0)))
+                                {
+                                    value_sp = ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx);
+                                    sb_value.SetSP (value_sp);
+                                    break;
+                                }
                             }
                         }
                     }
-                }
-                break;
+                    break;
 
-            case eValueTypeConstResult:         // constant result variables
-                {
-                    ConstString const_name(name);
-                    ClangExpressionVariableSP expr_var_sp (target->GetPersistentVariables().GetVariable (const_name));
-                    if (expr_var_sp)
+                case eValueTypeConstResult:         // constant result variables
                     {
-                        value_sp = expr_var_sp->GetValueObject();
-                        sb_value.SetSP (value_sp);
+                        ConstString const_name(name);
+                        ClangExpressionVariableSP expr_var_sp (target->GetPersistentVariables().GetVariable (const_name));
+                        if (expr_var_sp)
+                        {
+                            value_sp = expr_var_sp->GetValueObject();
+                            sb_value.SetSP (value_sp, use_dynamic);
+                        }
                     }
-                }
-                break;
+                    break;
 
-            default:
-                break;
+                default:
+                    break;
+                }
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::FindValue () => error: could not reconstruct frame object for this SBFrame.");
             }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::FindValue () => error: process is running", frame);
+                log->Printf ("SBFrame::FindValue () => error: process is running");
         }
     }
     
@@ -786,7 +987,7 @@ SBFrame::operator != (const SBFrame &rhs
 SBThread
 SBFrame::GetThread () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     ExecutionContext exe_ctx(m_opaque_sp.get());
     ThreadSP thread_sp (exe_ctx.GetThreadSP());
@@ -808,23 +1009,34 @@ SBFrame::GetThread () const
 const char *
 SBFrame::Disassemble () const
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     const char *disassembly = NULL;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            disassembly = frame->Disassemble();
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                disassembly = frame->Disassemble();
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::Disassemble () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::Disassemble () => error: process is running", frame);
+                log->Printf ("SBFrame::Disassemble () => error: process is running");
         }            
     }
 
@@ -860,83 +1072,94 @@ SBFrame::GetVariables (bool arguments,
                        bool in_scope_only,
                        lldb::DynamicValueType  use_dynamic)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBValueList value_list;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
 
     if (log)
-        log->Printf ("SBFrame(%p)::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i)", 
-                     frame, 
+        log->Printf ("SBFrame::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i)", 
                      arguments,
                      locals,
                      statics,
                      in_scope_only);
     
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-
-            size_t i;
-            VariableList *variable_list = NULL;
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            variable_list = frame->GetVariableList(true);
-            if (variable_list)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                const size_t num_variables = variable_list->GetSize();
-                if (num_variables)
+                size_t i;
+                VariableList *variable_list = NULL;
+                variable_list = frame->GetVariableList(true);
+                if (variable_list)
                 {
-                    for (i = 0; i < num_variables; ++i)
+                    const size_t num_variables = variable_list->GetSize();
+                    if (num_variables)
                     {
-                        VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
-                        if (variable_sp)
+                        for (i = 0; i < num_variables; ++i)
                         {
-                            bool add_variable = false;
-                            switch (variable_sp->GetScope())
-                            {
-                            case eValueTypeVariableGlobal:
-                            case eValueTypeVariableStatic:
-                                add_variable = statics;
-                                break;
-
-                            case eValueTypeVariableArgument:
-                                add_variable = arguments;
-                                break;
-
-                            case eValueTypeVariableLocal:
-                                add_variable = locals;
-                                break;
-
-                            default:
-                                break;
-                            }
-                            if (add_variable)
+                            VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
+                            if (variable_sp)
                             {
-                                if (in_scope_only && !variable_sp->IsInScope(frame))
-                                    continue;
-
-                                value_list.Append(frame->GetValueObjectForFrameVariable (variable_sp, use_dynamic));
+                                bool add_variable = false;
+                                switch (variable_sp->GetScope())
+                                {
+                                case eValueTypeVariableGlobal:
+                                case eValueTypeVariableStatic:
+                                    add_variable = statics;
+                                    break;
+
+                                case eValueTypeVariableArgument:
+                                    add_variable = arguments;
+                                    break;
+
+                                case eValueTypeVariableLocal:
+                                    add_variable = locals;
+                                    break;
+
+                                default:
+                                    break;
+                                }
+                                if (add_variable)
+                                {
+                                    if (in_scope_only && !variable_sp->IsInScope(frame))
+                                        continue;
+
+                                    ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues));
+                                    SBValue value_sb;
+                                    value_sb.SetSP(valobj_sp,use_dynamic);
+                                    value_list.Append(value_sb);
+                                }
                             }
                         }
                     }
                 }
             }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetVariables () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetVariables () => error: process is running", frame);
+                log->Printf ("SBFrame::GetVariables () => error: process is running");
         }            
     }
 
     if (log)
     {
-        log->Printf ("SBFrame(%p)::GetVariables (...) => SBValueList(%p)", frame,
-                     value_list.get());
+        log->Printf ("SBFrame(%p)::GetVariables (...) => SBValueList(%p)", frame, value_list.opaque_ptr());
     }
 
     return value_list;
@@ -945,37 +1168,48 @@ SBFrame::GetVariables (bool arguments,
 SBValueList
 SBFrame::GetRegisters ()
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBValueList value_list;
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            RegisterContextSP reg_ctx (frame->GetRegisterContext());
-            if (reg_ctx)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
-                for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
+                RegisterContextSP reg_ctx (frame->GetRegisterContext());
+                if (reg_ctx)
                 {
-                    value_list.Append(ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx));
+                    const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
+                    for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
+                    {
+                        value_list.Append(ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx));
+                    }
                 }
             }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetRegisters () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetRegisters () => error: process is running", frame);
+                log->Printf ("SBFrame::GetRegisters () => error: process is running");
         }            
     }
 
     if (log)
-        log->Printf ("SBFrame(%p)::GetRegisters () => SBValueList(%p)", frame, value_list.get());
+        log->Printf ("SBFrame(%p)::GetRegisters () => SBValueList(%p)", frame, value_list.opaque_ptr());
 
     return value_list;
 }
@@ -983,24 +1217,35 @@ SBFrame::GetRegisters ()
 bool
 SBFrame::GetDescription (SBStream &description)
 {
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     Stream &strm = description.ref();
 
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
+    StackFrame *frame;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            Mutex::Locker api_locker (target->GetAPIMutex());
-            frame->DumpUsingSettingsFormat (&strm);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                frame->DumpUsingSettingsFormat (&strm);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetDescription () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
-            LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::GetDescription () => error: process is running", frame);
+                log->Printf ("SBFrame::GetDescription () => error: process is running");
         }            
 
     }
@@ -1019,8 +1264,11 @@ SBFrame::EvaluateExpression (const char
     Target *target = exe_ctx.GetTargetPtr();
     if (frame && target)
     {
-        lldb::DynamicValueType use_dynamic = frame->CalculateTarget()->GetPreferDynamicValue();
-        result = EvaluateExpression (expr, use_dynamic);
+        SBExpressionOptions options;
+        lldb::DynamicValueType fetch_dynamic_value = frame->CalculateTarget()->GetPreferDynamicValue();
+        options.SetFetchDynamicValue (fetch_dynamic_value);
+        options.SetUnwindOnError (true);
+        return EvaluateExpression (expr, options);
     }
     return result;
 }
@@ -1028,59 +1276,83 @@ SBFrame::EvaluateExpression (const char
 SBValue
 SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value)
 {
-    return EvaluateExpression (expr, fetch_dynamic_value, true);
+    SBExpressionOptions options;
+    options.SetFetchDynamicValue (fetch_dynamic_value);
+    options.SetUnwindOnError (true);
+    return EvaluateExpression (expr, options);
 }
 
 SBValue
 SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value, bool unwind_on_error)
 {
-    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    SBExpressionOptions options;
+    options.SetFetchDynamicValue (fetch_dynamic_value);
+    options.SetUnwindOnError (unwind_on_error);
+    return EvaluateExpression (expr, options);
+}
+
+lldb::SBValue
+SBFrame::EvaluateExpression (const char *expr, const SBExpressionOptions &options)
+{
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
-    LogSP expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+    Log *expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
 
     ExecutionResults exe_results = eExecutionSetupError;
     SBValue expr_result;
+    
+    if (expr == NULL || expr[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::EvaluateExpression called with an empty expression");
+        return expr_result;
+    }
+    
     ValueObjectSP expr_value_sp;
 
-    ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
+    Mutex::Locker api_locker;
+    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
+
     if (log)
-        log->Printf ("SBFrame(%p)::EvaluateExpression (expr=\"%s\")...", frame, expr);
+        log->Printf ("SBFrame()::EvaluateExpression (expr=\"%s\")...", expr);
 
-    if (frame && target)
+    StackFrame *frame = NULL;
+    Target *target = exe_ctx.GetTargetPtr();
+    Process *process = exe_ctx.GetProcessPtr();
+    
+    if (target && process)
     {
-        Mutex::Locker api_locker (target->GetAPIMutex());
-            
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
 #ifdef LLDB_CONFIGURATION_DEBUG
-            StreamString frame_description;
-            frame->DumpUsingSettingsFormat (&frame_description);
-            Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
-                                                 expr, fetch_dynamic_value, frame_description.GetString().c_str());
+                StreamString frame_description;
+                frame->DumpUsingSettingsFormat (&frame_description);
+                Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
+                                                     expr, options.GetFetchDynamicValue(), frame_description.GetString().c_str());
 #endif
-            const bool coerce_to_id = false;
-            const bool keep_in_memory = false;
-
-            exe_results = target->EvaluateExpression (expr, 
-                                                      frame,
-                                                      eExecutionPolicyOnlyWhenNeeded,
-                                                      coerce_to_id,
-                                                      unwind_on_error, 
-                                                      keep_in_memory, 
-                                                      fetch_dynamic_value, 
-                                                      expr_value_sp);
-            expr_result.SetSP(expr_value_sp);
+                exe_results = target->EvaluateExpression (expr, 
+                                                          frame,
+                                                          expr_value_sp,
+                                                          options.ref());
+                expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
 #ifdef LLDB_CONFIGURATION_DEBUG
-            Host::SetCrashDescription (NULL);
+                Host::SetCrashDescription (NULL);
 #endif
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::EvaluateExpression () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::EvaluateExpression () => error: process is running", frame);
+                log->Printf ("SBFrame::EvaluateExpression () => error: process is running");
         }            
     }
 
@@ -1104,24 +1376,34 @@ SBFrame::EvaluateExpression (const char
 bool
 SBFrame::IsInlined()
 {
+    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
 
-            Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
-            if (block)
-                return block->GetContainingInlinedBlock () != NULL;
+                Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
+                if (block)
+                    return block->GetContainingInlinedBlock () != NULL;
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::IsInlined () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
-            LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::IsInlined () => error: process is running", frame);
+                log->Printf ("SBFrame::IsInlined () => error: process is running");
         }            
 
     }
@@ -1131,43 +1413,53 @@ SBFrame::IsInlined()
 const char *
 SBFrame::GetFunctionName()
 {
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     const char *name = NULL;
     ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            SymbolContext sc (frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol));
-            if (sc.block)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                Block *inlined_block = sc.block->GetContainingInlinedBlock ();
-                if (inlined_block)
+                SymbolContext sc (frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol));
+                if (sc.block)
                 {
-                    const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
-                    name = inlined_info->GetName().AsCString();
+                    Block *inlined_block = sc.block->GetContainingInlinedBlock ();
+                    if (inlined_block)
+                    {
+                        const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
+                        name = inlined_info->GetName().AsCString();
+                    }
+                }
+                
+                if (name == NULL)
+                {
+                    if (sc.function)
+                        name = sc.function->GetName().GetCString();
                 }
-            }
-            
-            if (name == NULL)
-            {
-                if (sc.function)
-                    name = sc.function->GetName().GetCString();
-            }
 
-            if (name == NULL)
+                if (name == NULL)
+                {
+                    if (sc.symbol)
+                        name = sc.symbol->GetName().GetCString();
+                }
+            }
+            else
             {
-                if (sc.symbol)
-                    name = sc.symbol->GetName().GetCString();
+                if (log)
+                    log->Printf ("SBFrame::GetFunctionName () => error: could not reconstruct frame object for this SBFrame.");
             }
         }
         else
         {
-            LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::GetFunctionName() => error: process is running", frame);
+                log->Printf ("SBFrame::GetFunctionName() => error: process is running");
 
         }
     }

Modified: lldb/branches/lldb-platform-work/source/API/SBFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBFunction.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBFunction.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBFunction.cpp Thu Jun  6 19:06:43 2013
@@ -62,7 +62,7 @@ SBFunction::GetName() const
     if (m_opaque_ptr)
         cstr = m_opaque_ptr->GetMangled().GetName().AsCString();
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         if (cstr)
@@ -79,7 +79,7 @@ SBFunction::GetMangledName () const
     const char *cstr = NULL;
     if (m_opaque_ptr)
         cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         if (cstr)
@@ -107,7 +107,7 @@ SBFunction::GetDescription (SBStream &s)
 {
     if (m_opaque_ptr)
     {
-        s.Printf ("SBFunction: id = 0x%8.8llx, name = %s", 
+        s.Printf ("SBFunction: id = 0x%8.8" PRIx64 ", name = %s",
                   m_opaque_ptr->GetID(),
                   m_opaque_ptr->GetName().AsCString());
         Type *func_type = m_opaque_ptr->GetType();
@@ -122,6 +122,12 @@ SBFunction::GetDescription (SBStream &s)
 SBInstructionList
 SBFunction::GetInstructions (SBTarget target)
 {
+    return GetInstructions (target, NULL);
+}
+
+SBInstructionList
+SBFunction::GetInstructions (SBTarget target, const char *flavor)
+{
     SBInstructionList sb_instructions;
     if (m_opaque_ptr)
     {
@@ -139,6 +145,7 @@ SBFunction::GetInstructions (SBTarget ta
         {
             sb_instructions.SetDisassembler (Disassembler::DisassembleRange (module_sp->GetArchitecture(),
                                                                              NULL,
+                                                                             flavor,
                                                                              exe_ctx,
                                                                              m_opaque_ptr->GetAddressRange()));
         }

Modified: lldb/branches/lldb-platform-work/source/API/SBHostOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBHostOS.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBHostOS.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBHostOS.cpp Thu Jun  6 19:06:43 2013
@@ -26,6 +26,18 @@ SBHostOS::GetProgramFileSpec ()
     return sb_filespec;
 }
 
+SBFileSpec
+SBHostOS::GetLLDBPythonPath ()
+{
+    SBFileSpec sb_lldb_python_filespec;
+    FileSpec lldb_python_spec;
+    if (Host::GetLLDBPath (ePathTypePythonDir, lldb_python_spec))
+    {
+        sb_lldb_python_filespec.SetFileSpec (lldb_python_spec);
+    }
+    return sb_lldb_python_filespec;
+}
+
 lldb::thread_t
 SBHostOS::ThreadCreate
 (
@@ -35,7 +47,7 @@ SBHostOS::ThreadCreate
     SBError *error_ptr
 )
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBHostOS::ThreadCreate (name=\"%s\", thread_function=%p, thread_arg=%p, error_ptr=%p)", name, 

Modified: lldb/branches/lldb-platform-work/source/API/SBInputReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBInputReader.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBInputReader.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBInputReader.cpp Thu Jun  6 19:06:43 2013
@@ -33,7 +33,7 @@ SBInputReader::SBInputReader ()  :
 SBInputReader::SBInputReader (const lldb::InputReaderSP &reader_sp) :
     m_opaque_sp (reader_sp)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBInputReader::SBInputReader (reader_sp=%p) => SBInputReader(%p)", reader_sp.get(), 
@@ -43,7 +43,7 @@ SBInputReader::SBInputReader (const lldb
 SBInputReader::SBInputReader (const SBInputReader &rhs) :
     m_opaque_sp (rhs.m_opaque_sp)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf("SBInputReader::SBInputReader (rhs.sp=%p) => SBInputReader(%p)", 
@@ -84,7 +84,7 @@ SBInputReader::Initialize
     bool echo
 )
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf("SBInputReader(%p)::Initialize (SBDebugger(%p), callback_function=%p, callback_baton=%p, "
@@ -194,7 +194,7 @@ SBInputReader::SetIsDone (bool value)
 bool
 SBInputReader::IsActive () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     bool ret_value = false;
     if (m_opaque_sp)

Modified: lldb/branches/lldb-platform-work/source/API/SBInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBInstruction.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBInstruction.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBInstruction.cpp Thu Jun  6 19:06:43 2013
@@ -17,6 +17,7 @@
 
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/DataBufferHeap.h"
+#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/StreamFile.h"

Modified: lldb/branches/lldb-platform-work/source/API/SBLineEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBLineEntry.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBLineEntry.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBLineEntry.cpp Thu Jun  6 19:06:43 2013
@@ -71,7 +71,7 @@ SBLineEntry::GetStartAddress () const
     if (m_opaque_ap.get())
         sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         StreamString sstr;
@@ -94,7 +94,7 @@ SBLineEntry::GetEndAddress () const
         sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
         sb_address.OffsetAddress(m_opaque_ap->range.GetByteSize());
     }
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         StreamString sstr;
@@ -117,7 +117,7 @@ SBLineEntry::IsValid () const
 SBFileSpec
 SBLineEntry::GetFileSpec () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBFileSpec sb_file_spec;
     if (m_opaque_ap.get() && m_opaque_ap->file)
@@ -137,7 +137,7 @@ SBLineEntry::GetFileSpec () const
 uint32_t
 SBLineEntry::GetLine () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     uint32_t line = 0;
     if (m_opaque_ap.get())

Modified: lldb/branches/lldb-platform-work/source/API/SBListener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBListener.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBListener.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBListener.cpp Thu Jun  6 19:06:43 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBListener.h"
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBDebugger.h"
@@ -36,7 +38,7 @@ SBListener::SBListener (const char *name
 {
     m_opaque_ptr = m_opaque_sp.get();
 
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
         log->Printf ("SBListener::SBListener (name=\"%s\") => SBListener(%p)",
@@ -129,15 +131,13 @@ SBListener::StopListeningForEventClass (
 uint32_t
 SBListener::StartListeningForEvents (const SBBroadcaster& broadcaster, uint32_t event_mask)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
     uint32_t acquired_event_mask = 0;
     if (m_opaque_ptr && broadcaster.IsValid())
     {
         acquired_event_mask = m_opaque_ptr->StartListeningForEvents (broadcaster.get(), event_mask);
     }
     
-    log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
+    Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
     if (log)
     {
         StreamString sstr_requested;
@@ -188,7 +188,7 @@ SBListener::StopListeningForEvents (cons
 bool
 SBListener::WaitForEvent (uint32_t timeout_secs, SBEvent &event)
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
         if (timeout_secs == UINT32_MAX)

Modified: lldb/branches/lldb-platform-work/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBModule.cpp?rev=183468&r1=183467&r2=183468&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBModule.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBModule.cpp Thu Jun  6 19:06:43 2013
@@ -15,10 +15,13 @@
 #include "lldb/API/SBSymbolContextList.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/Section.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Core/ValueObjectList.h"
 #include "lldb/Core/ValueObjectVariable.h"
+#include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/Symtab.h"
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/Target.h"
 
@@ -47,12 +50,14 @@ SBModule::SBModule (lldb::SBProcess &pro
     ProcessSP process_sp (process.GetSP());
     if (process_sp)
     {
-        const bool add_image_to_target = true;
-        const bool load_image_sections_in_target = true;
-        m_opaque_sp = process_sp->ReadModuleFromMemory (FileSpec(), 
-                                                        header_addr, 
-                                                        add_image_to_target,
-                                                        load_image_sections_in_target);
+        m_opaque_sp = process_sp->ReadModuleFromMemory (FileSpec(), header_addr);
+        if (m_opaque_sp)
+        {
+            Target &target = process_sp->GetTarget();
+            bool changed = false;
+            m_opaque_sp->SetLoadAddress(target, 0, changed);
+            target.GetImages().Append(m_opaque_sp);
+        }
     }
 }
 
@@ -83,7 +88,7 @@ SBModule::Clear()
 SBFileSpec
 SBModule::GetFileSpec () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBFileSpec file_spec;
     ModuleSP module_sp (GetSP ());
@@ -102,7 +107,7 @@ SBModule::GetFileSpec () const
 lldb::SBFileSpec
 SBModule::GetPlatformFileSpec () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     SBFileSpec file_spec;
     ModuleSP module_sp (GetSP ());
@@ -123,7 +128,7 @@ bool
 SBModule::SetPlatformFileSpec (const lldb::SBFileSpec &platform_file)
 {
     bool result = false;
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     ModuleSP module_sp (GetSP ());
     if (module_sp)
@@ -134,12 +139,10 @@ SBModule::SetPlatformFileSpec (const lld
     
     if (log)
     {
-        log->Printf ("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s%s%s)) => %i", 
+        log->Printf ("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i", 
                      module_sp.get(), 
                      platform_file.get(),
-                     platform_file->GetDirectory().GetCString(),
-                     platform_file->GetDirectory() ? "/" : "",
-                     platform_file->GetFilename().GetCString(),
+                     platform_file->GetPath().c_str(),
                      result);
     }
     return result;
@@ -150,7 +153,7 @@ SBModule::SetPlatformFileSpec (const lld
 const uint8_t *
 SBModule::GetUUIDBytes () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     const uint8_t *uuid_bytes = NULL;
     ModuleSP module_sp (GetSP ());
@@ -175,17 +178,24 @@ SBModule::GetUUIDBytes () const
 const char *
 SBModule::GetUUIDString () const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
-    static char uuid_string[80];
-    const char * uuid_c_string = NULL;
+    static char uuid_string_buffer[80];
+    const char *uuid_c_string = NULL;
+    std::string uuid_string;
     ModuleSP module_sp (GetSP ());
     if (module_sp)
-        uuid_c_string = (const char *)module_sp->GetUUID().GetAsCString(uuid_string, sizeof(uuid_string));
+        uuid_string = module_sp->GetUUID().GetAsString();
+
+    if (!uuid_string.empty())
+    {
+        strncpy (uuid_string_buffer, uuid_string.c_str(), sizeof (uuid_string_buffer));
+        uuid_c_string = uuid_string_buffer;
+    }
 
     if (log)
     {
-        if (uuid_c_string)
+        if (!uuid_string.empty())
         {
             StreamString s;
             module_sp->GetUUID().Dump (&s);
@@ -325,6 +335,68 @@ SBModule::GetSymbolAtIndex (size_t idx)
     return sb_symbol;
 }
 
+lldb::SBSymbol
+SBModule::FindSymbol (const char *name,
+                      lldb::SymbolType symbol_type)
+{
+    SBSymbol sb_symbol;
+    if (name && name[0])
+    {
+        ModuleSP module_sp (GetSP ());
+        if (module_sp)
+        {
+            ObjectFile *obj_file = module_sp->GetObjectFile();
+            if (obj_file)
+            {
+                Symtab *symtab = obj_file->GetSymtab();
+                if (symtab)
+                    sb_symbol.SetSymbol(symtab->FindFirstSymbolWithNameAndType(ConstString(name), symbol_type, Symtab::eDebugAny, Symtab::eVisibilityAny));
+            }
+        }
+    }
+    return sb_symbol;
+}
+
+
+lldb::SBSymbolContextList
+SBModule::FindSymbols (const char *name, lldb::SymbolType symbol_type)
+{
+    SBSymbolContextList sb_sc_list;
+    if (name && name[0])
+    {
+        ModuleSP module_sp (GetSP ());
+        if (module_sp)
+        {
+            ObjectFile *obj_file = module_sp->GetObjectFile();
+            if (obj_file)
+            {
+                Symtab *symtab = obj_file->GetSymtab();
+                if (symtab)
+                {
+                    std::vector<uint32_t> matching_symbol_indexes;
+                    const size_t num_matches = symtab->FindAllSymbolsWithNameAndType(ConstString(name), symbol_type, matching_symbol_indexes);
+                    if (num_matches)
+                    {
+                        SymbolContext sc;
+                        sc.module_sp = module_sp;
+                        SymbolContextList &sc_list = *sb_sc_list;
+                        for (size_t i=0; i<num_matches; ++i)
+                        {
+                            sc.symbol = symtab->SymbolAtIndex (matching_symbol_indexes[i]);
+                            if (sc.symbol)
+                                sc_list.Append(sc);
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return sb_sc_list;
+    
+}
+
+
+
 size_t
 SBModule::GetNumSections ()
 {
@@ -400,14 +472,13 @@ SBModule::FindGlobalVariables (SBTarget
 
         if (match_count > 0)
         {
-            ValueObjectList &value_object_list = sb_value_list.ref();
             for (uint32_t i=0; i<match_count; ++i)
             {
                 lldb::ValueObjectSP valobj_sp;
                 TargetSP target_sp (target.GetSP());
                 valobj_sp = ValueObjectVariable::Create (target_sp.get(), variable_list.GetVariableAtIndex(i));
                 if (valobj_sp)
-                    value_object_list.Append(valobj_sp);
+                    sb_value_list.Append(SBValue(valobj_sp));
             }
         }
     }
@@ -415,6 +486,15 @@ SBModule::FindGlobalVariables (SBTarget
     return sb_value_list;
 }
 
+lldb::SBValue
+SBModule::FindFirstGlobalVariable (lldb::SBTarget &target, const char *name)
+{
+    SBValueList sb_value_list(FindGlobalVariables(target, name, 1));
+    if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
+        return sb_value_list.GetValueAtIndex(0);
+    return SBValue();
+}
+
 lldb::SBType
 SBModule::FindFirstType (const char *name_cstr)
 {
@@ -423,27 +503,29 @@ SBModule::FindFirstType (const char *nam
     if (name_cstr && module_sp)
     {
         SymbolContext sc;
-        TypeList type_list;
-        uint32_t num_matches = 0;
         const bool exact_match = false;
         ConstString name(name_cstr);
 
-        num_matches = module_sp->FindTypes (sc,
-                                            name,
-                                            exact_match,
-                                            1,
-                                            type_list);
+        sb_type = SBType (module_sp->FindFirstType(sc, name, exact_match));
         
-        if (num_matches)
-            sb_type = lldb::SBType(type_list.GetTypeAtIndex(0));
+        if (!sb_type.IsValid())
+            sb_type = SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
     }
     return sb_type;
 }
 
+lldb::SBType
+SBModule::GetBasicType(lldb::BasicType type)
+{
+    ModuleSP module_sp (GetSP ());
+    if (module_sp)
+        return SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), type));
+    return SBType();
+}
+
 lldb::SBTypeList
 SBModule::FindTypes (const char *type)
 {
-    
     SBTypeList retval;
     
     ModuleSP module_sp (GetSP ());
@@ -452,20 +534,27 @@ SBModule::FindTypes (const char *type)
         SymbolContext sc;
         TypeList type_list;
         const bool exact_match = false;
-        uint32_t num_matches = 0;
         ConstString name(type);
+        const uint32_t num_matches = module_sp->FindTypes (sc,
+                                                           name,
+                                                           exact_match,
+                                                           UINT32_MAX,
+                                                           type_list);
         
-        num_matches = module_sp->FindTypes (sc,
-                                            name,
-                                            exact_match,
-                                            UINT32_MAX,
-                                            type_list);
-            
-        for (size_t idx = 0; idx < num_matches; idx++)
-        {
-            TypeSP type_sp (type_list.GetTypeAtIndex(idx));
-            if (type_sp)
-                retval.Append(SBType(type_sp));
+        if (num_matches > 0)
+        {
+            for (size_t idx = 0; idx < num_matches; idx++)
+            {
+                TypeSP type_sp (type_list.GetTypeAtIndex(idx));
+                if (type_sp)
+                    retval.Append(SBType(type_sp));
+            }
+        }
+        else
+        {
+            SBType sb_type(ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
+            if (sb_type.IsValid())
+                retval.Append(sb_type);
         }
     }
 
@@ -539,17 +628,15 @@ SBModule::GetVersion (uint32_t *versions
 {
     ModuleSP module_sp (GetSP ());
     if (module_sp)
+        return module_sp->GetVersion(versions, num_versions);
+    else
     {
-        ObjectFile *obj_file = module_sp->GetObjectFile();
-        if (obj_file)
-            return obj_file->GetVersion (versions, num_versions);
-    }
-    
-    if (versions && num_versions)
-    {
-        for (uint32_t i=0; i<num_versions; ++i)
-            versions[i] = UINT32_MAX;
+        if (versions && num_versions)
+        {
+            for (uint32_t i=0; i<num_versions; ++i)
+                versions[i] = UINT32_MAX;
+        }
+        return 0;
     }
-    return 0;
 }
 





More information about the llvm-branch-commits mailing list