rdar://problem/11390100

debugserver needs to be able to posix_spawn debugging apps that have ".app" in their path that aren't bundles

llvm-svn: 158327
This commit is contained in:
Johnny Chen 2012-06-11 21:05:26 +00:00
parent 32503020a4
commit be4e208103
1 changed files with 18 additions and 15 deletions

View File

@ -1533,6 +1533,24 @@ MachProcess::LaunchForDebug
m_pid = MachProcess::ForkChildForPTraceDebugging (path, argv, envp, this, launch_err);
break;
#ifdef WITH_SPRINGBOARD
case eLaunchFlavorSpringBoard:
{
const char *app_ext = strstr(path, ".app");
if (app_ext != NULL)
{
std::string app_bundle_path(path, app_ext + strlen(".app"));
if (SBLaunchForDebug (app_bundle_path.c_str(), argv, envp, no_stdio, launch_err) != 0)
return m_pid; // A successful SBLaunchForDebug() returns and assigns a non-zero m_pid.
}
}
// In case the executable name has a ".app" fragment which confuses our debugserver,
// let's do an intentional fallthrough here...
launch_flavor = eLaunchFlavorPosixSpawn;
#endif
case eLaunchFlavorPosixSpawn:
m_pid = MachProcess::PosixSpawnChildForPTraceDebugging (path,
DNBArchProtocol::GetArchitecture (),
@ -1548,21 +1566,6 @@ MachProcess::LaunchForDebug
launch_err);
break;
#ifdef WITH_SPRINGBOARD
case eLaunchFlavorSpringBoard:
{
const char *app_ext = strstr(path, ".app");
if (app_ext != NULL)
{
std::string app_bundle_path(path, app_ext + strlen(".app"));
return SBLaunchForDebug (app_bundle_path.c_str(), argv, envp, no_stdio, launch_err);
}
}
break;
#endif
default:
// Invalid launch
launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic);