Index: lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h =================================================================== --- lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h +++ lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h @@ -131,8 +131,6 @@ m_listener_sp = listener_sp; } - lldb::ListenerSP GetListenerForProcess(Debugger &debugger); - lldb::ListenerSP GetHijackListener() const { return m_hijack_listener_sp; } void SetHijackListener(const lldb::ListenerSP &listener_sp) { Index: lldb/trunk/include/lldb/Target/Target.h =================================================================== --- lldb/trunk/include/lldb/Target/Target.h +++ lldb/trunk/include/lldb/Target/Target.h @@ -533,7 +533,9 @@ //------------------------------------------------------------------ void Dump(Stream *s, lldb::DescriptionLevel description_level); - const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener, + // If listener_sp is null, the listener of the owning Debugger object will be + // used. + const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file); Index: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -318,8 +318,8 @@ // Now create the gdb-remote process. LLDB_LOG(log, "having target create process with gdb-remote plugin"); - process_sp = target->CreateProcess( - launch_info.GetListenerForProcess(debugger), "gdb-remote", nullptr); + process_sp = + target->CreateProcess(launch_info.GetListener(), "gdb-remote", nullptr); if (!process_sp) { error.SetErrorString("CreateProcess() failed for gdb-remote process"); Index: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp @@ -287,8 +287,8 @@ // Now create the gdb-remote process. LLDB_LOG(log, "having target create process with gdb-remote plugin"); - process_sp = target->CreateProcess( - launch_info.GetListenerForProcess(debugger), "gdb-remote", nullptr); + process_sp = + target->CreateProcess(launch_info.GetListener(), "gdb-remote", nullptr); if (!process_sp) { error.SetErrorString("CreateProcess() failed for gdb-remote process"); Index: lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -437,9 +437,8 @@ ProcessAttachInfo attach_info(launch_info); return Attach(attach_info, debugger, target, error); } else { - ProcessSP process_sp = - target->CreateProcess(launch_info.GetListenerForProcess(debugger), - launch_info.GetProcessPluginName(), nullptr); + ProcessSP process_sp = target->CreateProcess( + launch_info.GetListener(), launch_info.GetProcessPluginName(), nullptr); // We need to launch and attach to the process. launch_info.GetFlags().Set(eLaunchFlagDebug); Index: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -496,8 +496,8 @@ // The darwin always currently uses the GDB remote debugger plug-in // so even when debugging locally we are debugging remotely! - process_sp = target->CreateProcess( - launch_info.GetListenerForProcess(debugger), "gdb-remote", NULL); + process_sp = target->CreateProcess(launch_info.GetListener(), + "gdb-remote", NULL); if (process_sp) { error = process_sp->ConnectRemote(nullptr, connect_url.c_str()); Index: lldb/trunk/source/Target/ProcessLaunchInfo.cpp =================================================================== --- lldb/trunk/source/Target/ProcessLaunchInfo.cpp +++ lldb/trunk/source/Target/ProcessLaunchInfo.cpp @@ -9,7 +9,6 @@ #include -#include "lldb/Core/Debugger.h" #include "lldb/Host/Config.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/HostInfo.h" @@ -433,10 +432,3 @@ } return false; } - -ListenerSP ProcessLaunchInfo::GetListenerForProcess(Debugger &debugger) { - if (m_listener_sp) - return m_listener_sp; - else - return debugger.GetListener(); -} Index: lldb/trunk/source/Target/Target.cpp =================================================================== --- lldb/trunk/source/Target/Target.cpp +++ lldb/trunk/source/Target/Target.cpp @@ -194,6 +194,8 @@ const lldb::ProcessSP &Target::CreateProcess(ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file) { + if (!listener_sp) + listener_sp = GetDebugger().GetListener(); DeleteCurrentProcess(); m_process_sp = Process::FindPlugin(shared_from_this(), plugin_name, listener_sp, crash_file); @@ -2884,8 +2886,7 @@ } else { // Use a Process plugin to construct the process. const char *plugin_name = launch_info.GetProcessPluginName(); - CreateProcess(launch_info.GetListenerForProcess(debugger), plugin_name, - nullptr); + CreateProcess(launch_info.GetListener(), plugin_name, nullptr); } // Since we didn't have a platform launch the process, launch it here.