[Lldb-commits] [lldb] r222167 - Fixed more fallout from running the test suite remotely on iOS devices.

Greg Clayton gclayton at apple.com
Mon Nov 17 11:39:20 PST 2014


Author: gclayton
Date: Mon Nov 17 13:39:20 2014
New Revision: 222167

URL: http://llvm.org/viewvc/llvm-project?rev=222167&view=rev
Log:
Fixed more fallout from running the test suite remotely on iOS devices.

Fixed include:
- Change Platform::ResolveExecutable(...) to take a ModuleSpec instead of a FileSpec + ArchSpec to help resolve executables correctly when we have just a path + UUID (no arch).
- Add the ability to set the listener in SBLaunchInfo and SBAttachInfo in case you don't want to use the debugger as the default listener. 
- Modified all places that use the SBLaunchInfo/SBAttachInfo and the internal ProcessLaunchInfo/ProcessAttachInfo to not take a listener as a parameter since it is in the launch/attach info now
- Load a module's sections by default when removing a module from a target. Since we create JIT modules for expressions and helper functions, we could end up with stale data in the section load list if a module was removed from the target as the section load list would still have entries for the unloaded module. Target now has the following functions to help unload all sections a single or multiple modules:

    size_t
    Target::UnloadModuleSections (const ModuleList &module_list);

    size_t
    Target::UnloadModuleSections (const lldb::ModuleSP &module_sp);


Modified:
    lldb/trunk/include/lldb/API/SBListener.h
    lldb/trunk/include/lldb/API/SBTarget.h
    lldb/trunk/include/lldb/Target/Platform.h
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h
    lldb/trunk/include/lldb/Target/Target.h
    lldb/trunk/scripts/Python/interface/SBTarget.i
    lldb/trunk/source/API/SBListener.cpp
    lldb/trunk/source/API/SBTarget.cpp
    lldb/trunk/source/Commands/CommandObjectPlatform.cpp
    lldb/trunk/source/Commands/CommandObjectProcess.cpp
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
    lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp
    lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.h
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
    lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h
    lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp
    lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.h
    lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
    lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Target/Platform.cpp
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/source/Target/ProcessLaunchInfo.cpp
    lldb/trunk/source/Target/StackFrameList.cpp
    lldb/trunk/source/Target/Target.cpp
    lldb/trunk/source/Target/TargetList.cpp

Modified: lldb/trunk/include/lldb/API/SBListener.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBListener.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBListener.h (original)
+++ lldb/trunk/include/lldb/API/SBListener.h Mon Nov 17 13:39:20 2014
@@ -99,13 +99,23 @@ public:
     HandleBroadcastEvent (const lldb::SBEvent &event);
 
 protected:
+    friend class SBAttachInfo;
     friend class SBBroadcaster;
     friend class SBCommandInterpreter;
     friend class SBDebugger;
+    friend class SBLaunchInfo;
     friend class SBTarget;
 
     SBListener (lldb_private::Listener &listener);
 
+    SBListener (const lldb::ListenerSP &listener_sp);
+
+    lldb::ListenerSP
+    GetSP ()
+    {
+        return m_opaque_sp;
+    }
+
 private:
 
     lldb_private::Listener *

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Mon Nov 17 13:39:20 2014
@@ -51,7 +51,7 @@ public:
     
     SBFileSpec
     GetExecutableFile ();
-    
+
     //----------------------------------------------------------------------
     /// Set the executable file that will be used to launch the process and
     /// optionally set it as the first argument in the argument vector.
@@ -77,7 +77,29 @@ public:
     //----------------------------------------------------------------------
     void
     SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg);
-    
+
+
+    //----------------------------------------------------------------------
+    /// Get the listener that will be used to receive process events.
+    ///
+    /// If no listener has been set via a call to
+    /// SBLaunchInfo::SetListener(), then an invalid SBListener will be
+    /// returned (SBListener::IsValid() will return false). If a listener
+    /// has been set, then the valid listener object will be returned.
+    //----------------------------------------------------------------------
+    SBListener
+    GetListener ();
+
+    //----------------------------------------------------------------------
+    /// Set the listener that will be used to receive process events.
+    ///
+    /// By default the SBDebugger, which has a listener, that the SBTarget
+    /// belongs to will listen for the process events. Calling this function
+    /// allows a different listener to be used to listen for process events.
+    //----------------------------------------------------------------------
+    void
+    SetListener (SBListener &listener);
+
     uint32_t
     GetNumArguments ();
     
@@ -258,7 +280,28 @@ public:
     
     bool
     ParentProcessIDIsValid();
-    
+
+    //----------------------------------------------------------------------
+    /// Get the listener that will be used to receive process events.
+    ///
+    /// If no listener has been set via a call to
+    /// SBLaunchInfo::SetListener(), then an invalid SBListener will be
+    /// returned (SBListener::IsValid() will return false). If a listener
+    /// has been set, then the valid listener object will be returned.
+    //----------------------------------------------------------------------
+    SBListener
+    GetListener ();
+
+    //----------------------------------------------------------------------
+    /// Set the listener that will be used to receive process events.
+    ///
+    /// By default the SBDebugger, which has a listener, that the SBTarget
+    /// belongs to will listen for the process events. Calling this function
+    /// allows a different listener to be used to listen for process events.
+    //----------------------------------------------------------------------
+    void
+    SetListener (SBListener &listener);
+
     
 protected:
     friend class SBTarget;

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Mon Nov 17 13:39:20 2014
@@ -141,8 +141,7 @@ namespace lldb_private {
         ///     a suitable executable, \b false otherwise.
         //------------------------------------------------------------------
         virtual Error
-        ResolveExecutable (const FileSpec &exe_file,
-                           const ArchSpec &arch,
+        ResolveExecutable (const ModuleSpec &module_spec,
                            lldb::ModuleSP &module_sp,
                            const FileSpecList *module_search_paths_ptr);
 
@@ -413,7 +412,6 @@ namespace lldb_private {
         DebugProcess (ProcessLaunchInfo &launch_info,
                       Debugger &debugger,
                       Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                      Listener &listener,
                       Error &error);
 
         //------------------------------------------------------------------
@@ -438,7 +436,6 @@ namespace lldb_private {
         Attach (ProcessAttachInfo &attach_info,
                 Debugger &debugger,
                 Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                Listener &listener,
                 Error &error) = 0;
 
         //------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Mon Nov 17 13:39:20 2014
@@ -228,6 +228,8 @@ class ProcessAttachInfo : public Process
 public:
     ProcessAttachInfo() :
         ProcessInstanceInfo(),
+        m_listener_sp(),
+        m_hijack_listener_sp(),
         m_plugin_name (),
         m_resume_count (0),
         m_wait_for_launch (false),
@@ -239,6 +241,8 @@ public:
 
     ProcessAttachInfo (const ProcessLaunchInfo &launch_info) :
         ProcessInstanceInfo(),
+        m_listener_sp(),
+        m_hijack_listener_sp(),
         m_plugin_name (),
         m_resume_count (0),
         m_wait_for_launch (false),
@@ -249,6 +253,7 @@ public:
         ProcessInfo::operator= (launch_info);
         SetProcessPluginName (launch_info.GetProcessPluginName());
         SetResumeCount (launch_info.GetResumeCount());
+        SetListener(launch_info.GetListener());
         SetHijackListener(launch_info.GetHijackListener());
         m_detach_on_error = launch_info.GetDetachOnError();
     }
@@ -364,8 +369,26 @@ public:
     {
         m_detach_on_error = enable;
     }
-    
+
+    // Get and set the actual listener that will be used for the process events
+    lldb::ListenerSP
+    GetListener () const
+    {
+        return m_listener_sp;
+    }
+
+    void
+    SetListener (const lldb::ListenerSP &listener_sp)
+    {
+        m_listener_sp = listener_sp;
+    }
+
+
+    Listener &
+    GetListenerForProcess (Debugger &debugger);
+
 protected:
+    lldb::ListenerSP m_listener_sp;
     lldb::ListenerSP m_hijack_listener_sp;
     std::string m_plugin_name;
     uint32_t m_resume_count; // How many times do we resume after launching

Modified: lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h (original)
+++ lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h Mon Nov 17 13:39:20 2014
@@ -179,6 +179,22 @@ namespace lldb_private
             return *m_pty;
         }
 
+        // Get and set the actual listener that will be used for the process events
+        lldb::ListenerSP
+        GetListener () const
+        {
+            return m_listener_sp;
+        }
+
+        void
+        SetListener (const lldb::ListenerSP &listener_sp)
+        {
+            m_listener_sp = listener_sp;
+        }
+
+        Listener &
+        GetListenerForProcess (Debugger &debugger);
+
         lldb::ListenerSP
         GetHijackListener () const
         {
@@ -191,7 +207,6 @@ namespace lldb_private
             m_hijack_listener_sp = listener_sp;
         }
 
-
         void
         SetLaunchEventData (const char *data)
         {
@@ -225,6 +240,7 @@ namespace lldb_private
         void *m_monitor_callback_baton;
         bool m_monitor_signals;
         std::string m_event_data; // A string passed to the plugin launch, having no meaning to the upper levels of lldb.
+        lldb::ListenerSP m_listener_sp;
         lldb::ListenerSP m_hijack_listener_sp;
     };
 }

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Mon Nov 17 13:39:20 2014
@@ -607,8 +607,7 @@ public:
     Destroy();
     
     Error
-    Launch (Listener &listener,
-            ProcessLaunchInfo &launch_info,
+    Launch (ProcessLaunchInfo &launch_info,
             Stream *stream); // Optional stream to receive first stop info
 
     //------------------------------------------------------------------
@@ -1147,6 +1146,12 @@ public:
                            lldb::addr_t load_addr,
                            bool warn_multiple = false);
 
+    size_t
+    UnloadModuleSections (const lldb::ModuleSP &module_sp);
+
+    size_t
+    UnloadModuleSections (const ModuleList &module_list);
+
     bool
     SetSectionUnloaded (const lldb::SectionSP &section_sp);
 

Modified: lldb/trunk/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTarget.i?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTarget.i (original)
+++ lldb/trunk/scripts/Python/interface/SBTarget.i Mon Nov 17 13:39:20 2014
@@ -38,6 +38,12 @@ public:
     void
     SetExecutableFile (lldb::SBFileSpec exe_file, bool add_as_first_arg);
 
+    lldb::SBListener
+    GetListener ();
+
+    void
+    SetListener (lldb::SBListener &listener);
+
     uint32_t
     GetNumArguments ();
     
@@ -205,6 +211,12 @@ public:
     
     bool
     ParentProcessIDIsValid();
+
+    lldb::SBListener
+    GetListener ();
+
+    void
+    SetListener (lldb::SBListener &listener);
 };
     
     

Modified: lldb/trunk/source/API/SBListener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBListener.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/API/SBListener.cpp (original)
+++ lldb/trunk/source/API/SBListener.cpp Mon Nov 17 13:39:20 2014
@@ -69,6 +69,12 @@ SBListener::SBListener (Listener &listen
 {
 }
 
+SBListener::SBListener (const lldb::ListenerSP &listener_sp) :
+    m_opaque_sp (listener_sp),
+    m_opaque_ptr (listener_sp.get())
+{
+}
+
 SBListener::~SBListener ()
 {
 }

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Mon Nov 17 13:39:20 2014
@@ -133,6 +133,18 @@ SBLaunchInfo::SetExecutableFile (SBFileS
     m_opaque_sp->SetExecutableFile(exe_file.ref(), add_as_first_arg);
 }
 
+SBListener
+SBLaunchInfo::GetListener ()
+{
+    return SBListener(m_opaque_sp->GetListener());
+}
+
+void
+SBLaunchInfo::SetListener (SBListener &listener)
+{
+    m_opaque_sp->SetListener(listener.GetSP());
+}
+
 uint32_t
 SBLaunchInfo::GetNumArguments ()
 {
@@ -520,6 +532,17 @@ SBAttachInfo::ParentProcessIDIsValid()
     return m_opaque_sp->ParentProcessIDIsValid();
 }
 
+SBListener
+SBAttachInfo::GetListener ()
+{
+    return SBListener(m_opaque_sp->GetListener());
+}
+
+void
+SBAttachInfo::SetListener (SBListener &listener)
+{
+    m_opaque_sp->SetListener(listener.GetSP());
+}
 
 //----------------------------------------------------------------------
 // SBTarget constructor
@@ -751,9 +774,9 @@ SBTarget::Launch
             launch_info.GetEnvironmentEntries ().SetArguments (envp);
 
         if (listener.IsValid())
-            error.SetError (target_sp->Launch(listener.ref(), launch_info, NULL));
-        else
-            error.SetError (target_sp->Launch(target_sp->GetDebugger().GetListener(), launch_info, NULL));
+            launch_info.SetListener(listener.GetSP());
+
+        error.SetError (target_sp->Launch(launch_info, NULL));
 
         sb_process.SetSP(target_sp->GetProcessSP());
     }
