summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-02-09 21:20:17 +0000
committerGreg Clayton <gclayton@apple.com>2016-02-09 21:20:17 +0000
commit0e14c044792e464b00ed1303f59a3484bbf4f830 (patch)
treec5c1eab7299803b42663665e85727d613b2698b7
parent[AArch64] This check is specific to merging instructions. NFC. (diff)
downloadllvm-project-0e14c044792e464b00ed1303f59a3484bbf4f830.tar.gz
llvm-project-0e14c044792e464b00ed1303f59a3484bbf4f830.tar.bz2
llvm-project-0e14c044792e464b00ed1303f59a3484bbf4f830.zip
If we set the DYLD_INSERT_LIBRARIES environment variable when launching debugserver, for use with /usr/lib/libgmalloc.dylib, then make sure we don't pass this environment variable on to any child processes.
llvm-svn: 260284
-rw-r--r--lldb/tools/debugserver/source/debugserver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/debugserver.cpp b/lldb/tools/debugserver/source/debugserver.cpp
index 78990a671d82..369a0a1c47d3 100644
--- a/lldb/tools/debugserver/source/debugserver.cpp
+++ b/lldb/tools/debugserver/source/debugserver.cpp
@@ -885,6 +885,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__)