Removing unnecessary hacks
authorAndrew Au <andrewau@microsoft.com>
Thu, 24 May 2018 22:52:32 +0000 (15:52 -0700)
committerAndrew Au <cshung@gmail.com>
Wed, 7 Nov 2018 02:34:47 +0000 (18:34 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/6a9384827f7e1059bec5e246425e46cc7f3fc140

src/coreclr/src/debug/di/divalue.cpp
src/coreclr/src/debug/di/process.cpp
src/coreclr/src/debug/di/rspriv.h
src/coreclr/src/debug/di/shimevents.cpp
src/coreclr/src/debug/ee/controller.cpp
src/coreclr/src/debug/ee/controller.h
src/coreclr/src/debug/ee/debugger.cpp
src/coreclr/src/debug/ee/debugger.h
src/coreclr/src/debug/ee/rcthread.cpp
src/coreclr/src/utilcode/log.cpp
src/coreclr/src/vm/debugdebugger.cpp

index e8975ec..59cd382 100644 (file)
@@ -427,11 +427,7 @@ HRESULT CordbValue::InternalCreateHandle(CorDebugHandleType      handleType,
 
     *ppHandle = NULL;        
 
-    if (handleType == 3)
-    {
-        fStrong = 2;
-    }
-    else if (handleType == HANDLE_STRONG)
+    if (handleType == HANDLE_STRONG)
     {
         fStrong = TRUE;
     }
index 04f63f8..1ab0724 100644 (file)
@@ -938,7 +938,6 @@ CordbProcess::CordbProcess(ULONG64 clrInstanceId,
     m_syncCompleteReceived(false),
     m_pShim(pShim),
     m_userThreads(11),
-    m_dataBreakpoints(4),
     m_oddSync(false),
 #ifdef FEATURE_INTEROP_DEBUGGING
     m_unmanagedThreads(11),
@@ -1304,7 +1303,6 @@ void CordbProcess::NeuterChildren()
     // Sweep neuter lists.
     m_ExitNeuterList.NeuterAndClear(this);
     m_ContinueNeuterList.NeuterAndClear(this);
-    m_dataBreakpoints.NeuterAndClear(GetProcessLock());
 
     m_userThreads.NeuterAndClear(GetProcessLock());
 
index 868d6f6..a9f5893 100644 (file)
@@ -82,7 +82,6 @@ class CordbInternalFrame;
 class CordbContext;
 class CordbThread;
 class CordbVariableHome;
-class CordbValueBreakpoint;
 
 #ifdef FEATURE_INTEROP_DEBUGGING
 class CordbUnmanagedThread;
@@ -144,32 +143,6 @@ template <class T>
 class CordbSafeHashTable;
 
 
-typedef struct _DR7 *PDR7;
-typedef struct _DR7 {
-    DWORD       L0 : 1;
-    DWORD       G0 : 1;
-    DWORD       L1 : 1;
-    DWORD       G1 : 1;
-    DWORD       L2 : 1;
-    DWORD       G2 : 1;
-    DWORD       L3 : 1;
-    DWORD       G3 : 1;
-    DWORD       LE : 1;
-    DWORD       GE : 1;
-    DWORD       Pad1 : 3;
-    DWORD       GD : 1;
-    DWORD       Pad2 : 1;
-    DWORD       Pad3 : 1;
-    DWORD       Rwe0 : 2;
-    DWORD       Len0 : 2;
-    DWORD       Rwe1 : 2;
-    DWORD       Len1 : 2;
-    DWORD       Rwe2 : 2;
-    DWORD       Len2 : 2;
-    DWORD       Rwe3 : 2;
-    DWORD       Len3 : 2;
-} DR7;
-
 //---------------------------------------------------------------------------------------
 //
 // This is an encapsulation of the information necessary to connect to the debugger proxy on a remote machine. 
@@ -3832,8 +3805,6 @@ private:
     // This is just used for backwards compat.
     CORDB_ADDRESS         m_clrInstanceId;
 
-    CordbSafeHashTable<CordbValueBreakpoint> m_dataBreakpoints;
-
     // List of things that get neutered on process exit and Continue respectively.
     NeuterList            m_ExitNeuterList;
     NeuterList            m_ContinueNeuterList;
@@ -8817,18 +8788,14 @@ public:
 };
 
 /* ------------------------------------------------------------------------- *
- * Value Breakpoint class
- * ------------------------------------------------------------------------- */
+* Value Breakpoint class
+* ------------------------------------------------------------------------- */
 
 class CordbValueBreakpoint : public CordbBreakpoint,
-                             public ICorDebugValueBreakpoint
+    public ICorDebugValueBreakpoint
 {
 public:
-    CordbValueBreakpoint(unsigned int index, CordbValue *pValue, CordbProcess* pProcess): CordbBreakpoint(pProcess, CordbBreakpointType::CBT_VALUE)
-    {
-        m_value = pValue;
-        m_index = index;
-    }
+    CordbValueBreakpoint(CordbValue *pValue);
 
 
 #ifdef _DEBUG
@@ -8847,43 +8814,14 @@ public:
     {
         return (BaseRelease());
     }
-    COM_METHOD QueryInterface(REFIID riid, void **ppInterface)
-    {
-        if (riid == IID_ICorDebugValueBreakpoint)
-        {
-            *ppInterface = static_cast<ICorDebugValueBreakpoint*>(this);
-        }
-        else if (riid == IID_ICorDebugBreakpoint)
-        {
-            *ppInterface = static_cast<ICorDebugBreakpoint*>(static_cast<CordbBreakpoint*>(this));
-        }
-        else if (riid == IID_IUnknown)
-        {
-            *ppInterface = static_cast<IUnknown *>(static_cast<ICorDebugValueBreakpoint*>(this));
-        }
-        else
-        {
-            return E_NOINTERFACE;
-        }
-
-        ExternalAddRef();
-        return S_OK;
-    }
+    COM_METHOD QueryInterface(REFIID riid, void **ppInterface);
 
     //-----------------------------------------------------------
     // ICorDebugValueBreakpoint
     //-----------------------------------------------------------
 
-    COM_METHOD GetValue(ICorDebugValue **ppValue)
-    {
-        return S_OK;
-    }
-
-    COM_METHOD Activate(BOOL bActive)
-    {
-        return S_OK;
-    }
-
+    COM_METHOD GetValue(ICorDebugValue **ppValue);
+    COM_METHOD Activate(BOOL bActive);
     COM_METHOD IsActive(BOOL *pbActive)
     {
         VALIDATE_POINTER_TO_OBJECT(pbActive, BOOL *);
@@ -8895,25 +8833,15 @@ public:
     // Non-COM methods
     //-----------------------------------------------------------
 
-    void Disconnect()
-    {
-    }
-
-    unsigned int GetIndex()
-    {
-        return m_index;
-    }
+    void Disconnect();
 
 public:
-    CordbValue       *m_value;
-
-private:
-    unsigned int     m_index;
+    CordbValue * m_value;
 };
 
 /* ------------------------------------------------------------------------- *
- * Generic Value class
- * ------------------------------------------------------------------------- */
+* Generic Value class
+* ------------------------------------------------------------------------- */
 
 class CordbGenericValue : public CordbValue, public ICorDebugGenericValue, public ICorDebugValue2, public ICorDebugValue3
 {
index 15f4316..a2d0ea6 100644 (file)
@@ -78,7 +78,7 @@ ICorDebugManagedCallback3 * ManagedEvent::DispatchArgs::GetCallback3()
     return m_pCallback3;
 }
 
-// trivial accessor to get callback 3
+// trivial accessor to get callback 4
 ICorDebugManagedCallback4 * ManagedEvent::DispatchArgs::GetCallback4()
 {
     return m_pCallback4;
index 7b14244..5ae9a95 100644 (file)
@@ -46,6 +46,7 @@ DebuggerControllerPage         *DebuggerController::g_protections = NULL;
 CrstStatic                      DebuggerController::g_criticalSection;
 int                             DebuggerController::g_cTotalMethodEnter = 0;
 
+
 // Is this patch at a position at which it's safe to take a stack?
 bool DebuggerControllerPatch::IsSafeForStackTrace()
 {
@@ -3026,26 +3027,6 @@ DPOSS_ACTION DebuggerController::DispatchPatchOrSingleStep(Thread *thread, CONTE
         context->Dr2 = c.Dr2;
         context->Dr3 = c.Dr3;
 
-        //if (context->Dr0 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 0)
-        //{
-        //    DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context);
-        //}
-
-        //if (context->Dr1 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 1)
-        //{
-        //    DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context);
-        //}
-
-        //if (context->Dr2 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 2)
-        //{
-        //    DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context);
-        //}
-
-        //if (context->Dr3 != NULL && DebuggerDataBreakpoint::g_DataBreakpointCount == 3)
-        //{
-        //    DebuggerDataBreakpoint::CreateDebuggerDataBreakpoint(thread, thread->GetDomain(), context);
-        //}
-
         if (!atSafePlace)
             g_pDebugger->DecThreadsAtUnsafePlaces();
 
index 5a46981..4d91d7d 100644 (file)
@@ -991,7 +991,7 @@ inline void VerifyExecutableAddress(const BYTE* address)
 
 // DebuggerController:   DebuggerController serves
 // both as a static class that dispatches exceptions coming from the
-// EE, and as an abstract base class for the five classes that derive
+// EE, and as an abstract base class for the five classes that derrive
 // from it.
 class DebuggerController 
 {
index 1099032..8439e0f 100644 (file)
@@ -11461,7 +11461,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent)
              Object * pObject = (Object*)pEvent->CreateHandle.objectToken;
              OBJECTREF objref = ObjectToOBJECTREF(pObject);
              AppDomain * pAppDomain = pEvent->vmAppDomain.GetRawPtr();
-             int fStrong = (int) pEvent->CreateHandle.fStrong;
+             BOOL fStrong = pEvent->CreateHandle.fStrong;
              OBJECTHANDLE objectHandle;
 
              // This is a synchronous event (reply required)
@@ -11482,10 +11482,6 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent)
                          // create strong handle
                          objectHandle = pAppDomain->CreateStrongHandle(objref);
                      }
-                     else if (fStrong == 2)
-                     {
-                         objectHandle = pAppDomain->CreatePinningHandle(objref);
-                     }
                      else
                      {
                          // create the weak long handle
@@ -11754,12 +11750,8 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent)
     case DB_IPCE_GET_CONTAINER:
         {
             DebuggerIPCEvent * pResult = m_pRCThread->GetIPCEventReceiveBuffer();
-            // TODO, databp, replace with the right find_object call
-            pResult->GetContainerResult.answer = ((void*)(((long long)pEvent->GetContainer.interiorPointer) - sizeof(void*)));
-
-            // This is the right code for calling the method in GC, but that code has a bug such that it does not work in this scenario
-            // Object *pObject = GCHeapUtilities::GetGCHeap()->GetContainingObject(pEvent->GetContainer.interiorPointer, false);
-            // pResult->GetContainerResult.answer = pObject;
+            Object *pObject = GCHeapUtilities::GetGCHeap()->GetContainingObject(pEvent->GetContainer.interiorPointer, false);
+            pResult->GetContainerResult.answer = pObject;
             InitIPCEvent(pResult, DB_IPCE_GET_CONTAINER_RESULT, NULL, NULL);
             pResult->hr = S_OK;
             m_pRCThread->SendIPCReply();
index ac0f7be..10d62d6 100644 (file)
@@ -418,7 +418,7 @@ HRESULT ValidateObject(Object *objPtr);
 
 //-----------------------------------------------------------------------------
 // Execution control needs several ways to get at the context of a thread
-// stopped in managed code (stepping, setip, func-eval).
+// stopped in mangaged code (stepping, setip, func-eval).
 // We want to abstract away a few things:
 // - active: this thread is stopped at a patch
 // - inactive: this threads was managed suspended somewhere in jitted code
index 200e91e..00a2fdc 100644 (file)
@@ -13,6 +13,7 @@
 #include "stdafx.h"
 #include "threadsuspend.h"
 #ifndef FEATURE_PAL
+
 #include "securitywrapper.h"
 #endif
 #include <aclapi.h>
@@ -1795,6 +1796,7 @@ HRESULT DebuggerRCThread::SendIPCEvent()
             }
         }
 
+
         PRECONDITION(ThisMaybeHelperThread());
     }
     CONTRACTL_END;
index 03b6b59..bbe5d0f 100644 (file)
 #define LOG_ENABLE                      0x0040
 
 
-static DWORD    LogFlags                    = 0;
-//static DWORD LogFlags = LOG_ENABLE | LOG_ENABLE_FILE_LOGGING | LOG_ENABLE_DEBUGGER_LOGGING;
+static DWORD    LogFlags = 0;
 static CQuickWSTR     szLogFileName;
-static HANDLE   LogFileHandle               = INVALID_HANDLE_VALUE;
-static MUTEX_COOKIE   LogFileMutex                = 0;
-static DWORD    LogFacilityMask             = LF_ALL;
-static DWORD    LogFacilityMask2            = 0;
-static DWORD    LogVMLevel                  = LL_EVERYTHING;
-        // <TODO>@todo FIX should probably only display warnings and above by default</TODO>
+static HANDLE   LogFileHandle = INVALID_HANDLE_VALUE;
+static MUTEX_COOKIE   LogFileMutex = 0;
+static DWORD    LogFacilityMask = LF_ALL;
+static DWORD    LogFacilityMask2 = 0;
+static DWORD    LogVMLevel = LL_INFO100;
+// <TODO>@todo FIX should probably only display warnings and above by default</TODO>
 
 
 VOID InitLogging()
 {
     STATIC_CONTRACT_NOTHROW;
-    
-        // <TODO>FIX bit of a workaround for now, check for the log file in the
-        // registry and if there, turn on file logging VPM</TODO>
-    
-    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogEnable, LOG_ENABLE);    
+
+    // <TODO>FIX bit of a workaround for now, check for the log file in the
+    // registry and if there, turn on file logging VPM</TODO>
+
+    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogEnable, LOG_ENABLE);
     LogFacilityMask = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::INTERNAL_LogFacility, LogFacilityMask) | LF_ALWAYS;
     LogVMLevel = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_LogLevel, LogVMLevel);
     LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogFileAppend, LOG_ENABLE_APPEND_FILE);
