Suppress SOS.NETCore.dll error msg in release mode (dotnet/coreclr#6975)
authorchunseoklee <chunseoklee@naver.com>
Wed, 2 Nov 2016 22:18:53 +0000 (07:18 +0900)
committerMike McLaughlin <mikem@microsoft.com>
Wed, 2 Nov 2016 22:18:53 +0000 (15:18 -0700)
Suppress error msg when running coreclr without
SOS.NETCore.dll in release mode

Commit migrated from https://github.com/dotnet/coreclr/commit/8a05dcd07441b8779ec5b9eff9bdcb90f24fcb8e

src/coreclr/src/dlls/mscoree/unixinterface.cpp

index 4e75b33..edd361c 100644 (file)
@@ -247,22 +247,23 @@ int coreclr_initialize(
         host.SuppressRelease();
         *hostHandle = host;
 #ifdef FEATURE_GDBJIT
-
-        hr = coreclr_create_delegate(*hostHandle,
-                                     *domainId,
-                                     "SOS.NETCore",
-                                     "SOS.SymbolReader",
-                                     "GetInfoForMethod",
-                                     (void**)&getInfoForMethodDelegate);
-
-        if (!SUCCEEDED(hr))
+        HRESULT createDelegateResult;
+        createDelegateResult = coreclr_create_delegate(*hostHandle,
+                                                       *domainId,
+                                                       "SOS.NETCore",
+                                                       "SOS.SymbolReader",
+                                                       "GetInfoForMethod",
+                                                       (void**)&getInfoForMethodDelegate);
+
+#if defined(_DEBUG)
+        if (!SUCCEEDED(createDelegateResult))
         {
             fprintf(stderr,
                     "Can't create delegate for 'SOS.SymbolReader.GetInfoForMethod' "
-                    "method - status: 0x%08x\n", hr);
+                    "method - status: 0x%08x\n", createDelegateResult);
         }
+#endif // _DEBUG
 
-        hr = S_OK; // We don't need to fail if we can't create delegate
 #endif
     }
     return hr;