diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h index df8ff10e022a..8a47f4428d43 100644 --- a/lldb/include/lldb/API/SBTarget.h +++ b/lldb/include/lldb/API/SBTarget.h @@ -49,6 +49,9 @@ public: bool IsValid() const; + lldb::SBProcess + CreateProcess (); // DEPRECATED + lldb::SBProcess GetProcess (); diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 39b4e5004ebf..27da3aa9186d 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -105,6 +105,20 @@ SBTarget::GetDebugger () const return debugger; } + +// DEPRECATED +SBProcess +SBTarget::CreateProcess () +{ + SBProcess sb_process; + + if (m_opaque_sp) + sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener())); + + return sb_process; +} + + SBProcess SBTarget::LaunchProcess ( @@ -118,8 +132,17 @@ SBTarget::LaunchProcess SBProcess sb_process; if (m_opaque_sp) { - // When launching, we always want to create a new process - sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener())); + // DEPRECATED, this will change when CreateProcess is removed... + if (m_opaque_sp->GetProcessSP()) + { + sb_process.SetProcess(m_opaque_sp->GetProcessSP()); + } + else + { + // When launching, we always want to create a new process When + // SBTarget::CreateProcess is removed, this will always happen. + sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener())); + } if (sb_process.IsValid()) {