-    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogFlushFile,  LOG_ENABLE_FLUSH_FILE);
+    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogFlushFile, LOG_ENABLE_FLUSH_FILE);
     LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogToDebugger, LOG_ENABLE_DEBUGGER_LOGGING);
-    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogToFile,     LOG_ENABLE_FILE_LOGGING);
-    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogToConsole,  LOG_ENABLE_CONSOLE_LOGGING);
-    
+    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogToFile, LOG_ENABLE_FILE_LOGGING);
+    LogFlags |= REGUTIL::GetConfigFlag_DontUse_(CLRConfig::INTERNAL_LogToConsole, LOG_ENABLE_CONSOLE_LOGGING);
+
     LogFacilityMask2 = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::INTERNAL_LogFacility2, LogFacilityMask2) | LF_ALWAYS;
 
     if (SUCCEEDED(szLogFileName.ReSizeNoThrow(MAX_LONGPATH)))
@@ -94,10 +93,10 @@ VOID InitLogging()
             FILE_SHARE_READ,
             NULL,
             fdwCreate,
-            FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN |  ((LogFlags & LOG_ENABLE_FLUSH_FILE) ? FILE_FLAG_WRITE_THROUGH : 0),
+            FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | ((LogFlags & LOG_ENABLE_FLUSH_FILE) ? FILE_FLAG_WRITE_THROUGH : 0),
             NULL);
 
