Remove empty lines caused by empty fusion log string (dotnet/coreclr#27471)
authorDan Moseley <danmose@microsoft.com>
Sun, 27 Oct 2019 19:11:21 +0000 (12:11 -0700)
committermsftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com>
Sun, 27 Oct 2019 19:11:21 +0000 (19:11 +0000)
* Remove empty lines caused by empty fusion log string

* Remove fusion log more

Commit migrated from https://github.com/dotnet/coreclr/commit/7cdde63900a258a26a758f13107766e60e84596a

src/coreclr/src/System.Private.CoreLib/src/System/BadImageFormatException.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs
src/coreclr/src/System.Private.CoreLib/src/System/IO/FileNotFoundException.CoreCLR.cs
src/coreclr/src/vm/appdomain.cpp
src/coreclr/src/vm/clrex.cpp
src/coreclr/src/vm/clrex.h

index a7daa7ff91ea2253eef599488e9c01f2401df30d..8f29b3ed60b77167f24f7ebd1f25da908967c02d 100644 (file)
@@ -7,12 +7,11 @@ namespace System
     public partial class BadImageFormatException
     {
         // Do not delete: this is invoked from native code.
-        private BadImageFormatException(string? fileName, string? fusionLog, int hResult)
+        private BadImageFormatException(string? fileName, int hResult)
             : base(null)
         {
             HResult = hResult;
             _fileName = fileName;
-            _fusionLog = fusionLog;
             SetMessageField();
         }
     }
index 7c415620591190e2a31e6946f2ff7549b3539464..07259527731ca13557075cbc750a0678a5a13b04 100644 (file)
@@ -10,12 +10,11 @@ namespace System.IO
     public partial class FileLoadException
     {
         // Do not delete: this is invoked from native code.
-        private FileLoadException(string? fileName, string? fusionLog, int hResult)
+        private FileLoadException(string? fileName, int hResult)
             : base(null)
         {
             HResult = hResult;
             FileName = fileName;
-            FusionLog = fusionLog;
             _message = FormatFileLoadExceptionMessage(FileName, HResult);
         }
 
index 8471c9b30143c889f07bc2aaa5259295940f985e..0a753272df9c4ab54d0bcf43b9c4c405cc70f8c0 100644 (file)
@@ -7,12 +7,11 @@ namespace System.IO
     public partial class FileNotFoundException
     {
         // Do not delete: this is invoked from native code.
-        private FileNotFoundException(string? fileName, string? fusionLog, int hResult)
+        private FileNotFoundException(string? fileName, int hResult)
             : base(null)
         {
             HResult = hResult;
             FileName = fileName;
-            FusionLog = fusionLog;
             SetMessageField();
         }
     }
index 7b46b02241278100768ec88d121161bf9f62bd18..98853c8311ceaa50abc29a155d1b51699371d02e 100644 (file)
@@ -3801,7 +3801,7 @@ DomainAssembly* AppDomain::LoadDomainAssembly(AssemblySpec* pSpec,
             {
                 StackSString name;
                 pSpec->GetFileOrDisplayName(0, name);
-                pEx=new EEFileLoadException(name, pEx->GetHR(), NULL, pEx);
+                pEx=new EEFileLoadException(name, pEx->GetHR(), pEx);
                 AddExceptionToCache(pSpec, pEx);
                 PAL_CPP_THROW(Exception *, pEx);
             }
index b0dc916de1a3be5ff504ce4539f013d4c51b583a..b60d56fe5a627f26a6df963648c04806d9ebe07e 100644 (file)
@@ -1675,10 +1675,9 @@ OBJECTREF EETypeLoadException::CreateThrowable()
 // EEFileLoadException is an EE exception subclass representing a file loading
 // error
 // ---------------------------------------------------------------------------
-EEFileLoadException::EEFileLoadException(const SString &name, HRESULT hr, void *pFusionLog, Exception *pInnerException/* = NULL*/)
+EEFileLoadException::EEFileLoadException(const SString &name, HRESULT hr, Exception *pInnerException/* = NULL*/)
   : EEException(GetFileLoadKind(hr)),
     m_name(name),
-    m_pFusionLog(pFusionLog),
     m_hr(hr)
 {
     CONTRACTL
@@ -1822,22 +1821,18 @@ OBJECTREF EEFileLoadException::CreateThrowable()
     }
     CONTRACTL_END;
 
-    // Fetch any log info from the fusion log
-    SString logText;
     struct _gc {
         OBJECTREF pNewException;
         STRINGREF pNewFileString;
-        STRINGREF pFusLogString;
     } gc;
     ZeroMemory(&gc, sizeof(gc));
     GCPROTECT_BEGIN(gc);
 
     gc.pNewFileString = StringObject::NewString(m_name);
-    gc.pFusLogString = StringObject::NewString(logText);
     gc.pNewException = AllocateObject(MscorlibBinder::GetException(m_kind));
 
     MethodDesc* pMD = MemberLoader::FindMethod(gc.pNewException->GetMethodTable(),
-                            COR_CTOR_METHOD_NAME, &gsig_IM_Str_Str_Int_RetVoid);
+                            COR_CTOR_METHOD_NAME, &gsig_IM_Str_Int_RetVoid);
 
     if (!pMD)
     {
@@ -1850,7 +1845,6 @@ OBJECTREF EEFileLoadException::CreateThrowable()
     ARG_SLOT args[] = {
         ObjToArgSlot(gc.pNewException),
         ObjToArgSlot(gc.pNewFileString),
-        ObjToArgSlot(gc.pFusLogString),
         (ARG_SLOT) m_hr
     };
 
index 3fafb05c88eeb26e88aaee12c8259a0303b7232f..8653b489772394277305144dda3c4a49c2d43b7b 100644 (file)
@@ -668,13 +668,11 @@ class EEFileLoadException : public EEException
     
   private:
     SString m_name;
-    void  *m_pFusionLog;
     HRESULT m_hr;       
-                        
 
   public:
 
-    EEFileLoadException(const SString &name, HRESULT hr, void *pFusionLog = NULL,  Exception *pInnerException = NULL);
+    EEFileLoadException(const SString &name, HRESULT hr, Exception *pInnerException = NULL);
     ~EEFileLoadException();
 
     // virtual overrides
@@ -698,12 +696,12 @@ class EEFileLoadException : public EEException
     virtual Exception *CloneHelper()
     {
         WRAPPER_NO_CONTRACT;
-        return new EEFileLoadException(m_name, m_hr, m_pFusionLog);
+        return new EEFileLoadException(m_name, m_hr);
     }
 
  private:
 #ifdef _DEBUG    
-    EEFileLoadException() : m_pFusionLog(NULL)
+    EEFileLoadException()
     {
         // Used only for DebugIsEECxxExceptionPointer to get the vtable pointer.
         // We need a variant which does not allocate memory.