Make createdump build and work on Centos (dotnet/coreclr#10985)
authorMike McLaughlin <mikem@microsoft.com>
Sat, 15 Apr 2017 18:09:03 +0000 (11:09 -0700)
committerGitHub <noreply@github.com>
Sat, 15 Apr 2017 18:09:03 +0000 (11:09 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/dc5b99d0e10bb07c6b0c3071e2db9dac3c68b9c0

src/coreclr/src/CMakeLists.txt
src/coreclr/src/debug/createdump/createdump.cpp
src/coreclr/src/debug/createdump/dumpwriter.h

index c2e0260..9598d0c 100644 (file)
@@ -96,11 +96,11 @@ function(add_executable_clr)
 endfunction()
 
 if(CLR_CMAKE_PLATFORM_UNIX)
-  if(CLR_CMAKE_PLATFORM_UBUNTU_LINUX)
+  if(CLR_CMAKE_PLATFORM_LINUX)
     if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
       add_subdirectory(debug/createdump)
     endif(CLR_CMAKE_PLATFORM_UNIX_AMD64)
-  endif(CLR_CMAKE_PLATFORM_UBUNTU_LINUX)
+  endif(CLR_CMAKE_PLATFORM_LINUX)
 
   add_subdirectory(ToolBox/SOS/Strike)
 
index 863b3ec..4f43d11 100644 (file)
@@ -56,7 +56,7 @@ exit:
 //
 int __cdecl main(const int argc, const char* argv[])
 {
-    const char* dumpPathTemplate = "/tmp/coredump.%lu";
+    const char* dumpPathTemplate = "/tmp/coredump.%d";
 
     char* diagnostics = getenv("COMPlus_CreateDumpDiagnostics");
     g_diagnostics = diagnostics != nullptr && strcmp(diagnostics, "1") == 0;
@@ -76,7 +76,6 @@ int __cdecl main(const int argc, const char* argv[])
     }
     pid = _atoi64(argv[1]);
 
-    //if (!CreateDump(argv[0], dumpPathTemplate, pid, MiniDumpWithPrivateReadWriteMemory)) 
     if (!CreateDump(argv[0], dumpPathTemplate, pid, MiniDumpNormal)) 
     {
         exitCode = -1;
@@ -85,4 +84,4 @@ int __cdecl main(const int argc, const char* argv[])
 exit:
     PAL_TerminateEx(exitCode);
     return exitCode;
-}
\ No newline at end of file
+}
index 61e3936..272a2eb 100644 (file)
 
 #define PH_HDR_CANARY 0xFFFF
 
+#ifndef NT_FILE
+#define NT_FILE                0x46494c45
+#endif
+
 class DumpWriter : IUnknown
 {
 private: