Fix two sos issues.
authorMike McLaughlin <mikem@microsoft.com>
Fri, 4 Mar 2016 18:05:24 +0000 (10:05 -0800)
committerMike McLaughlin <mikem@microsoft.com>
Fri, 4 Mar 2016 18:05:24 +0000 (10:05 -0800)
ARM Disassemble problem and reenterency bug on Windows.

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

src/coreclr/src/ToolBox/SOS/Strike/exts.cpp
src/coreclr/src/ToolBox/SOS/lldbplugin/services.cpp

index 5084d0a..804363a 100644 (file)
@@ -191,6 +191,8 @@ void CleanupEventCallbacks()
     }
 }
 
+bool g_Initialized = false;
+
 extern "C"
 HRESULT
 CALLBACK
@@ -202,7 +204,12 @@ DebugExtensionInitialize(PULONG Version, PULONG Flags)
 
     *Version = DEBUG_EXTENSION_VERSION(1, 0);
     *Flags = 0;
-    
+
+    if (g_Initialized)
+    {
+        return S_OK;
+    }
+    g_Initialized = true;
 
     if ((Hr = DebugCreate(__uuidof(IDebugClient),
                           (void **)&DebugClient)) != S_OK)
index e66f29b..21d1a2c 100644 (file)
@@ -560,7 +560,7 @@ LLDBServices::Disassemble(
         hr = E_FAIL;
         goto exit;
     }
-    cch = snprintf(buffer, bufferSize, "%016lx ", offset);
+    cch = snprintf(buffer, bufferSize, "%016llx ", (unsigned long long)offset);
     buffer += cch;
     bufferSize -= cch;