-        if(0 == LogFileMutex)
+        if (0 == LogFileMutex)
         {
             LogFileMutex = ClrCreateMutex(
                 NULL,
@@ -106,7 +105,7 @@ VOID InitLogging()
             _ASSERTE(LogFileMutex != 0);
         }
 
-            // Some other logging may be going on, try again with another file name
+        // Some other logging may be going on, try again with another file name
         if (LogFileHandle == INVALID_HANDLE_VALUE && wcslen(szLogFileName.Ptr()) + 3 <= szLogFileName.Size())
         {
             WCHAR* ptr = szLogFileName.Ptr() + wcslen(szLogFileName.Ptr()) + 1;
@@ -114,7 +113,7 @@ VOID InitLogging()
             ptr[0] = W('0');
             ptr[1] = 0;
 
-            for(int i = 0; i < 10; i++)
+            for (int i = 0; i < 10; i++)
             {
                 LogFileHandle = WszCreateFile(
                     szLogFileName.Ptr(),
@@ -122,7 +121,7 @@ VOID InitLogging()
                     FILE_SHARE_READ,
                     NULL,
                     fdwCreate,
-                    FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN |  ((LogFlags & LOG_ENABLE_FLUSH_FILE) ? FILE_FLAG_WRITE_THROUGH : 0),
+                    FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | ((LogFlags & LOG_ENABLE_FLUSH_FILE) ? FILE_FLAG_WRITE_THROUGH : 0),
                     NULL);
                 if (LogFileHandle != INVALID_HANDLE_VALUE)
                     break;
@@ -153,7 +152,7 @@ VOID InitLogging()
         {
             if (LogFlags & LOG_ENABLE_APPEND_FILE)
                 SetFilePointer(LogFileHandle, 0, NULL, FILE_END);
-            LogSpew( LF_ALWAYS, FATALERROR, "************************ New Output *****************\n" );
+            LogSpew(LF_ALWAYS, FATALERROR, "************************ New Output *****************\n");
         }
     }
 }
@@ -167,7 +166,7 @@ VOID EnterLogLock()
     // rather hard to care about this, as we LOG all over the place.
     CONTRACT_VIOLATION(TakesLockViolation);
 
-    if(LogFileMutex != 0)
+    if (LogFileMutex != 0)
     {
         DWORD status;
         status = ClrWaitForMutex(LogFileMutex, INFINITE, FALSE);
@@ -180,7 +179,7 @@ VOID LeaveLogLock()
     STATIC_CONTRACT_NOTHROW;
     STATIC_CONTRACT_GC_NOTRIGGER;
 
-    if(LogFileMutex != 0)
+    if (LogFileMutex != 0)
     {
         BOOL success;
         success = ClrReleaseMutex(LogFileMutex);
@@ -207,9 +206,9 @@ VOID FlushLogging() {
     {
         // We must take the lock, as an OS deadlock can occur between
         // FlushFileBuffers and WriteFile.
-        EnterLogLock();        
-        FlushFileBuffers( LogFileHandle );
-        LeaveLogLock();        
+        EnterLogLock();
+        FlushFileBuffers(LogFileHandle);
+        LeaveLogLock();
     }
 }
 
@@ -218,8 +217,8 @@ VOID ShutdownLogging()
     STATIC_CONTRACT_NOTHROW;
 
     if (LogFileHandle != INVALID_HANDLE_VALUE) {
-        LogSpew( LF_ALWAYS, FATALERROR, "Logging shutting down\n");
-        CloseHandle( LogFileHandle );
+        LogSpew(LF_ALWAYS, FATALERROR, "Logging shutting down\n");
+        CloseHandle(LogFileHandle);
     }
     LogFileHandle = INVALID_HANDLE_VALUE;
     bLoggingInitialized = false;
@@ -240,8 +239,8 @@ bool LoggingOn(DWORD facility, DWORD level) {
     _ASSERTE(LogFacilityMask & LF_ALWAYS); // LF_ALWAYS should always be enabled
 
     return((LogFlags & LOG_ENABLE) &&
-           level <= LogVMLevel &&
-           (facility & LogFacilityMask));
+        level <= LogVMLevel &&
+        (facility & LogFacilityMask));
 }
 
 bool Logging2On(DWORD facility2, DWORD level) {
@@ -250,8 +249,8 @@ bool Logging2On(DWORD facility2, DWORD level) {
     _ASSERTE(LogFacilityMask2 & LF_ALWAYS); // LF_ALWAYS should always be enabled
 
     return((LogFlags & LOG_ENABLE) &&
-           level <= LogVMLevel &&
-           (facility2 & LogFacilityMask2));
+        level <= LogVMLevel &&
+        (facility2 & LogFacilityMask2));
 }
 
 //
@@ -262,7 +261,7 @@ VOID LogSpewValist(DWORD facility, DWORD level, const char *fmt, va_list args)
     SCAN_IGNORE_FAULT;  // calls to new (nothrow) in logging code are OK
     STATIC_CONTRACT_NOTHROW;
     STATIC_CONTRACT_GC_NOTRIGGER;
-    
+
     if (!LoggingOn(facility, level))
         return;
 
@@ -277,7 +276,7 @@ VOID LogSpew2Valist(DWORD facility2, DWORD level, const char *fmt, va_list args)
     SCAN_IGNORE_FAULT;  // calls to new (nothrow) in logging code are OK
     STATIC_CONTRACT_NOTHROW;
     STATIC_CONTRACT_GC_NOTRIGGER;
-    
+
     if (!Logging2On(facility2, level))
         return;
 
@@ -292,7 +291,7 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)
     SCAN_IGNORE_FAULT;  // calls to new (nothrow) in logging code are OK
     STATIC_CONTRACT_NOTHROW;
     STATIC_CONTRACT_GC_NOTRIGGER;
-    
+
     DEBUG_ONLY_FUNCTION;
 
     // We can't do heap allocations at all.  The current thread may have
@@ -315,8 +314,8 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)
 
     EnterLogLock();
 
