[Lldb-commits] [lldb] r221908 - Fixed "SBTarget SBDebugger::CreateTarget (const char *filename)" to use the same semantics as other SBDebugger::CreateTarget() functions.

Greg Clayton gclayton at apple.com
Thu Nov 13 10:30:07 PST 2014


Author: gclayton
Date: Thu Nov 13 12:30:06 2014
New Revision: 221908

URL: http://llvm.org/viewvc/llvm-project?rev=221908&view=rev
Log:
Fixed "SBTarget SBDebugger::CreateTarget (const char *filename)" to use the same semantics as other SBDebugger::CreateTarget() functions.

The issues were:
- If you called this function with any arch other than the default target architecture, creating the target would fail because the Target::GetDefaultArchitecture() would not match the single architecture in the file specified. This caused running the test suite remotely with lldb-platform to fail many many tests due to the bad target.
- It would specify the currently selected platform which might not work for the specified platform

All other SBDebugger::CreateTarget calls do not assume an architecture or platform and if they aren't specified, they don't auto select the wrong one for you.

With this fix, SBTarget SBDebugger::CreateTarget (const char *filename) now behaves like the other SBDebugger::CreateTarget() variants.


Modified:
    lldb/trunk/source/API/SBDebugger.cpp

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=221908&r1=221907&r2=221908&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Thu Nov 13 12:30:06 2014
@@ -715,16 +715,13 @@ SBDebugger::CreateTarget (const char *fi
     TargetSP target_sp;
     if (m_opaque_sp)
     {
-        ArchSpec arch = Target::GetDefaultArchitecture ();
         Error error;
         const bool add_dependent_modules = true;
-
-        PlatformSP platform_sp(m_opaque_sp->GetPlatformList().GetSelectedPlatform());
-        error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
+        error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp,
                                                            filename, 
-                                                           arch, 
+                                                           NULL,
                                                            add_dependent_modules, 
-                                                           platform_sp,
+                                                           NULL,
                                                            target_sp);
 
         if (error.Success())





More information about the lldb-commits mailing list