From: Xavier Roirand Date: Sat, 8 Sep 2018 14:51:21 +0000 (+0200) Subject: Darwin: set startup-with-shell to off on Sierra and later. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6be54ef73eacaaf5bf28bafc7dfebc80ebac832;p=binutils-gdb.git Darwin: set startup-with-shell to off on Sierra and later. On Mac OS X Sierra and later, the shell is not allowed to be debug so add a check and disable startup with shell in that case. This disabling is done temporary before forking inferior and restored after the fork. gdb/ChangeLog: * darwin-nat.c (should_disable_startup_with_shell): New function. (darwin_nat_target::create_inferior): Add call. Change-Id: Ie4d9090f65fdf2e83ecf7a0f9d0647fb1c27cdcc --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1469366b1fc..5f8480548e9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-09-11 Xavier Roirand + + * darwin-nat.c (should_disable_startup_with_shell): + New function. + (darwin_nat_target::create_inferior): Add call. + 2018-09-11 Xavier Roirand * darwin-nat.h (struct darwin_thread_info) = 16) + return true; + } + return false; +} + void darwin_nat_target::create_inferior (const char *exec_file, const std::string &allargs, char **env, int from_tty) { + gdb::optional> restore_startup_with_shell; + + if (startup_with_shell && should_disable_startup_with_shell ()) + { + warning (_("startup-with-shell not supported on this macOS version," + " disabling it.")); + restore_startup_with_shell.emplace (&startup_with_shell, 0); + } + /* Do the hard work. */ fork_inferior (exec_file, allargs, env, darwin_ptrace_me, darwin_ptrace_him, darwin_pre_ptrace, NULL,