[Lldb-commits] [lldb] r167848 - in /lldb/branches/windows: ./ docs/ include/lldb/ include/lldb/API/ include/lldb/Core/ include/lldb/Host/ include/lldb/Symbol/ include/lldb/Target/ lldb.xcodeproj/ lldb.xcodeproj/xcshareddata/xcschemes/ scripts/ scripts/Python/ source/Commands/ source/Core/ source/Expression/ source/Host/common/ source/Interpreter/ source/Plugins/DynamicLoader/Darwin-Kernel/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/DynamicLoader/POSIX-DYLD/ source/Plugins/DynamicLoader/Static/ source/Plug...

Carlo Kok ck at remobjects.com
Tue Nov 13 08:36:42 PST 2012


Author: carlokok
Date: Tue Nov 13 10:36:41 2012
New Revision: 167848

URL: http://llvm.org/viewvc/llvm-project?rev=167848&view=rev
Log:
Windows branch: merge of latest trunk

Added:
    lldb/branches/windows/tools/debugserver/source/com.apple.debugserver.posix.plist
      - copied unchanged from r167847, lldb/trunk/tools/debugserver/source/com.apple.debugserver.posix.plist
Modified:
    lldb/branches/windows/   (props changed)
    lldb/branches/windows/docs/code-signing.txt
    lldb/branches/windows/include/lldb/API/SBValue.h
    lldb/branches/windows/include/lldb/Core/ArchSpec.h
    lldb/branches/windows/include/lldb/Core/FormatNavigator.h
    lldb/branches/windows/include/lldb/Core/Module.h
    lldb/branches/windows/include/lldb/Core/ModuleList.h
    lldb/branches/windows/include/lldb/Core/UniqueCStringMap.h
    lldb/branches/windows/include/lldb/Core/ValueObjectSyntheticFilter.h
    lldb/branches/windows/include/lldb/Host/Symbols.h
    lldb/branches/windows/include/lldb/Symbol/ClangASTType.h
    lldb/branches/windows/include/lldb/Symbol/Type.h
    lldb/branches/windows/include/lldb/Target/Platform.h
    lldb/branches/windows/include/lldb/Target/StopInfo.h
    lldb/branches/windows/include/lldb/Target/Target.h
    lldb/branches/windows/include/lldb/lldb-private-enumerations.h
    lldb/branches/windows/lldb.xcodeproj/project.pbxproj
    lldb/branches/windows/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
    lldb/branches/windows/scripts/Python/build-swig-Python.sh
    lldb/branches/windows/scripts/Python/finish-swig-Python-LLDB.sh
    lldb/branches/windows/scripts/Python/modify-python-lldb.py
    lldb/branches/windows/scripts/build-swig-wrapper-classes.sh
    lldb/branches/windows/scripts/finish-swig-wrapper-classes.sh
    lldb/branches/windows/source/Commands/CommandObjectMemory.cpp
    lldb/branches/windows/source/Commands/CommandObjectTarget.cpp
    lldb/branches/windows/source/Commands/CommandObjectType.cpp
    lldb/branches/windows/source/Core/ArchSpec.cpp
    lldb/branches/windows/source/Core/ConstString.cpp
    lldb/branches/windows/source/Core/DataExtractor.cpp
    lldb/branches/windows/source/Core/FormatManager.cpp
    lldb/branches/windows/source/Core/Listener.cpp
    lldb/branches/windows/source/Core/Module.cpp
    lldb/branches/windows/source/Core/ModuleList.cpp
    lldb/branches/windows/source/Core/SearchFilter.cpp
    lldb/branches/windows/source/Expression/ClangASTSource.cpp
    lldb/branches/windows/source/Expression/IRForTarget.cpp
    lldb/branches/windows/source/Host/common/FileSpec.cpp
    lldb/branches/windows/source/Interpreter/Makefile
    lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
    lldb/branches/windows/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
    lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/branches/windows/source/Symbol/ClangASTContext.cpp
    lldb/branches/windows/source/Symbol/ClangASTType.cpp
    lldb/branches/windows/source/Symbol/Type.cpp
    lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp
    lldb/branches/windows/source/Target/Platform.cpp
    lldb/branches/windows/source/Target/Process.cpp
    lldb/branches/windows/source/Target/StopInfo.cpp
    lldb/branches/windows/source/Target/Target.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp
    lldb/branches/windows/test/Makefile
    lldb/branches/windows/test/dotest.py
    lldb/branches/windows/test/expression_command/timeout/TestCallWithTimeout.py
    lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/Makefile
    lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/Makefile
    lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/Makefile
    lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/Makefile
    lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/Makefile
    lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py
    lldb/branches/windows/test/lang/c/bitfields/main.c
    lldb/branches/windows/test/lang/c/blocks/Makefile
    lldb/branches/windows/test/lang/c/shared_lib/Makefile
    lldb/branches/windows/test/python_api/lldbutil/iter/Makefile
    lldb/branches/windows/test/python_api/lldbutil/process/Makefile
    lldb/branches/windows/test/python_api/module_section/Makefile
    lldb/branches/windows/test/python_api/watchpoint/watchlocation/Makefile
    lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj
    lldb/branches/windows/tools/debugserver/source/DNB.cpp
    lldb/branches/windows/tools/debugserver/source/RNBServices.cpp
    lldb/branches/windows/www/build.html
    lldb/branches/windows/www/index.html
    lldb/branches/windows/www/status.html

Propchange: lldb/branches/windows/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 13 10:36:41 2012
@@ -1,2 +1,2 @@
 /lldb/branches/apple/python-GIL:156467-162159
-/lldb/trunk:163223-167217
+/lldb/trunk:163223-167847

Modified: lldb/branches/windows/docs/code-signing.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/docs/code-signing.txt?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/docs/code-signing.txt (original)
+++ lldb/branches/windows/docs/code-signing.txt Tue Nov 13 10:36:41 2012
@@ -1,7 +1,14 @@
-On MacOSX lldb needs to be code signed. The Debug and Release builds 
-are set to code sign using a code signing certificate named 
+On MacOSX lldb needs to be code signed. The Debug, DebugClang and Release 
+builds  are set to code sign using a code signing certificate named 
 lldb_codesign. 
 
+If you have re-installed a new OS, please delete all old lldb_codesign items
+from your keychain. There will be 3: a code signing certification and a public
+and private key. Reboot after deleting them. You will also need to delete and
+build folders that contained old signed items. The darwin kernel will cache 
+code sigining using the executable's file system node, so you will need to 
+delete the file so the kernel clears its cache.
+
 If you don't have one yet you will need to:
 - Launch /Applications/Utilities/Keychain Access.app
 
@@ -34,20 +41,27 @@
 how Keychain Access makes certificates.
 [Note: These also apply for Lion and Mountain Lion.]
 
-- Option-drag the new lldb_codesign certificate from the login keychain to
+- Drag the new lldb_codesign certificate from the login keychain to
   the System keychain in the Keychains pane of the main Keychain Access window
   to make a copy of this certificate in the System keychain.  You'll have to
   authorize a few more times, set it to be "Always trusted" when asked.
+- Make sure there is no "~/Desktop/lldb_codesign.cer" file on your desktop,
+  if there is one, delete it first, otherwise when you drag a copy of the
+  lldb_codesign certificate to your desktop it will get renamed as
+  "lldb_codesign_1.cer" and the security command you run below will trust the
+  old incorrect certificate.
 - Switch to the System keychain, and drag the copy of lldb_codesign you just
   made there onto the desktop.
 - Switch to Terminal, and run the following:
 
 sudo security add-trust -d -r trustRoot -p basic -p codeSign -k /Library/Keychains/System.keychain ~/Desktop/lldb_codesign.cer
+rm -f ~/Desktop/lldb_codesign.cer
 
 - Right click on the "lldb_codesign" certificate in the "System" keychain (NOT
   "login", but the one in "System"), and select "Delete" to delete it from
   the "System" keychain.
 - Reboot
-- Clean and rebuild lldb and you should be able to debug.
+- Clean by removing all previously creating code signed binarires and rebuild
+  lldb and you should be able to debug.
 
 That should do it.

Modified: lldb/branches/windows/include/lldb/API/SBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBValue.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBValue.h (original)
+++ lldb/branches/windows/include/lldb/API/SBValue.h Tue Nov 13 10:36:41 2012
@@ -413,15 +413,8 @@
     lldb::SBWatchpoint
     WatchPointee (bool resolve_location, bool read, bool write, SBError &error);
 
-    // this must be defined in the .h file because synthetic children as implemented in the core
-    // currently rely on being able to extract the SharedPointer out of an SBValue. if the implementation
-    // is deferred to the .cpp file instead of being inlined here, the platform will fail to link
-    // correctly. however, this is temporary till a better general solution is found. FIXME
     lldb::ValueObjectSP
-    get_sp()
-    {
-        return GetSP();
-    }
+    GetSP () const;
 
 protected:
     friend class SBBlock;
@@ -429,9 +422,6 @@
     friend class SBThread;
     friend class SBValueList;
 
-    lldb::ValueObjectSP
-    GetSP () const;
-    
     // these calls do the right thing WRT adjusting their settings according to the target's preferences
     void
     SetSP (const lldb::ValueObjectSP &sp);

Modified: lldb/branches/windows/include/lldb/Core/ArchSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/ArchSpec.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/ArchSpec.h (original)
+++ lldb/branches/windows/include/lldb/Core/ArchSpec.h Tue Nov 13 10:36:41 2012
@@ -367,7 +367,30 @@
     lldb::ByteOrder
     GetDefaultEndian () const;
 
+    //------------------------------------------------------------------
+    /// Compare an ArchSpec to another ArchSpec, requiring an exact cpu 
+    /// type match between them.  
+    /// e.g. armv7s is not an exact match with armv7 - this would return false
+    ///
+    /// @return true if the two ArchSpecs match.
+    //------------------------------------------------------------------
+    bool
+    IsExactMatch (const ArchSpec& rhs) const;
+
+    //------------------------------------------------------------------
+    /// Compare an ArchSpec to another ArchSpec, requiring a compatible
+    /// cpu type match between them.  
+    /// e.g. armv7s is compatible with armv7 - this method would return true
+    ///
+    /// @return true if the two ArchSpecs are compatible
+    //------------------------------------------------------------------
+    bool
+    IsCompatibleMatch (const ArchSpec& rhs) const;
+
 protected:
+    bool
+    Compare (const ArchSpec& rhs, bool exact_match) const;
+
     llvm::Triple m_triple;
     Core m_core;
     lldb::ByteOrder m_byte_order;
@@ -388,6 +411,8 @@
 /// @param[in] lhs The Left Hand Side ArchSpec object to compare.
 /// @param[in] rhs The Left Hand Side ArchSpec object to compare.
 ///
+/// Uses the IsExactMatch() method for comparing the cpu types.
+///
 /// @return true if \a lhs is equal to \a rhs
 //------------------------------------------------------------------
 bool operator==(const ArchSpec& lhs, const ArchSpec& rhs);

Modified: lldb/branches/windows/include/lldb/Core/FormatNavigator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/FormatNavigator.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/FormatNavigator.h (original)
+++ lldb/branches/windows/include/lldb/Core/FormatNavigator.h Tue Nov 13 10:36:41 2012
@@ -633,6 +633,25 @@
                 return true;
             }
         }
+        
+        // if all else fails, go to static type
+        if (valobj.IsDynamic())
+        {
+            if (log)
+                log->Printf("[Get] going to static value");
+            lldb::ValueObjectSP static_value_sp(valobj.GetStaticValue());
+            if (static_value_sp)
+            {
+                if (log)
+                    log->Printf("[Get] has a static value - actually use it");
+                if (Get(*static_value_sp.get(), clang::QualType::getFromOpaquePtr(static_value_sp->GetClangType()) , entry, use_dynamic, reason))
+                {
+                    reason |= lldb_private::eFormatterChoiceCriterionWentToStaticValue;
+                    return true;
+                }
+            }
+        }
+        
         return false;
     }
 };

Modified: lldb/branches/windows/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/Module.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/Module.h (original)
+++ lldb/branches/windows/include/lldb/Core/Module.h Tue Nov 13 10:36:41 2012
@@ -532,6 +532,9 @@
     bool
     IsLoadedInTarget (Target *target);
 
+    bool
+    LoadScriptingResourceInTarget (Target *target, Error& error);
+    
     //------------------------------------------------------------------
     /// Get the number of compile units for this module.
     ///

Modified: lldb/branches/windows/include/lldb/Core/ModuleList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/ModuleList.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/ModuleList.h (original)
+++ lldb/branches/windows/include/lldb/Core/ModuleList.h Tue Nov 13 10:36:41 2012
@@ -27,6 +27,25 @@
 class ModuleList
 {
 public:
+    
+    class Notifier
+    {
+    public:
+        virtual void
+        ModuleAdded (const ModuleList& module_list, const lldb::ModuleSP& module_sp) = 0;
+        virtual void
+        ModuleRemoved (const ModuleList& module_list, const lldb::ModuleSP& module_sp) = 0;
+        virtual void
+        ModuleUpdated (const ModuleList& module_list, const lldb::ModuleSP& old_module_sp,
+                       const lldb::ModuleSP& new_module_sp) = 0;
+        virtual void
+        WillClearList (const ModuleList& module_list) = 0;
+        
+        virtual
+        ~Notifier ()
+        {}
+    };
+    
     //------------------------------------------------------------------
     /// Default constructor.
     ///
@@ -44,6 +63,8 @@
     ///     Another module list object.
     //------------------------------------------------------------------
     ModuleList (const ModuleList& rhs);
+    
+    ModuleList (ModuleList::Notifier* notifier);
 
     //------------------------------------------------------------------
     /// Destructor.
@@ -91,6 +112,15 @@
     bool
     AppendIfNeeded (const lldb::ModuleSP &module_sp);
 
+    void
+    Append (const ModuleList& module_list);
+    
+    bool
+    AppendIfNeeded (const ModuleList& module_list);
+    
+    bool
+    ReplaceModule (const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp);
+    
     //------------------------------------------------------------------
     /// Clear the object's state.
     ///
@@ -130,7 +160,7 @@
                      const char *prefix_cstr);
                      
     Mutex &
-    GetMutex ()
+    GetMutex () const
     {
         return m_modules_mutex;
     }
@@ -151,7 +181,7 @@
     /// @see ModuleList::GetSize()
     //------------------------------------------------------------------
     lldb::ModuleSP
-    GetModuleAtIndex (uint32_t idx);
+    GetModuleAtIndex (uint32_t idx) const;
 
     //------------------------------------------------------------------
     /// Get the module shared pointer for the module at index \a idx without
@@ -168,7 +198,7 @@
     /// @see ModuleList::GetSize()
     //------------------------------------------------------------------
     lldb::ModuleSP
-    GetModuleAtIndexUnlocked (uint32_t idx);
+    GetModuleAtIndexUnlocked (uint32_t idx) const;
 
     //------------------------------------------------------------------
     /// Get the module pointer for the module at index \a idx.
@@ -226,7 +256,7 @@
     uint32_t
     FindCompileUnits (const FileSpec &path,
                       bool append,
-                      SymbolContextList &sc_list);
+                      SymbolContextList &sc_list) const;
     
     //------------------------------------------------------------------
     /// @see Module::FindFunctions ()
@@ -237,7 +267,7 @@
                    bool include_symbols,
                    bool include_inlines,
                    bool append,
-                   SymbolContextList &sc_list);
+                   SymbolContextList &sc_list) const;
 
     //------------------------------------------------------------------
     /// Find global and static variables by name.
@@ -266,7 +296,7 @@
     FindGlobalVariables (const ConstString &name,
                          bool append,
                          uint32_t max_matches,
-                         VariableList& variable_list);
+                         VariableList& variable_list) const;
 
     //------------------------------------------------------------------
     /// Find global and static variables by regular exression.
@@ -294,7 +324,7 @@
     FindGlobalVariables (const RegularExpression& regex,
                          bool append,
                          uint32_t max_matches,
-                         VariableList& variable_list);
+                         VariableList& variable_list) const;
 
     //------------------------------------------------------------------
     /// Finds the first module whose file specification matches \a
@@ -332,7 +362,7 @@
                  ModuleList& matching_module_list) const;
 
     lldb::ModuleSP
-    FindModule (const Module *module_ptr);
+    FindModule (const Module *module_ptr) const;
 
     //------------------------------------------------------------------
     // Find a module by UUID
@@ -342,22 +372,22 @@
     // finding modules by UUID values is very efficient and accurate.
     //------------------------------------------------------------------
     lldb::ModuleSP
-    FindModule (const UUID &uuid);
+    FindModule (const UUID &uuid) const;
     
     lldb::ModuleSP
-    FindFirstModule (const ModuleSpec &module_spec);
+    FindFirstModule (const ModuleSpec &module_spec) const;
 
     size_t
     FindSymbolsWithNameAndType (const ConstString &name,
                                 lldb::SymbolType symbol_type,
                                 SymbolContextList &sc_list,
-                                bool append = false);
+                                bool append = false) const;
 
     size_t
     FindSymbolsMatchingRegExAndType (const RegularExpression &regex, 
                                      lldb::SymbolType symbol_type, 
                                      SymbolContextList &sc_list,
-                                     bool append = false);
+                                     bool append = false) const;
                                      
     //------------------------------------------------------------------
     /// Find types by name.
@@ -397,7 +427,7 @@
                const ConstString &name,
                bool name_is_fully_qualified,
                uint32_t max_matches,
-               TypeList& types);
+               TypeList& types) const;
     
     bool
     FindSourceFile (const FileSpec &orig_spec, FileSpec &new_spec) const;
@@ -416,7 +446,7 @@
 
     bool
     ResolveFileAddress (lldb::addr_t vm_addr,
-                        Address& so_addr);
+                        Address& so_addr) const;
 
     //------------------------------------------------------------------
     /// @copydoc Module::ResolveSymbolContextForAddress (const Address &,uint32_t,SymbolContext&)
@@ -424,7 +454,7 @@
     uint32_t
     ResolveSymbolContextForAddress (const Address& so_addr,
                                     uint32_t resolve_scope,
-                                    SymbolContext& sc);
+                                    SymbolContext& sc) const;
 
     //------------------------------------------------------------------
     /// @copydoc Module::ResolveSymbolContextForFilePath (const char *,uint32_t,bool,uint32_t,SymbolContextList&)
@@ -434,7 +464,7 @@
                                      uint32_t line,
                                      bool check_inlines,
                                      uint32_t resolve_scope,
-                                     SymbolContextList& sc_list);
+                                     SymbolContextList& sc_list) const;
 
     //------------------------------------------------------------------
     /// @copydoc Module::ResolveSymbolContextsForFileSpec (const FileSpec &,uint32_t,bool,uint32_t,SymbolContextList&)
@@ -444,7 +474,7 @@
                                      uint32_t line,
                                      bool check_inlines,
                                      uint32_t resolve_scope,
-                                     SymbolContextList& sc_list);
+                                     SymbolContextList& sc_list) const;
 
     //------------------------------------------------------------------
     /// Gets the size of the module list.
@@ -485,12 +515,26 @@
     //------------------------------------------------------------------
     typedef std::vector<lldb::ModuleSP> collection; ///< The module collection type.
 
+    void
+    AppendImpl (const lldb::ModuleSP &module_sp, bool use_notifier = true);
+    
+    bool
+    RemoveImpl (const lldb::ModuleSP &module_sp, bool use_notifier = true);
+    
+    collection::iterator
+    RemoveImpl (collection::iterator pos, bool use_notifier = true);
+    
+    void
+    ClearImpl (bool use_notifier = true);
+    
     //------------------------------------------------------------------
     // Member variables.
     //------------------------------------------------------------------
     collection m_modules; ///< The collection of modules.
     mutable Mutex m_modules_mutex;
 
+    Notifier* m_notifier;
+    
 };
 
 } // namespace lldb_private

Modified: lldb/branches/windows/include/lldb/Core/UniqueCStringMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/UniqueCStringMap.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/UniqueCStringMap.h (original)
+++ lldb/branches/windows/include/lldb/Core/UniqueCStringMap.h Tue Nov 13 10:36:41 2012
@@ -313,6 +313,33 @@
         }
     }
 
+    size_t
+    Erase (const char *unique_cstr)
+    {
+        size_t num_removed = 0;
+        Entry search_entry (unique_cstr);
+        iterator end = m_map.end();
+        iterator begin = m_map.begin();
+        iterator lower_pos = std::lower_bound (begin, end, search_entry);
+        if (lower_pos != end)
+        {
+            if (lower_pos->cstring == unique_cstr)
+            {
+                iterator upper_pos = std::upper_bound (lower_pos, end, search_entry);
+                if (lower_pos == upper_pos)
+                {
+                    m_map.erase (lower_pos);
+                    num_removed = 1;
+                }
+                else
+                {
+                    num_removed = std::distance (lower_pos, upper_pos);
+                    m_map.erase (lower_pos, upper_pos);
+                }
+            }
+        }
+        return num_removed;
+    }
 protected:
     typedef std::vector<Entry> collection;
     typedef typename collection::iterator iterator;

Modified: lldb/branches/windows/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/branches/windows/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Nov 13 10:36:41 2012
@@ -77,12 +77,9 @@
     virtual bool
     IsDynamic ()
     {
-        if (m_parent)
-            return m_parent->IsDynamic();
-        else
-            return false;
+        return false;
     }
