[Lldb-commits] [lldb] r156811 - in /lldb/branches/apple/python-GIL: ./ examples/darwin/heap_find/ examples/summaries/cocoa/ include/lldb/API/ include/lldb/Target/ scripts/Python/interface/ source/API/ source/Commands/ source/Host/common/ source/Plugins/Platform/MacOSX/ source/Plugins/Process/gdb-remote/ source/Plugins/SymbolFile/DWARF/ source/Target/ test/functionalities/data-formatter/data-formatter-objc/ test/lang/c/stepping/ www/

Filipe Cabecinhas me at filcab.net
Tue May 15 02:53:49 PDT 2012


Author: filcab
Date: Tue May 15 04:53:49 2012
New Revision: 156811

URL: http://llvm.org/viewvc/llvm-project?rev=156811&view=rev
Log:
Merge changes from ToT trunk.

Added:
    lldb/branches/apple/python-GIL/test/lang/c/stepping/TestStepAndBreakpoints.py
      - copied unchanged from r156797, lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py
Modified:
    lldb/branches/apple/python-GIL/   (props changed)
    lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py
    lldb/branches/apple/python-GIL/examples/summaries/cocoa/CFString.py
    lldb/branches/apple/python-GIL/include/lldb/API/SBFrame.h
    lldb/branches/apple/python-GIL/include/lldb/Target/Platform.h
    lldb/branches/apple/python-GIL/include/lldb/Target/Target.h
    lldb/branches/apple/python-GIL/scripts/Python/interface/SBFrame.i
    lldb/branches/apple/python-GIL/source/API/SBFrame.cpp
    lldb/branches/apple/python-GIL/source/API/SBThread.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectLog.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp
    lldb/branches/apple/python-GIL/source/Host/common/Host.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
    lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/branches/apple/python-GIL/source/Target/Platform.cpp
    lldb/branches/apple/python-GIL/source/Target/Target.cpp
    lldb/branches/apple/python-GIL/source/Target/Thread.cpp
    lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m
    lldb/branches/apple/python-GIL/test/lang/c/stepping/main.c
    lldb/branches/apple/python-GIL/www/lldb-gdb.html

Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 15 04:53:49 2012
@@ -1 +1 @@
-/lldb/trunk:156467-156639
+/lldb/trunk:156467-156797

Modified: lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py (original)
+++ lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py Tue May 15 04:53:49 2012
@@ -126,12 +126,10 @@
 def dump_stack_history_entries(addr, history):
     # malloc_stack_entry *get_stack_history_for_address (const void * addr)
     expr = 'get_stack_history_for_address((void *)0x%x, %u)' % (addr, history)
-    print 'expr = "%s"' % (expr)
     expr_sbvalue = lldb.frame.EvaluateExpression (expr)
     if expr_sbvalue.error.Success():
         if expr_sbvalue.unsigned:
             expr_value = lldb.value(expr_sbvalue)  
-            #print 'expr_value = ', expr_value
             idx = 0;
             stack_history_entry = expr_value[idx]
             while int(stack_history_entry.address) != 0:

Modified: lldb/branches/apple/python-GIL/examples/summaries/cocoa/CFString.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/summaries/cocoa/CFString.py?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/summaries/cocoa/CFString.py (original)
+++ lldb/branches/apple/python-GIL/examples/summaries/cocoa/CFString.py Tue May 15 04:53:49 2012
@@ -65,14 +65,14 @@
 			return 0;
 		return 6;
 
-	def read_unicode(self, pointer):
+	def read_unicode(self, pointer,max_len=2048):
 		logger = lldb.formatters.Logger.Logger()
 		process = self.valobj.GetTarget().GetProcess()
 		error = lldb.SBError()
 		pystr = u''
 		# cannot do the read at once because the length value has
 		# a weird encoding. better play it safe here
-		while True:
+		while max_len > 0:
 			content = process.ReadMemory(pointer, 2, error)
 			new_bytes = bytearray(content)
 			b0 = new_bytes[0]
@@ -89,6 +89,8 @@
 			else:
 				value = b0 * 256 + b1
 			pystr = pystr + unichr(value)
+			# read max_len unicode values, not max_len bytes
+			max_len = max_len - 1
 		return pystr
 
 	# handle the special case strings
@@ -150,8 +152,11 @@
 		data = self.valobj.CreateChildAtOffset("content",
 			offset, self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar).GetPointerType());
 		data_value = data.GetValueAsUnsigned(0)
-		data_value = data_value + 1
-		return self.valobj.CreateValueFromExpression("content", "(char*)(" + str(data_value) + ")")
+		if self.explicit and self.unicode:
+			return self.read_unicode(data_value).encode('utf-8')
+		else:
+			data_value = data_value + 1
+			return self.valobj.CreateValueFromExpression("content", "(char*)(" + str(data_value) + ")")
 
 	def handle_UTF8_inline(self):
 		logger = lldb.formatters.Logger.Logger()

Modified: lldb/branches/apple/python-GIL/include/lldb/API/SBFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/API/SBFrame.h?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/API/SBFrame.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/API/SBFrame.h Tue May 15 04:53:49 2012
@@ -103,6 +103,9 @@
     lldb::SBValue
     EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic);
 
