Fixed a launching issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115999 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 9aac03e..fa64cba 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -164,14 +164,14 @@
error.SetError (sb_process->Launch (argv, envp, launch_flags, tty, tty, tty));
if (error.Success())
{
+ // We we are stopping at the entry point, we can return now!
+ if (stop_at_entry)
+ return sb_process;
+
// Make sure we are stopped at the entry
StateType state = sb_process->WaitForProcessToStop (NULL);
if (state == eStateStopped)
{
- // We we are stopping at the entry point, we can return now!
- if (stop_at_entry)
- return sb_process;
-
// resume the process to skip the entry point
error.SetError (sb_process->Resume());
if (error.Success())