From f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:50:09 +0000 Subject: Vendor import of lldb release_39 branch r276489: https://llvm.org/svn/llvm-project/lldb/branches/release_39@276489 --- tools/debugserver/source/debugserver.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tools/debugserver/source/debugserver.cpp') diff --git a/tools/debugserver/source/debugserver.cpp b/tools/debugserver/source/debugserver.cpp index 78990a671d82..a22f046771d9 100644 --- a/tools/debugserver/source/debugserver.cpp +++ b/tools/debugserver/source/debugserver.cpp @@ -824,8 +824,9 @@ FileLogCallback(void *baton, uint32_t flags, const char *format, va_list args) if (baton == NULL || format == NULL) return; - ::vfprintf ((FILE *)baton, format, args); - ::fprintf ((FILE *)baton, "\n"); + ::vfprintf((FILE *)baton, format, args); + ::fprintf((FILE *)baton, "\n"); + ::fflush((FILE *)baton); } @@ -885,6 +886,10 @@ static struct option g_long_options[] = int main (int argc, char *argv[]) { + // If debugserver is launched with DYLD_INSERT_LIBRARIES, unset it so we + // don't spawn child processes with this enabled. + unsetenv("DYLD_INSERT_LIBRARIES"); + const char *argv_sub_zero = argv[0]; // save a copy of argv[0] for error reporting post-launch #if defined (__APPLE__) @@ -1076,7 +1081,7 @@ main (int argc, char *argv[]) case 'K': g_detach_on_error = false; - + break; case 'W': if (optarg && optarg[0]) working_dir.assign(optarg); -- cgit v1.3