+    lldb::SBValue
+    EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic, bool unwind_on_error);
+
     /// Gets the lexical block that defines the stack frame. Another way to think
     /// of this is it will return the block that contains all of the variables
     /// for a stack frame. Inlined functions are represented as SBBlock objects

Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Platform.h?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Platform.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Platform.h Tue May 15 04:53:49 2012
@@ -368,6 +368,15 @@
 
         virtual bool
         GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info);
+        
+        //------------------------------------------------------------------
+        // Set a breakpoint on all functions that can end up creating a thread
+        // for this platform. This is needed when running expressions and
+        // also for process control.
+        //------------------------------------------------------------------
+        virtual lldb::BreakpointSP
+        SetThreadCreationBreakpoint (Target &target);
+        
 
         const std::string &
         GetRemoteURL () const

Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Target.h?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Target.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Target.h Tue May 15 04:53:49 2012
@@ -500,8 +500,8 @@
     lldb::BreakpointSP
     CreateBreakpoint (const FileSpecList *containingModules,
                       const FileSpecList *containingSourceFiles,
-                      std::vector<std::string> func_names,
-                      uint32_t func_name_type_mask, 
+                      const std::vector<std::string> &func_names,
+                      uint32_t func_name_type_mask,
                       bool internal = false,
                       LazyBool skip_prologue = eLazyBoolCalculate);
 

Modified: lldb/branches/apple/python-GIL/scripts/Python/interface/SBFrame.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/Python/interface/SBFrame.i?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/Python/interface/SBFrame.i (original)
+++ lldb/branches/apple/python-GIL/scripts/Python/interface/SBFrame.i Tue May 15 04:53:49 2012
@@ -137,6 +137,9 @@
     lldb::SBValue
     EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic);
 
+    lldb::SBValue
+    EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic, bool unwind_on_error);
+
     %feature("docstring", "
     /// Gets the lexical block that defines the stack frame. Another way to think
     /// of this is it will return the block that contains all of the variables

Modified: lldb/branches/apple/python-GIL/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBFrame.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBFrame.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBFrame.cpp Tue May 15 04:53:49 2012
@@ -1028,6 +1028,12 @@
 SBValue
 SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value)
 {
+    return EvaluateExpression (expr, fetch_dynamic_value, true);
+}
+
+SBValue
+SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value, bool unwind_on_error)
+{
     LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     
     LogSP expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -1056,7 +1062,6 @@
                                                  expr, fetch_dynamic_value, frame_description.GetString().c_str());
 
             const bool coerce_to_id = false;
-            const bool unwind_on_error = true;
             const bool keep_in_memory = false;
 
             exe_results = target->EvaluateExpression (expr, 

Modified: lldb/branches/apple/python-GIL/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBThread.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBThread.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBThread.cpp Tue May 15 04:53:49 2012
@@ -531,7 +531,7 @@
     {
         Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
         Thread *thread = exe_ctx.GetThreadPtr();
-        bool abort_other_plans = true;
+        bool abort_other_plans = false;
         StackFrameSP frame_sp(thread->GetStackFrameAtIndex (0));
         ThreadPlan *new_plan = NULL;
 
@@ -574,7 +574,7 @@
     if (exe_ctx.HasThreadScope())
     {
         Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
-        bool abort_other_plans = true;
+        bool abort_other_plans = false;
 
         Thread *thread = exe_ctx.GetThreadPtr();
         StackFrameSP frame_sp(thread->GetStackFrameAtIndex (0));
@@ -616,7 +616,7 @@
     if (exe_ctx.HasThreadScope())
     {
         Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
-        bool abort_other_plans = true;
+        bool abort_other_plans = false;
         bool stop_other_threads = true;
 
         Thread *thread = exe_ctx.GetThreadPtr();
@@ -651,7 +651,7 @@
     if (exe_ctx.HasThreadScope())
     {
         Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
-        bool abort_other_plans = true;
+        bool abort_other_plans = false;
         bool stop_other_threads = true;
         Thread *thread = exe_ctx.GetThreadPtr();
 
@@ -703,7 +703,7 @@
     if (exe_ctx.HasThreadScope())
     {
         Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
-        bool abort_other_plans = true;
+        bool abort_other_plans = false;
         bool stop_other_threads = true;
 
         Address target_addr (addr);
@@ -806,7 +806,7 @@
         AddressRange fun_range = frame_sc.function->GetAddressRange();
         
         std::vector<addr_t> step_over_until_addrs;
-        const bool abort_other_plans = true;
+        const bool abort_other_plans = false;
         const bool stop_other_threads = true;
         const bool check_inlines = true;
         const bool exact = false;

Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectLog.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectLog.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectLog.cpp Tue May 15 04:53:49 2012
@@ -114,9 +114,9 @@
     Execute (Args& args,
              CommandReturnObject &result)
     {
-        if (args.GetArgumentCount() < 1)
+        if (args.GetArgumentCount() < 2)
         {
-            result.AppendErrorWithFormat("Usage: %s\n", m_cmd_syntax.c_str());
+            result.AppendErrorWithFormat("%s takes a log channel and one or more log types.\n", m_cmd_name.c_str());
         }
         else
         {
@@ -264,7 +264,7 @@
         const size_t argc = args.GetArgumentCount();
         if (argc == 0)
         {
-            result.AppendErrorWithFormat("Usage: %s\n", m_cmd_syntax.c_str());
+            result.AppendErrorWithFormat("%s takes a log channel and one or more log types.\n", m_cmd_name.c_str());
         }
         else
         {

Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp Tue May 15 04:53:49 2012
@@ -946,7 +946,7 @@
                 return false;
             }
 
-            const bool abort_other_plans = true;
+            const bool abort_other_plans = false;
 
             StackFrame *frame = thread->GetStackFrameAtIndex(m_options.m_frame_idx).get();
             if (frame == NULL)

Modified: lldb/branches/apple/python-GIL/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/common/Host.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/common/Host.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Host/common/Host.cpp Tue May 15 04:53:49 2012
@@ -371,12 +371,9 @@
     if (!g_vendor)
     {
 #if defined (__APPLE__)
-        char ostype[64];
-        size_t len = sizeof(ostype);
-        if (::sysctlbyname("kern.ostype", &ostype, &len, NULL, 0) == 0)
-            g_vendor.SetCString (ostype);
-        else
-            g_vendor.SetCString("apple");
+        const ArchSpec &host_arch = GetArchitecture (eSystemDefaultArchitecture);
+        const llvm::StringRef &str_ref = host_arch.GetTriple().getVendorName();
+        g_vendor.SetCStringWithLength(str_ref.data(), str_ref.size());
 #elif defined (__linux__)
         g_vendor.SetCString("gnu");
 #elif defined (__FreeBSD__)
@@ -393,7 +390,9 @@
     if (!g_os_string)
     {
 #if defined (__APPLE__)
-        g_os_string.SetCString("darwin");
+        const ArchSpec &host_arch = GetArchitecture (eSystemDefaultArchitecture);
+        const llvm::StringRef &str_ref = host_arch.GetTriple().getOSName();
+        g_os_string.SetCStringWithLength(str_ref.data(), str_ref.size());
 #elif defined (__linux__)
         g_os_string.SetCString("linux");
 #elif defined (__FreeBSD__)
@@ -409,18 +408,8 @@
     static ConstString g_host_triple;
     if (!(g_host_triple))
     {
-        StreamString triple;
-        triple.Printf("%s-%s-%s", 
-                      GetArchitecture().GetArchitectureName(),
-                      GetVendorString().AsCString(),
-                      GetOSString().AsCString());
-
-        std::transform (triple.GetString().begin(), 
-                        triple.GetString().end(), 
-                        triple.GetString().begin(), 
-                        ::tolower);
-
-        g_host_triple.SetCString(triple.GetString().c_str());
+        const ArchSpec &host_arch = GetArchitecture (eSystemDefaultArchitecture);
+        g_host_triple.SetCString(host_arch.GetTriple().getTriple().c_str());
     }
     return g_host_triple;
 }
@@ -1238,19 +1227,22 @@
 lldb::TargetSP
 Host::GetDummyTarget (lldb_private::Debugger &debugger)
 {
-    static TargetSP dummy_target;
+    static TargetSP g_dummy_target_sp;
     
-    if (!dummy_target)
+    if (!g_dummy_target_sp)
     {
+        ArchSpec arch(Target::GetDefaultArchitecture());
+        if (!arch.IsValid())
+            arch = Host::GetArchitecture ();
         Error err = debugger.GetTargetList().CreateTarget(debugger, 
                                                           FileSpec(), 
-                                                          Host::GetTargetTriple().AsCString(), 
+                                                          arch.GetTriple().getTriple().c_str(),
                                                           false, 
                                                           NULL, 
-                                                          dummy_target);
+                                                          g_dummy_target_sp);
     }
     
-    return dummy_target;
+    return g_dummy_target_sp;
 }
 
 struct ShellInfo

Modified: lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Tue May 15 04:53:49 2012
@@ -823,3 +823,38 @@
     return NULL;
 }
 
+
+BreakpointSP
+PlatformDarwin::SetThreadCreationBreakpoint (Target &target)
+{
+    BreakpointSP bp_sp;
+    static const char *g_bp_names[] =
+    {
+        "start_wqthread",
+        "_pthread_wqthread",
+        "_pthread_start",
+    };
+
+    static const char *g_bp_modules[] =
+    {
+        "libsystem_c.dylib",
+        "libSystem.B.dylib"
+    };
+
+    FileSpecList bp_modules;
+    for (int i = 0; i < sizeof(g_bp_modules)/sizeof(const char *); i++)
+    {
+        const char *bp_module = g_bp_modules[i];
+        bp_modules.Append(FileSpec(bp_module, false));
+    }
+
+    bp_sp = target.CreateBreakpoint (&bp_modules,
+                                     NULL,
+                                     g_bp_names,
+                                     sizeof(g_bp_names)/sizeof(const char *),
+                                     eFunctionNameTypeFull,
+                                     true);
+
+    return bp_sp;
+}
+

Modified: lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.h Tue May 15 04:53:49 2012
@@ -79,6 +79,9 @@
     GetProcessInfo (lldb::pid_t pid, 
                     lldb_private::ProcessInstanceInfo &proc_info);
     
+    virtual lldb::BreakpointSP
+    SetThreadCreationBreakpoint (lldb_private::Target &target);
+
     virtual uint32_t
     FindProcesses (const lldb_private::ProcessInstanceInfoMatch &match_info,
                    lldb_private::ProcessInstanceInfoList &process_infos);

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Tue May 15 04:53:49 2012
@@ -435,10 +435,10 @@
 
                         const uint8_t signo = response.GetHexU8 (UINT8_MAX);
 
-                        bool continue_after_aync = false;
+                        bool continue_after_async = false;
                         if (m_async_signal != -1 || m_async_packet_predicate.GetValue())
                         {
-                            continue_after_aync = true;
+                            continue_after_async = true;
                             // We sent an interrupt packet to stop the inferior process
                             // for an async signal or to send an async packet while running
                             // but we might have been single stepping and received the
@@ -453,7 +453,7 @@
                             // a lot of trouble for us!
                             if (signo != SIGINT && signo != SIGSTOP)
                             {
-                                continue_after_aync = false;
+                                continue_after_async = false;
 
                                 // We didn't get a a SIGINT or SIGSTOP, so try for a
                                 // very brief time (1 ms) to get another stop reply
@@ -470,7 +470,7 @@
                                         // our interrupt didn't stop the target so we
                                         // shouldn't continue after the async signal
                                         // or packet is sent...
-                                        continue_after_aync = false;
+                                        continue_after_async = false;
                                         break;
                                     }
                                 }
@@ -514,7 +514,7 @@
                                                        Host::GetSignalAsCString (async_signal));
 
                                 // Set the continue packet to resume even if the
-                                // interrupt didn't cause our stop (ignore continue_after_aync)
+                                // interrupt didn't cause our stop (ignore continue_after_async)
                                 continue_packet.assign(signal_packet, signal_packet_len);
                                 continue;
                             }
@@ -548,13 +548,13 @@
                             m_async_packet_predicate.SetValue(false, eBroadcastAlways);
 
                             if (packet_log) 
-                                packet_log->Printf ("async: sent packet, continue_after_aync = %i", continue_after_aync);
+                                packet_log->Printf ("async: sent packet, continue_after_async = %i", continue_after_async);
 
                             // Set the continue packet to resume if our interrupt
                             // for the async packet did cause the stop
-                            if (continue_after_aync)
+                            if (continue_after_async)
                             {
-                                continue_packet.assign (1, 'c');
+                                //continue_packet.assign (1, 'c');
                                 continue;
                             }
                         }

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue May 15 04:53:49 2012
@@ -18,6 +18,7 @@
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Target/ExecutionContext.h"
+#include "lldb/Utility/Utils.h"
 // Project includes
 #include "Utility/StringExtractorGDBRemote.h"
 #include "ProcessGDBRemote.h"
@@ -691,7 +692,7 @@
 }
 
 void
-GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters()
+GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch)
 {
     // For Advanced SIMD and VFP register mapping.
     static uint32_t g_d0_regs[] =  { 26, 27, LLDB_INVALID_REGNUM }; // (s0, s1)
@@ -727,6 +728,14 @@
     static uint32_t g_q14_regs[] = { 71, 72, LLDB_INVALID_REGNUM }; // (d28, d29)
     static uint32_t g_q15_regs[] = { 73, 74, LLDB_INVALID_REGNUM }; // (d30, d31)
 
+    // This is our array of composite registers, with each element coming from the above register mappings.
+    static uint32_t *g_composites[] = {
+        g_d0_regs, g_d1_regs,  g_d2_regs,  g_d3_regs,  g_d4_regs,  g_d5_regs,  g_d6_regs,  g_d7_regs,
+        g_d8_regs, g_d9_regs, g_d10_regs, g_d11_regs, g_d12_regs, g_d13_regs, g_d14_regs, g_d15_regs,
+        g_q0_regs, g_q1_regs,  g_q2_regs,  g_q3_regs,  g_q4_regs,  g_q5_regs,  g_q6_regs,  g_q7_regs,
+        g_q8_regs, g_q9_regs, g_q10_regs, g_q11_regs, g_q12_regs, g_q13_regs, g_q14_regs, g_q15_regs
+    };
+
     static RegisterInfo g_register_infos[] = {
 //   NAME    ALT    SZ  OFF  ENCODING          FORMAT          COMPILER             DWARF                GENERIC                 GDB    LLDB      VALUE REGS    INVALIDATE REGS
 //   ======  ====== === ===  =============     ============    ===================  ===================  ======================  ===    ====      ==========    ===============
@@ -839,51 +848,84 @@
     { "q15",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q15,   LLDB_INVALID_REGNUM,   106,    106 },  g_q15_regs,              NULL}
     };
 
-    static const uint32_t num_registers = sizeof (g_register_infos)/sizeof (RegisterInfo);
+    static const uint32_t num_registers = arraysize(g_register_infos);
     static ConstString gpr_reg_set ("General Purpose Registers");
     static ConstString sfp_reg_set ("Software Floating Point Registers");
     static ConstString vfp_reg_set ("Floating Point Registers");
     uint32_t i;
-    // Calculate the offsets of the registers
-    // Note that the layout of the "composite" registers (d0-d15 and q0-q15) which comes after the
-    // "primordial" registers is important.  This enables us to calculate the offset of the composite
-    // register by using the offset of its first primordial register.  For example, to calculate the
-    // offset of q0, use s0's offset.
-    if (g_register_infos[2].byte_offset == 0)
+    if (from_scratch)
     {
-        uint32_t byte_offset = 0;
-        for (i=0; i<num_registers; ++i)
+        // Calculate the offsets of the registers
+        // Note that the layout of the "composite" registers (d0-d15 and q0-q15) which comes after the
+        // "primordial" registers is important.  This enables us to calculate the offset of the composite
+        // register by using the offset of its first primordial register.  For example, to calculate the
+        // offset of q0, use s0's offset.
+        if (g_register_infos[2].byte_offset == 0)
         {
-            // For primordial registers, increment the byte_offset by the byte_size to arrive at the
-            // byte_offset for the next register.  Otherwise, we have a composite register whose
-            // offset can be calculated by consulting the offset of its first primordial register.
-            if (!g_register_infos[i].value_regs)
+            uint32_t byte_offset = 0;
+            for (i=0; i<num_registers; ++i)
             {
-                g_register_infos[i].byte_offset = byte_offset;
-                byte_offset += g_register_infos[i].byte_size;
+                // For primordial registers, increment the byte_offset by the byte_size to arrive at the
+                // byte_offset for the next register.  Otherwise, we have a composite register whose
+                // offset can be calculated by consulting the offset of its first primordial register.
+                if (!g_register_infos[i].value_regs)
+                {
+                    g_register_infos[i].byte_offset = byte_offset;
+                    byte_offset += g_register_infos[i].byte_size;
+                }
+                else
+                {
+                    const uint32_t first_primordial_reg = g_register_infos[i].value_regs[0];
+                    g_register_infos[i].byte_offset = g_register_infos[first_primordial_reg].byte_offset;
+                }
             }
+        }
+        for (i=0; i<num_registers; ++i)
+        {
+            ConstString name;
+            ConstString alt_name;
+            if (g_register_infos[i].name && g_register_infos[i].name[0])
+                name.SetCString(g_register_infos[i].name);
+            if (g_register_infos[i].alt_name && g_register_infos[i].alt_name[0])
+                alt_name.SetCString(g_register_infos[i].alt_name);
+
+            if (i <= 15 || i == 25)
+                AddRegister (g_register_infos[i], name, alt_name, gpr_reg_set);
+            else if (i <= 24)
+                AddRegister (g_register_infos[i], name, alt_name, sfp_reg_set);
             else
-            {
-                const uint32_t first_primordial_reg = g_register_infos[i].value_regs[0];
-                g_register_infos[i].byte_offset = g_register_infos[first_primordial_reg].byte_offset;
-            }
+                AddRegister (g_register_infos[i], name, alt_name, vfp_reg_set);
         }
     }
-    for (i=0; i<num_registers; ++i)
+    else
     {
-        ConstString name;
-        ConstString alt_name;
-        if (g_register_infos[i].name && g_register_infos[i].name[0])
-            name.SetCString(g_register_infos[i].name);
-        if (g_register_infos[i].alt_name && g_register_infos[i].alt_name[0])
-            alt_name.SetCString(g_register_infos[i].alt_name);
-
-        if (i <= 15 || i == 25)
-            AddRegister (g_register_infos[i], name, alt_name, gpr_reg_set);
-        else if (i <= 24)
-            AddRegister (g_register_infos[i], name, alt_name, sfp_reg_set);
-        else
-            AddRegister (g_register_infos[i], name, alt_name, vfp_reg_set);
+        // Add composite registers to our primordial registers, then.
+        const uint32_t num_composites = arraysize(g_composites);
+        const uint32_t num_primordials = GetNumRegisters();
+        RegisterInfo *g_comp_register_infos = g_register_infos + (num_registers - num_composites);
+        for (i=0; i<num_composites; ++i)
+        {
+            ConstString name;
+            ConstString alt_name;
+            const uint32_t first_primordial_reg = g_comp_register_infos[i].value_regs[0];
+            const char *reg_name = g_register_infos[first_primordial_reg].name;
+            if (reg_name && reg_name[0])
+            {
+                for (uint32_t j = 0; j < num_primordials; ++j)
+                {
+                    const RegisterInfo *reg_info = GetRegisterInfoAtIndex(j);
+                    // Find a matching primordial register info entry.
+                    if (reg_info && reg_info->name && ::strcasecmp(reg_info->name, reg_name) == 0)
+                    {
+                        // The name matches the existing primordial entry.
+                        // Find and assign the offset, and then add this composite register entry.
+                        g_comp_register_infos[i].byte_offset = reg_info->byte_offset;
+                        name.SetCString(g_comp_register_infos[i].name);
+                        AddRegister(g_comp_register_infos[i], name, alt_name, vfp_reg_set);
+                    }
+                }
+            }
+        }
     }
 }
 

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h Tue May 15 04:53:49 2012
@@ -154,7 +154,7 @@
     }
 
     void
-    HardcodeARMRegisters();
+    HardcodeARMRegisters(bool from_scratch);
 
 protected:
     //------------------------------------------------------------------

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue May 15 04:53:49 2012
@@ -173,8 +173,9 @@
     m_continue_S_tids (),
     m_dispatch_queue_offsets_addr (LLDB_INVALID_ADDRESS),
     m_max_memory_size (512),
-    m_waiting_for_attach (false),
-    m_thread_observation_bps()
+    m_addr_to_mmap_size (),
+    m_thread_create_bp_sp (),
+    m_waiting_for_attach (false)
 {
     m_async_broadcaster.SetEventName (eBroadcastBitAsyncThreadShouldExit,   "async thread should exit");
     m_async_broadcaster.SetEventName (eBroadcastBitAsyncContinue,           "async thread continue");
@@ -378,25 +379,28 @@
         }
     }
 
-    if (reg_num == 0)
+    // We didn't get anything if the accumulated reg_num is zero.  See if we are
+    // debugging ARM and fill with a hard coded register set until we can get an
+    // updated debugserver down on the devices.
+    // On the other hand, if the accumulated reg_num is positive, see if we can
+    // add composite registers to the existing primordial ones.
+    bool from_scratch = (reg_num == 0);
+
+    const ArchSpec &target_arch = GetTarget().GetArchitecture();
+    const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
+    if (!target_arch.IsValid())
     {
-        // We didn't get anything. See if we are debugging ARM and fill with
-        // a hard coded register set until we can get an updated debugserver
-        // down on the devices.
-        const ArchSpec &target_arch = GetTarget().GetArchitecture();
-        const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
-        if (!target_arch.IsValid())
-        {
-            if (remote_arch.IsValid()
-                && remote_arch.GetMachine() == llvm::Triple::arm
-                && remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
-                m_register_info.HardcodeARMRegisters();
-        }
-        else if (target_arch.GetMachine() == llvm::Triple::arm)
-        {
-            m_register_info.HardcodeARMRegisters();
-        }
+        if (remote_arch.IsValid()
+              && remote_arch.GetMachine() == llvm::Triple::arm
+              && remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
+            m_register_info.HardcodeARMRegisters(from_scratch);
     }
+    else if (target_arch.GetMachine() == llvm::Triple::arm)
+    {
+        m_register_info.HardcodeARMRegisters(from_scratch);
+    }
+
+    // At this point, we can finalize our register info.
     m_register_info.Finalize ();
 }
 
@@ -2669,51 +2673,33 @@
 bool
 ProcessGDBRemote::StartNoticingNewThreads()
 {
-    static const char *bp_names[] =
-    {
-        "start_wqthread",
-        "_pthread_wqthread",
-        "_pthread_start",
-        NULL
-    };
-    
     LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
-    size_t num_bps = m_thread_observation_bps.size();
-    if (num_bps != 0)
+    if (m_thread_create_bp_sp)
     {
-        for (int i = 0; i < num_bps; i++)
-        {
-            lldb::BreakpointSP break_sp = m_target.GetBreakpointByID(m_thread_observation_bps[i]);
-            if (break_sp)
-            {
-                if (log && log->GetVerbose())
-                    log->Printf("Enabled noticing new thread breakpoint.");
-                break_sp->SetEnabled(true);
-            }
-        }
+        if (log && log->GetVerbose())
+            log->Printf("Enabled noticing new thread breakpoint.");
+        m_thread_create_bp_sp->SetEnabled(true);
     }
-    else 
+    else
     {
-        for (int i = 0; bp_names[i] != NULL; i++)
+        PlatformSP platform_sp (m_target.GetPlatform());
+        if (platform_sp)
         {
-            Breakpoint *breakpoint = m_target.CreateBreakpoint (NULL, NULL, bp_names[i], eFunctionNameTypeFull, true).get();
-            if (breakpoint)
+            m_thread_create_bp_sp = platform_sp->SetThreadCreationBreakpoint(m_target);
+            if (m_thread_create_bp_sp)
             {
                 if (log && log->GetVerbose())
-                     log->Printf("Successfully created new thread notification breakpoint at \"%s\".", bp_names[i]);
-                m_thread_observation_bps.push_back(breakpoint->GetID());
-                breakpoint->SetCallback (ProcessGDBRemote::NewThreadNotifyBreakpointHit, this, true);
+                    log->Printf("Successfully created new thread notification breakpoint %i", m_thread_create_bp_sp->GetID());
+                m_thread_create_bp_sp->SetCallback (ProcessGDBRemote::NewThreadNotifyBreakpointHit, this, true);
             }
             else
             {
                 if (log)
                     log->Printf("Failed to create new thread notification breakpoint.");
-                return false;
             }
         }
     }
-
-    return true;
+    return m_thread_create_bp_sp.get() != NULL;
 }
 
 bool
@@ -2722,19 +2708,10 @@
     LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
     if (log && log->GetVerbose())
         log->Printf ("Disabling new thread notification breakpoint.");
-    size_t num_bps = m_thread_observation_bps.size();
-    if (num_bps != 0)
-    {
-        for (int i = 0; i < num_bps; i++)
-        {
-            
-            lldb::BreakpointSP break_sp = m_target.GetBreakpointByID(m_thread_observation_bps[i]);
-            if (break_sp)
-            {
-                break_sp->SetEnabled(false);
-            }
-        }
-    }
+
+    if (m_thread_create_bp_sp)
+        m_thread_create_bp_sp->SetEnabled(false);
+
     return true;
 }
     

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Tue May 15 04:53:49 2012
@@ -315,9 +315,10 @@
     tid_sig_collection m_continue_S_tids; // 'S' for step with signal
     lldb::addr_t m_dispatch_queue_offsets_addr;
     size_t m_max_memory_size;       // The maximum number of bytes to read/write when reading and writing memory
-    bool m_waiting_for_attach;
-    std::vector<lldb::user_id_t>  m_thread_observation_bps;
     MMapMap m_addr_to_mmap_size;
+    lldb::BreakpointSP m_thread_create_bp_sp;
+    bool m_waiting_for_attach;
+    
     bool
     StartAsyncThread ();
 

Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue May 15 04:53:49 2012
@@ -4858,6 +4858,135 @@
     return type_sp;
 }
 
+bool
+SymbolFileDWARF::CopyUniqueClassMethodTypes (Type *class_type,
+                                             DWARFCompileUnit* src_cu,
+                                             const DWARFDebugInfoEntry *src_class_die,
+                                             DWARFCompileUnit* dst_cu,
+                                             const DWARFDebugInfoEntry *dst_class_die)
+{
+    if (!class_type || !src_cu || !src_class_die || !dst_cu || !dst_class_die)
+        return false;
+    if (src_class_die->Tag() != dst_class_die->Tag())
+        return false;
+    
+    // We need to complete the class type so we can get all of the method types
+    // parsed so we can then unique those types to their equivalent counterparts
+    // in "dst_cu" and "dst_class_die"
+    class_type->GetClangFullType();
+
+    const DWARFDebugInfoEntry *src_die;
+    const DWARFDebugInfoEntry *dst_die;
+    UniqueCStringMap<const DWARFDebugInfoEntry *> src_name_to_die;
+    UniqueCStringMap<const DWARFDebugInfoEntry *> dst_name_to_die;
+    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);
+        }
+    }
+    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);
+        }
+    }
+    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)
+    {
+        uint32_t idx;
+        for (idx = 0; idx < src_size; ++idx)
+        {
+            src_die = src_name_to_die.GetValueAtIndexUnchecked (idx);
+            dst_die = dst_name_to_die.GetValueAtIndexUnchecked (idx);
+
+            if (src_die->Tag() != dst_die->Tag())
+            {
+                if (log)
+                    log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but 0x%8.8x (%s) tags didn't match 0x%8.8x (%s)",
+                                src_class_die->GetOffset(),
+                                dst_class_die->GetOffset(),
+                                src_die->GetOffset(),
+                                DW_TAG_value_to_name(src_die->Tag()),
+                                dst_die->GetOffset(),
+                                DW_TAG_value_to_name(src_die->Tag()));
+                return false;
+            }
+            
+            const char *src_name = src_die->GetMangledName (this, src_cu);
+            const char *dst_name = dst_die->GetMangledName (this, dst_cu);
+            
+            // Make sure the names match
+            if (src_name == dst_name || (strcmp (src_name, dst_name) == 0))
+                continue;
+
+            if (log)
+                log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but 0x%8.8x (%s) names didn't match 0x%8.8x (%s)",
+                            src_class_die->GetOffset(),
+                            dst_class_die->GetOffset(),
+                            src_die->GetOffset(),
+                            src_name,
+                            dst_die->GetOffset(),
+                            dst_name);
+            
+            return false;
+        }
+
+        for (idx = 0; idx < src_size; ++idx)
+        {
+            src_die = src_name_to_die.GetValueAtIndexUnchecked (idx);
+            dst_die = dst_name_to_die.GetValueAtIndexUnchecked (idx);
+            
+            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\n", 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());
+            }
+            
+            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());
+                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());
+            }
+        }
+        return true;
+    }
+    else
+    {
+        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",
+                        src_class_die->GetOffset(),
+                        dst_class_die->GetOffset(),
+                        src_die->GetOffset(),
+                        src_size,
+                        dst_die->GetOffset(),
+                        dst_size);
+    }
+    return false;
+}
 
 TypeSP
 SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool *type_is_new_ptr)
@@ -5745,6 +5874,31 @@
                                 Type *class_type = ResolveType (dwarf_cu, decl_ctx_die);
                                 if (class_type)
                                 {
+                                    if (class_type->GetID() != MakeUserID(decl_ctx_die->GetOffset()))
+                                    {
+                                        // We uniqued the parent class of this function to another class
+                                        // so we now need to associate all dies under "decl_ctx_die" to
+                                        // DIEs in the DIE for "class_type"...
+                                        DWARFCompileUnitSP class_type_cu_sp;
+                                        const DWARFDebugInfoEntry *class_type_die = DebugInfo()->GetDIEPtr(class_type->GetID(), &class_type_cu_sp);
+                                        if (class_type_die)
+                                        {
+                                            if (CopyUniqueClassMethodTypes (class_type,
+                                                                            class_type_cu_sp.get(),
+                                                                            class_type_die,
+                                                                            dwarf_cu,
+                                                                            decl_ctx_die))
+                                            {
+                                                type_ptr = m_die_to_type[die];
+                                                if (type_ptr)
+                                                {
+                                                    type_sp = type_ptr->shared_from_this();
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                    }
+                                    
                                     if (specification_die_offset != DW_INVALID_OFFSET)
                                     {
                                         // We have a specification which we are going to base our function

Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Tue May 15 04:53:49 2012
@@ -521,6 +521,13 @@
                            const DWARFDebugInfoEntry *class_die,
                            const lldb_private::ConstString &selector);
 
+    bool
+    CopyUniqueClassMethodTypes (lldb_private::Type *class_type,
+                                DWARFCompileUnit* src_cu,
+                                const DWARFDebugInfoEntry *src_class_die,
+                                DWARFCompileUnit* dst_cu,
+                                const DWARFDebugInfoEntry *dst_class_die);
+
     SymbolFileDWARFDebugMap *       m_debug_map_symfile;
     clang::TranslationUnitDecl *    m_clang_tu_decl;
     lldb_private::Flags             m_flags;

Modified: lldb/branches/apple/python-GIL/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Platform.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Platform.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Platform.cpp Tue May 15 04:53:49 2012
@@ -13,6 +13,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Breakpoint/BreakpointIDList.h"
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/PluginManager.h"
@@ -673,4 +674,9 @@
     
 }
 
+lldb::BreakpointSP
+Platform::SetThreadCreationBreakpoint (lldb_private::Target &target)
+{
+    return lldb::BreakpointSP();
+}
 

Modified: lldb/branches/apple/python-GIL/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Target.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Target.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Target.cpp Tue May 15 04:53:49 2012
@@ -291,11 +291,11 @@
 
 lldb::BreakpointSP
 Target::CreateBreakpoint (const FileSpecList *containingModules,
-                  const FileSpecList *containingSourceFiles,
-                  std::vector<std::string> func_names,
-                  uint32_t func_name_type_mask, 
-                  bool internal,
-                  LazyBool skip_prologue)
+                          const FileSpecList *containingSourceFiles,
+                          const std::vector<std::string> &func_names,
+                          uint32_t func_name_type_mask,
+                          bool internal,
+                          LazyBool skip_prologue)
 {
     BreakpointSP bp_sp;
     size_t num_names = func_names.size();
@@ -1512,7 +1512,6 @@
 Target::GetDefaultArchitecture ()
 {
     lldb::UserSettingsControllerSP settings_controller_sp (GetSettingsController());
-    
     if (settings_controller_sp)
         return static_cast<Target::SettingsController *>(settings_controller_sp.get())->GetArchitecture ();
     return ArchSpec();

Modified: lldb/branches/apple/python-GIL/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Thread.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Thread.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Thread.cpp Tue May 15 04:53:49 2012
@@ -375,8 +375,8 @@
                     
                     if (plan_ptr->MischiefManaged())
                     {
-                        // We're going to pop the plans up to AND INCLUDING the plan that explains the stop.
-                        plan_ptr = GetPreviousPlan(plan_ptr);
+                        // We're going to pop the plans up to and including the plan that explains the stop.
+                        ThreadPlan *prev_plan_ptr = GetPreviousPlan (plan_ptr);
                         
                         do 
                         {
@@ -384,8 +384,13 @@
                                 current_plan->WillStop();
                             PopPlan();
                         }
-                        while ((current_plan = GetCurrentPlan()) != plan_ptr);
-                        done_processing_current_plan = false;
+                        while ((current_plan = GetCurrentPlan()) != prev_plan_ptr);
+                        // Now, if the responsible plan was not "Okay to discard" then we're done,
+                        // otherwise we forward this to the next plan in the stack below.
+                        if (plan_ptr->IsMasterPlan() && !plan_ptr->OkayToDiscard())
+                            done_processing_current_plan = true;
+                        else
+                            done_processing_current_plan = false;
                     }
                     else
                         done_processing_current_plan = true;

Modified: lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp Tue May 15 04:53:49 2012
@@ -416,7 +416,7 @@
 bool
 ThreadPlanCallFunction::ShouldStop (Event *event_ptr)
 {
-    if (PlanExplainsStop())
+    if (IsPlanComplete() || PlanExplainsStop())
     {
         ReportRegisterState ("Function completed.  Register state was:");
         

Modified: lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Tue May 15 04:53:49 2012
@@ -136,6 +136,8 @@
         self.expect('frame variable french', substrs = ['Que veut cette horde d\'esclaves, De traîtres, de rois conjurés?'])
         self.expect('frame variable german', substrs = ['Über-Ich und aus den Ansprüchen der sozialen Umwelt'])
         self.expect('frame variable japanese', substrs = ['色は匂へど散りぬるを'])
+        self.expect('frame variable hebrew', substrs = ['לילה טוב'])
+
 
     def plain_data_formatter_commands(self):
         """Test basic ObjC formatting behavior."""

Modified: lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m Tue May 15 04:53:49 2012
@@ -285,6 +285,8 @@
 	    NSString* german = @"Über-Ich und aus den Ansprüchen der sozialen Umwelt";
 
 	    void* data_set[3] = {str1,str2,str3};
+	
+		NSString *hebrew = [NSString stringWithString:@"לילה טוב"];
 
 	    NSArray* newArray = [[NSMutableArray alloc] init];
 	    [newArray addObject:str1];

Modified: lldb/branches/apple/python-GIL/test/lang/c/stepping/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lang/c/stepping/main.c?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lang/c/stepping/main.c (original)
+++ lldb/branches/apple/python-GIL/test/lang/c/stepping/main.c Tue May 15 04:53:49 2012
@@ -14,12 +14,18 @@
 
 int a(int val)
 {
+    int return_value = val;
+
     if (val <= 1)
-        return b(val);
+    {
+        return_value =  b(val); // break here to stop in a before calling b
+    }
     else if (val >= 3)
-        return c(val);
+    {
+        return_value = c(val);
+    }
 
-    return val;
+    return return_value;
 }
 
 int b(int val)

Modified: lldb/branches/apple/python-GIL/www/lldb-gdb.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/www/lldb-gdb.html?rev=156811&r1=156810&r2=156811&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/www/lldb-gdb.html (original)
+++ lldb/branches/apple/python-GIL/www/lldb-gdb.html Tue May 15 04:53:49 2012
@@ -21,7 +21,7 @@
                 <div class="post">
 
                     <p>Below is a table of LLDB commands with the GDB counterparts.
-                        The built in GDB compatability aliases in GDB are also
+                        The built in GDB-compatibility aliases in LLDB are also
                         listed.</p>
                 </div>
                 <div class="postfooter"></div>





More information about the lldb-commits mailing list