-    
+
     virtual ValueObject *
     GetParent()
     {

Modified: lldb/branches/windows/include/lldb/Host/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Host/Symbols.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Host/Symbols.h (original)
+++ lldb/branches/windows/include/lldb/Host/Symbols.h Tue Nov 13 10:36:41 2012
@@ -40,7 +40,7 @@
     //----------------------------------------------------------------------
     static FileSpec
     LocateExecutableSymbolFile (const ModuleSpec &module_spec);
-    
+        
     static FileSpec
     FindSymbolFileInBundle (const FileSpec& dsym_bundle_fspec,
                             const lldb_private::UUID *uuid,

Modified: lldb/branches/windows/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/ClangASTType.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/ClangASTType.h Tue Nov 13 10:36:41 2012
@@ -320,6 +320,9 @@
     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/windows/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/Type.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/Type.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/Type.h Tue Nov 13 10:36:41 2012
@@ -302,7 +302,7 @@
     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;
     Declaration m_decl;

Modified: lldb/branches/windows/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/Platform.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/Platform.h (original)
+++ lldb/branches/windows/include/lldb/Target/Platform.h Tue Nov 13 10:36:41 2012
@@ -291,6 +291,15 @@
                  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 FileSpec
+        LocateExecutableScriptingResource (const ModuleSpec &module_spec);
+        
         virtual Error
         GetSharedModule (const ModuleSpec &module_spec, 
                          lldb::ModuleSP &module_sp,

Modified: lldb/branches/windows/include/lldb/Target/StopInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/StopInfo.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/StopInfo.h (original)
+++ lldb/branches/windows/include/lldb/Target/StopInfo.h Tue Nov 13 10:36:41 2012
@@ -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 Process::ProcessEventData;
+    friend class ThreadPlanBase;
+    
 public:
     //------------------------------------------------------------------
     // Constructors and Destructors
@@ -65,25 +68,7 @@
 
     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.
@@ -148,6 +133,25 @@
     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)
+    {
+    }
+
+    // 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
     //------------------------------------------------------------------

Modified: lldb/branches/windows/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/Target.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/Target.h (original)
+++ lldb/branches/windows/include/lldb/Target/Target.h Tue Nov 13 10:36:41 2012
@@ -47,7 +47,6 @@
     eInlineBreakpointsAlways
 } InlineStrategy;
 
-
 //----------------------------------------------------------------------
 // TargetProperties
 //----------------------------------------------------------------------
@@ -266,7 +265,8 @@
     public STD_ENABLE_SHARED_FROM_THIS(Target),
     public TargetProperties,
     public Broadcaster,
-    public ExecutionContextScope
+    public ExecutionContextScope,
+    public ModuleList::Notifier
 {
 public:
     friend class TargetList;
@@ -586,13 +586,6 @@
     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
     ///
@@ -623,13 +616,31 @@
     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);
+    
     //------------------------------------------------------------------
     /// Gets the module for the main executable.
     ///
@@ -702,18 +713,17 @@
     /// @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.

Modified: lldb/branches/windows/include/lldb/lldb-private-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/lldb-private-enumerations.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/branches/windows/include/lldb/lldb-private-enumerations.h Tue Nov 13 10:36:41 2012
@@ -213,7 +213,8 @@
     eFormatterChoiceCriterionRegularExpressionSummary =      0x00000004,
     eFormatterChoiceCriterionRegularExpressionFilter =       0x00000004,
     eFormatterChoiceCriterionDynamicObjCDiscovery =          0x00000008,
-    eFormatterChoiceCriterionStrippedBitField =              0x00000010
+    eFormatterChoiceCriterionStrippedBitField =              0x00000010,
+    eFormatterChoiceCriterionWentToStaticValue =             0x00000020
 } FormatterChoiceCriterion;
 
 //----------------------------------------------------------------------

Modified: lldb/branches/windows/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/lldb.xcodeproj/project.pbxproj?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/windows/lldb.xcodeproj/project.pbxproj Tue Nov 13 10:36:41 2012
@@ -4322,7 +4322,7 @@
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
 				LLVM_CONFIGURATION = "Release+Asserts";
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
-				MACOSX_DEPLOYMENT_TARGET = "";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"-flimit-debug-info",
@@ -4381,7 +4381,7 @@
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
 				LLVM_CONFIGURATION = Release;
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
-				MACOSX_DEPLOYMENT_TARGET = "";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"-flimit-debug-info",
@@ -4890,6 +4890,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Debug;
@@ -4898,6 +4899,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;
@@ -5229,7 +5231,7 @@
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
 				LLVM_CONFIGURATION = "Debug+Asserts";
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
-				MACOSX_DEPLOYMENT_TARGET = "";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"-flimit-debug-info",
@@ -5247,6 +5249,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = DebugClang;

Modified: lldb/branches/windows/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme (original)
+++ lldb/branches/windows/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme Tue Nov 13 10:36:41 2012
@@ -84,7 +84,7 @@
    <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"

Modified: lldb/branches/windows/scripts/Python/build-swig-Python.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/build-swig-Python.sh?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/build-swig-Python.sh (original)
+++ lldb/branches/windows/scripts/Python/build-swig-Python.sh Tue Nov 13 10:36:41 2012
@@ -4,22 +4,39 @@
 
 # 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
 
-os_name=`uname -s`
-if [ "$os_name" = "Darwin" ]
+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
@@ -263,20 +280,26 @@
 
 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
@@ -297,7 +320,18 @@
 
 # Build the SWIG C++ wrapper file for Python.
 
-$SWIG -c++ -shadow -python -threads -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.
@@ -312,7 +346,12 @@
 
 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/windows/scripts/Python/finish-swig-Python-LLDB.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/finish-swig-Python-LLDB.sh?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/finish-swig-Python-LLDB.sh (original)
+++ lldb/branches/windows/scripts/Python/finish-swig-Python-LLDB.sh Tue Nov 13 10:36:41 2012
@@ -5,10 +5,10 @@
 # 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,6 +32,7 @@
 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
@@ -46,6 +47,13 @@
     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/env python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
 
@@ -56,12 +64,19 @@
     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" ]
@@ -79,13 +94,20 @@
 
     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.
@@ -130,10 +152,12 @@
     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
+        ln -s "../../../liblldb${SOEXT}" _lldb.so
     fi
 else
     if [ $Debug -eq 1 ]

Modified: lldb/branches/windows/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/modify-python-lldb.py?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/modify-python-lldb.py (original)
+++ lldb/branches/windows/scripts/Python/modify-python-lldb.py Tue Nov 13 10:36:41 2012
@@ -386,7 +386,7 @@
                 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)

Modified: lldb/branches/windows/scripts/build-swig-wrapper-classes.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/build-swig-wrapper-classes.sh?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/scripts/build-swig-wrapper-classes.sh (original)
+++ lldb/branches/windows/scripts/build-swig-wrapper-classes.sh Tue Nov 13 10:36:41 2012
@@ -26,20 +26,45 @@
 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.
 #
 
@@ -119,7 +144,7 @@
                 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

Modified: lldb/branches/windows/scripts/finish-swig-wrapper-classes.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/finish-swig-wrapper-classes.sh?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/scripts/finish-swig-wrapper-classes.sh (original)
+++ lldb/branches/windows/scripts/finish-swig-wrapper-classes.sh Tue Nov 13 10:36:41 2012
@@ -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 @@
 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
@@ -76,8 +87,8 @@
                 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/windows/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectMemory.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectMemory.cpp Tue Nov 13 10:36:41 2012
@@ -40,7 +40,9 @@
     { LLDB_OPT_SET_1, false, "num-per-line" ,'l', required_argument, NULL, 0, eArgTypeNumberPerLine ,"The number of items per line to display."},
     { LLDB_OPT_SET_2, false, "binary"       ,'b', no_argument      , NULL, 0, eArgTypeNone          ,"If true, memory will be saved as binary. If false, the memory is saved save as an ASCII dump that uses the format, size, count and number per line settings."},
     { LLDB_OPT_SET_3, true , "type"         ,'t', required_argument, NULL, 0, eArgTypeNone          ,"The name of a type to view memory as."}, 
-    { LLDB_OPT_SET_4, false, "force"        ,'r', no_argument,       NULL, 0, eArgTypeNone          ,"Necessary if reading over 1024 bytes of memory."},
+    { LLDB_OPT_SET_1|
+      LLDB_OPT_SET_2|
+      LLDB_OPT_SET_3, false, "force"        ,'r', no_argument,       NULL, 0, eArgTypeNone          ,"Necessary if reading over 1024 bytes of memory."},
 };
 
 
@@ -146,7 +148,7 @@
 
             case eFormatInstruction:
                 if (count_option_set)
-                    byte_size_value = target->GetArchitecture().GetMaximumOpcodeByteSize() * format_options.GetCountValue().GetCurrentValue();
+                    byte_size_value = target->GetArchitecture().GetMaximumOpcodeByteSize();
                 m_num_per_line = 1;
                 break;
 

Modified: lldb/branches/windows/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectTarget.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectTarget.cpp Tue Nov 13 10:36:41 2012
@@ -571,7 +571,7 @@
     CommandObjectTargetVariable (CommandInterpreter &interpreter) :
         CommandObjectParsed (interpreter,
                              "target variable",
-                             "Read global variable(s) prior to running your binary.",
+                             "Read global variable(s) prior to, or while running your binary.",
                              NULL,
                              0),
         m_option_group (interpreter),
@@ -2255,7 +2255,7 @@
             if (command.GetArgumentCount() == 0)
             {
                 // Dump all sections for all modules images
-                ModuleList &target_modules = target->GetImages();
+                const ModuleList &target_modules = target->GetImages();
                 Mutex::Locker modules_locker (target_modules.GetMutex());
                 const uint32_t num_modules = target_modules.GetSize();
                 if (num_modules > 0)
@@ -2368,7 +2368,7 @@
                 {
                     FileSpec file_spec(arg_cstr, false);
                     
-                    ModuleList &target_modules = target->GetImages();
+                    const ModuleList &target_modules = target->GetImages();
                     Mutex::Locker modules_locker(target_modules.GetMutex());
                     const uint32_t num_modules = target_modules.GetSize();
                     if (num_modules > 0)
@@ -2940,7 +2940,7 @@
             Mutex::Locker locker;      // This locker will be locked on the mutex in module_list_ptr if it is non-NULL.
                                        // Otherwise it will lock the AllocationModuleCollectionMutex when accessing
                                        // the global module list directly.
-            ModuleList *module_list_ptr = NULL;
+            const ModuleList *module_list_ptr = NULL;
             const size_t argc = command.GetArgumentCount();
             if (argc == 0)
             {
@@ -3825,7 +3825,7 @@
                 
                 // Dump all sections for all other modules
                 
-                ModuleList &target_modules = target->GetImages();
+                const ModuleList &target_modules = target->GetImages();
                 Mutex::Locker modules_locker(target_modules.GetMutex());
                 const uint32_t num_modules = target_modules.GetSize();
                 if (num_modules > 0)

Modified: lldb/branches/windows/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectType.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectType.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectType.cpp Tue Nov 13 10:36:41 2012
@@ -3821,7 +3821,7 @@
                     "    int i;\n"
                     "} \n"
                     "Typing:\n"
-                    "type filter add --child a -- child g Foo\n"
+                    "type filter add --child a --child g Foo\n"
                     "frame variable a_foo\n"
                     "will produce an output where only a and g are displayed\n"
                     "Other children of a_foo (b,c,d,e,f,h and i) are available by asking for them, as in:\n"

Modified: lldb/branches/windows/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ArchSpec.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ArchSpec.cpp (original)
+++ lldb/branches/windows/source/Core/ArchSpec.cpp Tue Nov 13 10:36:41 2012
@@ -27,6 +27,9 @@
 
 #define ARCH_SPEC_SEPARATOR_CHAR '-'
 
+
+static bool cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_inverse, bool enforce_exact_match);
+
 namespace lldb_private {
 
     struct CoreDefinition
@@ -711,6 +714,82 @@
     return 0;
 }
 
+bool
+ArchSpec::IsExactMatch (const ArchSpec& rhs) const
+{
+    return Compare (rhs, true);
+}
+
+bool
+ArchSpec::IsCompatibleMatch (const ArchSpec& rhs) const
+{
+    return Compare (rhs, false);
+}
+
+bool
+ArchSpec::Compare (const ArchSpec& rhs, bool exact_match) const
+{
+    if (GetByteOrder() != rhs.GetByteOrder())
+        return false;
+        
+    const ArchSpec::Core lhs_core = GetCore ();
+    const ArchSpec::Core rhs_core = rhs.GetCore ();
+
+    const bool core_match = cores_match (lhs_core, rhs_core, true, exact_match);
+
+    if (core_match)
+    {
+        const llvm::Triple &lhs_triple = GetTriple();
+        const llvm::Triple &rhs_triple = rhs.GetTriple();
+
+        const llvm::Triple::VendorType lhs_triple_vendor = lhs_triple.getVendor();
+        const llvm::Triple::VendorType rhs_triple_vendor = rhs_triple.getVendor();
+        if (lhs_triple_vendor != rhs_triple_vendor)
+        {
+            const bool rhs_vendor_specified = rhs.TripleVendorWasSpecified();
+            const bool lhs_vendor_specified = TripleVendorWasSpecified();
+            // Both architectures had the vendor specified, so if they aren't
+            // equal then we return false
+            if (rhs_vendor_specified && lhs_vendor_specified)
+                return false;
+            
+            // Only fail if both vendor types are not unknown
+            if (lhs_triple_vendor != llvm::Triple::UnknownVendor &&
+                rhs_triple_vendor != llvm::Triple::UnknownVendor)
+                return false;
+        }
+        
+        const llvm::Triple::OSType lhs_triple_os = lhs_triple.getOS();
+        const llvm::Triple::OSType rhs_triple_os = rhs_triple.getOS();
+        if (lhs_triple_os != rhs_triple_os)
+        {
+            const bool rhs_os_specified = rhs.TripleOSWasSpecified();
+            const bool lhs_os_specified = TripleOSWasSpecified();
+            // Both architectures had the OS specified, so if they aren't
+            // equal then we return false
+            if (rhs_os_specified && lhs_os_specified)
+                return false;
+            // Only fail if both os types are not unknown
+            if (lhs_triple_os != llvm::Triple::UnknownOS &&
+                rhs_triple_os != llvm::Triple::UnknownOS)
+                return false;
+        }
+
+        const llvm::Triple::EnvironmentType lhs_triple_env = lhs_triple.getEnvironment();
+        const llvm::Triple::EnvironmentType rhs_triple_env = rhs_triple.getEnvironment();
+            
+        if (lhs_triple_env != rhs_triple_env)
+        {
+            // Only fail if both environment types are not unknown
+            if (lhs_triple_env != llvm::Triple::UnknownEnvironment &&
+                rhs_triple_env != llvm::Triple::UnknownEnvironment)
+                return false;
+        }
+        return true;
+    }
+    return false;
+}
+
 //===----------------------------------------------------------------------===//
 // Helper methods.
 
@@ -736,119 +815,13 @@
 // Operators.
 
 static bool
-cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_inverse)
+cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_inverse, bool enforce_exact_match)
 {
+    if (core1 == core2)
+        return true;
+
     switch (core1)
     {
-//    case ArchSpec::eCore_arm_armv4:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumb)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv4t:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv4t)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv5:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv5)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv5t:
-//    case ArchSpec::eCore_arm_armv5e:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv5e)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv6:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv6)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv7:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv7)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv7f:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv7f)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv7k:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv7k)
-//            return true;
-//        break;
-//        
-//    case ArchSpec::eCore_arm_armv7s:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_thumbv7s)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumb:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv4)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumbv4t:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv4t)
-//            return true;
-//        break;
-//    
-//    case ArchSpec::eCore_thumbv5:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv5)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumbv5e:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv5t || core2 == ArchSpec::eCore_arm_armv5e)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumbv6:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv6)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumbv7:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv7)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumbv7f:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv7f)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumbv7k:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv7k)
-//            return true;
-//        break;
-//
-//    case ArchSpec::eCore_thumbv7s:
-//        try_inverse = false;
-//        if (core2 == ArchSpec::eCore_arm_armv7s)
-//            return true;
-//        break;
-    
     case ArchSpec::kCore_any:
         return true;
 
@@ -876,87 +849,29 @@
             return true;
         break;
 
-    case ArchSpec::eCore_arm_armv7:
     case ArchSpec::eCore_arm_armv7f:
     case ArchSpec::eCore_arm_armv7k:
     case ArchSpec::eCore_arm_armv7s:
-        try_inverse = false;
-        if (core2 == ArchSpec::eCore_arm_armv7)
-            return true;
+        if (!enforce_exact_match)
+        {
+            try_inverse = false;
+            if (core2 == ArchSpec::eCore_arm_armv7)
+                return true;
+        }
         break;
 
     default:
         break;
     }
     if (try_inverse)
-        return cores_match (core2, core1, false);
+        return cores_match (core2, core1, false, enforce_exact_match);
     return false;
 }
 
 bool
 lldb_private::operator== (const ArchSpec& lhs, const ArchSpec& rhs)
 {
-    if (lhs.GetByteOrder() != rhs.GetByteOrder())
-        return false;
-        
-    const ArchSpec::Core lhs_core = lhs.GetCore ();
-    const ArchSpec::Core rhs_core = rhs.GetCore ();
-
-    // Check if the cores match, or check a little closer watching for wildcard
-    // and equivalent cores
-    const bool core_match = (lhs_core == rhs_core) || cores_match (lhs_core, rhs_core, true);
-
-    if (core_match)
-    {
-        const llvm::Triple &lhs_triple = lhs.GetTriple();
-        const llvm::Triple &rhs_triple = rhs.GetTriple();
-
-        const llvm::Triple::VendorType lhs_triple_vendor = lhs_triple.getVendor();
-        const llvm::Triple::VendorType rhs_triple_vendor = rhs_triple.getVendor();
-        if (lhs_triple_vendor != rhs_triple_vendor)
-        {
-            const bool rhs_vendor_specified = rhs.TripleVendorWasSpecified();
-            const bool lhs_vendor_specified = lhs.TripleVendorWasSpecified();
-            // Both architectures had the vendor specified, so if they aren't
-            // equal then we return false
-            if (rhs_vendor_specified && lhs_vendor_specified)
-                return false;
-            
-            // Only fail if both vendor types are not unknown
-            if (lhs_triple_vendor != llvm::Triple::UnknownVendor &&
-                rhs_triple_vendor != llvm::Triple::UnknownVendor)
-                return false;
-        }
-        
-        const llvm::Triple::OSType lhs_triple_os = lhs_triple.getOS();
-        const llvm::Triple::OSType rhs_triple_os = rhs_triple.getOS();
-        if (lhs_triple_os != rhs_triple_os)
-        {
-            const bool rhs_os_specified = rhs.TripleOSWasSpecified();
-            const bool lhs_os_specified = lhs.TripleOSWasSpecified();
-            // Both architectures had the OS specified, so if they aren't
-            // equal then we return false
-            if (rhs_os_specified && lhs_os_specified)
-                return false;
-            // Only fail if both os types are not unknown
-            if (lhs_triple_os != llvm::Triple::UnknownOS &&
-                rhs_triple_os != llvm::Triple::UnknownOS)
-                return false;
-        }
-
-        const llvm::Triple::EnvironmentType lhs_triple_env = lhs_triple.getEnvironment();
-        const llvm::Triple::EnvironmentType rhs_triple_env = rhs_triple.getEnvironment();
-            
-        if (lhs_triple_env != rhs_triple_env)
-        {
-            // Only fail if both environment types are not unknown
-            if (lhs_triple_env != llvm::Triple::UnknownEnvironment &&
-                rhs_triple_env != llvm::Triple::UnknownEnvironment)
-                return false;
-        }
-        return true;
-    }
-    return false;
+    return lhs.IsExactMatch (rhs);
 }
 
 bool

Modified: lldb/branches/windows/source/Core/ConstString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ConstString.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ConstString.cpp (original)
+++ lldb/branches/windows/source/Core/ConstString.cpp Tue Nov 13 10:36:41 2012
@@ -279,9 +279,12 @@
 void
 ConstString::Dump(Stream *s, const char *fail_value) const
 {
-    const char *cstr = AsCString (fail_value);
-    if (cstr)
-        s->PutCString (cstr);
+    if (s)
+    {
+        const char *cstr = AsCString (fail_value);
+        if (cstr)
+            s->PutCString (cstr);
+    }
 }
 
 void

Modified: lldb/branches/windows/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/DataExtractor.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/DataExtractor.cpp (original)
+++ lldb/branches/windows/source/Core/DataExtractor.cpp Tue Nov 13 10:36:41 2012
@@ -1710,25 +1710,25 @@
         case eFormatFloat:
             {
                 std::ostringstream ss;
-                switch (item_byte_size)
+                if (item_byte_size == sizeof(float))
                 {
-                default:
-                    s->Printf("error: unsupported byte size (%u) for float format", item_byte_size);
-                    return offset;
-                case sizeof(float):
                     ss.precision(std::numeric_limits<float>::digits10);
                     ss << GetFloat(&offset);
-                    break;
-                case sizeof(double):
+                } 
+                else if (item_byte_size == sizeof(double))
+                {
                     ss.precision(std::numeric_limits<double>::digits10);
                     ss << GetDouble(&offset);
-                    break;
-#ifndef _MSC_VER
-                case sizeof(long double):
+                }
+                else if (item_byte_size == sizeof(long double))
+                {
                     ss.precision(std::numeric_limits<long double>::digits10);
                     ss << GetLongDouble(&offset);
-                    break;
-#endif
+                }
+                else
+                {
+                    s->Printf("error: unsupported byte size (%u) for float format", item_byte_size);
+                    return offset;
                 }
                 ss.flush();
                 s->Printf("%s", ss.str().c_str());

Modified: lldb/branches/windows/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/FormatManager.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/FormatManager.cpp (original)
+++ lldb/branches/windows/source/Core/FormatManager.cpp Tue Nov 13 10:36:41 2012
@@ -955,7 +955,6 @@
     objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL *"),
                                                  ObjC_BOOL_summary);
 
-
     // we need to skip pointers here since we are special casing a SEL* when retrieving its value
     objc_flags.SetSkipPointers(true);
 #ifndef LLDB_DISABLE_PYTHON

Modified: lldb/branches/windows/source/Core/Listener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Listener.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Listener.cpp (original)
+++ lldb/branches/windows/source/Core/Listener.cpp Tue Nov 13 10:36:41 2012
@@ -312,11 +312,6 @@
                 m_cond_wait.SetValue (false, eBroadcastNever);
         }
         
-        // Unlock the event queue here.  We've removed this event and are about to return
-        // it so it should be okay to get the next event off the queue here - and it might
-        // be useful to do that in the "DoOnRemoval".
-        lock.Unlock();
-        
         // Don't call DoOnRemoval if you aren't removing the event...
         if (remove)
             event_sp->DoOnRemoval();
@@ -411,12 +406,20 @@
 
     while (1)
     {
-        if (GetNextEventInternal (broadcaster, broadcaster_names, num_broadcaster_names, event_type_mask, event_sp))
-            return true;
-
-        // Reset condition value to false, so we can wait for new events to be
-        // added that might meet our current filter
-        m_cond_wait.SetValue (false, eBroadcastNever);
+        // Scope for "event_locker"
+        {
+            // Don't allow new events to be added while we're checking for the
+            // one we want.  Otherwise, setting m_cond_wait to false below
+            // might cause us to miss one.
+            Mutex::Locker event_locker(m_events_mutex);
+
+            if (GetNextEventInternal (broadcaster, broadcaster_names, num_broadcaster_names, event_type_mask, event_sp))
+                return true;
+
+            // Reset condition value to false, so we can wait for new events to be
+            // added that might meet our current filter
+            m_cond_wait.SetValue (false, eBroadcastNever);
+        }
 
         if (m_cond_wait.WaitForValueEqualTo (true, timeout, &timed_out))
             continue;

Modified: lldb/branches/windows/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Module.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Module.cpp (original)
+++ lldb/branches/windows/source/Core/Module.cpp Tue Nov 13 10:36:41 2012
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/Core/Error.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/DataBufferHeap.h"
@@ -18,6 +19,9 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Core/Timer.h"
 #include "lldb/Host/Host.h"
+#include "lldb/Host/Symbols.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/ScriptInterpreter.h"
 #include "lldb/lldb-private-log.h"
 #include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/ObjectFile.h"
@@ -1132,7 +1136,48 @@
     }
     return false;
 }
