From 58d1c9a44f9c3a0b2813e2a63f912d3fe8ec3840 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 18 Oct 2010 04:14:23 +0000 Subject: Still trying to get detach to work with debugserver. Got a bit closer, but something is still killing our inferior. Fixed an issue with darwin-debug where it wasn't passing all needed arguments to the inferior. Fixed a race condition with the attach to named process code. llvm-svn: 116697 --- lldb/tools/darwin-debug/darwin-debug.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lldb/tools/darwin-debug/darwin-debug.cpp') diff --git a/lldb/tools/darwin-debug/darwin-debug.cpp b/lldb/tools/darwin-debug/darwin-debug.cpp index f79d837e634..a894806f64c 100644 --- a/lldb/tools/darwin-debug/darwin-debug.cpp +++ b/lldb/tools/darwin-debug/darwin-debug.cpp @@ -87,10 +87,12 @@ exit_with_errno (int err, const char *prefix) } pid_t -posix_spawn_for_debug (const char *path, char *const *argv, char *const *envp, cpu_type_t cpu_type, int disable_aslr) +posix_spawn_for_debug (char *const *argv, char *const *envp, cpu_type_t cpu_type, int disable_aslr) { pid_t pid = 0; + const char *path = argv[0]; + posix_spawnattr_t attr; exit_with_errno (::posix_spawnattr_init (&attr), "::posix_spawnattr_init (&attr) error: "); @@ -203,13 +205,7 @@ int main (int argc, char *const *argv, char *const *envp, const char **apple) printf ("argv[%u] = '%s'\n", i, argv[i]); #endif - const char *exe_path = argv[0]; - - // Skip this inferior program name... - ++argv; - - posix_spawn_for_debug (exe_path, - argv, + posix_spawn_for_debug (argv, pass_env ? envp : NULL, cpu_type, disable_aslr); -- cgit v1.2.3