-    char *  pBuffer      = &rgchBuffer[0];
-    DWORD       buflen       = 0;
+    char *  pBuffer = &rgchBuffer[0];
+    DWORD       buflen = 0;
     DWORD       written;
 
     static bool needsPrefix = true;
@@ -324,19 +323,20 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)
     if (needsPrefix)
         buflen = sprintf_s(pBuffer, COUNTOF(rgchBuffer), "TID %04x: ", GetCurrentThreadId());
 
-    needsPrefix = (fmt[strlen(fmt)-1] == '\n');
+    needsPrefix = (fmt[strlen(fmt) - 1] == '\n');
 
-    int cCountWritten = _vsnprintf_s(&pBuffer[buflen], BUFFERSIZE-buflen, _TRUNCATE, fmt, args );
-    pBuffer[BUFFERSIZE-1] = 0;
+    int cCountWritten = _vsnprintf_s(&pBuffer[buflen], BUFFERSIZE - buflen, _TRUNCATE, fmt, args);
+    pBuffer[BUFFERSIZE - 1] = 0;
     if (cCountWritten < 0) {
         buflen = BUFFERSIZE - 1;
-    } else {
+    }
+    else {
         buflen += cCountWritten;
     }
 
     // Its a little late for this, but at least you wont continue
     // trashing your program...