-bool 
+
+bool
+Module::LoadScriptingResourceInTarget (Target *target, Error& error)
+{
+    if (!target)
+    {
+        error.SetErrorString("invalid destination Target");
+        return false;
+    }
+    
+    PlatformSP platform_sp(target->GetPlatform());
+    
+    if (!platform_sp)
+    {
+        error.SetErrorString("invalid Platform");
+        return false;
+    }
+
+    ModuleSpec module_spec(GetFileSpec());
+    FileSpec scripting_fspec = platform_sp->LocateExecutableScriptingResource(module_spec);
+    Debugger &debugger(target->GetDebugger());
+    if (scripting_fspec && scripting_fspec.Exists())
+    {
+        ScriptInterpreter *script_interpreter = debugger.GetCommandInterpreter().GetScriptInterpreter();
+        if (script_interpreter)
+        {
+            StreamString scripting_stream;
+            scripting_fspec.Dump(&scripting_stream);
+            bool did_load = script_interpreter->LoadScriptingModule(scripting_stream.GetData(), false, true, error);
+            if (!did_load)
+                return false;
+        }
+        else
+        {
+            error.SetErrorString("invalid ScriptInterpreter");
+            return false;
+        }
+    }
+    return true;
+}
+
+bool
 Module::SetArchitecture (const ArchSpec &new_arch)
 {
     if (!m_arch.IsValid())

Modified: lldb/branches/windows/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ModuleList.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ModuleList.cpp (original)
+++ lldb/branches/windows/source/Core/ModuleList.cpp Tue Nov 13 10:36:41 2012
@@ -30,7 +30,8 @@
 //----------------------------------------------------------------------
 ModuleList::ModuleList() :
     m_modules(),
-    m_modules_mutex (Mutex::eMutexTypeRecursive)
+    m_modules_mutex (Mutex::eMutexTypeRecursive),
+    m_notifier(NULL)
 {
 }
 
@@ -46,6 +47,13 @@
     m_modules = rhs.m_modules;
 }
 
+ModuleList::ModuleList (ModuleList::Notifier* notifier) :
+    m_modules(),
+    m_modules_mutex (Mutex::eMutexTypeRecursive),
+    m_notifier(notifier)
+{
+}
+
 //----------------------------------------------------------------------
 // Assignment operator
 //----------------------------------------------------------------------
@@ -69,16 +77,24 @@
 }
 
 void
-ModuleList::Append (const ModuleSP &module_sp)
+ModuleList::AppendImpl (const ModuleSP &module_sp, bool use_notifier)
 {
     if (module_sp)
     {
         Mutex::Locker locker(m_modules_mutex);
         m_modules.push_back(module_sp);
+        if (use_notifier && m_notifier)
+            m_notifier->ModuleAdded(*this, module_sp);
     }
 }
 
 void
+ModuleList::Append (const ModuleSP &module_sp)
+{
+    AppendImpl (module_sp);
+}
+
+void
 ModuleList::ReplaceEquivalent (const ModuleSP &module_sp)
 {
     if (module_sp)
@@ -95,12 +111,12 @@
         {
             ModuleSP module_sp (m_modules[idx]);
             if (module_sp->MatchesModuleSpec (equivalent_module_spec))
-                m_modules.erase(m_modules.begin() + idx);
+                RemoveImpl(m_modules.begin() + idx);
             else
                 ++idx;
         }
         // Now add the new module to the list
-        m_modules.push_back(module_sp);
+        Append(module_sp);
     }
 }
 
@@ -117,14 +133,30 @@
                 return false; // Already in the list
         }
         // Only push module_sp on the list if it wasn't already in there.
-        m_modules.push_back(module_sp);
+        Append(module_sp);
         return true;
     }
     return false;
 }
 
+void
+ModuleList::Append (const ModuleList& module_list)
+{
+    for (auto pos = module_list.m_modules.begin(); pos != module_list.m_modules.end(); ++pos) 
+        Append(*pos);
+}
+
 bool
-ModuleList::Remove (const ModuleSP &module_sp)
+ModuleList::AppendIfNeeded (const ModuleList& module_list)
+{
+    bool any_in = false;
+    for (auto pos = module_list.m_modules.begin(); pos != module_list.m_modules.end(); ++pos)
+        any_in = AppendIfNeeded(*pos) | any_in;
+    return any_in;
+}
+
+bool
+ModuleList::RemoveImpl (const ModuleSP &module_sp, bool use_notifier)
 {
     if (module_sp)
     {
@@ -135,6 +167,8 @@
             if (pos->get() == module_sp.get())
             {
                 m_modules.erase (pos);
+                if (use_notifier && m_notifier)
+                    m_notifier->ModuleRemoved(*this, module_sp);
                 return true;
             }
         }
@@ -142,6 +176,33 @@
     return false;
 }
 
+ModuleList::collection::iterator
+ModuleList::RemoveImpl (ModuleList::collection::iterator pos, bool use_notifier)
+{
+    ModuleSP module_sp(*pos);
+    collection::iterator retval = m_modules.erase(pos);
+    if (use_notifier && m_notifier)
+        m_notifier->ModuleRemoved(*this, module_sp);
+    return retval;
+}
+
+bool
+ModuleList::Remove (const ModuleSP &module_sp)
+{
+    return RemoveImpl (module_sp);
+}
+
+bool
+ModuleList::ReplaceModule (const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)
+{
+    if (!RemoveImpl(old_module_sp, false))
+        return false;
+    AppendImpl (new_module_sp, false);
+    if (m_notifier)
+        m_notifier->ModuleUpdated(*this, old_module_sp,new_module_sp);
+    return true;
+}
+
 bool
 ModuleList::RemoveIfOrphaned (const Module *module_ptr)
 {
@@ -155,7 +216,7 @@
             {
                 if (pos->unique())
                 {
-                    pos = m_modules.erase (pos);
+                    pos = RemoveImpl(pos);
                     return true;
                 }
                 else
@@ -187,7 +248,7 @@
     {
         if (pos->unique())
         {
-            pos = m_modules.erase (pos);
+            pos = RemoveImpl(pos);
             ++remove_count;
         }
         else
@@ -213,20 +274,25 @@
 }
 
 
-
 void
 ModuleList::Clear()
 {
-    Mutex::Locker locker(m_modules_mutex);
-    m_modules.clear();
+    ClearImpl();
 }
 
 void
 ModuleList::Destroy()
 {
+    ClearImpl();
+}
+
+void
+ModuleList::ClearImpl (bool use_notifier)
+{
     Mutex::Locker locker(m_modules_mutex);
-    collection empty;
-    m_modules.swap(empty);
+    if (use_notifier && m_notifier)
+        m_notifier->WillClearList(*this);
+    m_modules.clear();
 }
 
 Module*
@@ -245,14 +311,14 @@
 }
 
 ModuleSP
-ModuleList::GetModuleAtIndex(uint32_t idx)
+ModuleList::GetModuleAtIndex(uint32_t idx) const
 {
     Mutex::Locker locker(m_modules_mutex);
     return GetModuleAtIndexUnlocked(idx);
 }
 
 ModuleSP
-ModuleList::GetModuleAtIndexUnlocked(uint32_t idx)
+ModuleList::GetModuleAtIndexUnlocked(uint32_t idx) const
 {
     ModuleSP module_sp;
     if (idx < m_modules.size())
@@ -266,7 +332,7 @@
                            bool include_symbols,
                            bool include_inlines,
                            bool append, 
-                           SymbolContextList &sc_list)
+                           SymbolContextList &sc_list) const
 {
     if (!append)
         sc_list.Clear();
@@ -284,7 +350,7 @@
 uint32_t
 ModuleList::FindCompileUnits (const FileSpec &path, 
                               bool append, 
-                              SymbolContextList &sc_list)
+                              SymbolContextList &sc_list) const
 {
     if (!append)
         sc_list.Clear();
@@ -303,11 +369,11 @@
 ModuleList::FindGlobalVariables (const ConstString &name, 
                                  bool append, 
                                  uint32_t max_matches, 
-                                 VariableList& variable_list)
+                                 VariableList& variable_list) const
 {
     size_t initial_size = variable_list.GetSize();
     Mutex::Locker locker(m_modules_mutex);
-    collection::iterator pos, end = m_modules.end();
+    collection::const_iterator pos, end = m_modules.end();
     for (pos = m_modules.begin(); pos != end; ++pos)
     {
         (*pos)->FindGlobalVariables (name, NULL, append, max_matches, variable_list);
@@ -320,11 +386,11 @@
 ModuleList::FindGlobalVariables (const RegularExpression& regex, 
                                  bool append, 
                                  uint32_t max_matches, 
-                                 VariableList& variable_list)
+                                 VariableList& variable_list) const
 {
     size_t initial_size = variable_list.GetSize();
     Mutex::Locker locker(m_modules_mutex);
-    collection::iterator pos, end = m_modules.end();
+    collection::const_iterator pos, end = m_modules.end();
     for (pos = m_modules.begin(); pos != end; ++pos)
     {
         (*pos)->FindGlobalVariables (regex, append, max_matches, variable_list);
@@ -337,14 +403,14 @@
 ModuleList::FindSymbolsWithNameAndType (const ConstString &name, 
                                         SymbolType symbol_type, 
                                         SymbolContextList &sc_list,
-                                        bool append)
+                                        bool append) const
 {
     Mutex::Locker locker(m_modules_mutex);
     if (!append)
         sc_list.Clear();
     size_t initial_size = sc_list.GetSize();
     
-    collection::iterator pos, end = m_modules.end();
+    collection::const_iterator pos, end = m_modules.end();
     for (pos = m_modules.begin(); pos != end; ++pos)
         (*pos)->FindSymbolsWithNameAndType (name, symbol_type, sc_list);
     return sc_list.GetSize() - initial_size;
@@ -354,14 +420,14 @@
 ModuleList::FindSymbolsMatchingRegExAndType (const RegularExpression &regex, 
                                              lldb::SymbolType symbol_type, 
                                              SymbolContextList &sc_list,
-                                             bool append)
+                                             bool append) const
 {
     Mutex::Locker locker(m_modules_mutex);
     if (!append)
         sc_list.Clear();
     size_t initial_size = sc_list.GetSize();
     
-    collection::iterator pos, end = m_modules.end();
+    collection::const_iterator pos, end = m_modules.end();
     for (pos = m_modules.begin(); pos != end; ++pos)
         (*pos)->FindSymbolsMatchingRegExAndType (regex, symbol_type, sc_list);
     return sc_list.GetSize() - initial_size;
@@ -384,7 +450,7 @@
 }
 
 ModuleSP
-ModuleList::FindModule (const Module *module_ptr)
+ModuleList::FindModule (const Module *module_ptr) const
 {
     ModuleSP module_sp;
 
@@ -407,7 +473,7 @@
 }
 
 ModuleSP
-ModuleList::FindModule (const UUID &uuid)
+ModuleList::FindModule (const UUID &uuid) const
 {
     ModuleSP module_sp;
     
@@ -430,7 +496,7 @@
 
 
 uint32_t
-ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, uint32_t max_matches, TypeList& types)
+ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, uint32_t max_matches, TypeList& types) const
 {
     Mutex::Locker locker(m_modules_mutex);
 
@@ -487,7 +553,7 @@
 
 
 ModuleSP
-ModuleList::FindFirstModule (const ModuleSpec &module_spec)
+ModuleList::FindFirstModule (const ModuleSpec &module_spec) const
 {
     ModuleSP module_sp;
     Mutex::Locker locker(m_modules_mutex);
@@ -554,7 +620,7 @@
 }
 
 bool
-ModuleList::ResolveFileAddress (lldb::addr_t vm_addr, Address& so_addr)
+ModuleList::ResolveFileAddress (lldb::addr_t vm_addr, Address& so_addr) const
 {
     Mutex::Locker locker(m_modules_mutex);
     collection::const_iterator pos, end = m_modules.end();
@@ -568,7 +634,7 @@
 }
 
 uint32_t
-ModuleList::ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc)
+ModuleList::ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc) const
 {
     // The address is already section offset so it has a module
     uint32_t resolved_flags = 0;
@@ -604,14 +670,14 @@
     bool check_inlines, 
     uint32_t resolve_scope, 
     SymbolContextList& sc_list
-)
+)  const
 {
     FileSpec file_spec(file_path, false);
     return ResolveSymbolContextsForFileSpec (file_spec, line, check_inlines, resolve_scope, sc_list);
 }
 
 uint32_t
-ModuleList::ResolveSymbolContextsForFileSpec (const FileSpec &file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list)
+ModuleList::ResolveSymbolContextsForFileSpec (const FileSpec &file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list) const
 {
     Mutex::Locker locker(m_modules_mutex);
     collection::const_iterator pos, end = m_modules.end();

Modified: lldb/branches/windows/source/Core/SearchFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/SearchFilter.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/SearchFilter.cpp (original)
+++ lldb/branches/windows/source/Core/SearchFilter.cpp Tue Nov 13 10:36:41 2012
@@ -204,7 +204,7 @@
         }
         else
         {
-            ModuleList &target_images = m_target_sp->GetImages();
+            const ModuleList &target_images = m_target_sp->GetImages();
             Mutex::Locker modules_locker(target_images.GetMutex());
             
             size_t n_modules = target_images.GetSize();
@@ -428,7 +428,7 @@
     // filespec that passes.  Otherwise, we need to go through all modules and
     // find the ones that match the file name.
 
-    ModuleList &target_modules = m_target_sp->GetImages();
+    const ModuleList &target_modules = m_target_sp->GetImages();
     Mutex::Locker modules_locker (target_modules.GetMutex());
     
     const size_t num_modules = target_modules.GetSize ();
@@ -595,7 +595,7 @@
     // filespec that passes.  Otherwise, we need to go through all modules and
     // find the ones that match the file name.
 
-    ModuleList &target_modules = m_target_sp->GetImages();
+    const ModuleList &target_modules = m_target_sp->GetImages();
     Mutex::Locker modules_locker (target_modules.GetMutex());
     
     const size_t num_modules = target_modules.GetSize ();
@@ -768,7 +768,7 @@
     // find the ones that match the file name.
 
     ModuleList matching_modules;
-    ModuleList &target_images = m_target_sp->GetImages();
+    const ModuleList &target_images = m_target_sp->GetImages();
     Mutex::Locker modules_locker(target_images.GetMutex());
     
     const size_t num_modules = target_images.GetSize ();

Modified: lldb/branches/windows/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ClangASTSource.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ClangASTSource.cpp (original)
+++ lldb/branches/windows/source/Expression/ClangASTSource.cpp Tue Nov 13 10:36:41 2012
@@ -250,7 +250,7 @@
             ConstString name(tag_decl->getName().str().c_str());
             ClangNamespaceDecl namespace_decl;
             
-            ModuleList &module_list = m_target->GetImages();
+            const ModuleList &module_list = m_target->GetImages();
 
             bool exact_match = false;
             module_list.FindTypes (null_sc, name, exact_match, UINT32_MAX, types);
@@ -612,7 +612,7 @@
     }
     else 
     {
-        ModuleList &target_images = m_target->GetImages();
+        const ModuleList &target_images = m_target->GetImages();
         Mutex::Locker modules_locker (target_images.GetMutex());
         
         for (uint32_t i = 0, e = target_images.GetSize();
@@ -693,6 +693,63 @@
     } while(0);
 }
 
+template <class D> class TaggedASTDecl {
+public:
+    TaggedASTDecl() : decl(NULL) { }
+    TaggedASTDecl(D *_decl) : decl(_decl) { }
+    bool IsValid() const { return (decl != NULL); }
+    bool IsInvalid() const { return !IsValid(); }
+    D *operator->() const { return decl; }
+    D *decl;
+};
+
+template <class D2, template <class D> class TD, class D1> 
+TD<D2>
+DynCast(TD<D1> source)
+{
+    return TD<D2> (dyn_cast<D2>(source.decl));
+}
+
+template <class D = Decl> class DeclFromParser;
+template <class D = Decl> class DeclFromUser;
+
+template <class D> class DeclFromParser : public TaggedASTDecl<D> { 
+public:
+    DeclFromParser() : TaggedASTDecl<D>() { }
+    DeclFromParser(D *_decl) : TaggedASTDecl<D>(_decl) { }
+    
+    DeclFromUser<D> GetOrigin(ClangASTImporter *importer);
+};
+
+template <class D> class DeclFromUser : public TaggedASTDecl<D> { 
+public:
+    DeclFromUser() : TaggedASTDecl<D>() { }
+    DeclFromUser(D *_decl) : TaggedASTDecl<D>(_decl) { }
+    
+    DeclFromParser<D> Import(ClangASTImporter *importer, ASTContext &dest_ctx);
+};
+
+template <class D>
+DeclFromUser<D>
+DeclFromParser<D>::GetOrigin(ClangASTImporter *importer)
+{
+    DeclFromUser <> origin_decl;
+    importer->ResolveDeclOrigin(this->decl, &origin_decl.decl, NULL);
+    if (origin_decl.IsInvalid())
+        return DeclFromUser<D>();
+    return DeclFromUser<D>(dyn_cast<D>(origin_decl.decl));
+}
+
+template <class D>
+DeclFromParser<D>
+DeclFromUser<D>::Import(ClangASTImporter *importer, ASTContext &dest_ctx)
+{
+    DeclFromParser <> parser_generic_decl(importer->CopyDecl(&dest_ctx, &this->decl->getASTContext(), this->decl));
+    if (parser_generic_decl.IsInvalid())
+        return DeclFromParser<D>();
+    return DeclFromParser<D>(dyn_cast<D>(parser_generic_decl.decl));
+}
+
 static void
 FindObjCMethodDeclsWithOrigin (unsigned int current_id,
                                NameSearchContext &context,
@@ -807,7 +864,7 @@
                                       original_interface_decl,
                                       m_ast_context,
                                       m_ast_importer,
-                                      "in debug info");
+                                      "at origin");
     } while (0);
     
     StreamString ss;
@@ -964,117 +1021,93 @@
                 if (log)
                 {
                     ASTDumper dumper((Decl*)copied_method_decl);
-                    log->Printf("  CAS::FOMD[%d] found (in debug info) %s", current_id, dumper.GetCString());
+                    log->Printf("  CAS::FOMD[%d] found (in symbols) %s", current_id, dumper.GetCString());
                 }
                 
                 context.AddNamedDecl(copied_method_decl);
             }
         }
+        
+        return;
     }
-    else
+    
+    // Try the debug information.
+    
+    do
     {
-        do
-        {
-            // We need to look at the runtime.
-            
-            lldb::ProcessSP process(m_target->GetProcessSP());
-            
-            if (!process)
-                break;
-            
-            ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
-
-            TypeVendor *type_vendor = language_runtime->GetTypeVendor();
-            
-            if (!type_vendor)
-                break;
-            
-            ConstString interface_name(interface_decl->getNameAsString().c_str());
-            bool append = false;
-            uint32_t max_matches = 1;
-            std::vector <ClangASTType> types;
-            
-            if (!type_vendor->FindTypes(interface_name,
-                                        append,
-                                        max_matches,
-                                        types))
-                break;
-            
-            const clang::Type *runtime_clang_type = QualType::getFromOpaquePtr(types[0].GetOpaqueQualType()).getTypePtr();
-            
-            const ObjCInterfaceType *runtime_interface_type = dyn_cast<ObjCInterfaceType>(runtime_clang_type);
-            
-            if (!runtime_interface_type)
-                break;
-            
-            ObjCInterfaceDecl *runtime_interface_decl = runtime_interface_type->getDecl();
-            
-            FindObjCMethodDeclsWithOrigin(current_id,
-                                          context,
-                                          runtime_interface_decl,
-                                          m_ast_context,
-                                          m_ast_importer,
-                                          "in runtime");
-        }
-        while(0);
+        ObjCInterfaceDecl *complete_interface_decl = GetCompleteObjCInterface(const_cast<ObjCInterfaceDecl*>(interface_decl));
+        
+        if (!complete_interface_decl)
+            break;
+        
+        // We found the complete interface.  The runtime never needs to be queried in this scenario.
+        
+        DeclFromUser<const ObjCInterfaceDecl> complete_iface_decl(complete_interface_decl);
+        
+        if (complete_interface_decl == interface_decl)
+            break; // already checked this one
+        
+        if (log)
+            log->Printf("CAS::FOPD[%d] trying origin (ObjCInterfaceDecl*)%p/(ASTContext*)%p...",
+                        current_id,
+                        complete_interface_decl,
+                        &complete_iface_decl->getASTContext());
+        
+        FindObjCMethodDeclsWithOrigin(current_id,
+                                      context,
+                                      complete_interface_decl,
+                                      m_ast_context,
+                                      m_ast_importer,
+                                      "in debug info");
+        
+        return;
     }
-}
-
-template <class D> class TaggedASTDecl {
-public:
-    TaggedASTDecl() : decl(NULL) { }
-    TaggedASTDecl(D *_decl) : decl(_decl) { }
-    bool IsValid() const { return (decl != NULL); }
-    bool IsInvalid() const { return !IsValid(); }
-    D *operator->() const { return decl; }
-    D *decl;
-};
-
-template <class D2, template <class D> class TD, class D1> 
-TD<D2>
-DynCast(TD<D1> source)
-{
-    return TD<D2> (dyn_cast<D2>(source.decl));
-}
-
-template <class D = Decl> class DeclFromParser;
-template <class D = Decl> class DeclFromUser;
-
-template <class D> class DeclFromParser : public TaggedASTDecl<D> { 
-public:
-    DeclFromParser() : TaggedASTDecl<D>() { }
-    DeclFromParser(D *_decl) : TaggedASTDecl<D>(_decl) { }
-    
-    DeclFromUser<D> GetOrigin(ClangASTImporter *importer);
-};
-
-template <class D> class DeclFromUser : public TaggedASTDecl<D> { 
-public:
-    DeclFromUser() : TaggedASTDecl<D>() { }
-    DeclFromUser(D *_decl) : TaggedASTDecl<D>(_decl) { }
+    while (0);
     
-    DeclFromParser<D> Import(ClangASTImporter *importer, ASTContext &dest_ctx);
-};
-
-template <class D>
-DeclFromUser<D>
-DeclFromParser<D>::GetOrigin(ClangASTImporter *importer)
-{
-    DeclFromUser <> origin_decl;
-    importer->ResolveDeclOrigin(this->decl, &origin_decl.decl, NULL);
-    if (origin_decl.IsInvalid())
-        return DeclFromUser<D>();
-    return DeclFromUser<D>(dyn_cast<D>(origin_decl.decl));
-}
-
-template <class D>
-DeclFromParser<D>
-DeclFromUser<D>::Import(ClangASTImporter *importer, ASTContext &dest_ctx)
-{
-    DeclFromParser <> parser_generic_decl(importer->CopyDecl(&dest_ctx, &this->decl->getASTContext(), this->decl));
-    if (parser_generic_decl.IsInvalid())
-        return DeclFromParser<D>();
-    return DeclFromParser<D>(dyn_cast<D>(parser_generic_decl.decl));
+    do
+    {
+        // Check the runtime only if the debug information didn't have a complete interface.
+        
+        lldb::ProcessSP process(m_target->GetProcessSP());
+        
+        if (!process)
+            break;
+        
+        ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
+        
+        TypeVendor *type_vendor = language_runtime->GetTypeVendor();
+        
+        if (!type_vendor)
+            break;
+        
+        ConstString interface_name(interface_decl->getNameAsString().c_str());
+        bool append = false;
+        uint32_t max_matches = 1;
+        std::vector <ClangASTType> types;
+        
+        if (!type_vendor->FindTypes(interface_name,
+                                    append,
+                                    max_matches,
+                                    types))
+            break;
+        
+        const clang::Type *runtime_clang_type = QualType::getFromOpaquePtr(types[0].GetOpaqueQualType()).getTypePtr();
+        
+        const ObjCInterfaceType *runtime_interface_type = dyn_cast<ObjCInterfaceType>(runtime_clang_type);
+        
+        if (!runtime_interface_type)
+            break;
+        
+        ObjCInterfaceDecl *runtime_interface_decl = runtime_interface_type->getDecl();
+        
+        FindObjCMethodDeclsWithOrigin(current_id,
+                                      context,
+                                      runtime_interface_decl,
+                                      m_ast_context,
+                                      m_ast_importer,
+                                      "in runtime");
+    }
+    while(0);
 }
 
 static bool
@@ -1170,16 +1203,6 @@
     SymbolContext null_sc;
     TypeList type_list;
     
-    lldb::ProcessSP process(m_target->GetProcessSP());
-    
-    if (!process)
-        return;
-    
-    ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
-    
-    if (!language_runtime)
-        return;
-    
     do
     {
         ObjCInterfaceDecl *complete_interface_decl = GetCompleteObjCInterface(const_cast<ObjCInterfaceDecl*>(parser_iface_decl.decl));
@@ -1187,6 +1210,8 @@
         if (!complete_interface_decl)
             break;
         
+        // We found the complete interface.  The runtime never needs to be queried in this scenario.
+        
         DeclFromUser<const ObjCInterfaceDecl> complete_iface_decl(complete_interface_decl);
         
         if (complete_iface_decl.decl == origin_iface_decl.decl)
@@ -1198,18 +1223,29 @@
                         complete_iface_decl.decl, 
                         &complete_iface_decl->getASTContext());
         
-        if (FindObjCPropertyAndIvarDeclsWithOrigin(current_id, 
-                                                   context, 
-                                                   *m_ast_context, 
-                                                   m_ast_importer, 
-                                                   complete_iface_decl))
-            return;
+        FindObjCPropertyAndIvarDeclsWithOrigin(current_id, 
+                                               context, 
+                                               *m_ast_context, 
+                                               m_ast_importer, 
+                                               complete_iface_decl);
+        
+        return;
     }
     while(0);
     
     do
     {
-        // Now check the runtime.
+        // Check the runtime only if the debug information didn't have a complete interface.
+        
+        lldb::ProcessSP process(m_target->GetProcessSP());
+        
+        if (!process)
+            return;
+        
+        ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
+        
+        if (!language_runtime)
+            return;
         
         TypeVendor *type_vendor = language_runtime->GetTypeVendor();
         
@@ -1500,7 +1536,7 @@
     }
     else
     {
-        ModuleList &target_images = m_target->GetImages();
+        const ModuleList &target_images = m_target->GetImages();
         Mutex::Locker modules_locker(target_images.GetMutex());
         
         ClangNamespaceDecl null_namespace_decl;

Modified: lldb/branches/windows/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/IRForTarget.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/IRForTarget.cpp (original)
+++ lldb/branches/windows/source/Expression/IRForTarget.cpp Tue Nov 13 10:36:41 2012
@@ -548,7 +548,7 @@
         const char *value_name = result_name_str.c_str();
         
         if (strstr(value_name, "$__lldb_expr_result_ptr") &&
-            !strstr(value_name, "GV"))
+            strncmp(value_name, "_ZGV", 4))
         {
             result_name = value_name;
             m_result_is_pointer = true;
@@ -556,7 +556,7 @@
         }
         
         if (strstr(value_name, "$__lldb_expr_result") &&
-            !strstr(value_name, "GV")) 
+            strncmp(value_name, "_ZGV", 4))
         {
             result_name = value_name;
             m_result_is_pointer = false;

Modified: lldb/branches/windows/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/common/FileSpec.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/common/FileSpec.cpp (original)
+++ lldb/branches/windows/source/Host/common/FileSpec.cpp Tue Nov 13 10:36:41 2012
@@ -442,7 +442,7 @@
                 // rhs's path wasn't resolved but now it is. Check if the resolved
                 // directory is the same as rhs's unresolved directory, and if so, 
                 // we can mark this object as resolved to avoid more future resolves
-                rhs.m_is_resolved = (m_directory == resolved_rhs.m_directory);
+                rhs.m_is_resolved = (rhs.m_directory == resolved_rhs.m_directory);
             }
             else
                 return false;
@@ -546,10 +546,13 @@
 void
 FileSpec::Dump(Stream *s) const
 {
-    m_directory.Dump(s);
-    if (m_directory)
-        s->PutChar('/');
-    m_filename.Dump(s);
+    if (s)
+    {
+        m_directory.Dump(s);
+        if (m_directory)
+            s->PutChar('/');
+        m_filename.Dump(s);
+    }
 }
 
 //------------------------------------------------------------------

Modified: lldb/branches/windows/source/Interpreter/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/Makefile (original)
+++ lldb/branches/windows/source/Interpreter/Makefile Tue Nov 13 10:36:41 2012
@@ -18,177 +18,19 @@
 
 # edit-swig-python-wrapper-file.py needs $(SRCROOT)
 export SRCROOT := $(PROJ_SRC_DIR)/$(LLDB_LEVEL)
-TARGET_DIR := $(PROJ_OBJ_DIR)
 
-PYTHON_DIR := $(LibDir)/python/lldb
-ifeq ($(HOST_OS),Darwin)
-PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,/Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages)/lldb
-else
-PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,$(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages)/lldb
-endif
-LLDB_SWIG_INCLUDE_DIRS:= -I"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include" -I./.
-LIBLLDB := $(LibDir)/liblldb$(SHLIBEXT)
-INST_LIBLLDB := $(PROJ_libdir)/liblldb$(SHLIBEXT)
+PYTHON_DIR := $(PROJ_OBJ_ROOT)/$(BuildMode)
 
-# Subpackages of the main LLDB package
-LLDB_SUBPACKAGES := FORMATTERS FORMATTERS_CPP FORMATTERS_OBJC RUNTIME RUNTIME_OBJC UTILS
-# lldb.formatters
-LLDB_PACKAGE_FORMATTERS := formatters
-LLDB_PACKAGE_FORMATTERS_FILES := $(addprefix \
-  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/, \
-  cache.py metrics.py attrib_fromdict.py Logger.py)
-# lldb.formatters.cpp
-LLDB_PACKAGE_FORMATTERS_CPP := formatters/cpp
-LLDB_PACKAGE_FORMATTERS_CPP_FILES := $(addprefix \
-  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/synthetic/,gnu_libstdcpp.py libcxx.py)
-# lldb.formatters.objc
-LLDB_PACKAGE_FORMATTERS_OBJC := formatters/objc
-LLDB_PACKAGE_FORMATTERS_OBJC_FILES := \
-  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/Selector.py \
-  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/objc.py \
-  $(addprefix $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/, \
-    Class.py CFArray.py CFBag.py CFBinaryHeap.py CFBitVector.py \
-    CFDictionary.py CFString.py NSBundle.py NSData.py NSDate.py \
-    NSException.py NSIndexSet.py NSMachPort.py NSNotification.py \
-    NSNumber.py NSSet.py NSURL.py \
-  )
-# lldb.runtime
-LLDB_PACKAGE_RUNTIME := runtime
-LLDB_PACKAGE_RUNTIME_FILES :=
-# lldb.runtime.objc
-LLDB_PACKAGE_RUNTIME_OBJC := runtime/objc
-LLDB_PACKAGE_RUNTIME_OBJC_FILES := \
-  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/objc_runtime.py
-# lldb.utils
-LLDB_PACKAGE_UTILS := utils
-LLDB_PACKAGE_UTILS_FILES := \
-  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/python/symbolication.py
-
-ifeq ($(HOST_OS),Darwin)
-# Additional packages for Darwin/Mac OS X
-LLDB_SUBPACKAGES += MACOSX
-# lldb.macosx
-LLDB_PACKAGE_MACOSX := macosx
-LLDB_PACKAGE_MACOSX_FILES := $(addprefix \
-  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/, python/crashlog.py darwin/heap_find/heap.py \
-)
-endif
-
-LLDB_ALL_SUBPACKAGE_FILES := $(foreach subpackage,$(LLDB_SUBPACKAGES),$(LLDB_PACKAGE_$(subpackage)_FILES))
-LLDB_ALL_INSTALLED_SUBPACKAGE_FILES := $(foreach subpackage,$(LLDB_SUBPACKAGES),$(addprefix $(LLDB_PACKAGE_$(subpackage))/,$(notdir $(LLDB_PACKAGE_$(subpackage)_FILES))))
-
-comma := ,
-LLDB_COPY_PACKAGE = $(Verb) \
-$(foreach subpackage,$(LLDB_SUBPACKAGES), \
-  init_file="$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py"; \
-  $(MKDIR) "$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))"; \
-  $(foreach file,$(LLDB_PACKAGE_$(subpackage)_FILES), \
-    $(CP) "$(file)" "$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))"; \
-  ) \
-  echo "__all__ = [$(patsubst %,\"%\"$(comma),\
-    $(basename $(notdir $(LLDB_PACKAGE_$(subpackage)_FILES))))]" >$$init_file; \
-  echo "for x in __all__:" >>$$init_file; \
-  echo "    __import__('lldb.$(subst /,.,$(LLDB_PACKAGE_$(subpackage))).'+x)" >>$$init_file; \
-)
-
-LLDB_INSTALL_SUBPACKAGES = $(Verb) \
-$(foreach subpackage,$(LLDB_SUBPACKAGES), \
-  $(MKDIR) $(PYTHON_DEST_DIR)/$(LLDB_PACKAGE_$(subpackage)); \
-  $(DataInstall) $(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py \
-                 $(PYTHON_DEST_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py; \
-) \
-$(foreach file,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES), \
-  $(DataInstall) $(PYTHON_DIR)/$(file) $(PYTHON_DEST_DIR)/$(file); \
-)
-
-ifeq ($(HOST_OS),Darwin)
-# Install the heap_find sources, too.
-LLDB_INSTALL_SUBPACKAGES += $(MKDIR) $(PYTHON_DEST_DIR)/macosx/heap/; \
-$(DataInstall) $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/darwin/heap_find/heap/heap_find.cpp \
-               $(PYTHON_DEST_DIR)/macosx/heap/heap_find.cpp; \
-$(DataInstall) $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/darwin/heap_find/heap/Makefile \
-			   $(PYTHON_DEST_DIR)/macosx/heap/Makefile;
-endif
-
-# We need Swig to process stdint.h, but by default it will not inspect system
-# include directories.  The following should cover the standard locations on
-# most platforms.
-LLDB_SWIG_INCLUDE_DIRS += -I"/usr/local/include"
-LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include"
-
-# On Darwin, stdint.h might only be in the compiler subdirectory. Unfortunately,
-# swig doesn't currently seem able to understand Clang's stdint.h, so we have to
-# point at the GCC one.
-ifeq ($(HOST_OS),Darwin)
-LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include/gcc/darwin/4.2"
-endif
-
-ifndef DISABLE_AUTO_DEPENDENCIES
-
-SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"
-CPP_DEPEND_MOVEFILE = then $(MV) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" "$(PROJ_OBJ_DIR)/$*.cpp.d"; \
-                      else $(RM) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"; exit 1; fi
-
-LLDBWrapPython.cpp: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \
-                    $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py \
-                    $(wildcard $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/interface/*.i)
+LLDBWrapPython.cpp lldb.py: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \
+                            $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py \
+                            $(wildcard $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/interface/*.i)
 	$(Echo) Generating LLDBWrapPython.cpp
-	$(Verb) $(MKDIR) $(PYTHON_DIR)
-	$(Verb) "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/build-swig-wrapper-classes.sh" "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)" "$(TARGET_DIR)" "$(PYTHON_DIR)" "$(PYTHON_DIR)"
-	$(Verb) "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/finish-swig-wrapper-classes.sh" "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)" "$(TARGET_DIR)" "$(PYTHON_DIR)" "$(PYTHON_DIR)"
-#	$(Verb) if swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
-#          -D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)"   \
-#          $(SWIG_DEPEND_OPTIONS) \
-#          -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig" ; \
-#          $(CPP_DEPEND_MOVEFILE)
-#	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \
-#		  "$(PYTHON_DIR)"
-#	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
-#		  "$(PROJ_OBJ_DIR)"
-#	$(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
-#		  $(MV) "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
-#				"$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
-#	$(Verb) $(MV) "$(PYTHON_DIR)/lldb.py" "$(PYTHON_DIR)/__init__.py"
-#	$(Verb) $(CP) "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
-#	$(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so
-#	$(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so
-#	$(LLDB_COPY_PACKAGE)
-
-else
-
-LLDBWrapPython.cpp: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \
-                    $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py
-	$(Echo) Generating LLDBWrapPython.cpp
-	$(Verb) $(MKDIR) $(PYTHON_DIR)
-	$(Verb) swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
-          -D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)"   \
-          -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig"
-	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \
-		  "$(PYTHON_DIR)"
-	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
-		  "$(PROJ_OBJ_DIR)"
-	$(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
-		  $(MV) "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
-				"$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
-	$(Verb) $(MV) "$(PYTHON_DIR)/lldb.py" "$(PYTHON_DIR)/__init__.py"
-	$(Verb) $(CP) "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
-	$(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so
-	$(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so
-	$(LLDB_COPY_PACKAGE)
-
-endif
+	$(Verb) "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/build-swig-wrapper-classes.sh" "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)" "$(PROJ_OBJ_DIR)" "$(PROJ_OBJ_DIR)" "$(PYTHON_DIR)" -m $(if $(DISABLE_AUTO_DEPENDENCIES),,-M)
+	$(Verb) "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/finish-swig-wrapper-classes.sh" "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)" "$(PROJ_OBJ_DIR)" "$(PROJ_OBJ_DIR)" "$(PYTHON_DIR)" -m
 
-install-local:: $(PYTHON_DIR)/__init__.py $(PYTHON_DIR)/embedded_interpreter.py \
-                $(addprefix $(PYTHON_DIR)/,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES))
+install-local:: lldb.py
 	$(Echo) Installing $(BuildMode) LLDB python modules
-	$(Verb) $(MKDIR) $(PYTHON_DEST_DIR)
-	$(Verb) $(DataInstall) $(PYTHON_DIR)/__init__.py $(PYTHON_DEST_DIR)/__init__.py
-	$(Verb) $(DataInstall) $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DEST_DIR)/embedded_interpreter.py
-	$(Verb) $(RM) -f $(PYTHON_DEST_DIR)/_lldb.so
-	$(Verb) $(AliasTool) $(INST_LIBLLDB) $(PYTHON_DEST_DIR)/_lldb.so
-	$(LLDB_INSTALL_SUBPACKAGES)
+	$(Verb) "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/finish-swig-wrapper-classes.sh" "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)" "$(PROJ_OBJ_DIR)" "$(PROJ_OBJ_DIR)" "" -m
 
 clean-local::
-	$(Verb) $(RM) -f LLDBWrapPython.cpp $(PYTHON_DIR)/_lldb.so \
-	          $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DIR)/__init__.py \
-			  $(addprefix $(PYTHON_DIR)/,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES))
+	$(Verb) $(RM) -f LLDBWrapPython.cpp lldb.py

Modified: lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp Tue Nov 13 10:36:41 2012
@@ -2300,7 +2300,7 @@
             if (value_sb == NULL)
                 Py_XDECREF(child_ptr);
             else
-                ret_val = value_sb->get_sp();
+                ret_val = value_sb->GetSP();
         }
         else
         {
@@ -2424,7 +2424,7 @@
         
         // now make sure that Python has "directory" in the search path
         StreamString command_stream;
-        command_stream.Printf("if not (sys.path.__contains__('%s')):\n    sys.path.append('%s');\n\n",
+        command_stream.Printf("if not (sys.path.__contains__('%s')):\n    sys.path.insert(1,'%s');\n\n",
                               directory,
                               directory);
         bool syspath_retval = ExecuteMultipleLines(command_stream.GetData(), ScriptInterpreter::ExecuteScriptOptions().SetEnableIO(false).SetSetLLDBGlobals(false));
@@ -2483,7 +2483,17 @@
                 }
                 else // any other error
                 {
-                    error.SetErrorString("Python raised an error while importing module");
+                    PyObject *type,*value,*traceback;
+                    PyErr_Fetch (&type,&value,&traceback);
+                    
+                    if (value && value != Py_None)
+                        error.SetErrorStringWithFormat("Python error raised while importing module: %s", PyString_AsString(PyObject_Str(value)));
+                    else
+                        error.SetErrorString("Python raised an error while importing module");
+                    
+                    Py_XDECREF(type);
+                    Py_XDECREF(value);
+                    Py_XDECREF(traceback);
                 }
             }
             else // we failed but have no error to explain why

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Tue Nov 13 10:36:41 2012
@@ -264,7 +264,8 @@
             uuid = memory_module_sp->GetUUID();
             uuid_is_valid = uuid.IsValid();
         }
-        if (memory_module_sp->GetObjectFile() 
+        if (memory_module_sp 
+            && memory_module_sp->GetObjectFile() 
             && memory_module_sp->GetObjectFile()->GetType() == ObjectFile::eTypeExecutable
             && memory_module_sp->GetObjectFile()->GetStrata() == ObjectFile::eStrataKernel)
         {
@@ -280,7 +281,7 @@
     {
         if (uuid_is_valid)
         {
-            ModuleList &target_images = target.GetImages();
+            const ModuleList &target_images = target.GetImages();
             module_sp = target_images.FindModule(uuid);
 
             if (!module_sp)
@@ -668,10 +669,7 @@
             loaded_module_list.AppendIfNeeded (image_infos[idx].module_sp);
     }
     
-    if (loaded_module_list.GetSize() > 0)
-    {
-        m_process->GetTarget().ModulesDidLoad (loaded_module_list);
-    }
+    m_process->GetTarget().ModulesDidLoad (loaded_module_list);
     return true;
 }
 

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Nov 13 10:36:41 2012
@@ -287,7 +287,9 @@
 {
     if (did_create_ptr)
         *did_create_ptr = false;
-    ModuleList &target_images = m_process->GetTarget().GetImages();
+    
+    
+    const ModuleList &target_images = m_process->GetTarget().GetImages();
     ModuleSpec module_spec (image_info.file_spec, image_info.GetArchitecture ());
     module_spec.GetUUID() = image_info.uuid;
     ModuleSP module_sp (target_images.FindFirstModule (module_spec));
@@ -816,7 +818,7 @@
                     Section *commpage_section = sections->FindSectionByName(commpage_dbstr).get();
                     if (commpage_section)
                     {
-                        ModuleList& target_images = m_process->GetTarget().GetImages();
+                        const ModuleList& target_images = m_process->GetTarget().GetImages();
                         ModuleSpec module_spec (objfile->GetFileSpec(), image_infos[idx].GetArchitecture ());
                         module_spec.GetObjectName() = commpage_dbstr;
                         ModuleSP commpage_image_module_sp(target_images.FindFirstModule (module_spec));
@@ -966,7 +968,7 @@
             log->PutCString("Unloaded:");
             unloaded_module_list.LogUUIDAndPaths (log, "DynamicLoaderMacOSXDYLD::ModulesDidUnload");
         }
-        m_process->GetTarget().ModulesDidUnload (unloaded_module_list);
+        m_process->GetTarget().GetImages().Remove (unloaded_module_list);
     }
     m_dyld_image_infos_stop_id = m_process->GetStopID();
     return true;
@@ -1060,7 +1062,7 @@
         // to an equivalent version.  We don't want it to stay in the target's module list or it will confuse
         // us, so unload it here.
         Target &target = m_process->GetTarget();
-        ModuleList &target_modules = target.GetImages();
+        const ModuleList &target_modules = target.GetImages();
         ModuleList not_loaded_modules;
         Mutex::Locker modules_locker(target_modules.GetMutex());
         
@@ -1082,7 +1084,7 @@
         
         if (not_loaded_modules.GetSize() != 0)
         {
-            target.ModulesDidUnload(not_loaded_modules);
+            target.GetImages().Remove(not_loaded_modules);
         }
 
         return true;
@@ -1586,7 +1588,7 @@
             {
                 SymbolContextList target_symbols;
                 TargetSP target_sp (thread.CalculateTarget());
-                ModuleList &images = target_sp->GetImages();
+                const ModuleList &images = target_sp->GetImages();
                 
                 images.FindSymbolsWithNameAndType(trampoline_name, eSymbolTypeCode, target_symbols);
 

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Tue Nov 13 10:36:41 2012
@@ -271,9 +271,8 @@
             FileSpec file(I->path.c_str(), true);
             ModuleSP module_sp = LoadModuleAtAddress(file, I->base_addr);
             if (module_sp.get())
-                new_modules.Append(module_sp);
+                loaded_modules.AppendIfNeeded(module_sp);
         }
-        m_process->GetTarget().ModulesDidLoad(new_modules);
     }
     
     if (m_rendezvous.ModulesDidUnload())
@@ -290,7 +289,7 @@
             if (module_sp.get())
                 old_modules.Append(module_sp);
         }
-        m_process->GetTarget().ModulesDidUnload(old_modules);
+        loaded_modules.Remove(old_modules);
     }
 }
 
@@ -312,7 +311,7 @@
 
     SymbolContextList target_symbols;
     Target &target = thread.GetProcess()->GetTarget();
-    ModuleList &images = target.GetImages();
+    const ModuleList &images = target.GetImages();
 
     images.FindSymbolsWithNameAndType(sym_name, eSymbolTypeCode, target_symbols);
     size_t num_targets = target_symbols.GetSize();

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp Tue Nov 13 10:36:41 2012
@@ -95,7 +95,7 @@
 void
 DynamicLoaderStatic::LoadAllImagesAtFileAddresses ()
 {
-    ModuleList &module_list = m_process->GetTarget().GetImages();
+    const ModuleList &module_list = m_process->GetTarget().GetImages();
     
     ModuleList loaded_module_list;
 
@@ -143,8 +143,7 @@
         }
     }
 
-    if (loaded_module_list.GetSize())
-        m_process->GetTarget().ModulesDidLoad (loaded_module_list);
+    m_process->GetTarget().ModulesDidLoad (loaded_module_list);
 }
 
 ThreadPlanSP

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Tue Nov 13 10:36:41 2012
@@ -178,7 +178,7 @@
     Process *process = GetProcess();
     if (process)
     {
-        ModuleList& modules = process->GetTarget().GetImages();
+        const ModuleList& modules = process->GetTarget().GetImages();
         for (uint32_t idx = 0; idx < modules.GetSize(); idx++)
         {
             module_sp = modules.GetModuleAtIndex(idx);
@@ -197,7 +197,7 @@
 {
     if (!m_PrintForDebugger_addr.get())
     {
-        ModuleList &modules = m_process->GetTarget().GetImages();
+        const ModuleList &modules = m_process->GetTarget().GetImages();
         
         SymbolContextList contexts;
         SymbolContext context;
@@ -289,7 +289,7 @@
         return eObjC_VersionUnknown;
         
     Target &target = process->GetTarget();
-    ModuleList &target_modules = target.GetImages();
+    const ModuleList &target_modules = target.GetImages();
     Mutex::Locker modules_locker(target_modules.GetMutex());
     
     size_t num_images = target_modules.GetSize();

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Tue Nov 13 10:36:41 2012
@@ -1618,7 +1618,7 @@
     {
         if (!target_sp)
             return eLazyBoolCalculate;
-        ModuleList& modules = target_sp->GetImages();
+        const ModuleList& modules = target_sp->GetImages();
         for (uint32_t idx = 0; idx < modules.GetSize(); idx++)
         {
             lldb::ModuleSP module_sp = modules.GetModuleAtIndex(idx);

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Tue Nov 13 10:36:41 2012
@@ -334,7 +334,7 @@
         return true;
     Target &target = m_process_sp->GetTarget();
     
-    ModuleList &target_modules = target.GetImages();
+    const ModuleList &target_modules = target.GetImages();
     Mutex::Locker modules_locker(target_modules.GetMutex());
     size_t num_modules = target_modules.GetSize();
     if (!m_objc_module_sp)

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp Tue Nov 13 10:36:41 2012
@@ -524,6 +524,9 @@
         
         clang::ObjCMethodDecl *method_decl = method_type.BuildMethod (interface_decl, name, true);
         
+        if (log)
+            log->Printf("[  AOTV::FD] Instance method [%s] [%s]", name, types);
+        
         if (method_decl)
             interface_decl->addDecl(method_decl);
     };
@@ -534,10 +537,21 @@
         
         clang::ObjCMethodDecl *method_decl = method_type.BuildMethod (interface_decl, name, false);
         
+        if (log)
+            log->Printf("[  AOTV::FD] Class method [%s] [%s]", name, types);
+        
         if (method_decl)
             interface_decl->addDecl(method_decl);
     };
     
+    if (log)
+    {
+        ASTDumper method_dumper ((clang::Decl*)interface_decl);
+        
+        log->Printf("[AppleObjCTypeVendor::FinishDecl] Finishing Objective-C interface for %s", descriptor->GetClassName().AsCString());
+    }
+    
+    
     if (!descriptor->Describe(superclass_func, instance_method_func, class_method_func))
         return false;
     
@@ -661,8 +675,6 @@
                         current_id,
                         dumper.GetCString(),
                         (uint64_t)isa);
-            
-            break;
         }
         
         types.push_back(ClangASTType(ast_ctx, new_iface_type.getAsOpaquePtr()));

Modified: lldb/branches/windows/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp (original)
+++ lldb/branches/windows/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp Tue Nov 13 10:36:41 2012
@@ -203,11 +203,12 @@
             arch = module_sp->GetArchitecture();
             
         ArchSpec curr_arch;
+        // First, try to find an exact match for the Arch of the Target.
         for (arch_idx = 0; arch_idx < m_header.nfat_arch; ++arch_idx)
         {
             if (GetArchitectureAtIndex (arch_idx, curr_arch))
             {
-                if (arch == curr_arch)
+                if (arch.IsExactMatch(curr_arch))
                 {
                     return ObjectFile::FindPlugin (module_sp, 
                                                    file, 
@@ -217,6 +218,23 @@
                 }
             }
         }
+
+        // Failing an exact match, try to find a compatible Arch of the Target.
+        for (arch_idx = 0; arch_idx < m_header.nfat_arch; ++arch_idx)
+        {
+            if (GetArchitectureAtIndex (arch_idx, curr_arch))
+            {
+                if (arch.IsCompatibleMatch(curr_arch))
+                {
+                    return ObjectFile::FindPlugin (module_sp, 
+                                                   file, 
+                                                   m_offset + m_fat_archs[arch_idx].offset, 
+                                                   m_fat_archs[arch_idx].size,
+                                                   m_data.GetSharedDataBuffer());
+                }
+            }
+        }
+
     }
     return ObjectFileSP();
 }

Modified: lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Nov 13 10:36:41 2012
@@ -964,7 +964,7 @@
     reloc_info_fn reloc_type;
     reloc_info_fn reloc_symbol;
 
-    if (hdr->Is32Bit() == 4)
+    if (hdr->Is32Bit())
     {
         reloc_type = ELFRelocation::RelocType32;
         reloc_symbol = ELFRelocation::RelocSymbol32;

Modified: lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Tue Nov 13 10:36:41 2012
@@ -227,7 +227,7 @@
                                                  NULL,
                                                  NULL);
 
-            if (exe_module_sp->GetObjectFile() == NULL)
+            if (!exe_module_sp || exe_module_sp->GetObjectFile() == NULL)
             {
                 exe_module_sp.reset();
                 error.SetErrorStringWithFormat ("'%s%s%s' doesn't contain the architecture %s",

Modified: lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Tue Nov 13 10:36:41 2012
@@ -18,6 +18,7 @@
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
+#include "lldb/Core/Timer.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/Symbols.h"
 #include "lldb/Symbol/ObjectFile.h"
@@ -47,6 +48,61 @@
 {
 }
 
+FileSpec
+PlatformDarwin::LocateExecutableScriptingResource (const ModuleSpec &module_spec)
+{
+    const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
+    const ArchSpec *arch = module_spec.GetArchitecturePtr();
+    const UUID *uuid = module_spec.GetUUIDPtr();
+    
+    const char* module_directory = exec_fspec->GetDirectory().GetCString();
+    const char* module_basename = exec_fspec->GetFileNameStrippingExtension().GetCString();
+    
+    if (!module_directory || !module_basename)
+        return FileSpec();
+    
+    Timer scoped_timer (__PRETTY_FUNCTION__,
+                        "LocateExecutableScriptingResource (file = %s, arch = %s, uuid = %p)",
+                        exec_fspec ? exec_fspec->GetFilename().AsCString ("<NULL>") : "<NULL>",
+                        arch ? arch->GetArchitectureName() : "<NULL>",
+                        uuid);
+    
+    
+    FileSpec symbol_fspec (Symbols::LocateExecutableSymbolFile(module_spec));
+    
+    FileSpec script_fspec;
+    
+    StreamString path_string;
+    
+    if (symbol_fspec && symbol_fspec.Exists())
+    {
+        // for OSX we are going to be in .dSYM/Contents/Resources/DWARF/<basename>
+        // let us go to .dSYM/Contents/Resources/Python/<basename>.py and see if the file exists
+        path_string.Printf("%s/../Python/%s.py",symbol_fspec.GetDirectory().AsCString(""),module_basename);
+        script_fspec.SetFile(path_string.GetData(), true);
+        if (!script_fspec.Exists())
+            script_fspec.Clear();
+    }
+    
+    // no symbols or symbols did not have a scripting resource
+    if (!symbol_fspec || !script_fspec)
+    {
+        path_string.Clear();
+        path_string.Printf("%s.framework",module_basename);
+        if (module_directory && strstr(module_directory, path_string.GetData()))
+        {
+            // we are going to be in foo.framework/Versions/X/foo
+            path_string.Clear();
+            // let's go to foo.framework/Versions/X/Resources/Python/foo.py
+            path_string.Printf("%s/Resources/Python/%s.py",module_directory,module_basename);
+            script_fspec.SetFile(path_string.GetData(), true);
+            if (!script_fspec.Exists())
+                script_fspec.Clear();
+        }
+    }
+    
+    return script_fspec;
+}
 
 Error
 PlatformDarwin::ResolveExecutable (const FileSpec &exe_file,

Modified: lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.h Tue Nov 13 10:36:41 2012
@@ -38,6 +38,9 @@
                        const lldb_private::ModuleSpec &sym_spec,
                        lldb_private::FileSpec &sym_file);
 
+    lldb_private::FileSpec
+    LocateExecutableScriptingResource (const lldb_private::ModuleSpec &module_spec);
+    
     virtual lldb_private::Error
     GetSharedModule (const lldb_private::ModuleSpec &module_spec,
                      lldb::ModuleSP &module_sp,

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Nov 13 10:36:41 2012
@@ -858,7 +858,6 @@
     for (size_t idx = 0; idx < num_cmds; idx++)
     {
         StringExtractorGDBRemote response;
-        printf ("Sending command: \\%s.\n", GetExtraStartupCommands().GetArgumentAtIndex(idx));
         m_gdb_comm.SendPacketAndWaitForResponse (GetExtraStartupCommands().GetArgumentAtIndex(idx), response, false);
     }
     return error;
@@ -2968,8 +2967,8 @@
         struct dispatch_queue_offsets_s
         {
             uint16_t dqo_version;
-            uint16_t dqo_label;
-            uint16_t dqo_label_size;
+            uint16_t dqo_label;      // in version 1-3, offset to string; in version 4+, offset to a pointer to a string
+            uint16_t dqo_label_size; // in version 1-3, length of string; in version 4+, size of a (void*) in this process
         } dispatch_queue_offsets;
 
 
@@ -2983,11 +2982,28 @@
                 {
                     data_offset = 0;
                     lldb::addr_t queue_addr = data.GetAddress(&data_offset);
-                    lldb::addr_t label_addr = queue_addr + dispatch_queue_offsets.dqo_label;
-                    dispatch_queue_name.resize(dispatch_queue_offsets.dqo_label_size, '\0');
-                    size_t bytes_read = ReadMemory (label_addr, &dispatch_queue_name[0], dispatch_queue_offsets.dqo_label_size, error);
-                    if (bytes_read < dispatch_queue_offsets.dqo_label_size)
-                        dispatch_queue_name.erase (bytes_read);
+                    if (dispatch_queue_offsets.dqo_version >= 4)
+                    {
+                        // libdispatch versions 4+, pointer to dispatch name is in the 
+                        // queue structure.
+                        lldb::addr_t pointer_to_label_address = queue_addr + dispatch_queue_offsets.dqo_label;
+                        if (ReadMemory (pointer_to_label_address, &memory_buffer, data.GetAddressByteSize(), error) == data.GetAddressByteSize())
+                        {
+                            data_offset = 0;
+                            lldb::addr_t label_addr = data.GetAddress(&data_offset);
+                            ReadCStringFromMemory (label_addr, dispatch_queue_name, error);
+                        }
+                    }
+                    else
+                    {
+                        // libdispatch versions 1-3, dispatch name is a fixed width char array
+                        // in the queue structure.
+                        lldb::addr_t label_addr = queue_addr + dispatch_queue_offsets.dqo_label;
+                        dispatch_queue_name.resize(dispatch_queue_offsets.dqo_label_size, '\0');
+                        size_t bytes_read = ReadMemory (label_addr, &dispatch_queue_name[0], dispatch_queue_offsets.dqo_label_size, error);
+                        if (bytes_read < dispatch_queue_offsets.dqo_label_size)
+                            dispatch_queue_name.erase (bytes_read);
+                    }
                 }
             }
         }

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp Tue Nov 13 10:36:41 2012
@@ -809,8 +809,8 @@
             // field in the header, plus the value of the line_range field,
             // minus 1 (line base + line range - 1). If the desired line
             // increment is greater than the maximum line increment, a standard
-            // opcode must be used instead of a special opcode. The “address
-            // advance” is calculated by dividing the desired address increment
+            // opcode must be used instead of a special opcode. The "address
+            // advance" is calculated by dividing the desired address increment
             // by the minimum_instruction_length field from the header. The
             // special opcode is then calculated using the following formula:
             //

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Nov 13 10:36:41 2012
@@ -961,19 +961,21 @@
 {
     assert (sc.comp_unit);
     DWARFCompileUnit* dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
-    assert (dwarf_cu);
-    const DWARFDebugInfoEntry * cu_die = dwarf_cu->GetCompileUnitDIEOnly();
-
-    if (cu_die)
+    if (dwarf_cu)
     {
-        const char * cu_comp_dir = cu_die->GetAttributeValueAsString(this, dwarf_cu, DW_AT_comp_dir, NULL);
-        dw_offset_t stmt_list = cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_stmt_list, DW_INVALID_OFFSET);
+        const DWARFDebugInfoEntry * cu_die = dwarf_cu->GetCompileUnitDIEOnly();
+
+        if (cu_die)
+        {
+            const char * cu_comp_dir = cu_die->GetAttributeValueAsString(this, dwarf_cu, DW_AT_comp_dir, NULL);
+            dw_offset_t stmt_list = cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_stmt_list, DW_INVALID_OFFSET);
 
-        // All file indexes in DWARF are one based and a file of index zero is
-        // supposed to be the compile unit itself.
-        support_files.Append (*sc.comp_unit);
+            // All file indexes in DWARF are one based and a file of index zero is
+            // supposed to be the compile unit itself.
+            support_files.Append (*sc.comp_unit);
 
-        return DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(), get_debug_line_data(), cu_comp_dir, stmt_list, support_files);
+            return DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(), get_debug_line_data(), cu_comp_dir, stmt_list, support_files);
+        }
     }
     return false;
 }
@@ -1502,6 +1504,11 @@
     
     DelayedAddObjCClassProperty (const DelayedAddObjCClassProperty &rhs)
     {
+      *this = rhs;
+    }
+
+    DelayedAddObjCClassProperty& operator= (const DelayedAddObjCClassProperty &rhs)
+    {
         m_ast                  = rhs.m_ast;
         m_class_opaque_type    = rhs.m_class_opaque_type;
         m_property_name        = rhs.m_property_name;
@@ -1516,7 +1523,7 @@
             m_metadata_ap.reset (new ClangASTMetadata());
             *(m_metadata_ap.get()) = *(rhs.m_metadata_ap.get());
         }
-        
+        return *this;
     }
     
     bool Finalize() const
@@ -1554,6 +1561,7 @@
     std::vector<clang::CXXBaseSpecifier *>& base_classes,
     std::vector<int>& member_accessibilities,
     DWARFDIECollection& member_function_dies,
+    BitfieldMap &bitfield_map,
     DelayedPropertyList& delayed_properties,
     AccessType& default_accessibility,
     bool &is_a_class,
@@ -1757,7 +1765,83 @@
                                     accessibility = default_accessibility;
                                 member_accessibilities.push_back(accessibility);
 
-                                field_decl = GetClangASTContext().AddFieldToRecordType (class_clang_type, 
+                                // Code to detect unnamed bitifields
+                                if (bit_size > 0 && member_byte_offset != UINT32_MAX)
+                                {
+                                    // Objective C has invalid DW_AT_bit_offset values so we can't use them to detect
+                                    // unnamed bitfields. Once clang is fixed we will enable unnamed bitfields
+                                    // in ObjC classes (<rdar://problem/12636970>)
+                                    
+                                    if (!(class_language == eLanguageTypeObjC || class_language == eLanguageTypeObjC_plus_plus))
+                                    {
+                                        // We have a bitfield, we need to watch out for
+                                        // unnamed bitfields that we need to insert if
+                                        // there is a gap in the bytes as many compilers
+                                        // doesn't emit DWARF DW_TAG_member tags for
+                                        // unnammed bitfields.
+                                        BitfieldMap::iterator bit_pos = bitfield_map.find(member_byte_offset);
+                                        uint32_t unnamed_bit_size = 0;
+                                        uint32_t unnamed_bit_offset = 0;
+                                        if (bit_pos == bitfield_map.end())
+                                        {
+                                            // First bitfield in an integral type.
+                                            
+                                            // We might need to insert a leading unnamed bitfield
+                                            if (bit_offset < byte_size * 8)
+                                            {
+                                                unnamed_bit_size = byte_size * 8 - (bit_size + bit_offset);
+                                                unnamed_bit_offset = byte_size * 8 - unnamed_bit_size;
+                                            }
+                                            
+                                            // Now put the current bitfield info into the map
+                                            bitfield_map[member_byte_offset].bit_size = bit_size;
+                                            bitfield_map[member_byte_offset].bit_offset = bit_offset;
+                                        }
+                                        else
+                                        {
+                                            // Subsequent bitfield in an integral type.
+
+                                            // We have a bitfield that isn't the first for this
+                                            // integral type, check to make sure there aren't any
+                                            // gaps.
+                                            assert (bit_pos->second.bit_size > 0);
+                                            if (bit_offset < bit_pos->second.bit_offset)
+                                            {
+                                                unnamed_bit_size = bit_pos->second.bit_offset - (bit_size + bit_offset);
+                                                unnamed_bit_offset = bit_pos->second.bit_offset - unnamed_bit_size;
+                                            }
+
+                                            // Now put the current bitfield info into the map
+                                            bit_pos->second.bit_size = bit_size;
+                                            bit_pos->second.bit_offset = bit_offset;
+                                        }
+                                        
+                                        if (unnamed_bit_size > 0)
+                                        {
+                                            clang::FieldDecl *unnamed_bitfield_decl = GetClangASTContext().AddFieldToRecordType (class_clang_type,
+                                                                                                                                 NULL,
+                                                                                                                                 member_type->GetClangLayoutType(),
+                                                                                                                                 accessibility,
+                                                                                                                                 unnamed_bit_size);
+                                            uint64_t total_bit_offset = 0;
+                                            
+                                            total_bit_offset += (member_byte_offset == UINT32_MAX ? 0 : (member_byte_offset * 8));
+                                            
+                                            if (GetObjectFile()->GetByteOrder() == eByteOrderLittle)
+                                            {
+                                                total_bit_offset += byte_size * 8;
+                                                total_bit_offset -= (unnamed_bit_offset + unnamed_bit_size);
+                                            }
+                                            else
+                                            {
+                                                total_bit_offset += unnamed_bit_size;
+                                            }
+                                            
+                                            layout_info.field_offsets.insert(std::make_pair(unnamed_bitfield_decl, total_bit_offset));
+                                        }
+                                    }
+                                }
+                                field_decl = GetClangASTContext().AddFieldToRecordType (class_clang_type,
                                                                                         name, 
                                                                                         member_type->GetClangLayoutType(), 
                                                                                         accessibility, 
@@ -1796,13 +1880,11 @@
                                 // AT_bit_size indicates the size of the field in bits.
                                 /////////////////////////////////////////////////////////////
                                                         
-                                ByteOrder object_endian = GetObjectFile()->GetModule()->GetArchitecture().GetDefaultEndian();
-
                                 uint64_t total_bit_offset = 0;
                                 
                                 total_bit_offset += (member_byte_offset == UINT32_MAX ? 0 : (member_byte_offset * 8));
                                 
-                                if (object_endian == eByteOrderLittle)
+                                if (GetObjectFile()->GetByteOrder() == eByteOrderLittle)
                                 {  
                                     total_bit_offset += byte_size * 8;
                                     total_bit_offset -= (bit_offset + bit_size);
@@ -1871,7 +1953,7 @@
                     AccessType accessibility = default_accessibility;
                     bool is_virtual = false;
                     bool is_base_of_class = true;
-                    //off_t member_offset = 0;
+                    off_t member_byte_offset = 0;
                     uint32_t i;
                     for (i=0; i<num_attributes; ++i)
                     {
@@ -1885,31 +1967,31 @@
                             case DW_AT_decl_line:   decl.SetLine(form_value.Unsigned()); break;
                             case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
                             case DW_AT_type:        encoding_uid = form_value.Reference(dwarf_cu); break;
-//                            case DW_AT_data_member_location:
-//                                if (form_value.BlockData())
-//                                {
-//                                    Value initialValue(0);
-//                                    Value memberOffset(0);
-//                                    const DataExtractor& debug_info_data = get_debug_info_data();
-//                                    uint32_t block_length = form_value.Unsigned();
-//                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
-//                                    if (DWARFExpression::Evaluate (NULL, 
-//                                                                   NULL, 
-//                                                                   NULL, 
-//                                                                   NULL, 
-//                                                                   NULL,
-//                                                                   debug_info_data, 
-//                                                                   block_offset, 
-//                                                                   block_length, 
-//                                                                   eRegisterKindDWARF, 
-//                                                                   &initialValue, 
-//                                                                   memberOffset, 
-//                                                                   NULL))
-//                                    {
-//                                        member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
-//                                    }
-//                                }
-//                                break;
+                            case DW_AT_data_member_location:
+                                if (form_value.BlockData())
+                                {
+                                    Value initialValue(0);
+                                    Value memberOffset(0);
+                                    const DataExtractor& debug_info_data = get_debug_info_data();
+                                    uint32_t block_length = form_value.Unsigned();
+                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
+                                    if (DWARFExpression::Evaluate (NULL, 
+                                                                   NULL, 
+                                                                   NULL, 
+                                                                   NULL, 
+                                                                   NULL,
+                                                                   debug_info_data, 
+                                                                   block_offset, 
+                                                                   block_length, 
+                                                                   eRegisterKindDWARF, 
+                                                                   &initialValue, 
+                                                                   memberOffset, 
+                                                                   NULL))
+                                    {
+                                        member_byte_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
+                                    }
+                                }
+                                break;
 
                             case DW_AT_accessibility:
                                 accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned());
@@ -1938,6 +2020,17 @@
                                                                                                accessibility, 
                                                                                                is_virtual, 
                                                                                                is_base_of_class));
+                        
+                        if (is_virtual)
+                        {
+                            layout_info.vbase_offsets.insert(std::make_pair(ClangASTType::GetAsCXXRecordDecl(class_clang_type),
+                                                                            clang::CharUnits::fromQuantity(member_byte_offset)));
+                        }
+                        else
+                        {
+                            layout_info.base_offsets.insert(std::make_pair(ClangASTType::GetAsCXXRecordDecl(class_clang_type),
+                                                                           clang::CharUnits::fromQuantity(member_byte_offset)));
+                        }
                     }
                 }
             }
@@ -2154,8 +2247,8 @@
                     DWARFDIECollection member_function_dies;
                                         
                     DelayedPropertyList delayed_properties;
-                    
-                    ParseChildMembers (sc, 
+                    BitfieldMap bitfield_map;
+                    ParseChildMembers (sc,
                                        dwarf_cu,
                                        die, 
                                        clang_type,
@@ -2163,6 +2256,7 @@
                                        base_classes, 
                                        member_accessibilities,
                                        member_function_dies,
+                                       bitfield_map,
                                        delayed_properties,
                                        default_accessibility, 
                                        is_a_class,
@@ -2276,37 +2370,68 @@
             
             ast.CompleteTagDeclarationDefinition (clang_type);
             
-            if (!layout_info.field_offsets.empty())
+            if (!layout_info.field_offsets.empty() ||
+                !layout_info.base_offsets.empty()  ||
+                !layout_info.vbase_offsets.empty() )
             {
                 if (type)
                     layout_info.bit_size = type->GetByteSize() * 8;
                 if (layout_info.bit_size == 0)
                     layout_info.bit_size = die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_byte_size, 0) * 8;
-                clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type));
-                const clang::RecordType *record_type = clang::dyn_cast<clang::RecordType>(qual_type.getTypePtr());
-                if (record_type)
+                
+                clang::CXXRecordDecl *record_decl = ClangASTType::GetAsCXXRecordDecl(clang_type);
+                if (record_decl)
                 {
-                    const clang::RecordDecl *record_decl = record_type->getDecl();
-                    
                     if (log)
                     {
                         GetObjectFile()->GetModule()->LogMessage (log.get(), 
-                                                                  "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) caching layout info for record_decl = %p, bit_size = %llu, alignment = %llu, field_offsets[%u], base_offsets[0], vbase_offsets[0])",
+                                                                  "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) caching layout info for record_decl = %p, bit_size = %llu, alignment = %llu, field_offsets[%u], base_offsets[%u], vbase_offsets[%u])",
                                                                   clang_type,
                                                                   record_decl,
                                                                   layout_info.bit_size,
                                                                   layout_info.alignment,
-                                                                  (uint32_t)layout_info.field_offsets.size());
+                                                                  (uint32_t)layout_info.field_offsets.size(),
+                                                                  (uint32_t)layout_info.base_offsets.size(),
+                                                                  (uint32_t)layout_info.vbase_offsets.size());
                         
+                        uint32_t idx;
+                        {
                         llvm::DenseMap <const clang::FieldDecl *, uint64_t>::const_iterator pos, end = layout_info.field_offsets.end();
-                        for (pos = layout_info.field_offsets.begin(); pos != end; ++pos)
+                        for (idx = 0, pos = layout_info.field_offsets.begin(); pos != end; ++pos, ++idx)
                         {
                             GetObjectFile()->GetModule()->LogMessage (log.get(), 
-                                                                      "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) field = { bit_offset=%u, name='%s' }",
+                                                                      "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) field[%u] = { bit_offset=%u, name='%s' }",
                                                                       clang_type,
+                                                                      idx,
                                                                       (uint32_t)pos->second,
                                                                       pos->first->getNameAsString().c_str());
                         }
+                        }
+                        
+                        {
+                        llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits>::const_iterator base_pos, base_end = layout_info.base_offsets.end();
+                        for (idx = 0, base_pos = layout_info.base_offsets.begin(); base_pos != base_end; ++base_pos, ++idx)
+                        {
+                            GetObjectFile()->GetModule()->LogMessage (log.get(),
+                                                                      "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) base[%u] = { byte_offset=%u, name='%s' }",
+                                                                      clang_type,
+                                                                      idx,
+                                                                      (uint32_t)base_pos->second.getQuantity(),
+                                                                      base_pos->first->getNameAsString().c_str());
+                        }
+                        }
+                        {
+                        llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits>::const_iterator vbase_pos, vbase_end = layout_info.vbase_offsets.end();
+                        for (idx = 0, vbase_pos = layout_info.vbase_offsets.begin(); vbase_pos != vbase_end; ++vbase_pos, ++idx)
+                        {
+                            GetObjectFile()->GetModule()->LogMessage (log.get(),
+                                                                      "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) vbase[%u] = { byte_offset=%u, name='%s' }",
+                                                                      clang_type,
+                                                                      idx,
+                                                                      (uint32_t)vbase_pos->second.getQuantity(),
+                                                                      vbase_pos->first->getNameAsString().c_str());
+                        }
+                        }
                     }
                     m_record_decl_to_layout_map.insert(std::make_pair(record_decl, layout_info));
                 }
@@ -4952,42 +5077,58 @@
     const DWARFDebugInfoEntry *dst_die;
     UniqueCStringMap<const DWARFDebugInfoEntry *> src_name_to_die;
     UniqueCStringMap<const DWARFDebugInfoEntry *> dst_name_to_die;
+    UniqueCStringMap<const DWARFDebugInfoEntry *> src_name_to_die_artificial;
+    UniqueCStringMap<const DWARFDebugInfoEntry *> dst_name_to_die_artificial;
     for (src_die = src_class_die->GetFirstChild(); src_die != NULL; src_die = src_die->GetSibling())
     {
         if (src_die->Tag() == DW_TAG_subprogram)
         {
-            const char *src_name = src_die->GetMangledName (this, src_cu);
-            if (src_name)
-                src_name_to_die.Append(ConstString(src_name).GetCString(), src_die);
+            // Make sure this is a declaration and not a concrete instance by looking
+            // for DW_AT_declaration set to 1. Sometimes concrete function instances
+            // are placed inside the class definitions and shouldn't be included in
+            // the list of things are are tracking here.
+            if (src_die->GetAttributeValueAsUnsigned(this, src_cu, DW_AT_declaration, 0) == 1)
+            {
+                const char *src_name = src_die->GetMangledName (this, src_cu);
+                if (src_name)
+                {
+                    ConstString src_const_name(src_name);
+                    if (src_die->GetAttributeValueAsUnsigned(this, src_cu, DW_AT_artificial, 0))
+                        src_name_to_die_artificial.Append(src_const_name.GetCString(), src_die);
+                    else
+                        src_name_to_die.Append(src_const_name.GetCString(), src_die);
+                }
+            }
         }
     }
     for (dst_die = dst_class_die->GetFirstChild(); dst_die != NULL; dst_die = dst_die->GetSibling())
     {
         if (dst_die->Tag() == DW_TAG_subprogram)
         {
-            const char *dst_name = dst_die->GetMangledName (this, dst_cu);
-            if (dst_name)
-                dst_name_to_die.Append(ConstString(dst_name).GetCString(), dst_die);
+            // Make sure this is a declaration and not a concrete instance by looking
+            // for DW_AT_declaration set to 1. Sometimes concrete function instances
+            // are placed inside the class definitions and shouldn't be included in
+            // the list of things are are tracking here.
+            if (dst_die->GetAttributeValueAsUnsigned(this, dst_cu, DW_AT_declaration, 0) == 1)
+            {
+                const char *dst_name = dst_die->GetMangledName (this, dst_cu);
+                if (dst_name)
+                {
+                    ConstString dst_const_name(dst_name);
+                    if (dst_die->GetAttributeValueAsUnsigned(this, dst_cu, DW_AT_artificial, 0))
+                        dst_name_to_die_artificial.Append(dst_const_name.GetCString(), dst_die);
+                    else
+                        dst_name_to_die.Append(dst_const_name.GetCString(), dst_die);
+                }
+            }
         }
     }
     const uint32_t src_size = src_name_to_die.GetSize ();
     const uint32_t dst_size = dst_name_to_die.GetSize ();
     LogSP log (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO | DWARF_LOG_TYPE_COMPLETION));
     
-    if (src_size && dst_size)
+    if (src_size == dst_size)
     {
-        if (src_size != dst_size)
-        {
-            if (log)
-                log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but they didn't have the same size (src=%d, dst=%d)",
-                            src_class_die->GetOffset(),
-                            dst_class_die->GetOffset(),
-                            src_size,
-                            dst_size);
-            
-            return false;
-        }
-            
         uint32_t idx;
         for (idx = 0; idx < src_size; ++idx)
         {
@@ -5035,40 +5176,94 @@
             if (src_decl_ctx)
             {
                 if (log)
-                    log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x\n", src_decl_ctx, src_die->GetOffset(), dst_die->GetOffset());
+                    log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", src_decl_ctx, src_die->GetOffset(), dst_die->GetOffset());
                 LinkDeclContextToDIE (src_decl_ctx, dst_die);
             }
             else
             {
                 if (log)
-                    log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found\n", src_die->GetOffset(), dst_die->GetOffset());
+                    log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found", src_die->GetOffset(), dst_die->GetOffset());
             }
             
             Type *src_child_type = m_die_to_type[src_die];
             if (src_child_type)
             {
                 if (log)
-                    log->Printf ("uniquing type %p (uid=0x%llx) from 0x%8.8x for 0x%8.8x\n", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
+                    log->Printf ("uniquing type %p (uid=0x%llx) from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
                 m_die_to_type[dst_die] = src_child_type;
             }
             else
             {
                 if (log)
-                    log->Printf ("warning: tried to unique lldb_private::Type from 0x%8.8x for 0x%8.8x, but none was found\n", src_die->GetOffset(), dst_die->GetOffset());
+                    log->Printf ("warning: tried to unique lldb_private::Type from 0x%8.8x for 0x%8.8x, but none was found", src_die->GetOffset(), dst_die->GetOffset());
+            }
+        }
+        
+        const uint32_t src_size_artificial = src_name_to_die_artificial.GetSize ();
+        
+        UniqueCStringMap<const DWARFDebugInfoEntry *> name_to_die_artificial_not_in_src;
+
+        for (idx = 0; idx < src_size_artificial; ++idx)
+        {
+            const char *src_name_artificial = src_name_to_die_artificial.GetCStringAtIndex(idx);
+            src_die = src_name_to_die_artificial.GetValueAtIndexUnchecked (idx);
+            dst_die = dst_name_to_die_artificial.Find(src_name_artificial, NULL);
+            
+            if (dst_die)
+            {
+                // Erase this entry from the map
+                const size_t num_removed = dst_name_to_die_artificial.Erase (src_name_artificial);
+                assert (num_removed == 0 || num_removed == 1); // REMOVE THIS
+                // Both classes have the artificial types, link them
+                clang::DeclContext *src_decl_ctx = m_die_to_decl_ctx[src_die];
+                if (src_decl_ctx)
+                {
+                    if (log)
+                        log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", src_decl_ctx, src_die->GetOffset(), dst_die->GetOffset());
+                    LinkDeclContextToDIE (src_decl_ctx, dst_die);
+                }
+                else
+                {
+                    if (log)
+                        log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found", src_die->GetOffset(), dst_die->GetOffset());
+                }
+                
+                Type *src_child_type = m_die_to_type[src_die];
+                if (src_child_type)
+                {
+                    if (log)
+                        log->Printf ("uniquing type %p (uid=0x%llx) from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
+                    m_die_to_type[dst_die] = src_child_type;
+                }
+                else
+                {
+                    if (log)
+                        log->Printf ("warning: tried to unique lldb_private::Type from 0x%8.8x for 0x%8.8x, but none was found", src_die->GetOffset(), dst_die->GetOffset());
+                }
+            }
+        }
+        const uint32_t dst_size_artificial = dst_name_to_die_artificial.GetSize ();
+
+        if (dst_size_artificial)
+        {
+            for (idx = 0; idx < dst_size_artificial; ++idx)
+            {
+                const char *dst_name_artificial = dst_name_to_die_artificial.GetCStringAtIndex(idx);
+                dst_die = dst_name_to_die_artificial.GetValueAtIndexUnchecked (idx);
+                if (log)
+                    log->Printf ("warning: need to create artificial method for 0x%8.8x for method '%s'", dst_die->GetOffset(), dst_name_artificial);
             }
         }
         return true;
     }
-    else
+    else if (src_size != 0 && dst_size != 0)
     {
         if (log)
-            log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but 0x%8.8x has %u methods and 0x%8.8x has %u",
+            log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but they didn't have the same size (src=%d, dst=%d)",
                         src_class_die->GetOffset(),
                         dst_class_die->GetOffset(),
-                        src_die->GetOffset(),
                         src_size,
-                        dst_die->GetOffset(),
-                        dst_size);
+                        dst_size);        
     }
     return false;
 }
@@ -6375,7 +6570,10 @@
                     break;
                 }
             default:
-                assert(false && "Unhandled type tag!");
+                GetObjectFile()->GetModule()->ReportError ("{0x%8.8x}: unhandled type tag 0x%4.4x (%s), please file a bug and attach the file at the start of this error message",
+                                                           die->GetOffset(),
+                                                           tag,
+                                                           DW_TAG_value_to_name(tag));
                 break;
             }
 
@@ -7257,6 +7455,8 @@
         bit_size = pos->second.bit_size;
         alignment = pos->second.alignment;
         field_offsets.swap(pos->second.field_offsets);
+        base_offsets.swap (pos->second.base_offsets);
+        vbase_offsets.swap (pos->second.vbase_offsets);
         m_record_decl_to_layout_map.erase(pos);
         success = true;
     }

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Tue Nov 13 10:36:41 2012
@@ -59,6 +59,14 @@
 class DWARFFormValue;
 class SymbolFileDWARFDebugMap;
 
+struct BitfieldInfo
+{
+    uint32_t bit_size;
+    uint32_t bit_offset;
+};
+
+typedef std::map<int64_t, BitfieldInfo> BitfieldMap;
+
 class SymbolFileDWARF : public lldb_private::SymbolFile, public lldb_private::UserID
 {
 public:
@@ -166,16 +174,16 @@
         LayoutInfo () :
             bit_size(0),
             alignment(0),
-            field_offsets()//,
-            //base_offsets(), // We don't need to fill in the base classes, this can be done automatically
-            //vbase_offsets() // We don't need to fill in the virtual base classes, this can be done automatically
+            field_offsets(),
+            base_offsets(),
+            vbase_offsets()
         {
         }
         uint64_t bit_size;
         uint64_t alignment;
         llvm::DenseMap <const clang::FieldDecl *, uint64_t> field_offsets;
-//        llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> base_offsets;
-//        llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> vbase_offsets;
+        llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> base_offsets;
+        llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> vbase_offsets;
     };
     //------------------------------------------------------------------
     // PluginInterface protocol
@@ -345,6 +353,7 @@
                                 std::vector<clang::CXXBaseSpecifier *>& base_classes,
                                 std::vector<int>& member_accessibilities,
                                 DWARFDIECollection& member_function_dies,
+                                BitfieldMap &bitfield_map,
                                 DelayedPropertyList& delayed_properties,
                                 lldb::AccessType &default_accessibility,
                                 bool &is_a_class,

Modified: lldb/branches/windows/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/ClangASTContext.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/branches/windows/source/Symbol/ClangASTContext.cpp Tue Nov 13 10:36:41 2012
@@ -258,7 +258,7 @@
     }
 
     const LangStandard &Std = LangStandard::getLangStandardForKind(LangStd);
-    Opts.BCPLComment = Std.hasBCPLComments();
+    Opts.LineComment = Std.hasLineComments();
     Opts.C99 = Std.isC99();
     Opts.CPlusPlus = Std.isCPlusPlus();
     Opts.CPlusPlus0x = Std.isCPlusPlus0x();
@@ -2367,7 +2367,7 @@
                                               class_interface_decl,
                                               SourceLocation(),
                                               SourceLocation(),
-                                              &identifier_table->get(name), // Identifier
+                                              name ? &identifier_table->get(name) : NULL, // Identifier
                                               QualType::getFromOpaquePtr(ivar_opaque_type), // Field type
                                               NULL, // TypeSourceInfo *
                                               ConvertAccessTypeToObjCIvarAccessControl (access),

Modified: lldb/branches/windows/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/ClangASTType.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/ClangASTType.cpp (original)
+++ lldb/branches/windows/source/Symbol/ClangASTType.cpp Tue Nov 13 10:36:41 2012
@@ -1768,6 +1768,13 @@
     return qual_type.getAsOpaquePtr();
 }
 
+clang::CXXRecordDecl *
+ClangASTType::GetAsCXXRecordDecl (lldb::clang_type_t opaque_clang_qual_type)
+{
+    if (opaque_clang_qual_type)
+        return clang::QualType::getFromOpaquePtr(opaque_clang_qual_type)->getAsCXXRecordDecl();
+    return NULL;
+}
 
 bool
 lldb_private::operator == (const lldb_private::ClangASTType &lhs, const lldb_private::ClangASTType &rhs)

Modified: lldb/branches/windows/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/Type.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/Type.cpp (original)
+++ lldb/branches/windows/source/Symbol/Type.cpp Tue Nov 13 10:36:41 2012
@@ -80,7 +80,7 @@
     m_symbol_file (NULL),
     m_context (NULL),
     m_encoding_type (NULL),
-    m_encoding_uid (0),
+    m_encoding_uid (LLDB_INVALID_UID),
     m_encoding_uid_type (eEncodingInvalid),
     m_byte_size (0),
     m_decl (),
@@ -150,7 +150,7 @@
     }
     else if (m_encoding_uid != LLDB_INVALID_UID)
     {
-        s->Printf(", type_uid = 0x%8.8x", m_encoding_uid);
+        s->Printf(", type_uid = 0x%8.8llx", m_encoding_uid);
         switch (m_encoding_uid_type)
         {
         case eEncodingInvalid: break;

Modified: lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp (original)
+++ lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp Tue Nov 13 10:36:41 2012
@@ -75,7 +75,7 @@
             m_complete_class_cache.erase(name);
     }
     
-    ModuleList &modules = m_process->GetTarget().GetImages();
+    const ModuleList &modules = m_process->GetTarget().GetImages();
 
     SymbolContextList sc_list;
     const size_t matching_symbols = modules.FindSymbolsWithNameAndType (name,
@@ -124,17 +124,6 @@
                         incomplete_type_sp = type_sp;
                 }
             }
-           
-            // We didn't find any "real" definitions, so just use any??? Why was
-            // this being done? Prior to this, if there was 1 match only, then it
-            // would always use any objc definition, else we would only accept a
-            // definition if it was the real thing???? Doesn't make sense.
-
-            if (incomplete_type_sp)
-            {
-                m_complete_class_cache[name] = incomplete_type_sp;
-                return incomplete_type_sp;
-            }
         }
     }
     return TypeSP();

Modified: lldb/branches/windows/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Platform.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Platform.cpp (original)
+++ lldb/branches/windows/source/Target/Platform.cpp Tue Nov 13 10:36:41 2012
@@ -89,6 +89,12 @@
     return Error();
 }
 
+FileSpec
+Platform::LocateExecutableScriptingResource (const ModuleSpec &module_spec)
+{
+    return FileSpec();
+}
+
 Error
 Platform::GetSharedModule (const ModuleSpec &module_spec,
                            ModuleSP &module_sp,

Modified: lldb/branches/windows/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Process.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Process.cpp (original)
+++ lldb/branches/windows/source/Target/Process.cpp Tue Nov 13 10:36:41 2012
@@ -2984,7 +2984,7 @@
 
     m_os_ap.reset (OperatingSystem::FindPlugin (this, NULL));
     // Figure out which one is the executable, and set that in our target:
-    ModuleList &target_modules = m_target.GetImages();
+    const ModuleList &target_modules = m_target.GetImages();
     Mutex::Locker modules_locker(target_modules.GetMutex());
     size_t num_modules = target_modules.GetSize();
     ModuleSP new_executable_module_sp;
@@ -3654,7 +3654,11 @@
     while (!exit_now)
     {
         EventSP event_sp;
-        WaitForEventsPrivate (NULL, event_sp, control_only);
+        if (!WaitForEventsPrivate (NULL, event_sp, control_only)) {
+            if (log)
+                log->Printf ("Process::%s (arg = %p, pid = %llu) returned false for WaitForEventsPrivate", __FUNCTION__, this, GetID());
+            break;
+        }
         if (event_sp->BroadcasterIs(&m_private_state_control_broadcaster))
         {
             if (log)

Modified: lldb/branches/windows/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/StopInfo.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/StopInfo.cpp (original)
+++ lldb/branches/windows/source/Target/StopInfo.cpp Tue Nov 13 10:36:41 2012
@@ -174,6 +174,62 @@
         return m_should_stop;
     }
     
+    virtual bool
+    ShouldNotify (Event *event_ptr)
+    {
+        BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByID (m_value));
+        if (bp_site_sp)
+        {
+            bool all_internal = true;
+
+            for (uint32_t i = 0; i < bp_site_sp->GetNumberOfOwners(); i++)
+            {
+                if (!bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint().IsInternal())
+                {
+                    all_internal = false;
+                    break;
+                }
+            }
+            return all_internal == false;
+        }
+        return true;
+    }
+
+    virtual const char *
+    GetDescription ()
+    {
+        if (m_description.empty())
+        {
+            BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByID (m_value));
+            if (bp_site_sp)
+            {
+                StreamString strm;
+                strm.Printf("breakpoint ");
+                bp_site_sp->GetDescription(&strm, eDescriptionLevelBrief);
+                m_description.swap (strm.GetString());
+            }
+            else
+            {
+                StreamString strm;
+                if (m_break_id != LLDB_INVALID_BREAK_ID)
+                {
+                    if (m_was_one_shot)
+                        strm.Printf ("one-shot breakpoint %d", m_break_id);
+                    else
+                        strm.Printf ("breakpoint %d which has been deleted.", m_break_id);
+                }
+                else if (m_address == LLDB_INVALID_ADDRESS)
+                    strm.Printf("breakpoint site %lli which has been deleted - unknown address", m_value);
+                else
+                    strm.Printf("breakpoint site %lli which has been deleted - was at 0x%llx", m_value, m_address);
+                
+                m_description.swap (strm.GetString());
+            }
+        }
+        return m_description.c_str();
+    }
+
+protected:
     bool
     ShouldStop (Event *event_ptr)
     {
@@ -346,61 +402,6 @@
         if (log)
             log->Printf ("Process::%s returning from action with m_should_stop: %d.", __FUNCTION__, m_should_stop);
     }
-        
-    virtual bool
-    ShouldNotify (Event *event_ptr)
-    {
-        BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByID (m_value));
-        if (bp_site_sp)
-        {
-            bool all_internal = true;
-
-            for (uint32_t i = 0; i < bp_site_sp->GetNumberOfOwners(); i++)
-            {
-                if (!bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint().IsInternal())
-                {
-                    all_internal = false;
-                    break;
-                }
-            }
-            return all_internal == false;
-        }
-        return true;
-    }
-
-    virtual const char *
-    GetDescription ()
-    {
-        if (m_description.empty())
-        {
-            BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByID (m_value));
-            if (bp_site_sp)
-            {
-                StreamString strm;
-                strm.Printf("breakpoint ");
-                bp_site_sp->GetDescription(&strm, eDescriptionLevelBrief);
-                m_description.swap (strm.GetString());
-            }
-            else
-            {
-                StreamString strm;
-                if (m_break_id != LLDB_INVALID_BREAK_ID)
-                {
-                    if (m_was_one_shot)
-                        strm.Printf ("one-shot breakpoint %d", m_break_id);
-                    else
-                        strm.Printf ("breakpoint %d which has been deleted.", m_break_id);
-                }
-                else if (m_address == LLDB_INVALID_ADDRESS)
-                    strm.Printf("breakpoint site %lli which has been deleted - unknown address", m_value);
-                else
-                    strm.Printf("breakpoint site %lli which has been deleted - was at 0x%llx", m_value, m_address);
-                
-                m_description.swap (strm.GetString());
-            }
-        }
-        return m_description.c_str();
-    }
 
 private:
     std::string m_description;
@@ -423,6 +424,32 @@
 class StopInfoWatchpoint : public StopInfo
 {
 public:
+    // Make sure watchpoint is properly disabled and subsequently enabled while performing watchpoint actions.
+    class WatchpointSentry {
+    public:
+        WatchpointSentry(Process *p, Watchpoint *w):
+            process(p),
+            watchpoint(w)
+        {
+            if (process && watchpoint)
+            {
+                watchpoint->TurnOnEphemeralMode();
+                process->DisableWatchpoint(watchpoint);
+            }
+        }
+        ~WatchpointSentry()
+        {
+            if (process && watchpoint)
+            {
+                if (!watchpoint->IsDisabledDuringEphemeralMode())
+                    process->EnableWatchpoint(watchpoint);
+                watchpoint->TurnOffEphemeralMode();
+            }
+        }
+    private:
+        Process *process;
+        Watchpoint *watchpoint;
+    };
 
     StopInfoWatchpoint (Thread &thread, break_id_t watch_id) :
         StopInfo(thread, watch_id),
@@ -442,6 +469,19 @@
         return eStopReasonWatchpoint;
     }
 
+    virtual const char *
+    GetDescription ()
+    {
+        if (m_description.empty())
+        {
+            StreamString strm;
+            strm.Printf("watchpoint %lli", m_value);
+            m_description.swap (strm.GetString());
+        }
+        return m_description.c_str();
+    }
+
+protected:
     virtual bool
     ShouldStop (Event *event_ptr)
     {
@@ -478,35 +518,6 @@
         return m_should_stop;
     }
     
-    // Make sure watchpoint is properly disabled and subsequently enabled while performing watchpoint actions.
-    class WatchpointSentry {
-    public:
-        WatchpointSentry(Process *p, Watchpoint *w):
-            process(p),
-            watchpoint(w)
-        {
-            if (process && watchpoint)
-            {
-                watchpoint->TurnOnEphemeralMode();
-                process->DisableWatchpoint(watchpoint);
-            }
-        }
-        ~WatchpointSentry()
-        {
-            if (process && watchpoint)
-            {
-                if (!watchpoint->IsDisabledDuringEphemeralMode())
-                    process->EnableWatchpoint(watchpoint);
-                watchpoint->TurnOffEphemeralMode();
-            }
-        }
-    private:
-        Process *process;
-        Watchpoint *watchpoint;
-    };
-
-    // 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)
     {
@@ -662,18 +673,6 @@
         
     }
         
-    virtual const char *
-    GetDescription ()
-    {
-        if (m_description.empty())
-        {
-            StreamString strm;
-            strm.Printf("watchpoint %lli", m_value);
-            m_description.swap (strm.GetString());
-        }
-        return m_description.c_str();
-    }
-
 private:
     std::string m_description;
     bool m_should_stop;

Modified: lldb/branches/windows/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Target.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Target.cpp (original)
+++ lldb/branches/windows/source/Target/Target.cpp Tue Nov 13 10:36:41 2012
@@ -64,7 +64,7 @@
     m_platform_sp (platform_sp),
     m_mutex (Mutex::eMutexTypeRecursive), 
     m_arch (target_arch),
-    m_images (),
+    m_images (this),
     m_section_load_list (),
     m_breakpoint_list (false),
     m_internal_breakpoint_list (true),
@@ -954,6 +954,18 @@
     return m_images.GetModulePointerAtIndex(0);
 }
 
+static void
+LoadScriptingResourceForModule (const ModuleSP &module_sp, Target *target)
+{
+    Error error;
+    if (module_sp && !module_sp->LoadScriptingResourceInTarget(target, error))
+    {
+        target->GetDebugger().GetOutputStream().Printf("unable to load scripting data for module %s - error reported was %s\n",
+                                                       module_sp->GetFileSpec().GetFileNameStrippingExtension().GetCString(),
+                                                       error.AsCString());
+    }
+}
+
 void
 Target::SetExecutableModule (ModuleSP& executable_sp, bool get_dependent_files)
 {
@@ -1047,16 +1059,31 @@
 }
 
 void
-Target::ModuleAdded (ModuleSP &module_sp)
+Target::WillClearList (const ModuleList& module_list)
+{
+}
+
+void
+Target::ModuleAdded (const ModuleList& module_list, const ModuleSP &module_sp)
 {
     // A module is being added to this target for the first time
-    ModuleList module_list;
-    module_list.Append(module_sp);
-    ModulesDidLoad (module_list);
+    ModuleList my_module_list;
+    my_module_list.Append(module_sp);
+    LoadScriptingResourceForModule(module_sp, this);
+    ModulesDidLoad (my_module_list);
 }
 
 void
-Target::ModuleUpdated (ModuleSP &old_module_sp, ModuleSP &new_module_sp)
+Target::ModuleRemoved (const ModuleList& module_list, const ModuleSP &module_sp)
+{
+    // A module is being added to this target for the first time
+    ModuleList my_module_list;
+    my_module_list.Append(module_sp);
+    ModulesDidUnload (my_module_list);
+}
+
+void
+Target::ModuleUpdated (const ModuleList& module_list, const ModuleSP &old_module_sp, const ModuleSP &new_module_sp)
 {
     // A module is replacing an already added module
     m_breakpoint_list.UpdateBreakpointsWhenModuleIsReplaced(old_module_sp, new_module_sp);
@@ -1065,28 +1092,28 @@
 void
 Target::ModulesDidLoad (ModuleList &module_list)
 {
-    m_breakpoint_list.UpdateBreakpoints (module_list, true);
-    // TODO: make event data that packages up the module_list
-    BroadcastEvent (eBroadcastBitModulesLoaded, NULL);
+    if (module_list.GetSize())
+    {
+        m_breakpoint_list.UpdateBreakpoints (module_list, true);
+        // TODO: make event data that packages up the module_list
+        BroadcastEvent (eBroadcastBitModulesLoaded, NULL);
+    }
 }
 
 void
 Target::ModulesDidUnload (ModuleList &module_list)
 {
-    m_breakpoint_list.UpdateBreakpoints (module_list, false);
-
-    // Remove the images from the target image list
-    m_images.Remove(module_list);
-
-    // TODO: make event data that packages up the module_list
-    BroadcastEvent (eBroadcastBitModulesUnloaded, NULL);
+    if (module_list.GetSize())
+    {
+        m_breakpoint_list.UpdateBreakpoints (module_list, false);
+        // TODO: make event data that packages up the module_list
+        BroadcastEvent (eBroadcastBitModulesUnloaded, NULL);
+    }
 }
 
-
 bool
 Target::ModuleIsExcludedForNonModuleSpecificSearches (const FileSpec &module_file_spec)
 {
-
     if (GetBreakpointsConsultPlatformAvoidList())
     {
         ModuleList matchingModules;
@@ -1456,17 +1483,15 @@
                 }
             }
             
-            m_images.Append (module_sp);
             if (old_module_sp && m_images.GetIndexForModule (old_module_sp.get()) != LLDB_INVALID_INDEX32)
             {
-                ModuleUpdated(old_module_sp, module_sp);
-                m_images.Remove (old_module_sp);
+                m_images.ReplaceModule(old_module_sp, module_sp);
                 Module *old_module_ptr = old_module_sp.get();
                 old_module_sp.reset();
                 ModuleList::RemoveSharedModuleIfOrphaned (old_module_ptr);
             }
             else
-                ModuleAdded(module_sp);
+                m_images.Append(module_sp);
         }
     }
     if (error_ptr)

Modified: lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp Tue Nov 13 10:36:41 2012
@@ -18,7 +18,9 @@
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/Function.h"
+#include "lldb/Symbol/LineTable.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/Target.h"
@@ -173,6 +175,99 @@
             // stub, and then it will be straight-forward to step out.        
             new_plan = m_thread.QueueThreadPlanForStepThrough (m_stack_id, false, stop_others);
         }
+        else
+        {
+            // The current clang (at least through 424) doesn't always get the address range for the 
+            // DW_TAG_inlined_subroutines right, so that when you leave the inlined range the line table says 
+            // you are still in the source file of the inlining function.  This is bad, because now you are missing 
+            // the stack frame for the function containing the inlining, and if you sensibly do "finish" to get
+            // out of this function you will instead exit the containing function.
+            // To work around this, we check whether we are still in the source file we started in, and if not assume
+            // it is an error, and push a plan to get us out of this line and back to the containing file.
+
+            if (m_addr_context.line_entry.IsValid())
+            {
+                SymbolContext sc;
+                StackFrameSP frame_sp = m_thread.GetStackFrameAtIndex(0);
+                sc = frame_sp->GetSymbolContext (eSymbolContextEverything);
+                if (sc.line_entry.IsValid())
+                {
+                    if (sc.line_entry.file != m_addr_context.line_entry.file
+                         && sc.comp_unit == m_addr_context.comp_unit
+                         && sc.function == m_addr_context.function)
+                    {
+                        // Okay, find the next occurance of this file in the line table:
+                        LineTable *line_table = m_addr_context.comp_unit->GetLineTable();
+                        if (line_table)
+                        {
+                            Address cur_address = frame_sp->GetFrameCodeAddress();
+                            uint32_t entry_idx;
+                            LineEntry line_entry;
+                            if (line_table->FindLineEntryByAddress (cur_address, line_entry, &entry_idx))
+                            {
+                                LineEntry next_line_entry;
+                                bool step_past_remaining_inline = false;
+                                if (entry_idx > 0)
+                                {
+                                    // We require the the previous line entry and the current line entry come
+                                    // from the same file.
+                                    // The other requirement is that the previous line table entry be part of an
+                                    // inlined block, we don't want to step past cases where people have inlined
+                                    // some code fragment by using #include <source-fragment.c> directly.
+                                    LineEntry prev_line_entry;
+                                    if (line_table->GetLineEntryAtIndex(entry_idx - 1, prev_line_entry)
+                                        && prev_line_entry.file == line_entry.file)
+                                    {
+                                        SymbolContext prev_sc;
+                                        Address prev_address = prev_line_entry.range.GetBaseAddress();
+                                        prev_address.CalculateSymbolContext(&prev_sc);
+                                        if (prev_sc.block)
+                                        {
+                                            Block *inlined_block = prev_sc.block->GetContainingInlinedBlock();
+                                            if (inlined_block)
+                                            {
+                                                AddressRange inline_range;
+                                                inlined_block->GetRangeContainingAddress(prev_address, inline_range);
+                                                if (!inline_range.ContainsFileAddress(cur_address))
+                                                {
+                                                    
+                                                    step_past_remaining_inline = true;
+                                                }
+                                                
+                                            }
+                                        }
+                                    }
+                                }
+                                
+                                if (step_past_remaining_inline)
+                                {
+                                    uint32_t look_ahead_step = 1;
+                                    while (line_table->GetLineEntryAtIndex(entry_idx + look_ahead_step, next_line_entry))
+                                    {
+                                        // Make sure we haven't wandered out of the function we started from...
+                                        Address next_line_address = next_line_entry.range.GetBaseAddress();
+                                        Function *next_line_function = next_line_address.CalculateSymbolContextFunction();
+                                        if (next_line_function != m_addr_context.function)
+                                            break;
+                                        
+                                        if (next_line_entry.file == m_addr_context.line_entry.file)
+                                        {
+                                            const bool abort_other_plans = false;
+                                            const bool stop_other_threads = false;
+                                            new_plan = m_thread.QueueThreadPlanForRunToAddress(abort_other_plans,
+                                                                                               next_line_address,
+                                                                                               stop_other_threads);
+                                            break;
+                                        }
+                                        look_ahead_step++;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
     }
 
     // If we get to this point, we're not going to use a previously set "next branch" breakpoint, so delete it:

Modified: lldb/branches/windows/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/Makefile (original)
+++ lldb/branches/windows/test/Makefile Tue Nov 13 10:36:41 2012
@@ -31,8 +31,8 @@
 check-local::
 	rm -rf ../test-rdir
 	env PATH="$(ToolDir):$(PATH)" \
-	    PYTHONPATH=$(LibDir)/python \
+	    PYTHONPATH="$(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, False, \"$(LibDir)/..\")" )" \
 	    LLDB_EXEC=$(ToolDir)/lldb \
-		LLDB_BUILD_TYPE=Makefile \
+	    LLDB_BUILD_TYPE=Makefile \
 	    $(SHLIBPATH_VAR)=$(LibDir):$($(SHLIBPATH_VAR)) \
 	     python $(PROJ_SRC_DIR)/dotest.py -i -v -r ../test-rdir

Modified: lldb/branches/windows/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/dotest.py?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/dotest.py (original)
+++ lldb/branches/windows/test/dotest.py Tue Nov 13 10:36:41 2012
@@ -749,6 +749,7 @@
     if lldbExecutablePath:
         if is_exe(lldbExecutablePath):
             lldbExec = lldbExecutablePath
+            lldbHere = lldbExec
         else:
             print lldbExecutablePath + " is not an executable"
             sys.exit(-1)
@@ -790,20 +791,19 @@
             lldbHere = baiExec2
         elif lldbExec:
             lldbHere = lldbExec
-    
-        if lldbHere:
-            os.environ["LLDB_HERE"] = lldbHere
-            os.environ["LLDB_BUILD_DIR"] = os.path.split(lldbHere)[0]
-            if not noHeaders:
-                print "LLDB build dir:", os.environ["LLDB_BUILD_DIR"]
-                os.system('%s -v' % lldbHere)
-    
+
         # One last chance to locate the 'lldb' executable.
         if not lldbExec:
             lldbExec = which('lldb')
             if lldbHere and not lldbExec:
                 lldbExec = lldbHere
-
+    
+    if lldbHere:
+        os.environ["LLDB_HERE"] = lldbHere
+        os.environ["LLDB_BUILD_DIR"] = os.path.split(lldbHere)[0]
+        if not noHeaders:
+            print "LLDB build dir:", os.environ["LLDB_BUILD_DIR"]
+            os.system('%s -v' % lldbHere)
 
     if not lldbExec:
         print "The 'lldb' executable cannot be located.  Some of the tests may not be run as a result."

Modified: lldb/branches/windows/test/expression_command/timeout/TestCallWithTimeout.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/expression_command/timeout/TestCallWithTimeout.py?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/expression_command/timeout/TestCallWithTimeout.py (original)
+++ lldb/branches/windows/test/expression_command/timeout/TestCallWithTimeout.py Tue Nov 13 10:36:41 2012
@@ -29,7 +29,7 @@
     @dwarf_test
     def test_with_dwarf(self):
         """Test calling std::String member function."""
-        self.buildDsym()
+        self.buildDwarf()
         self.call_function()
 
     def call_function(self):

Modified: lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/Makefile (original)
+++ lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,6 @@
 LEVEL = ../../make
 
+CFLAGS_EXTRAS := -lpthread
 C_SOURCES := locking.c
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/Makefile (original)
+++ lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,6 @@
 LEVEL = ../../../make
 
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/Makefile (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,6 @@
 LEVEL = ../../../make
 
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/Makefile (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,6 @@
 LEVEL = ../../../make
 
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/Makefile (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,6 @@
 LEVEL = ../../../make
 
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py (original)
+++ lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py Tue Nov 13 10:36:41 2012
@@ -113,15 +113,14 @@
         frame = thread.GetFrameAtIndex(0)
         bits = frame.FindVariable("bits")
         self.DebugSBValue(bits)
-        self.assertTrue(bits.GetTypeName() == "Bits" and
-                        bits.GetNumChildren() == 8 and
-                        bits.GetByteSize() == 32,
-                        "(Bits)bits with byte size of 32 and 8 children")
+        self.assertTrue(bits.GetTypeName() == 'Bits', "bits.GetTypeName() == 'Bits'");
+        self.assertTrue(bits.GetNumChildren() == 10, "bits.GetNumChildren() == 10");
+        self.assertTrue(bits.GetByteSize() == 32, "bits.GetByteSize() == 32");
 
         # Notice the pattern of int(b1.GetValue(), 0).  We pass a base of 0
         # so that the proper radix is determined based on the contents of the
         # string.
-        b1 = bits.GetChildAtIndex(0)
+        b1 = bits.GetChildMemberWithName("b1")
         self.DebugSBValue(b1)
         self.assertTrue(b1.GetName() == "b1" and
                         b1.GetTypeName() == "uint32_t:1" and
@@ -129,7 +128,7 @@
                         int(b1.GetValue(), 0) == 1,
                         'bits.b1 has type uint32_t:1, is in scope, and == 1')
 
-        b7 = bits.GetChildAtIndex(6)
+        b7 = bits.GetChildMemberWithName("b7")
         self.DebugSBValue(b7)
         self.assertTrue(b7.GetName() == "b7" and
                         b7.GetTypeName() == "uint32_t:7" and
@@ -137,7 +136,7 @@
                         int(b7.GetValue(), 0) == 127,
                         'bits.b7 has type uint32_t:7, is in scope, and == 127')
 
-        four = bits.GetChildAtIndex(7)
+        four = bits.GetChildMemberWithName("four")
         self.DebugSBValue(four)
         self.assertTrue(four.GetName() == "four" and
                         four.GetTypeName() == "uint32_t:4" and

Modified: lldb/branches/windows/test/lang/c/bitfields/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/bitfields/main.c?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/bitfields/main.c (original)
+++ lldb/branches/windows/test/lang/c/bitfields/main.c Tue Nov 13 10:36:41 2012
@@ -12,9 +12,12 @@
 {
     struct Bits
     {
-        uint32_t    b1 : 1,
+        uint32_t    : 1, // Unnamed bitfield
+                    b1 : 1,
                     b2 : 2,
+                    : 2, // Unnamed bitfield
                     b3 : 3,
+                    : 2, // Unnamed bitfield (this will get removed)
                     b4 __attribute__ ((align(16))),
                     b5 : 5,
                     b6 : 6,

Modified: lldb/branches/windows/test/lang/c/blocks/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/blocks/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/blocks/Makefile (original)
+++ lldb/branches/windows/test/lang/c/blocks/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,6 @@
 LEVEL = ../../../make
 
 C_SOURCES := main.c
+CFLAGS_EXTRAS += -fblocks
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/test/lang/c/shared_lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/shared_lib/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/shared_lib/Makefile (original)
+++ lldb/branches/windows/test/lang/c/shared_lib/Makefile Tue Nov 13 10:36:41 2012
@@ -3,5 +3,6 @@
 DYLIB_NAME := libfoo
 DYLIB_C_SOURCES := foo.c
 C_SOURCES := main.c
+CFLAGS_EXTRAS += -fPIC
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/test/python_api/lldbutil/iter/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/lldbutil/iter/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/lldbutil/iter/Makefile (original)
+++ lldb/branches/windows/test/python_api/lldbutil/iter/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,7 @@
 LEVEL = ../../../make
 
+CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp
 MAKE_DSYM :=NO
 

Modified: lldb/branches/windows/test/python_api/lldbutil/process/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/lldbutil/process/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/lldbutil/process/Makefile (original)
+++ lldb/branches/windows/test/python_api/lldbutil/process/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,7 @@
 LEVEL = ../../../make
 
+CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp
 MAKE_DSYM :=NO
 

Modified: lldb/branches/windows/test/python_api/module_section/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/module_section/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/module_section/Makefile (original)
+++ lldb/branches/windows/test/python_api/module_section/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,7 @@
 LEVEL = ../../make
 
+CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp b.cpp c.cpp
 MAKE_DSYM :=NO
 

Modified: lldb/branches/windows/test/python_api/watchpoint/watchlocation/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/watchpoint/watchlocation/Makefile?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/watchpoint/watchlocation/Makefile (original)
+++ lldb/branches/windows/test/python_api/watchpoint/watchlocation/Makefile Tue Nov 13 10:36:41 2012
@@ -1,5 +1,6 @@
 LEVEL = ../../../make
 
+LDFLAGS := -lpthread
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Nov 13 10:36:41 2012
@@ -67,6 +67,7 @@
 		2695DE2E0D3EE55B007E4CA2 /* CFData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CFData.cpp; sourceTree = "<group>"; };
 		269DE5C50CB5B723008989F0 /* ProfileObjectiveC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProfileObjectiveC.h; sourceTree = "<group>"; };
 		269DE5C60CB5B723008989F0 /* ProfileObjectiveC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProfileObjectiveC.cpp; sourceTree = "<group>"; };
+		269E8DF8164B2ED200AD65F6 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
 		26A02918114AB9240029C479 /* debugserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = debugserver.cpp; sourceTree = "<group>"; };
 		26A4BAED0D498B7D00A9BEAB /* com.apple.debugserver.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.plist; sourceTree = "<group>"; };
 		26A68F7D0D104EC800665A9E /* RNBContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBContext.h; sourceTree = "<group>"; };
@@ -184,6 +185,7 @@
 		26A028FE114AB6A60029C479 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				269E8DF8164B2ED200AD65F6 /* com.apple.debugserver.posix.plist */,
 				26203D1C1641EFB200A662F7 /* com.apple.debugserver.applist.internal.plist */,
 				26203D1D1641EFB200A662F7 /* com.apple.debugserver.internal.plist */,
 				260FC7320E5B290400043FC9 /* debugnub-exports */,
@@ -548,6 +550,8 @@
 		262419A21198A93E00067686 /* BuildAndIntegration */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
 				COPY_PHASE_STRIP = YES;
 				CURRENT_PROJECT_VERSION = 193;
@@ -558,6 +562,7 @@
 					"$(SDKROOT)/Developer/Library/PrivateFrameworks",
 				);
 				"FRAMEWORK_SEARCH_PATHS[sdk=macosx*][arch=*]" = "$(SDKROOT)/System/Library/PrivateFrameworks";
+				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_BUILDANDINTEGRATION;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				HEADER_SEARCH_PATHS = /System/Library/Frameworks/System.framework/PrivateHeaders;
@@ -599,6 +604,8 @@
 		26CE0596115C31C30022F371 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
@@ -610,6 +617,7 @@
 					"$(SDKROOT)/Developer/Library/PrivateFrameworks",
 				);
 				"FRAMEWORK_SEARCH_PATHS[sdk=macosx*][arch=*]" = "$(SDKROOT)/System/Library/PrivateFrameworks";