@@ -817,7 +840,7 @@ SBTarget::Launch (SBLaunchInfo &sb_launc
         if (arch_spec.IsValid())
             launch_info.GetArchitecture () = arch_spec;
 
-        error.SetError (target_sp->Launch (target_sp->GetDebugger().GetListener(), launch_info, NULL));
+        error.SetError (target_sp->Launch (launch_info, NULL));
         sb_process.SetSP(target_sp->GetProcessSP());
     }
     else

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Mon Nov 17 13:39:20 2014
@@ -1347,7 +1347,6 @@ protected:
                 ProcessSP process_sp (platform_sp->DebugProcess (m_options.launch_info, 
                                                                  debugger,
                                                                  target,
-                                                                 debugger.GetListener(),
                                                                  error));
                 if (process_sp && process_sp->IsAlive())
                 {
@@ -1933,7 +1932,7 @@ public:
         {
             Error err;
             ProcessSP remote_process_sp =
-            platform_sp->Attach(m_options.attach_info, m_interpreter.GetDebugger(), NULL, m_interpreter.GetDebugger().GetListener(), err);
+            platform_sp->Attach(m_options.attach_info, m_interpreter.GetDebugger(), NULL, err);
             if (err.Fail())
             {
                 result.AppendError(err.AsCString());

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Mon Nov 17 13:39:20 2014
@@ -260,7 +260,7 @@ protected:
         }
 
         StreamString stream;
-        Error error = target->Launch(debugger.GetListener(), m_options.launch_info, &stream);
+        Error error = target->Launch(m_options.launch_info, &stream);
         
         if (error.Success())
         {

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Mon Nov 17 13:39:20 2014
@@ -42,6 +42,7 @@
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/ConnectionFileDescriptor.h"
@@ -1306,17 +1307,14 @@ Host::LaunchProcess (ProcessLaunchInfo &
     Error error;
     char exe_path[PATH_MAX];
     PlatformSP host_platform_sp (Platform::GetHostPlatform ());
-    
-    const ArchSpec &arch_spec = launch_info.GetArchitecture();
-    
-    FileSpec exe_spec(launch_info.GetExecutableFile());
-    
-    FileSpec::FileType file_type = exe_spec.GetFileType();
+
+    ModuleSpec exe_module_spec(launch_info.GetExecutableFile(), launch_info.GetArchitecture());
+
+    FileSpec::FileType file_type = exe_module_spec.GetFileSpec().GetFileType();
     if (file_type != FileSpec::eFileTypeRegular)
     {
         lldb::ModuleSP exe_module_sp;
-        error = host_platform_sp->ResolveExecutable (exe_spec,
-                                                     arch_spec,
+        error = host_platform_sp->ResolveExecutable (exe_module_spec,
                                                      exe_module_sp,
                                                      NULL);
         
@@ -1324,12 +1322,12 @@ Host::LaunchProcess (ProcessLaunchInfo &
             return error;
         
         if (exe_module_sp)
-            exe_spec = exe_module_sp->GetFileSpec();
+            exe_module_spec.GetFileSpec() = exe_module_sp->GetFileSpec();
     }
     
-    if (exe_spec.Exists())
+    if (exe_module_spec.GetFileSpec().Exists())
     {
-        exe_spec.GetPath (exe_path, sizeof(exe_path));
+        exe_module_spec.GetFileSpec().GetPath (exe_path, sizeof(exe_path));
     }
     else
     {

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Mon Nov 17 13:39:20 2014
@@ -180,8 +180,7 @@ PlatformFreeBSD::RunShellCommand (const
 
 
 Error
-PlatformFreeBSD::ResolveExecutable (const FileSpec &exe_file,
-                                    const ArchSpec &exe_arch,
+PlatformFreeBSD::ResolveExecutable (const ModuleSpec &module_spec,
                                     lldb::ModuleSP &exe_module_sp,
                                     const FileSpecList *module_search_paths_ptr)
 {
@@ -189,35 +188,33 @@ PlatformFreeBSD::ResolveExecutable (cons
     // Nothing special to do here, just use the actual file and architecture
 
     char exe_path[PATH_MAX];
-    FileSpec resolved_exe_file (exe_file);
+    ModuleSpec resolved_module_spec(module_spec);
 
     if (IsHost())
     {
-        // If we have "ls" as the exe_file, resolve the executable location based on
+        // If we have "ls" as the module_spec's file, resolve the executable location based on
         // the current path variables
-        if (!resolved_exe_file.Exists())
+        if (!resolved_module_spec.GetFileSpec().Exists())
         {
-            exe_file.GetPath(exe_path, sizeof(exe_path));
-            resolved_exe_file.SetFile(exe_path, true);
+            module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
+            resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
         }
 
-        if (!resolved_exe_file.Exists())
-            resolved_exe_file.ResolveExecutableLocation ();
+        if (!resolved_module_spec.GetFileSpec().Exists())
+            resolved_module_spec.GetFileSpec().ResolveExecutableLocation ();
 
-        if (resolved_exe_file.Exists())
+        if (resolved_module_spec.GetFileSpec().Exists())
             error.Clear();
         else
         {
-            exe_file.GetPath(exe_path, sizeof(exe_path));
-            error.SetErrorStringWithFormat("unable to find executable for '%s'", exe_path);
+            error.SetErrorStringWithFormat("unable to find executable for '%s'", resolved_module_spec.GetFileSpec().GetPath().c_str());
         }
     }
     else
     {
         if (m_remote_platform_sp)
         {
-            error = m_remote_platform_sp->ResolveExecutable (exe_file,
-                                                             exe_arch,
+            error = m_remote_platform_sp->ResolveExecutable (module_spec,
                                                              exe_module_sp,
                                                              module_search_paths_ptr);
         }
@@ -226,25 +223,24 @@ PlatformFreeBSD::ResolveExecutable (cons
             // We may connect to a process and use the provided executable (Don't use local $PATH).
 
             // Resolve any executable within a bundle on MacOSX
-            Host::ResolveExecutableInBundle (resolved_exe_file);
+            Host::ResolveExecutableInBundle (resolved_module_spec.GetFileSpec());
 
-            if (resolved_exe_file.Exists()) {
+            if (resolved_module_spec.GetFileSpec().Exists())
+            {
                 error.Clear();
             }
             else
             {
-                exe_file.GetPath(exe_path, sizeof(exe_path));
-                error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", exe_path);
+                error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", resolved_module_spec.GetFileSpec().GetPath().c_str());
             }
         }
     }
 
     if (error.Success())
     {
-        ModuleSpec module_spec (resolved_exe_file, exe_arch);
-        if (module_spec.GetArchitecture().IsValid())
+        if (resolved_module_spec.GetArchitecture().IsValid())
         {
-            error = ModuleList::GetSharedModule (module_spec,
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp,
                                                  module_search_paths_ptr,
                                                  NULL,
@@ -254,8 +250,8 @@ PlatformFreeBSD::ResolveExecutable (cons
             {
                 exe_module_sp.reset();
                 error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
-                                                exe_file.GetPath().c_str(),
-                                                exe_arch.GetArchitectureName());
+                                                resolved_module_spec.GetFileSpec().GetPath().c_str(),
+                                                resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
         }
         else
@@ -264,10 +260,9 @@ PlatformFreeBSD::ResolveExecutable (cons
             // the architectures that we should be using (in the correct order)
             // and see if we can find a match that way
             StreamString arch_names;
-            ArchSpec platform_arch;
-            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, platform_arch); ++idx)
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
             {
-                error = ModuleList::GetSharedModule (module_spec,
+                error = ModuleList::GetSharedModule (resolved_module_spec,
                                                      exe_module_sp,
                                                      module_search_paths_ptr,
                                                      NULL,
@@ -283,21 +278,21 @@ PlatformFreeBSD::ResolveExecutable (cons
 
                 if (idx > 0)
                     arch_names.PutCString (", ");
-                arch_names.PutCString (platform_arch.GetArchitectureName());
+                arch_names.PutCString (resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
 
             if (error.Fail() || !exe_module_sp)
             {
-                if (exe_file.Readable())
+                if (resolved_module_spec.GetFileSpec().Readable())
                 {
                     error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
-                                                    exe_file.GetPath().c_str(),
+                                                    resolved_module_spec.GetFileSpec().GetPath().c_str(),
                                                     GetPluginName().GetCString(),
                                                     arch_names.GetString().c_str());
                 }
                 else
                 {
-                    error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+                    error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
                 }
             }
         }
@@ -514,7 +509,6 @@ lldb::ProcessSP
 PlatformFreeBSD::Attach(ProcessAttachInfo &attach_info,
                         Debugger &debugger,
                         Target *target,
-                        Listener &listener,
                         Error &error)
 {
     lldb::ProcessSP process_sp;
@@ -542,7 +536,7 @@ PlatformFreeBSD::Attach(ProcessAttachInf
             // The freebsd always currently uses the GDB remote debugger plug-in
             // so even when debugging locally we are debugging remotely!
             // Just like the darwin plugin.
-            process_sp = target->CreateProcess (listener, "gdb-remote", NULL);
+            process_sp = target->CreateProcess (attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
 
             if (process_sp)
                 error = process_sp->Attach (attach_info);
@@ -551,7 +545,7 @@ PlatformFreeBSD::Attach(ProcessAttachInf
     else
     {
         if (m_remote_platform_sp)
-            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, listener, error);
+            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, error);
         else
             error.SetErrorString ("the platform is not currently connected");
     }

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h Mon Nov 17 13:39:20 2014
@@ -80,8 +80,7 @@ public:
                      uint32_t timeout_sec);
 
     virtual lldb_private::Error
-    ResolveExecutable (const lldb_private::FileSpec &exe_file,
-                       const lldb_private::ArchSpec &arch,
+    ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
                        lldb::ModuleSP &module_sp,
                        const lldb_private::FileSpecList *module_search_paths_ptr);
 
@@ -135,7 +134,6 @@ public:
     Attach(lldb_private::ProcessAttachInfo &attach_info,
            lldb_private::Debugger &debugger,
            lldb_private::Target *target,
-           lldb_private::Listener &listener,
            lldb_private::Error &error);
 
     // FreeBSD processes can not be launched by spawning and attaching.

Modified: lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp Mon Nov 17 13:39:20 2014
@@ -97,27 +97,25 @@ PlatformKalimba::Terminate ()
 }
 
 Error
-PlatformKalimba::ResolveExecutable (const FileSpec &exe_file,
-                                  const ArchSpec &exe_arch,
-                                  lldb::ModuleSP &exe_module_sp,
-                                  const FileSpecList *module_search_paths_ptr)
+PlatformKalimba::ResolveExecutable (const ModuleSpec &ms,
+                                    lldb::ModuleSP &exe_module_sp,
+                                    const FileSpecList *module_search_paths_ptr)
 {
     Error error;
     char exe_path[PATH_MAX];
-    FileSpec resolved_exe_file (exe_file);
+    ModuleSpec resolved_module_spec(ms);
 
-    if (!resolved_exe_file.Exists())
+    if (!resolved_module_spec.GetFileSpec().Exists())
     {
-        exe_file.GetPath(exe_path, sizeof(exe_path));
+        resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
         error.SetErrorStringWithFormat("unable to find executable for '%s'", exe_path);
     }
 
     if (error.Success())
     {
-        ModuleSpec module_spec (resolved_exe_file, exe_arch);
-        if (exe_arch.IsValid())
+        if (resolved_module_spec.GetArchitecture().IsValid())
         {
-            error = ModuleList::GetSharedModule (module_spec, 
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp, 
                                                  NULL, 
                                                  NULL,
@@ -126,7 +124,7 @@ PlatformKalimba::ResolveExecutable (cons
             {
                 // If we failed, it may be because the vendor and os aren't known. If that is the
                 // case, try setting them to the host architecture and give it another try.
-                llvm::Triple &module_triple = module_spec.GetArchitecture().GetTriple(); 
+                llvm::Triple &module_triple = resolved_module_spec.GetArchitecture().GetTriple();
                 bool is_vendor_specified = (module_triple.getVendor() != llvm::Triple::UnknownVendor);
                 bool is_os_specified = (module_triple.getOS() != llvm::Triple::UnknownOS);
                 if (!is_vendor_specified || !is_os_specified)
@@ -138,7 +136,7 @@ PlatformKalimba::ResolveExecutable (cons
                     if (!is_os_specified)
                         module_triple.setOSName (host_triple.getOSName());
 
-                    error = ModuleList::GetSharedModule (module_spec, 
+                    error = ModuleList::GetSharedModule (resolved_module_spec,
                                                          exe_module_sp, 
                                                          NULL, 
                                                          NULL,
@@ -151,8 +149,8 @@ PlatformKalimba::ResolveExecutable (cons
             {
                 exe_module_sp.reset();
                 error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
-                                                exe_file.GetPath().c_str(),
-                                                exe_arch.GetArchitectureName());
+                                                resolved_module_spec.GetFileSpec().GetPath().c_str(),
+                                                resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
         }
         else
@@ -161,9 +159,9 @@ PlatformKalimba::ResolveExecutable (cons
             // the architectures that we should be using (in the correct order)
             // and see if we can find a match that way
             StreamString arch_names;
-            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
             {
-                error = ModuleList::GetSharedModule (module_spec, 
+                error = ModuleList::GetSharedModule (resolved_module_spec,
                                                      exe_module_sp, 
                                                      NULL, 
                                                      NULL,
@@ -179,21 +177,21 @@ PlatformKalimba::ResolveExecutable (cons
                 
                 if (idx > 0)
                     arch_names.PutCString (", ");
-                arch_names.PutCString (module_spec.GetArchitecture().GetArchitectureName());
+                arch_names.PutCString (resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
             
             if (error.Fail() || !exe_module_sp)
             {
-                if (exe_file.Readable())
+                if (resolved_module_spec.GetFileSpec().Readable())
                 {
                     error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
-                                                    exe_file.GetPath().c_str(),
+                                                    resolved_module_spec.GetFileSpec().GetPath().c_str(),
                                                     GetPluginName().GetCString(),
                                                     arch_names.GetString().c_str());
                 }
                 else
                 {
-                    error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+                    error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
                 }
             }
         }
@@ -298,10 +296,9 @@ PlatformKalimba::LaunchProcess (ProcessL
 
 lldb::ProcessSP
 PlatformKalimba::Attach(ProcessAttachInfo &attach_info,
-                      Debugger &debugger,
-                      Target *target,
-                      Listener &listener,
-                      Error &error)
+                        Debugger &debugger,
+                        Target *target,
+                        Error &error)
 {
     lldb::ProcessSP process_sp;
     if (IsHost())
@@ -311,7 +308,7 @@ PlatformKalimba::Attach(ProcessAttachInf
     else
     {
         if (m_remote_platform_sp)
-            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, listener, error);
+            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, error);
         else
             error.SetErrorString ("the platform is not currently connected");
     }

Modified: lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.h (original)
+++ lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.h Mon Nov 17 13:39:20 2014
@@ -58,8 +58,7 @@ namespace lldb_private {
         // lldb_private::Platform functions
         //------------------------------------------------------------
         virtual Error
-        ResolveExecutable (const FileSpec &exe_file,
-                           const ArchSpec &arch,
+        ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
                            lldb::ModuleSP &module_sp,
                            const FileSpecList *module_search_paths_ptr) override;
 
@@ -91,7 +90,7 @@ namespace lldb_private {
 
         virtual lldb::ProcessSP
         Attach(ProcessAttachInfo &attach_info, Debugger &debugger,
-               Target *target, Listener &listener, Error &error) override;
+               Target *target, Error &error) override;
 
         // Kalimba processes can not be launched by spawning and attaching.
         virtual bool

Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Mon Nov 17 13:39:20 2014
@@ -269,8 +269,7 @@ PlatformLinux::Terminate ()
 }
 
 Error
-PlatformLinux::ResolveExecutable (const FileSpec &exe_file,
-                                  const ArchSpec &exe_arch,
+PlatformLinux::ResolveExecutable (const ModuleSpec &ms,
                                   lldb::ModuleSP &exe_module_sp,
                                   const FileSpecList *module_search_paths_ptr)
 {
@@ -278,35 +277,33 @@ PlatformLinux::ResolveExecutable (const
     // Nothing special to do here, just use the actual file and architecture
 
     char exe_path[PATH_MAX];
-    FileSpec resolved_exe_file (exe_file);
+    ModuleSpec resolved_module_spec (ms);
     
     if (IsHost())
     {
         // If we have "ls" as the exe_file, resolve the executable location based on
         // the current path variables
-        if (!resolved_exe_file.Exists())
+        if (!resolved_module_spec.GetFileSpec().Exists())
         {
-            exe_file.GetPath(exe_path, sizeof(exe_path));
-            resolved_exe_file.SetFile(exe_path, true);
+            resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
+            resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
         }
 
-        if (!resolved_exe_file.Exists())
-            resolved_exe_file.ResolveExecutableLocation ();
+        if (!resolved_module_spec.GetFileSpec().Exists())
+            resolved_module_spec.GetFileSpec().ResolveExecutableLocation ();
 
-        if (resolved_exe_file.Exists())
+        if (resolved_module_spec.GetFileSpec().Exists())
             error.Clear();
         else
         {
-            exe_file.GetPath(exe_path, sizeof(exe_path));
-            error.SetErrorStringWithFormat("unable to find executable for '%s'", exe_path);
+            error.SetErrorStringWithFormat("unable to find executable for '%s'", resolved_module_spec.GetFileSpec().GetPath().c_str());
         }
     }
     else
     {
         if (m_remote_platform_sp)
         {
-            error = m_remote_platform_sp->ResolveExecutable (exe_file,
-                                                             exe_arch,
+            error = m_remote_platform_sp->ResolveExecutable (ms,
                                                              exe_module_sp,
                                                              NULL);
         }
@@ -314,7 +311,7 @@ PlatformLinux::ResolveExecutable (const
         {
             // We may connect to a process and use the provided executable (Don't use local $PATH).
             
-            if (resolved_exe_file.Exists())
+            if (resolved_module_spec.GetFileSpec().Exists())
                 error.Clear();
             else
                 error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", exe_path);
@@ -323,10 +320,9 @@ PlatformLinux::ResolveExecutable (const
 
     if (error.Success())
     {
-        ModuleSpec module_spec (resolved_exe_file, exe_arch);
-        if (exe_arch.IsValid())
+        if (resolved_module_spec.GetArchitecture().IsValid())
         {
-            error = ModuleList::GetSharedModule (module_spec, 
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp, 
                                                  NULL, 
                                                  NULL,
@@ -335,7 +331,7 @@ PlatformLinux::ResolveExecutable (const
             {
                 // If we failed, it may be because the vendor and os aren't known. If that is the
                 // case, try setting them to the host architecture and give it another try.
-                llvm::Triple &module_triple = module_spec.GetArchitecture().GetTriple(); 
+                llvm::Triple &module_triple = resolved_module_spec.GetArchitecture().GetTriple();
                 bool is_vendor_specified = (module_triple.getVendor() != llvm::Triple::UnknownVendor);
                 bool is_os_specified = (module_triple.getOS() != llvm::Triple::UnknownOS);
                 if (!is_vendor_specified || !is_os_specified)
@@ -347,7 +343,7 @@ PlatformLinux::ResolveExecutable (const
                     if (!is_os_specified)
                         module_triple.setOSName (host_triple.getOSName());
 
-                    error = ModuleList::GetSharedModule (module_spec, 
+                    error = ModuleList::GetSharedModule (resolved_module_spec,
                                                          exe_module_sp, 
                                                          NULL, 
                                                          NULL,
@@ -360,8 +356,8 @@ PlatformLinux::ResolveExecutable (const
             {
                 exe_module_sp.reset();
                 error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
-                                                exe_file.GetPath().c_str(),
-                                                exe_arch.GetArchitectureName());
+                                                resolved_module_spec.GetFileSpec().GetPath().c_str(),
+                                                resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
         }
         else
@@ -370,9 +366,9 @@ PlatformLinux::ResolveExecutable (const
             // the architectures that we should be using (in the correct order)
             // and see if we can find a match that way
             StreamString arch_names;
-            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
             {
-                error = ModuleList::GetSharedModule (module_spec, 
+                error = ModuleList::GetSharedModule (resolved_module_spec,
                                                      exe_module_sp, 
                                                      NULL, 
                                                      NULL,
@@ -388,21 +384,21 @@ PlatformLinux::ResolveExecutable (const
                 
                 if (idx > 0)
                     arch_names.PutCString (", ");
-                arch_names.PutCString (module_spec.GetArchitecture().GetArchitectureName());
+                arch_names.PutCString (resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
             
             if (error.Fail() || !exe_module_sp)
             {
-                if (exe_file.Readable())
+                if (resolved_module_spec.GetFileSpec().Readable())
                 {
                     error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
-                                                    exe_file.GetPath().c_str(),
+                                                    resolved_module_spec.GetFileSpec().GetPath().c_str(),
                                                     GetPluginName().GetCString(),
                                                     arch_names.GetString().c_str());
                 }
                 else
                 {
-                    error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+                    error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
                 }
             }
         }
@@ -638,10 +634,9 @@ PlatformLinux::CanDebugProcess ()
 // approach on MacOSX.
 lldb::ProcessSP
 PlatformLinux::DebugProcess (ProcessLaunchInfo &launch_info,
-                        Debugger &debugger,
-                        Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                        Listener &listener,
-                        Error &error)
+                             Debugger &debugger,
+                             Target *target,       // Can be NULL, if NULL create a new target, else use existing one
+                             Error &error)
 {
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM));
     if (log)
@@ -649,7 +644,7 @@ PlatformLinux::DebugProcess (ProcessLaun
 
     // If we're a remote host, use standard behavior from parent class.
     if (!IsHost ())
-        return PlatformPOSIX::DebugProcess (launch_info, debugger, target, listener, error);
+        return PlatformPOSIX::DebugProcess (launch_info, debugger, target, error);
 
     //
     // For local debugging, we'll insist on having ProcessGDBRemote create the process.
@@ -714,7 +709,7 @@ PlatformLinux::DebugProcess (ProcessLaun
     // Now create the gdb-remote process.
     if (log)
         log->Printf ("PlatformLinux::%s having target create process with gdb-remote plugin", __FUNCTION__);
-    process_sp = target->CreateProcess (listener, "gdb-remote", nullptr);
+    process_sp = target->CreateProcess (launch_info.GetListenerForProcess(debugger), "gdb-remote", nullptr);
 
     if (!process_sp)
     {

Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h (original)
+++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Mon Nov 17 13:39:20 2014
@@ -61,8 +61,7 @@ namespace lldb_private {
         // lldb_private::Platform functions
         //------------------------------------------------------------
         Error
-        ResolveExecutable (const FileSpec &exe_file,
-                           const ArchSpec &arch,
+        ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
                            lldb::ModuleSP &module_sp,
                            const FileSpecList *module_search_paths_ptr) override;
 
@@ -99,7 +98,6 @@ namespace lldb_private {
         DebugProcess (ProcessLaunchInfo &launch_info,
                       Debugger &debugger,
                       Target *target,
-                      Listener &listener,
                       Error &error) override;
 
         void

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Mon Nov 17 13:39:20 2014
@@ -157,8 +157,7 @@ PlatformDarwin::LocateExecutableScriptin
 }
 
 Error
-PlatformDarwin::ResolveExecutable (const FileSpec &exe_file,
-                                   const ArchSpec &exe_arch,
+PlatformDarwin::ResolveExecutable (const ModuleSpec &module_spec,
                                    lldb::ModuleSP &exe_module_sp,
                                    const FileSpecList *module_search_paths_ptr)
 {
@@ -166,45 +165,40 @@ PlatformDarwin::ResolveExecutable (const
     // Nothing special to do here, just use the actual file and architecture
 
     char exe_path[PATH_MAX];
-    FileSpec resolved_exe_file (exe_file);
-    
+    ModuleSpec resolved_module_spec(module_spec);
+
     if (IsHost())
     {
         // If we have "ls" as the exe_file, resolve the executable loation based on
         // the current path variables
-        if (resolved_exe_file.Exists())
-        {
-            
-        }
-        else
+        if (!resolved_module_spec.GetFileSpec().Exists())
         {
-            exe_file.GetPath (exe_path, sizeof(exe_path));
-            resolved_exe_file.SetFile(exe_path, true);
+            module_spec.GetFileSpec().GetPath (exe_path, sizeof(exe_path));
+            resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
         }
 
-        if (!resolved_exe_file.Exists())
-            resolved_exe_file.ResolveExecutableLocation ();
+        if (!resolved_module_spec.GetFileSpec().Exists())
+            resolved_module_spec.GetFileSpec().ResolveExecutableLocation ();
 
         // Resolve any executable within a bundle on MacOSX
-        Host::ResolveExecutableInBundle (resolved_exe_file);
+        Host::ResolveExecutableInBundle (resolved_module_spec.GetFileSpec());
         
-        if (resolved_exe_file.Exists())
+        if (resolved_module_spec.GetFileSpec().Exists())
             error.Clear();
         else
         {
-            const uint32_t permissions = resolved_exe_file.GetPermissions();
+            const uint32_t permissions = resolved_module_spec.GetFileSpec().GetPermissions();
             if (permissions && (permissions & eFilePermissionsEveryoneR) == 0)
-                error.SetErrorStringWithFormat ("executable '%s' is not readable", resolved_exe_file.GetPath().c_str());
+                error.SetErrorStringWithFormat ("executable '%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
             else
-                error.SetErrorStringWithFormat ("unable to find executable for '%s'", resolved_exe_file.GetPath().c_str());
+                error.SetErrorStringWithFormat ("unable to find executable for '%s'", resolved_module_spec.GetFileSpec().GetPath().c_str());
         }
     }
     else
     {
         if (m_remote_platform_sp)
         {
-            error = m_remote_platform_sp->ResolveExecutable (exe_file, 
-                                                             exe_arch,
+            error = m_remote_platform_sp->ResolveExecutable (module_spec,
                                                              exe_module_sp,
                                                              module_search_paths_ptr);
         }
@@ -213,22 +207,21 @@ PlatformDarwin::ResolveExecutable (const
             // We may connect to a process and use the provided executable (Don't use local $PATH).
 
             // Resolve any executable within a bundle on MacOSX
-            Host::ResolveExecutableInBundle (resolved_exe_file);
+            Host::ResolveExecutableInBundle (resolved_module_spec.GetFileSpec());
 
-            if (resolved_exe_file.Exists())
+            if (resolved_module_spec.GetFileSpec().Exists())
                 error.Clear();
             else
-                error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", resolved_exe_file.GetFilename().AsCString(""));
+                error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", resolved_module_spec.GetFileSpec().GetFilename().AsCString(""));
         }
     }
     
 
     if (error.Success())
     {
-        ModuleSpec module_spec (resolved_exe_file, exe_arch);
-        if (module_spec.GetArchitecture().IsValid())
+        if (resolved_module_spec.GetArchitecture().IsValid())
         {
-            error = ModuleList::GetSharedModule (module_spec, 
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp, 
                                                  module_search_paths_ptr,
                                                  NULL, 
@@ -238,8 +231,8 @@ PlatformDarwin::ResolveExecutable (const
             {
                 exe_module_sp.reset();
                 error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
-                                                exe_file.GetPath().c_str(),
-                                                exe_arch.GetArchitectureName());
+                                                resolved_module_spec.GetFileSpec().GetPath().c_str(),
+                                                resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
         }
         else
@@ -248,9 +241,9 @@ PlatformDarwin::ResolveExecutable (const
             // the architectures that we should be using (in the correct order)
             // and see if we can find a match that way
             StreamString arch_names;
-            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
             {
-                error = GetSharedModule (module_spec, 
+                error = GetSharedModule (resolved_module_spec,
                                          exe_module_sp, 
                                          module_search_paths_ptr,
                                          NULL, 
@@ -266,21 +259,21 @@ PlatformDarwin::ResolveExecutable (const
                 
                 if (idx > 0)
                     arch_names.PutCString (", ");
-                arch_names.PutCString (module_spec.GetArchitecture().GetArchitectureName());
+                arch_names.PutCString (resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
             
             if (error.Fail() || !exe_module_sp)
             {
-                if (exe_file.Readable())
+                if (resolved_module_spec.GetFileSpec().Readable())
                 {
                     error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
-                                                    exe_file.GetPath().c_str(),
+                                                    resolved_module_spec.GetFileSpec().GetPath().c_str(),
                                                     GetPluginName().GetCString(),
                                                     arch_names.GetString().c_str());
                 }
                 else
                 {
-                    error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+                    error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
                 }
             }
         }

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Mon Nov 17 13:39:20 2014
@@ -28,10 +28,9 @@ public:
     // lldb_private::Platform functions
     //------------------------------------------------------------
     virtual lldb_private::Error
-    ResolveExecutable (const lldb_private::FileSpec &exe_file,
-                       const lldb_private::ArchSpec &arch,
+    ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
                        lldb::ModuleSP &module_sp,
-                       const lldb_private::FileSpecList *module_search_paths_ptr);
+                       const lldb_private::FileSpecList *module_search_paths_ptr) override;
 
     virtual lldb_private::Error
     ResolveSymbolFile (lldb_private::Target &target,

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Mon Nov 17 13:39:20 2014
@@ -172,7 +172,8 @@ PlatformRemoteiOS::PlatformRemoteiOS ()
     m_device_support_directory(),
     m_device_support_directory_for_os_version (),
     m_build_update(),
-    m_last_module_sdk_idx(UINT32_MAX)
+    m_last_module_sdk_idx (UINT32_MAX),
+    m_connected_module_sdk_idx (UINT32_MAX)
 {
 }
 
@@ -209,32 +210,24 @@ PlatformRemoteiOS::GetStatus (Stream &st
 
 
 Error
-PlatformRemoteiOS::ResolveExecutable (const FileSpec &exe_file,
-                                      const ArchSpec &exe_arch,
+PlatformRemoteiOS::ResolveExecutable (const ModuleSpec &ms,
                                       lldb::ModuleSP &exe_module_sp,
                                       const FileSpecList *module_search_paths_ptr)
 {
     Error error;
     // Nothing special to do here, just use the actual file and architecture
 
-    FileSpec resolved_exe_file (exe_file);
-    
-    // If we have "ls" as the exe_file, resolve the executable loation based on
-    // the current path variables
-    // TODO: resolve bare executables in the Platform SDK
-//    if (!resolved_exe_file.Exists())
-//        resolved_exe_file.ResolveExecutableLocation ();
+    ModuleSpec resolved_module_spec(ms);
 
     // Resolve any executable within a bundle on MacOSX
     // TODO: verify that this handles shallow bundles, if not then implement one ourselves
-    Host::ResolveExecutableInBundle (resolved_exe_file);
+    Host::ResolveExecutableInBundle (resolved_module_spec.GetFileSpec());
 
-    if (resolved_exe_file.Exists())
+    if (resolved_module_spec.GetFileSpec().Exists())
     {
-        if (exe_arch.IsValid())
+        if (resolved_module_spec.GetArchitecture().IsValid() || resolved_module_spec.GetUUID().IsValid())
         {
-            ModuleSpec module_spec (resolved_exe_file, exe_arch);
-            error = ModuleList::GetSharedModule (module_spec,
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp, 
                                                  NULL,
                                                  NULL, 
@@ -248,11 +241,9 @@ PlatformRemoteiOS::ResolveExecutable (co
         // found so ask the platform for the architectures that we should be
         // using (in the correct order) and see if we can find a match that way
         StreamString arch_names;
-        ArchSpec platform_arch;
-        for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, platform_arch); ++idx)
+        for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
         {
-            ModuleSpec module_spec (resolved_exe_file, platform_arch);
-            error = ModuleList::GetSharedModule (module_spec, 
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp, 
                                                  NULL,
                                                  NULL, 
@@ -268,28 +259,28 @@ PlatformRemoteiOS::ResolveExecutable (co
             
             if (idx > 0)
                 arch_names.PutCString (", ");
-            arch_names.PutCString (platform_arch.GetArchitectureName());
+            arch_names.PutCString (resolved_module_spec.GetArchitecture().GetArchitectureName());
         }
         
         if (error.Fail() || !exe_module_sp)
         {
-            if (exe_file.Readable())
+            if (resolved_module_spec.GetFileSpec().Readable())
             {
                 error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
-                                                exe_file.GetPath().c_str(),
+                                                resolved_module_spec.GetFileSpec().GetPath().c_str(),
                                                 GetPluginName().GetCString(),
                                                 arch_names.GetString().c_str());
             }
             else
             {
-                error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+                error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
             }
         }
     }
     else
     {
         error.SetErrorStringWithFormat ("'%s' does not exist",
-                                        exe_file.GetPath().c_str());
+                                        resolved_module_spec.GetFileSpec().GetPath().c_str());
     }
 
     return error;
@@ -315,13 +306,28 @@ PlatformRemoteiOS::UpdateSDKDirectoryInf
             const bool find_directories = true;
             const bool find_files = false;
             const bool find_other = false;
+
+            SDKDirectoryInfoCollection builtin_sdk_directory_infos;
             FileSpec::EnumerateDirectory (m_device_support_directory.c_str(),
                                           find_directories,
                                           find_files,
                                           find_other,
                                           GetContainedFilesIntoVectorOfStringsCallback,
-                                          &m_sdk_directory_infos);
-            
+                                          &builtin_sdk_directory_infos);
+
+            // Only add SDK directories that have symbols in them, some SDKs only contain
+            // developer disk images and no symbols, so they aren't useful to us.
+            FileSpec sdk_symbols_symlink_fspec;
+            for (const auto &sdk_directory_info : builtin_sdk_directory_infos)
+            {
+                sdk_symbols_symlink_fspec = sdk_directory_info.directory;
+                sdk_symbols_symlink_fspec.AppendPathComponent("Symbols");
+                if (sdk_symbols_symlink_fspec.Exists())
+                {
+                    m_sdk_directory_infos.push_back(sdk_directory_info);
+                }
+            }
+
             const uint32_t num_installed = m_sdk_directory_infos.size();
             FileSpec local_sdk_cache("~/Library/Developer/Xcode/iOS DeviceSupport", true);
             if (local_sdk_cache.Exists())
@@ -686,32 +692,50 @@ PlatformRemoteiOS::GetSharedModule (cons
     // with the right UUID.
     const FileSpec &platform_file = module_spec.GetFileSpec();
 
-    FileSpec local_file;
-    const UUID *module_uuid_ptr = module_spec.GetUUIDPtr();
     Error error;
     char platform_file_path[PATH_MAX];
     
     if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path)))
     {
-        FileSpec local_file;
+        ModuleSpec platform_module_spec(module_spec);
+        UpdateSDKDirectoryInfosInNeeded();
+
         UpdateSDKDirectoryInfosInNeeded();
 
         const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
+
+        // If we are connected we migth be able to correctly deduce the SDK directory
+        // using the OS build.
+        const uint32_t connected_sdk_idx = GetConnectedSDKIndex ();
+        if (connected_sdk_idx < num_sdk_infos)
+        {
+            if (GetFileInSDK (platform_file_path, connected_sdk_idx, platform_module_spec.GetFileSpec()))
+            {
+                module_sp.reset();
+                error = ResolveExecutable (platform_module_spec,
+                                           module_sp,
+                                           NULL);
+                if (module_sp)
+                {
+                    m_last_module_sdk_idx = connected_sdk_idx;
+                    error.Clear();
+                    return error;
+                }
+            }
+        }
+
         // Try the last SDK index if it is set as most files from an SDK
         // will tend to be valid in that same SDK.
         if (m_last_module_sdk_idx < num_sdk_infos)
         {
-            if (GetFileInSDK (platform_file_path, m_last_module_sdk_idx, local_file))
+            if (GetFileInSDK (platform_file_path, m_last_module_sdk_idx, platform_module_spec.GetFileSpec()))
             {
-                //printf ("sdk[%u] last: '%s'\n", m_last_module_sdk_idx, local_file.GetPath().c_str());
                 module_sp.reset();
-                error = ResolveExecutable (local_file,
-                                           module_spec.GetArchitecture(),
+                error = ResolveExecutable (platform_module_spec,
                                            module_sp,
                                            NULL);
-                if (module_sp && ((module_uuid_ptr == NULL) || (module_sp->GetUUID() == *module_uuid_ptr)))
+                if (module_sp)
                 {
-                    //printf ("sdk[%u] last found\n", m_last_module_sdk_idx);
                     error.Clear();
                     return error;
                 }
@@ -727,20 +751,16 @@ PlatformRemoteiOS::GetSharedModule (cons
                 // it above
                 continue;
             }
-            if (GetFileInSDK (platform_file_path, sdk_idx, local_file))
+            if (GetFileInSDK (platform_file_path, sdk_idx, platform_module_spec.GetFileSpec()))
             {
                 //printf ("sdk[%u]: '%s'\n", sdk_idx, local_file.GetPath().c_str());
                 
-                error = ResolveExecutable (local_file,
-                                           module_spec.GetArchitecture(),
-                                           module_sp,
-                                           NULL);
-                if (module_sp && ((module_uuid_ptr == NULL) || (module_sp->GetUUID() == *module_uuid_ptr)))
+                error = ResolveExecutable (platform_module_spec, module_sp, NULL);
+                if (module_sp)
                 {
                     // Remember the index of the last SDK that we found a file
                     // in in case the wrong SDK was selected.
                     m_last_module_sdk_idx = sdk_idx;
-                    //printf ("sdk[%u]: found (setting last to %u)\n", sdk_idx, m_last_module_sdk_idx);
                     error.Clear();
                     return error;
                 }
@@ -756,7 +776,7 @@ PlatformRemoteiOS::GetSharedModule (cons
         return error;
 
     const bool always_create = false;
-    error = ModuleList::GetSharedModule (module_spec, 
+    error = ModuleList::GetSharedModule (module_spec,
                                          module_sp,
                                          module_search_paths_ptr,
                                          old_module_sp_ptr,
@@ -774,3 +794,33 @@ PlatformRemoteiOS::GetSupportedArchitect
 {
     return ARMGetSupportedArchitectureAtIndex (idx, arch);
 }
+
+uint32_t
+PlatformRemoteiOS::GetConnectedSDKIndex ()
+{
+    if (IsConnected())
+    {
+        if (m_connected_module_sdk_idx == UINT32_MAX)
+        {
+            std::string build;
+            if (GetRemoteOSBuildString(build))
+            {
+                const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
+                for (uint32_t i=0; i<num_sdk_infos; ++i)
+                {
+                    const SDKDirectoryInfo &sdk_dir_info = m_sdk_directory_infos[i];
+                    if (strstr(sdk_dir_info.directory.GetFilename().AsCString(""), build.c_str()))
+                    {
+                        m_connected_module_sdk_idx = i;
+                    }
+                }
+            }
+        }
+    }
+    else
+    {
+        m_connected_module_sdk_idx = UINT32_MAX;
+    }
+    return m_connected_module_sdk_idx;
+}
+

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h Mon Nov 17 13:39:20 2014
@@ -67,8 +67,7 @@ public:
     // lldb_private::Platform functions
     //------------------------------------------------------------
     virtual lldb_private::Error
-    ResolveExecutable (const lldb_private::FileSpec &exe_file,
-                       const lldb_private::ArchSpec &arch,
+    ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
                        lldb::ModuleSP &module_sp,
                        const lldb_private::FileSpecList *module_search_paths_ptr);
 
@@ -114,6 +113,7 @@ protected:
     std::string m_device_support_directory_for_os_version;
     std::string m_build_update;
     uint32_t m_last_module_sdk_idx;
+    uint32_t m_connected_module_sdk_idx;
 
     bool
     UpdateSDKDirectoryInfosInNeeded();
@@ -154,6 +154,9 @@ protected:
     FindFileInAllSDKs (const lldb_private::FileSpec &platform_file,
                        lldb_private::FileSpecList &file_list);
 
+    uint32_t
+    GetConnectedSDKIndex ();
+
 private:
     DISALLOW_COPY_AND_ASSIGN (PlatformRemoteiOS);
 

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp Mon Nov 17 13:39:20 2014
@@ -172,16 +172,15 @@ PlatformiOSSimulator::GetStatus (Stream
 
 
 Error
-PlatformiOSSimulator::ResolveExecutable (const FileSpec &exe_file,
-                                         const ArchSpec &exe_arch,
+PlatformiOSSimulator::ResolveExecutable (const ModuleSpec &module_spec,
                                          lldb::ModuleSP &exe_module_sp,
                                          const FileSpecList *module_search_paths_ptr)
 {
     Error error;
     // Nothing special to do here, just use the actual file and architecture
 
-    FileSpec resolved_exe_file (exe_file);
-    
+    ModuleSpec resolved_module_spec(module_spec);
+
     // If we have "ls" as the exe_file, resolve the executable loation based on
     // the current path variables
     // TODO: resolve bare executables in the Platform SDK
@@ -190,14 +189,13 @@ PlatformiOSSimulator::ResolveExecutable
 
     // Resolve any executable within a bundle on MacOSX
     // TODO: verify that this handles shallow bundles, if not then implement one ourselves
-    Host::ResolveExecutableInBundle (resolved_exe_file);
+    Host::ResolveExecutableInBundle (resolved_module_spec.GetFileSpec());
 
-    if (resolved_exe_file.Exists())
+    if (resolved_module_spec.GetFileSpec().Exists())
     {
-        ModuleSpec module_spec(resolved_exe_file, exe_arch);
-        if (exe_arch.IsValid())
+        if (resolved_module_spec.GetArchitecture().IsValid())
         {
-            error = ModuleList::GetSharedModule (module_spec, 
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp, 
                                                  NULL,
                                                  NULL, 
@@ -212,12 +210,12 @@ PlatformiOSSimulator::ResolveExecutable
         // using (in the correct order) and see if we can find a match that way
         StreamString arch_names;
         ArchSpec platform_arch;
-        for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
+        for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
         {
             // Only match x86 with x86 and x86_64 with x86_64...
-            if (!exe_arch.IsValid() || exe_arch.GetCore() == module_spec.GetArchitecture().GetCore())
+            if (!module_spec.GetArchitecture().IsValid() || module_spec.GetArchitecture().GetCore() == resolved_module_spec.GetArchitecture().GetCore())
             {
-                error = ModuleList::GetSharedModule (module_spec,
+                error = ModuleList::GetSharedModule (resolved_module_spec,
                                                      exe_module_sp, 
                                                      NULL,
                                                      NULL, 
@@ -239,23 +237,23 @@ PlatformiOSSimulator::ResolveExecutable
         
         if (error.Fail() || !exe_module_sp)
         {
-            if (exe_file.Readable())
+            if (resolved_module_spec.GetFileSpec().Readable())
             {
                 error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
-                                                exe_file.GetPath().c_str(),
+                                                resolved_module_spec.GetFileSpec().GetPath().c_str(),
                                                 GetPluginName().GetCString(),
                                                 arch_names.GetString().c_str());
             }
             else
             {
-                error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+                error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
             }
         }
     }
     else
     {
         error.SetErrorStringWithFormat ("'%s' does not exist",
-                                        exe_file.GetPath().c_str());
+                                        module_spec.GetFileSpec().GetPath().c_str());
     }
 
     return error;
@@ -379,12 +377,12 @@ PlatformiOSSimulator::GetSharedModule (c
     // then we attempt to get a shared module for the right architecture
     // with the right UUID.
     Error error;
-    FileSpec local_file;
+    ModuleSpec platform_module_spec (module_spec);
     const FileSpec &platform_file = module_spec.GetFileSpec();
-    error = GetSymbolFile (platform_file, module_spec.GetUUIDPtr(), local_file);
+    error = GetSymbolFile (platform_file, module_spec.GetUUIDPtr(), platform_module_spec.GetFileSpec());
     if (error.Success())
     {
-        error = ResolveExecutable (local_file, module_spec.GetArchitecture(), module_sp, module_search_paths_ptr);
+        error = ResolveExecutable (platform_module_spec, module_sp, module_search_paths_ptr);
     }
     else
     {

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h Mon Nov 17 13:39:20 2014
@@ -65,8 +65,7 @@ public:
     // lldb_private::Platform functions
     //------------------------------------------------------------
     virtual lldb_private::Error
-    ResolveExecutable (const lldb_private::FileSpec &exe_file,
-                       const lldb_private::ArchSpec &arch,
+    ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
                        lldb::ModuleSP &module_sp,
                        const lldb_private::FileSpecList *module_search_paths_ptr);
 

Modified: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp Mon Nov 17 13:39:20 2014
@@ -794,7 +794,6 @@ lldb::ProcessSP
 PlatformPOSIX::Attach (ProcessAttachInfo &attach_info,
                        Debugger &debugger,
                        Target *target,
-                       Listener &listener,
                        Error &error)
 {
     lldb::ProcessSP process_sp;
@@ -835,7 +834,7 @@ PlatformPOSIX::Attach (ProcessAttachInfo
             }
 
 
-            process_sp = target->CreateProcess (listener, attach_info.GetProcessPluginName(), NULL);
+            process_sp = target->CreateProcess (attach_info.GetListenerForProcess(debugger), attach_info.GetProcessPluginName(), NULL);
 
             if (process_sp)
             {
@@ -852,7 +851,7 @@ PlatformPOSIX::Attach (ProcessAttachInfo
     else
     {
         if (m_remote_platform_sp)
-            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, listener, error);
+            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, error);
         else
             error.SetErrorString ("the platform is not currently connected");
     }
@@ -863,7 +862,6 @@ lldb::ProcessSP
 PlatformPOSIX::DebugProcess (ProcessLaunchInfo &launch_info,
                               Debugger &debugger,
                               Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                              Listener &listener,
                               Error &error)
 {
     ProcessSP process_sp;
@@ -874,12 +872,12 @@ PlatformPOSIX::DebugProcess (ProcessLaun
         // We still need to reap it from lldb but if we let the monitor thread also set the exit status, we set up a
         // race between debugserver & us for who will find out about the debugged process's death.
         launch_info.GetFlags().Set(eLaunchFlagDontSetExitStatus);
-        process_sp = Platform::DebugProcess (launch_info, debugger, target, listener, error);
+        process_sp = Platform::DebugProcess (launch_info, debugger, target, error);
     }
     else
     {
         if (m_remote_platform_sp)
-            process_sp = m_remote_platform_sp->DebugProcess (launch_info, debugger, target, listener, error);
+            process_sp = m_remote_platform_sp->DebugProcess (launch_info, debugger, target, error);
         else
             error.SetErrorString ("the platform is not currently connected");
     }

Modified: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h (original)
+++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h Mon Nov 17 13:39:20 2014
@@ -138,14 +138,12 @@ public:
     Attach (lldb_private::ProcessAttachInfo &attach_info,
             lldb_private::Debugger &debugger,
             lldb_private::Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-            lldb_private::Listener &listener,
             lldb_private::Error &error) override;
 
     lldb::ProcessSP
     DebugProcess (lldb_private::ProcessLaunchInfo &launch_info,
                   lldb_private::Debugger &debugger,
                   lldb_private::Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                  lldb_private::Listener &listener,
                   lldb_private::Error &error) override;
 
     virtual std::string

Modified: lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp Mon Nov 17 13:39:20 2014
@@ -196,8 +196,7 @@ PlatformWindows::~PlatformWindows()
 }
 
 Error
-PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
-                                    const ArchSpec &exe_arch,
+PlatformWindows::ResolveExecutable (const ModuleSpec &ms,
                                     lldb::ModuleSP &exe_module_sp,
                                     const FileSpecList *module_search_paths_ptr)
 {
@@ -205,25 +204,25 @@ PlatformWindows::ResolveExecutable (cons
     // Nothing special to do here, just use the actual file and architecture
 
     char exe_path[PATH_MAX];
-    FileSpec resolved_exe_file (exe_file);
+    ModuleSpec resolved_module_spec(ms);
 
     if (IsHost())
     {
         // if we cant resolve the executable loation based on the current path variables
-        if (!resolved_exe_file.Exists())
+        if (!resolved_module_spec.GetFileSpec().Exists())
         {
-            exe_file.GetPath(exe_path, sizeof(exe_path));
-            resolved_exe_file.SetFile(exe_path, true);
+            resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
+            resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
         }
 
-        if (!resolved_exe_file.Exists())
-            resolved_exe_file.ResolveExecutableLocation ();
+        if (!resolved_module_spec.GetFileSpec().Exists())
+            resolved_module_spec.GetFileSpec().ResolveExecutableLocation ();
 
-        if (resolved_exe_file.Exists())
+        if (resolved_module_spec.GetFileSpec().Exists())
             error.Clear();
         else
         {
-            exe_file.GetPath(exe_path, sizeof(exe_path));
+            ms.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
             error.SetErrorStringWithFormat("unable to find executable for '%s'", exe_path);
         }
     }
@@ -231,15 +230,14 @@ PlatformWindows::ResolveExecutable (cons
     {
         if (m_remote_platform_sp)
         {
-            error = m_remote_platform_sp->ResolveExecutable (exe_file,
-                                                             exe_arch,
+            error = m_remote_platform_sp->ResolveExecutable (ms,
                                                              exe_module_sp,
                                                              NULL);
         }
         else
         {
             // We may connect to a process and use the provided executable (Don't use local $PATH).
-            if (resolved_exe_file.Exists())
+            if (resolved_module_spec.GetFileSpec().Exists())
                 error.Clear();
             else
                 error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", exe_path);
@@ -248,10 +246,9 @@ PlatformWindows::ResolveExecutable (cons
 
     if (error.Success())
     {
-        ModuleSpec module_spec (resolved_exe_file, exe_arch);
-        if (exe_arch.IsValid())
+        if (resolved_module_spec.GetArchitecture().IsValid())
         {
-            error = ModuleList::GetSharedModule (module_spec,
+            error = ModuleList::GetSharedModule (resolved_module_spec,
                                                  exe_module_sp,
                                                  NULL,
                                                  NULL,
@@ -261,8 +258,8 @@ PlatformWindows::ResolveExecutable (cons
             {
                 exe_module_sp.reset();
                 error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
-                                                exe_file.GetPath().c_str(),
-                                                exe_arch.GetArchitectureName());
+                                                resolved_module_spec.GetFileSpec().GetPath().c_str(),
+                                                resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
         }
         else
@@ -271,9 +268,9 @@ PlatformWindows::ResolveExecutable (cons
             // the architectures that we should be using (in the correct order)
             // and see if we can find a match that way
             StreamString arch_names;
-            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
             {
-                error = ModuleList::GetSharedModule (module_spec,
+                error = ModuleList::GetSharedModule (resolved_module_spec,
                                                      exe_module_sp,
                                                      NULL,
                                                      NULL,
@@ -289,21 +286,21 @@ PlatformWindows::ResolveExecutable (cons
 
                 if (idx > 0)
                     arch_names.PutCString (", ");
-                arch_names.PutCString (module_spec.GetArchitecture().GetArchitectureName());
+                arch_names.PutCString (resolved_module_spec.GetArchitecture().GetArchitectureName());
             }
 
             if (error.Fail() || !exe_module_sp)
             {
-                if (exe_file.Readable())
+                if (resolved_module_spec.GetFileSpec().Readable())
                 {
                     error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
-                                                    exe_file.GetPath().c_str(),
+                                                    resolved_module_spec.GetFileSpec().GetPath().c_str(),
                                                     GetPluginName().GetCString(),
                                                     arch_names.GetString().c_str());
                 }
                 else
                 {
-                    error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+                    error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
                 }
             }
         }
@@ -518,7 +515,6 @@ lldb::ProcessSP
 PlatformWindows::Attach(ProcessAttachInfo &attach_info,
                         Debugger &debugger,
                         Target *target,
-                        Listener &listener,
                         Error &error)
 {
     lldb::ProcessSP process_sp;
@@ -547,7 +543,7 @@ PlatformWindows::Attach(ProcessAttachInf
             // The Windows platform always currently uses the GDB remote debugger plug-in
             // so even when debugging locally we are debugging remotely!
             // Just like the darwin plugin.
-            process_sp = target->CreateProcess (listener, "gdb-remote", NULL);
+            process_sp = target->CreateProcess (attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
 
             if (process_sp)
                 error = process_sp->Attach (attach_info);
@@ -556,7 +552,7 @@ PlatformWindows::Attach(ProcessAttachInf
     else
     {
         if (m_remote_platform_sp)
-            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, listener, error);
+            process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, error);
         else
             error.SetErrorString ("the platform is not currently connected");
     }

Modified: lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.h (original)
+++ lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.h Mon Nov 17 13:39:20 2014
@@ -60,8 +60,7 @@ public:
     // lldb_private::Platform functions
     //------------------------------------------------------------
     virtual Error
-    ResolveExecutable(const FileSpec &exe_file,
-                      const ArchSpec &arch,
+    ResolveExecutable(const lldb_private::ModuleSpec &module_spec,
                       lldb::ModuleSP &module_sp,
                       const FileSpecList *module_search_paths_ptr);
 
@@ -121,7 +120,6 @@ public:
     Attach(lldb_private::ProcessAttachInfo &attach_info,
            lldb_private::Debugger &debugger,
            lldb_private::Target *target,
-           lldb_private::Listener &listener,
            lldb_private::Error &error);
 
     virtual lldb_private::Error

Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Mon Nov 17 13:39:20 2014
@@ -21,6 +21,7 @@
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleList.h"
+#include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/ConnectionFileDescriptor.h"
@@ -100,14 +101,13 @@ PlatformRemoteGDBServer::GetDescription
 }
 
 Error
-PlatformRemoteGDBServer::ResolveExecutable (const FileSpec &exe_file,
-                                            const ArchSpec &exe_arch,
+PlatformRemoteGDBServer::ResolveExecutable (const ModuleSpec &module_spec,
                                             lldb::ModuleSP &exe_module_sp,
                                             const FileSpecList *module_search_paths_ptr)
 {
     Error error;
     //error.SetErrorString ("PlatformRemoteGDBServer::ResolveExecutable() is unimplemented");
-    if (m_gdb_client.GetFileExists(exe_file))
+    if (m_gdb_client.GetFileExists(module_spec.GetFileSpec()))
         return error;
     // TODO: get the remote end to somehow resolve this file
     error.SetErrorString("file not found on remote end");
@@ -421,7 +421,6 @@ lldb::ProcessSP
 PlatformRemoteGDBServer::DebugProcess (lldb_private::ProcessLaunchInfo &launch_info,
                                        lldb_private::Debugger &debugger,
                                        lldb_private::Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                                       lldb_private::Listener &listener,
                                        lldb_private::Error &error)
 {
     lldb::ProcessSP process_sp;
@@ -473,7 +472,7 @@ PlatformRemoteGDBServer::DebugProcess (l
                     
                     // The darwin always currently uses the GDB remote debugger plug-in
                     // so even when debugging locally we are debugging remotely!
-                    process_sp = target->CreateProcess (listener, "gdb-remote", NULL);
+                    process_sp = target->CreateProcess (launch_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
                     
                     if (process_sp)
                     {
@@ -515,7 +514,6 @@ lldb::ProcessSP
 PlatformRemoteGDBServer::Attach (lldb_private::ProcessAttachInfo &attach_info,
                                  Debugger &debugger,
                                  Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                                 Listener &listener, 
                                  Error &error)
 {
     lldb::ProcessSP process_sp;
@@ -567,7 +565,7 @@ PlatformRemoteGDBServer::Attach (lldb_pr
                     
                     // The darwin always currently uses the GDB remote debugger plug-in
                     // so even when debugging locally we are debugging remotely!
-                    process_sp = target->CreateProcess (listener, "gdb-remote", NULL);
+                    process_sp = target->CreateProcess (attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
                     
                     if (process_sp)
                     {

Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h (original)
+++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h Mon Nov 17 13:39:20 2014
@@ -64,8 +64,7 @@ public:
     // lldb_private::Platform functions
     //------------------------------------------------------------
     virtual lldb_private::Error
-    ResolveExecutable (const lldb_private::FileSpec &exe_file,
-                       const lldb_private::ArchSpec &arch,
+    ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
                        lldb::ModuleSP &module_sp,
                        const lldb_private::FileSpecList *module_search_paths_ptr);
 
@@ -92,14 +91,12 @@ public:
     DebugProcess (lldb_private::ProcessLaunchInfo &launch_info,
                   lldb_private::Debugger &debugger,
                   lldb_private::Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                  lldb_private::Listener &listener,
                   lldb_private::Error &error);
 
     virtual lldb::ProcessSP
     Attach (lldb_private::ProcessAttachInfo &attach_info,
             lldb_private::Debugger &debugger,
             lldb_private::Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-            lldb_private::Listener &listener,
             lldb_private::Error &error);
 
     virtual bool

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Nov 17 13:39:20 2014
@@ -889,6 +889,13 @@ ClangASTContext::GetBuiltinTypeForDWARFE
                 break;
                 
             case DW_ATE_float:
+                if (streq(type_name, "float") && QualTypeMatchesBitSize (bit_size, ast, ast->FloatTy))
+                    return ClangASTType (ast, ast->FloatTy.getAsOpaquePtr());
+                if (streq(type_name, "double") && QualTypeMatchesBitSize (bit_size, ast, ast->DoubleTy))
+                    return ClangASTType (ast, ast->DoubleTy.getAsOpaquePtr());
+                if (streq(type_name, "long double") && QualTypeMatchesBitSize (bit_size, ast, ast->LongDoubleTy))
+                    return ClangASTType (ast, ast->LongDoubleTy.getAsOpaquePtr());
+                // Fall back to not requring a name match
                 if (QualTypeMatchesBitSize (bit_size, ast, ast->FloatTy))
                     return ClangASTType (ast, ast->FloatTy.getAsOpaquePtr());
                 if (QualTypeMatchesBitSize (bit_size, ast, ast->DoubleTy))

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Mon Nov 17 13:39:20 2014
@@ -882,15 +882,13 @@ Platform::SetOSVersion (uint32_t major,
 
 
 Error
-Platform::ResolveExecutable (const FileSpec &exe_file,
-                             const ArchSpec &exe_arch,
+Platform::ResolveExecutable (const ModuleSpec &module_spec,
                              lldb::ModuleSP &exe_module_sp,
                              const FileSpecList *module_search_paths_ptr)
 {
     Error error;
-    if (exe_file.Exists())
+    if (module_spec.GetFileSpec().Exists())
     {
-        ModuleSpec module_spec (exe_file, exe_arch);
         if (module_spec.GetArchitecture().IsValid())
         {
             error = ModuleList::GetSharedModule (module_spec, 
@@ -904,9 +902,10 @@ Platform::ResolveExecutable (const FileS
             // No valid architecture was specified, ask the platform for
             // the architectures that we should be using (in the correct order)
             // and see if we can find a match that way
-            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
+            ModuleSpec arch_module_spec(module_spec);
+            for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, arch_module_spec.GetArchitecture()); ++idx)
             {
-                error = ModuleList::GetSharedModule (module_spec, 
+                error = ModuleList::GetSharedModule (arch_module_spec,
                                                      exe_module_sp, 
                                                      module_search_paths_ptr,
                                                      NULL, 
@@ -920,7 +919,7 @@ Platform::ResolveExecutable (const FileS
     else
     {
         error.SetErrorStringWithFormat ("'%s' does not exist",
-                                        exe_file.GetPath().c_str());
+                                        module_spec.GetFileSpec().GetPath().c_str());
     }
     return error;
 }
@@ -1094,7 +1093,6 @@ lldb::ProcessSP
 Platform::DebugProcess (ProcessLaunchInfo &launch_info, 
                         Debugger &debugger,
                         Target *target,       // Can be NULL, if NULL create a new target, else use existing one
-                        Listener &listener,
                         Error &error)
 {
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM));
@@ -1117,7 +1115,7 @@ Platform::DebugProcess (ProcessLaunchInf
         if (launch_info.GetProcessID() != LLDB_INVALID_PROCESS_ID)
         {
             ProcessAttachInfo attach_info (launch_info);
-            process_sp = Attach (attach_info, debugger, target, listener, error);
+            process_sp = Attach (attach_info, debugger, target, error);
             if (process_sp)
             {
                 if (log)

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Mon Nov 17 13:39:20 2014
@@ -3252,6 +3252,15 @@ Process::AttachCompletionHandler::GetExi
     return m_exit_string.c_str();
 }
 
+Listener &
+ProcessAttachInfo::GetListenerForProcess (Debugger &debugger)
+{
+    if (m_listener_sp)
+        return *m_listener_sp;
+    else
+        return debugger.GetListener();
+}
+
 Error
 Process::Attach (ProcessAttachInfo &attach_info)
 {

Modified: lldb/trunk/source/Target/ProcessLaunchInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ProcessLaunchInfo.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Target/ProcessLaunchInfo.cpp (original)
+++ lldb/trunk/source/Target/ProcessLaunchInfo.cpp Mon Nov 17 13:39:20 2014
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Config.h"
 
+#include "lldb/Core/Debugger.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Target/ProcessLaunchInfo.h"
 #include "lldb/Target/FileAction.h"
@@ -32,6 +33,7 @@ ProcessLaunchInfo::ProcessLaunchInfo ()
     m_monitor_callback (NULL),
     m_monitor_callback_baton (NULL),
     m_monitor_signals (false),
+    m_listener_sp (),
     m_hijack_listener_sp ()
 {
 }
@@ -48,6 +50,7 @@ ProcessLaunchInfo::ProcessLaunchInfo(con
     m_monitor_callback(NULL),
     m_monitor_callback_baton(NULL),
     m_monitor_signals(false),
+    m_listener_sp (),
     m_hijack_listener_sp()
 {
     if (stdin_path)
@@ -218,6 +221,7 @@ ProcessLaunchInfo::Clear ()
     m_flags.Clear();
     m_file_actions.clear();
     m_resume_count = 0;
+    m_listener_sp.reset();
     m_hijack_listener_sp.reset();
 }
 
@@ -485,3 +489,12 @@ ProcessLaunchInfo::ConvertArgumentsForLa
     }
     return false;
 }
+
+Listener &
+ProcessLaunchInfo::GetListenerForProcess (Debugger &debugger)
+{
+    if (m_listener_sp)
+        return *m_listener_sp;
+    else
+        return debugger.GetListener();
+}

Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Mon Nov 17 13:39:20 2014
@@ -288,8 +288,8 @@ StackFrameList::GetFramesUpTo(uint32_t e
         do
         {
             uint32_t idx = m_concrete_frames_fetched++;
-            lldb::addr_t pc;
-            lldb::addr_t cfa;
+            lldb::addr_t pc = LLDB_INVALID_ADDRESS;
+            lldb::addr_t cfa = LLDB_INVALID_ADDRESS;
             if (idx == 0)
             {
                 // We might have already created frame zero, only create it
@@ -625,11 +625,14 @@ StackFrameList::GetFrameWithStackID (con
         if (begin != end)
         {
             collection::const_iterator pos = std::lower_bound (begin, end, stack_id, CompareStackID);
-            if (pos != end && (*pos)->GetStackID() == stack_id)
-                return *pos;
+            if (pos != end)
+            {
+                if ((*pos)->GetStackID() == stack_id)
+                    return *pos;
+            }
             
-            if (m_frames.back()->GetStackID() < stack_id)
-                frame_idx = m_frames.size();
+//            if (m_frames.back()->GetStackID() < stack_id)
+//                frame_idx = m_frames.size();
         }
         do
         {

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Mon Nov 17 13:39:20 2014
@@ -1215,6 +1215,7 @@ Target::ModulesDidUnload (ModuleList &mo
 {
     if (m_valid && module_list.GetSize())
     {
+        UnloadModuleSections (module_list);
         m_breakpoint_list.UpdateBreakpoints (module_list, false, delete_locations);
         // TODO: make event data that packages up the module_list
         BroadcastEvent (eBroadcastBitModulesUnloaded, NULL);
@@ -2308,6 +2309,40 @@ Target::SetSectionLoadAddress (const Sec
 
 }
 
+size_t
+Target::UnloadModuleSections (const ModuleList &module_list)
+{
+    size_t section_unload_count = 0;
+    size_t num_modules = module_list.GetSize();
+    for (size_t i=0; i<num_modules; ++i)
+    {
+        section_unload_count += UnloadModuleSections (module_list.GetModuleAtIndex(i));
+    }
+    return section_unload_count;
+}
+
+size_t
+Target::UnloadModuleSections (const lldb::ModuleSP &module_sp)
+{
+    uint32_t stop_id = 0;
+    ProcessSP process_sp(GetProcessSP());
+    if (process_sp)
+        stop_id = process_sp->GetStopID();
+    else
+        stop_id = m_section_load_history.GetLastStopID();
+    SectionList *sections = module_sp->GetSectionList();
+    size_t section_unload_count = 0;
+    if (sections)
+    {
+        const uint32_t num_sections = sections->GetNumSections(0);
+        for (uint32_t i = 0; i < num_sections; ++i)
+        {
+            section_unload_count += m_section_load_history.SetSectionUnloaded(stop_id, sections->GetSectionAtIndex(i));
+        }
+    }
+    return section_unload_count;
+}
+
 bool
 Target::SetSectionUnloaded (const lldb::SectionSP &section_sp)
 {
@@ -2340,7 +2375,7 @@ Target::ClearAllLoadedSections ()
 
 
 Error
-Target::Launch (Listener &listener, ProcessLaunchInfo &launch_info, Stream *stream)
+Target::Launch (ProcessLaunchInfo &launch_info, Stream *stream)
 {
     Error error;
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TARGET));
@@ -2412,7 +2447,6 @@ Target::Launch (Listener &listener, Proc
         m_process_sp = GetPlatform()->DebugProcess (launch_info,
                                                     debugger,
                                                     this,
-                                                    listener,
                                                     error);
     }
     else
@@ -2428,7 +2462,7 @@ Target::Launch (Listener &listener, Proc
         {
             // Use a Process plugin to construct the process.
             const char *plugin_name = launch_info.GetProcessPluginName();
-            CreateProcess (listener, plugin_name, NULL);
+            CreateProcess (launch_info.GetListenerForProcess(debugger), plugin_name, NULL);
         }
 
         // Since we didn't have a platform launch the process, launch it here.

Modified: lldb/trunk/source/Target/TargetList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/TargetList.cpp?rev=222167&r1=222166&r2=222167&view=diff
==============================================================================
--- lldb/trunk/source/Target/TargetList.cpp (original)
+++ lldb/trunk/source/Target/TargetList.cpp Mon Nov 17 13:39:20 2014
@@ -363,8 +363,8 @@ TargetList::CreateTarget (Debugger &debu
         if (platform_sp)
         {
             FileSpecList executable_search_paths (Target::GetDefaultExecutableSearchPaths());
-            error = platform_sp->ResolveExecutable (file,
-                                                    arch,
+            ModuleSpec module_spec(file, arch);
+            error = platform_sp->ResolveExecutable (module_spec,
                                                     exe_module_sp, 
                                                     executable_search_paths.GetSize() ? &executable_search_paths : NULL);
         }





More information about the lldb-commits mailing list