diff options
| author | Jason Molenda <jmolenda@apple.com> | 2013-03-28 01:48:21 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2013-03-28 01:48:21 +0000 |
| commit | d37a8a9e2e17dbdd21de7d922259eded95d60919 (patch) | |
| tree | 5a4b555ccfde6a6a689ecacca78196c89c98fbfa | |
| parent | 99866dd535fbeaeb3108768362592bff4259456a (diff) | |
| download | bcm5719-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.cpp | 18 |
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) |