+				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_DEBUG;
@@ -651,6 +659,8 @@
 		26CE0597115C31C30022F371 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
@@ -663,6 +673,7 @@
 					"$(SDKROOT)/Developer/Library/PrivateFrameworks",
 				);
 				"FRAMEWORK_SEARCH_PATHS[sdk=macosx*][arch=*]" = "$(SDKROOT)/System/Library/PrivateFrameworks";
+				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_RELEASE;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				HEADER_SEARCH_PATHS = /System/Library/Frameworks/System.framework/PrivateHeaders;

Modified: lldb/branches/windows/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/DNB.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/DNB.cpp (original)
+++ lldb/branches/windows/tools/debugserver/source/DNB.cpp Tue Nov 13 10:36:41 2012
@@ -40,8 +40,8 @@
 typedef ProcessMap::iterator ProcessMapIter;
 typedef ProcessMap::const_iterator ProcessMapConstIter;
 
-static size_t          GetAllInfos                  (std::vector<struct kinfo_proc>& proc_infos);
-static size_t          GetAllInfosMatchingName      (const char *process_name, std::vector<struct kinfo_proc>& matching_proc_infos);
+size_t GetAllInfos (std::vector<struct kinfo_proc>& proc_infos);
+static size_t GetAllInfosMatchingName (const char *process_name, std::vector<struct kinfo_proc>& matching_proc_infos);
 
 //----------------------------------------------------------------------
 // A Thread safe singleton to get a process map pointer.
@@ -391,10 +391,10 @@
     return INVALID_NUB_PROCESS;
 }
 
-static size_t
+size_t
 GetAllInfos (std::vector<struct kinfo_proc>& proc_infos)
 {
-    size_t size;
+    size_t size = 0;
     int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL };
     u_int namelen = sizeof(name)/sizeof(int);
     int err;

Modified: lldb/branches/windows/tools/debugserver/source/RNBServices.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/RNBServices.cpp?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/RNBServices.cpp (original)
+++ lldb/branches/windows/tools/debugserver/source/RNBServices.cpp Tue Nov 13 10:36:41 2012
@@ -14,7 +14,11 @@
 #import "RNBServices.h"
 
 #import <CoreFoundation/CoreFoundation.h>
+#include <libproc.h>
 #import <unistd.h>
+#include <sys/sysctl.h>
+#include "CFString.h"
+#include <vector>
 #import "DNBLog.h"
 #include "MacOSX/CFUtils.h"
 
@@ -22,69 +26,178 @@
 #import <SpringBoardServices/SpringBoardServices.h>
 #endif
 
+// From DNB.cpp
+size_t GetAllInfos (std::vector<struct kinfo_proc>& proc_infos);
+
+int
+GetPrcoesses (CFMutableArrayRef plistMutableArray, bool all_users)
+{
+    if (plistMutableArray == NULL)
+        return -1;
+
+    // Running as root, get all processes
+    std::vector<struct kinfo_proc> proc_infos;
+    const size_t num_proc_infos = GetAllInfos(proc_infos);
+    if (num_proc_infos > 0)
+    {
+        const pid_t our_pid = getpid();
+        const uid_t our_uid = getuid();
+        uint32_t i;
+        CFAllocatorRef alloc = kCFAllocatorDefault;
+
+        for (i=0; i<num_proc_infos; i++)
+        {
+            struct kinfo_proc &proc_info = proc_infos[i];
+            
+            bool kinfo_user_matches;
+            // Special case, if lldb is being run as root we can attach to anything.
+            if (all_users)
+                kinfo_user_matches = true;
+            else
+                kinfo_user_matches = proc_info.kp_eproc.e_pcred.p_ruid == our_uid;
+            
+
+            const pid_t pid = proc_info.kp_proc.p_pid;
+            // Skip zombie processes and processes with unset status
+            if (kinfo_user_matches == false             || // User is acceptable
+                pid == our_pid                          || // Skip this process
+                pid == 0                                || // Skip kernel (kernel pid is zero)
+                proc_info.kp_proc.p_stat == SZOMB       || // Zombies are bad, they like brains...
+                proc_info.kp_proc.p_flag & P_TRACED     || // Being debugged?
+                proc_info.kp_proc.p_flag & P_WEXIT      || // Working on exiting?
+                proc_info.kp_proc.p_flag & P_TRANSLATED)   // Skip translated ppc (Rosetta)
+                continue;
+            
+            // Create a new mutable dictionary for each application
+            CFReleaser<CFMutableDictionaryRef> appInfoDict (::CFDictionaryCreateMutable (alloc, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+            
+            // Get the process id for the app (if there is one)
+            const int32_t pid_int32 = pid;
+            CFReleaser<CFNumberRef> pidCFNumber (::CFNumberCreate (alloc,  kCFNumberSInt32Type, &pid_int32));
+            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_PID_KEY, pidCFNumber.get());
+            
+            // Set the a boolean to indicate if this is the front most
+            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_FRONTMOST_KEY, kCFBooleanFalse);
+            
+            const char *pid_basename = proc_info.kp_proc.p_comm;
+            char proc_path_buf[PATH_MAX];
+            
+            int return_val = proc_pidpath (pid, proc_path_buf, PATH_MAX);
+            if (return_val > 0)
+            {
+                // Okay, now search backwards from that to see if there is a
+                // slash in the name.  Note, even though we got all the args we don't care
+                // because the list data is just a bunch of concatenated null terminated strings
+                // so strrchr will start from the end of argv0.
+                
+                pid_basename = strrchr(proc_path_buf, '/');
+                if (pid_basename)
+                {
+                    // Skip the '/'
+                    ++pid_basename;
+                }
+                else
+                {
+                    // We didn't find a directory delimiter in the process argv[0], just use what was in there
+                    pid_basename = proc_path_buf;
+                }
+                CFString cf_pid_path (proc_path_buf);
+                if (cf_pid_path.get())
+                    ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_PATH_KEY, cf_pid_path.get());
+            }
+
+            if (pid_basename && pid_basename[0])
+            {
+                CFString pid_name (pid_basename);
+                ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_DISPLAY_NAME_KEY, pid_name.get());
+            }
+            
+            // Append the application info to the plist array
+            ::CFArrayAppendValue (plistMutableArray, appInfoDict.get());
+        }
+    }
+    return 0;
+}
 int
 ListApplications(std::string& plist, bool opt_runningApps, bool opt_debuggable)
 {
-#ifdef WITH_SPRINGBOARD
     int result = -1;
-
+    
     CFAllocatorRef alloc = kCFAllocatorDefault;
-
+    
     // Create a mutable array that we can populate. Specify zero so it can be of any size.
     CFReleaser<CFMutableArrayRef> plistMutableArray (::CFArrayCreateMutable (alloc, 0, &kCFTypeArrayCallBacks));
 
-    CFReleaser<CFStringRef> sbsFrontAppID (::SBSCopyFrontmostApplicationDisplayIdentifier ());
-    CFReleaser<CFArrayRef> sbsAppIDs (::SBSCopyApplicationDisplayIdentifiers (opt_runningApps, opt_debuggable));
-
-    // Need to check the return value from SBSCopyApplicationDisplayIdentifiers.
-    CFIndex count = sbsAppIDs.get() ? ::CFArrayGetCount (sbsAppIDs.get()) : 0;
-    CFIndex i = 0;
-    for (i = 0; i < count; i++)
-    {
-        CFStringRef displayIdentifier = (CFStringRef)::CFArrayGetValueAtIndex (sbsAppIDs.get(), i);
-
-        // Create a new mutable dictionary for each application
-        CFReleaser<CFMutableDictionaryRef> appInfoDict (::CFDictionaryCreateMutable (alloc, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-
-        // Get the process id for the app (if there is one)
-        pid_t pid = INVALID_NUB_PROCESS;
-        if (::SBSProcessIDForDisplayIdentifier ((CFStringRef)displayIdentifier, &pid) == true)
-        {
-            CFReleaser<CFNumberRef> pidCFNumber (::CFNumberCreate (alloc,  kCFNumberSInt32Type, &pid));
-            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_PID_KEY, pidCFNumber.get());
-        }
-
-        // Set the a boolean to indicate if this is the front most
-        if (sbsFrontAppID.get() && displayIdentifier && (::CFStringCompare (sbsFrontAppID.get(), displayIdentifier, 0) == kCFCompareEqualTo))
-            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_FRONTMOST_KEY, kCFBooleanTrue);
-        else
-            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_FRONTMOST_KEY, kCFBooleanFalse);
+    const uid_t our_uid = getuid();
 
+#ifdef WITH_SPRINGBOARD
 
-        CFReleaser<CFStringRef> executablePath (::SBSCopyExecutablePathForDisplayIdentifier (displayIdentifier));
-        if (executablePath.get() != NULL)
-        {
-            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_PATH_KEY, executablePath.get());
-        }
+    
+    if (our_uid == 0)
+    {
+        bool all_users = true;
+        result = GetPrcoesses (plistMutableArray.get(), all_users);
+    }
+    else
+    {
+        CFReleaser<CFStringRef> sbsFrontAppID (::SBSCopyFrontmostApplicationDisplayIdentifier ());
+        CFReleaser<CFArrayRef> sbsAppIDs (::SBSCopyApplicationDisplayIdentifiers (opt_runningApps, opt_debuggable));
 
-        CFReleaser<CFStringRef> iconImagePath (::SBSCopyIconImagePathForDisplayIdentifier (displayIdentifier)) ;
-        if (iconImagePath.get() != NULL)
-        {
-            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_ICON_PATH_KEY, iconImagePath.get());
-        }
+        // Need to check the return value from SBSCopyApplicationDisplayIdentifiers.
+        CFIndex count = sbsAppIDs.get() ? ::CFArrayGetCount (sbsAppIDs.get()) : 0;
+        CFIndex i = 0;
+        for (i = 0; i < count; i++)
+        {
+            CFStringRef displayIdentifier = (CFStringRef)::CFArrayGetValueAtIndex (sbsAppIDs.get(), i);
+
+            // Create a new mutable dictionary for each application
+            CFReleaser<CFMutableDictionaryRef> appInfoDict (::CFDictionaryCreateMutable (alloc, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+            // Get the process id for the app (if there is one)
+            pid_t pid = INVALID_NUB_PROCESS;
+            if (::SBSProcessIDForDisplayIdentifier ((CFStringRef)displayIdentifier, &pid) == true)
+            {
+                CFReleaser<CFNumberRef> pidCFNumber (::CFNumberCreate (alloc,  kCFNumberSInt32Type, &pid));
+                ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_PID_KEY, pidCFNumber.get());
+            }
+
+            // Set the a boolean to indicate if this is the front most
+            if (sbsFrontAppID.get() && displayIdentifier && (::CFStringCompare (sbsFrontAppID.get(), displayIdentifier, 0) == kCFCompareEqualTo))
+                ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_FRONTMOST_KEY, kCFBooleanTrue);
+            else
+                ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_FRONTMOST_KEY, kCFBooleanFalse);
+
+
+            CFReleaser<CFStringRef> executablePath (::SBSCopyExecutablePathForDisplayIdentifier (displayIdentifier));
+            if (executablePath.get() != NULL)
+            {
+                ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_PATH_KEY, executablePath.get());
+            }
+
+            CFReleaser<CFStringRef> iconImagePath (::SBSCopyIconImagePathForDisplayIdentifier (displayIdentifier)) ;
+            if (iconImagePath.get() != NULL)
+            {
+                ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_ICON_PATH_KEY, iconImagePath.get());
+            }
+
+            CFReleaser<CFStringRef> localizedDisplayName (::SBSCopyLocalizedApplicationNameForDisplayIdentifier (displayIdentifier));
+            if (localizedDisplayName.get() != NULL)
+            {
+                ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_DISPLAY_NAME_KEY, localizedDisplayName.get());
+            }
 
-        CFReleaser<CFStringRef> localizedDisplayName (::SBSCopyLocalizedApplicationNameForDisplayIdentifier (displayIdentifier));
-        if (localizedDisplayName.get() != NULL)
-        {
-            ::CFDictionarySetValue (appInfoDict.get(), DTSERVICES_APP_DISPLAY_NAME_KEY, localizedDisplayName.get());
+            // Append the application info to the plist array
+            ::CFArrayAppendValue (plistMutableArray.get(), appInfoDict.get());
         }
-
-        // Append the application info to the plist array
-        ::CFArrayAppendValue (plistMutableArray.get(), appInfoDict.get());
     }
-
+#else
+    // When root, show all processes
+    bool all_users = (our_uid == 0);
+    result = GetPrcoesses (plistMutableArray.get(), all_users);
+#endif
+    
     CFReleaser<CFDataRef> plistData (::CFPropertyListCreateXMLData (alloc, plistMutableArray.get()));
-
+    
     // write plist to service port
     if (plistData.get() != NULL)
     {
@@ -106,13 +219,9 @@
         DNBLogError("serializing task list.");
         result = -3;
     }
-
+    
     return result;
-#else
-    // TODO: list all current processes
-    DNBLogError("SBS doesn't support getting application list.");
-    return -1;
-#endif
+
 }
 
 

Modified: lldb/branches/windows/www/build.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/build.html?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/www/build.html (original)
+++ lldb/branches/windows/www/build.html Tue Nov 13 10:36:41 2012
@@ -105,8 +105,8 @@
                 <code>> cd $llvm/..
                   <br>> mkdir build
                   <br>> cd build
-                  <br>> $llvm/configure --enable-libcpp
-                  <br>> make CXXFLAGS=-std=c++11</code>
+                  <br>> $llvm/configure --enable-cxx11 --enable-libcpp
+                  <br>> make </code>
                 <p>Note that once both LLVM and Clang have been configured and built it is not
                 necessary to perform a top-level <tt>make</tt> to rebuild changes made only to LLDB.
                 You can run <tt>make</tt> from the <tt>build/tools/lldb</tt> subdirectory as well. If your
@@ -114,7 +114,7 @@
                 parameter to the configure script.</p>
                 
                 <h2>Additional Notes</h2>
-                <p>LLDB has a Python scripting capability and supplies it’s own Python module,
+                <p>LLDB has a Python scripting capability and supplies its own Python module,
                 <tt>lldb</tt>, built alongside the <tt>lldb</tt> binary.  Python needs to know where to
                 look for this module when LLDB starts up.  To tell python the location of LLDB, set
                 <tt>PYTHONPATH</tt> environment variable.

Modified: lldb/branches/windows/www/index.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/index.html?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/www/index.html (original)
+++ lldb/branches/windows/www/index.html Tue Nov 13 10:36:41 2012
@@ -92,6 +92,8 @@
 					   	<li>Mac OS X desktop user space debugging for i386 and x86-64</li>
 					   	<li>iOS simulator debugging on i386</li>
 					   	<li>iOS device debugging on ARM</li>
+					   	<li>Linux local user-space debugging for i386 and x86-64</li>
+					   	<li>FreeBSD local user-space debugging for i386 and x86-64</li>
 				    </ul>
 				</div>
 				<div class="postfooter"></div>
@@ -108,8 +110,8 @@
 				        <li>svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb</li>
 				    </ul>
 
-				    <p>Note that LLDB currently only builds out of the box on Mac OS X with
-				        Xcode, but patches to improve portability are definitely welcome.</p>
+				    <p>Note that LLDB generally builds from top-of-trunk on Mac OS X with
+				        Xcode and on Linux (with clang and libstdc++/libc++). </p>
 
 				    <p>Discussions about LLDB should go to the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev">lldb-dev</a> mailing
 				        list.  Commit messages for the lldb SVN module are automatically sent to the
@@ -123,4 +125,4 @@
 	</div>
 </div>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: lldb/branches/windows/www/status.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/status.html?rev=167848&r1=167847&r2=167848&view=diff
==============================================================================
--- lldb/branches/windows/www/status.html (original)
+++ lldb/branches/windows/www/status.html Tue Nov 13 10:36:41 2012
@@ -1,61 +1,160 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<link href="style.css" rel="stylesheet" type="text/css" />
-<title>LLDB Status</title>
-</head>
-
-<body>
-    <div class="www_title">
-      The <strong>LLDB</strong> Debugger
-    </div>
-    
-<div id="container">
-	<div id="content">
-        <!--#include virtual="sidebar.incl"-->
-        
-		<div id="middle">
-			<div class="post">
-				<h1 class ="postheader">Status</h1>
-				<div class="postcontent">
-
-				   <p>LLDB has matured a lot in the last year and can be used for
-				      C, C++ and Objective C development for x86_64, i386 and ARM debugging.
-				      The entire public API is exposed though a framework on Mac OS X which
-				      is used by Xcode, the lldb command line tool, and can also be used by
-				      python. The entire public API is exposed through script bridging which
-				      allows LLDB to use an embedded python script interpreter, as well as 
-				      having a python module named "lldb" which can be used from python
-				      on the command line. This allows debug sessions to be scripted. It also
-				      allows powerful debugging actions to be created and attached to a variety
-				      of debugging workflows.</p>
-
-				   <p>What works well:</p>
-				   <ul>   
-				       <li>Process control, including external process control via debugserver
-				           (which is included as part of the lldb project)</li>
-				           <li>Breakpoints: Source-line, symbolic, C++ mangled names, module
-    				       scoping</li>
-    				   <li>Symbol reading and object file introspection</li>
-    				   <li>Script bridging</li>
-    				   <li>Thread inspection and stepping</li>
-    				   <li>Disassembly of i386, x86-64, & ARM/Thumb machine code</li>
-    				   <li>Backtracing of i386, x86-64, & ARM/Thumb machine code</li>
-    				   <li>libedit powers the command line prompt and input
-    				   <li>Objective-C 2.0 Support: Printing properties, synthetic properties,
-    				       Objective-C expressions, KVO, dynamic types, dot syntax, runtime data</li>
-    				   <li>C++ support: method access, template support, dynamic types</li>
-    				   <li>The public API to the library</li>
-    				   <li>Expression evaluation</li>
-    				   <li>Objective-C support: stepping into/over, printing the description of
-    				       an object ("po")</li>
-				   </ul>
-				</div>
-				<div class="postfooter"></div>
-			</div>
-		</div>
-	</div>
-</div>
-</body>
-</html>
\ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link href="style.css" rel="stylesheet" type="text/css" />
+<title>LLDB Status</title>
+</head>
+
+<body>
+    <div class="www_title">
+      The <strong>LLDB</strong> Debugger
+    </div>
+    
+<div id="container">
+	<div id="content">
+        <!--#include virtual="sidebar.incl"-->
+        
+		<div id="middle">
+			<div class="post">
+				<h1 class ="postheader">Mac OS X Status</h1>
+				<div class="postcontent">
+
+				   <p>LLDB has matured a lot in the last year and can be used for
+				      C, C++ and Objective C development for x86_64, i386 and ARM debugging.
+				      The entire public API is exposed though a framework on Mac OS X which
+				      is used by Xcode, the lldb command line tool, and can also be used by
+				      Python. The entire public API is exposed through script bridging which
+				      allows LLDB to use an embedded Python script interpreter, as well as 
+				      having a Python module named "lldb" which can be used from Python
+				      on the command line. This allows debug sessions to be scripted. It also
+				      allows powerful debugging actions to be created and attached to a variety
+				      of debugging workflows.</p>
+				</div>
+				<h1 class ="postheader">Linux Status</h1>
+				<div class="postcontent">
+					<p> LLDB is improving on Linux. While the debugserver is not ported
+					(to enable remote debugging) and there are some stability issues, most
+					of the basic functionality, including the Python API and the commandline tool,
+					are working on i386/x86_64 architectures. ARM architectures on Linux are untested.
+					For more details, see the Features by OS section below.
+				</div>
+				<h1 class ="postheader">Features by OS</h1>
+				<div class="postcontent">
+					<p> The table below shows a summary of the features that are available
+					on several platforms. In addition to Linux and Mac OS X, LLDB is also
+					known to work on FreeBSD. Windows support is under development.
+							<table border="1">
+								<tr>
+									<th>Feature</th>
+									<th>Linux<br>(i386 and x86_64)</th>
+									<th>Mac OS X (i386/x86_64 and ARM/Thumb)</th>
+								</tr>
+								<tr>
+									<td>Backtracing</td>
+									<td>OK</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Breakpoints
+										<ul>
+											<li>source-line
+											<li>symbolic
+											<li>C++ mangled names
+											<li>module scoping
+										</ul>
+									</td>
+									<td>OK except on C++ exception (catch/throw)</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>C++11:
+									<ul>
+										<li>function access
+										<li>template support
+										<li>dynamic types
+									</ul></td>
+									<td>OK</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Commandline lldb tool</td>
+									<td>OK</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Debugserver (remote debugging)</td>
+									<td>Not ported</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Disassembly</td>
+									<td>OK</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Expression evaluation</td>
+									<td>Works with some bugs</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Objective-C 2.0:
+										<ul>
+											<li>printing properties
+											<li>synthetic properties
+											<li>expressions
+											<li>KVO
+											<li>dynamic types
+											<li>dot syntax
+											<li>runtime data
+											<li>stepping into/over
+											<li>printing the description of an object ("po")
+									</ul></td>
+									<td>Not applicable</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Process control
+										<ul>
+											<li>launch
+											<li>attach
+											<li>continue
+										</ul>
+									</td>
+									<td>OK except attach-by-name </td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Public Python API</td>
+									<td>OK</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Script bridging</td>
+									<td>OK</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Symbol reading and object file introspection</td>
+									<td>OK</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Thread inspection and stepping</td>
+									<td>OK for single thread (no multi-threaded support)</td>
+									<td>OK</td>
+								</tr>
+								<tr>
+									<td>Watchpoints</td>
+									<td>Broken</td>
+									<td>OK</td>
+								</tr>
+							</table>
+				</div>
+				<div class="postfooter"></div>
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>





More information about the lldb-commits mailing list