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
This commit is contained in:
Greg Clayton
2010-10-18 04:14:23 +00:00
parent 5cd41c4b13
commit 58d1c9a44f
10 changed files with 109 additions and 74 deletions

View File

@@ -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);