Added to the public API to allow symbolication:
- New SBSection objects that are object file sections which can be accessed
  through the SBModule classes. You can get the number of sections, get a 
  section at index, and find a section by name.
- SBSections can contain subsections (first find "__TEXT" on darwin, then
  us the resulting SBSection to find "__text" sub section).
- Set load addresses for a SBSection in the SBTarget interface
- Set the load addresses of all SBSection in a SBModule in the SBTarget interface
- Add a new module the an existing target in the SBTarget interface
- Get a SBSection from a SBAddress object

This should get us a lot closer to being able to symbolicate using LLDB through
the public API.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140437 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectTarget.cpp b/source/Commands/CommandObjectTarget.cpp
index eb2ef07..4ff540d 100644
--- a/source/Commands/CommandObjectTarget.cpp
+++ b/source/Commands/CommandObjectTarget.cpp
@@ -186,48 +186,18 @@
             const char *file_path = command.GetArgumentAtIndex(0);
             Timer scoped_timer(__PRETTY_FUNCTION__, "(lldb) target create '%s'", file_path);
             FileSpec file_spec (file_path, true);
-            
-            bool select = true;
-            PlatformSP platform_sp;
-            
-            Error error;
-            
-            if (m_platform_options.PlatformWasSpecified ())
-            {
-                platform_sp = m_platform_options.CreatePlatformWithOptions(m_interpreter, select, error);
-                if (!platform_sp)
-                {
-                    result.AppendError(error.AsCString());
-                    result.SetStatus (eReturnStatusFailed);
-                    return false;
-                }
-            }
-            ArchSpec file_arch;
-            
-            const char *arch_cstr = m_arch_option.GetArchitectureName();
-            if (arch_cstr)
-            {        
-                if (!platform_sp)
-                    platform_sp = m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
-                if (!m_arch_option.GetArchitecture(platform_sp.get(), file_arch))
-                {
-                    result.AppendErrorWithFormat("invalid architecture '%s'\n", arch_cstr);
-                    result.SetStatus (eReturnStatusFailed);
-                    return false;
-                }
-            }
-            
-            if (! file_spec.Exists() && !file_spec.ResolveExecutableLocation())
-            {
-                result.AppendErrorWithFormat ("File '%s' does not exist.\n", file_path);
-                result.SetStatus (eReturnStatusFailed);
-                return false;
-            }
-            
+
             TargetSP target_sp;
             Debugger &debugger = m_interpreter.GetDebugger();
-            error = debugger.GetTargetList().CreateTarget (debugger, file_spec, file_arch, true, target_sp);
-            
+            const char *arch_cstr = m_arch_option.GetArchitectureName();
+            const bool get_dependent_files = true;
+            Error error (debugger.GetTargetList().CreateTarget (debugger,
+                                                                file_spec,
+                                                                arch_cstr,
+                                                                get_dependent_files,
+                                                                &m_platform_options,
+                                                                target_sp));
+
             if (target_sp)
             {
                 debugger.GetTargetList().SetSelectedTarget(target_sp.get());