-    _ASSERTE((buflen < (DWORD) BUFFERSIZE) && "Log text is too long!") ;
+    _ASSERTE((buflen < (DWORD)BUFFERSIZE) && "Log text is too long!");
 
 #if !PLATFORM_UNIX
     //convert NL's to CR NL to fixup notepad
@@ -365,7 +365,7 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)
     {
         WriteFile(LogFileHandle, pBuffer, buflen, &written, NULL);
         if (LogFlags & LOG_ENABLE_FLUSH_FILE) {
-            FlushFileBuffers( LogFileHandle );
+            FlushFileBuffers(LogFileHandle);
         }
     }
 
@@ -374,7 +374,7 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)
         WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, buflen, &written, 0);
         //<TODO>@TODO ...Unnecessary to flush console?</TODO>
         if (LogFlags & LOG_ENABLE_FLUSH_FILE)
-            FlushFileBuffers( GetStdHandle(STD_OUTPUT_HANDLE) );
+            FlushFileBuffers(GetStdHandle(STD_OUTPUT_HANDLE));
     }
 
     if (LogFlags & LOG_ENABLE_DEBUGGER_LOGGING)
@@ -385,12 +385,12 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)
     LeaveLogLock();
 }
 
-VOID LogSpew(DWORD facility, DWORD level, const char *fmt, ... )
+VOID LogSpew(DWORD facility, DWORD level, const char *fmt, ...)
 {
     STATIC_CONTRACT_WRAPPER;
-    
+
     ENTER_SO_NOT_MAINLINE_CODE;
-    
+
 #ifdef SELF_NO_HOST
     if (TRUE)
 #else //!SELF_NO_HOST
@@ -399,7 +399,7 @@ VOID LogSpew(DWORD facility, DWORD level, const char *fmt, ... )
     {
         va_list     args;
         va_start(args, fmt);
-        LogSpewValist (facility, level, fmt, args);
+        LogSpewValist(facility, level, fmt, args);
         va_end(args);
     }
     else
@@ -407,16 +407,16 @@ VOID LogSpew(DWORD facility, DWORD level, const char *fmt, ... )
         // Cannot acquire the required lock, as this would call back
         // into the host.  Eat the log message.
     }
-    
+
     LEAVE_SO_NOT_MAINLINE_CODE;
 }
 
-VOID LogSpew2(DWORD facility2, DWORD level, const char *fmt, ... )
+VOID LogSpew2(DWORD facility2, DWORD level, const char *fmt, ...)
 {
     STATIC_CONTRACT_WRAPPER;
-    
+
     ENTER_SO_NOT_MAINLINE_CODE;
-    
+
 #ifdef SELF_NO_HOST
     if (TRUE)
 #else //!SELF_NO_HOST
@@ -433,16 +433,16 @@ VOID LogSpew2(DWORD facility2, DWORD level, const char *fmt, ... )
         // Cannot acquire the required lock, as this would call back
         // into the host.  Eat the log message.
     }
-    
+
     LEAVE_SO_NOT_MAINLINE_CODE;
 }
 
-VOID LogSpewAlways (const char *fmt, ... )
+VOID LogSpewAlways(const char *fmt, ...)
 {
     STATIC_CONTRACT_WRAPPER;
-    
+
     ENTER_SO_NOT_MAINLINE_CODE;
-    
+
 #ifdef SELF_NO_HOST
     if (TRUE)
 #else //!SELF_NO_HOST
@@ -451,7 +451,7 @@ VOID LogSpewAlways (const char *fmt, ... )
     {
         va_list     args;
         va_start(args, fmt);
-        LogSpewValist (LF_ALWAYS, LL_ALWAYS, fmt, args);
+        LogSpewValist(LF_ALWAYS, LL_ALWAYS, fmt, args);
         va_end(args);
     }
     else
@@ -459,7 +459,7 @@ VOID LogSpewAlways (const char *fmt, ... )
         // Cannot acquire the required lock, as this would call back
         // into the host.  Eat the log message.
     }
-    
+
     LEAVE_SO_NOT_MAINLINE_CODE;
 }
 
index ab05d63..daadc91 100644 (file)
@@ -99,6 +99,7 @@ UINT_PTR FindMostRecentUserCodeOnStack(void)
     return address;
 }
 
+
 // This does a user break, triggered by System.Diagnostics.Debugger.Break, or the IL opcode for break.
 //
 // Notes: