Unset profiler env var for debugger own libcoreclr
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Fri, 4 May 2018 20:46:59 +0000 (23:46 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Fri, 4 May 2018 20:46:59 +0000 (23:46 +0300)
src/debug/netcoredbg/platform.cpp
src/debug/netcoredbg/platform.h
src/debug/netcoredbg/symbolreader.cpp

index 78ec636..793647a 100644 (file)
@@ -186,6 +186,11 @@ void *DLSym(void *handle, const std::string &name)
     return dlsym(handle, name.c_str());
 }
 
+void UnsetCoreCLREnv()
+{
+    unsetenv("CORECLR_ENABLE_PROFILING");
+}
+
 // From https://stackoverflow.com/questions/13541313/handle-socket-descriptors-like-file-descriptor-fstream-c-linux
 class fdbuf : public std::streambuf
 {
index 801bf4f..5f5ac0b 100644 (file)
@@ -14,6 +14,7 @@ bool SetWorkDir(const std::string &path);
 void USleep(uint32_t duration);
 void *DLOpen(const std::string &path);
 void *DLSym(void *handle, const std::string &name);
+void UnsetCoreCLREnv();
 
 class IORedirectServer
 {
index 29975ac..9359ba5 100644 (file)
@@ -136,6 +136,8 @@ HRESULT SymbolReader::PrepareSymbolReader()
 
     HRESULT Status;
 
+    UnsetCoreCLREnv();
+
     void *coreclrLib = DLOpen(coreClrPath);
     if (coreclrLib == nullptr)
     {