summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-03-28 01:48:21 +0000
committerJason Molenda <jmolenda@apple.com>2013-03-28 01:48:21 +0000
commitd37a8a9e2e17dbdd21de7d922259eded95d60919 (patch)
tree5a4b555ccfde6a6a689ecacca78196c89c98fbfa
parent99866dd535fbeaeb3108768362592bff4259456a (diff)
downloadbcm5719-llvm-d37a8a9e2e17dbdd21de7d922259eded95d60919.tar.gz
bcm5719-llvm-d37a8a9e2e17dbdd21de7d922259eded95d60919.zip
Debugserver fix for launching iOS apps who are named "com.apple.something"
- the ".app" would be treated as the app bundle final characters and the SpringBoard launch would fail. <rdar://problem/13258935> llvm-svn: 178209
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachProcess.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
index 606a78bb3cd..c0240b76e19 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
@@ -1652,8 +1652,22 @@ MachProcess::LaunchForDebug
case eLaunchFlavorSpringBoard:
{
- const char *app_ext = strstr(path, ".app");
- if (app_ext && (app_ext[4] == '\0' || app_ext[4] == '/'))
+ // .../whatever.app/whatever ?
+ // Or .../com.apple.whatever.app/whatever -- be careful of ".app" in "com.apple.whatever" here
+ const char *app_ext = strstr (path, ".app/");
+ if (app_ext == NULL)
+ {
+ // .../whatever.app ?
+ int len = strlen (path);
+ if (len > 5)
+ {
+ if (strcmp (path + len - 4, ".app") == 0)
+ {
+ app_ext = path + len - 4;
+ }
+ }
+ }
+ if (app_ext)
{
std::string app_bundle_path(path, app_ext + strlen(".app"));
if (SBLaunchForDebug (app_bundle_path.c_str(), argv, envp, no_stdio, launch_err) != 0)
OpenPOWER on IntegriCloud