From 91b5ae5cbfea3eef8ec616893c0a626978f90b20 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Sat, 15 Apr 2017 11:09:03 -0700 Subject: [PATCH] Make createdump build and work on Centos (dotnet/coreclr#10985) Commit migrated from https://github.com/dotnet/coreclr/commit/dc5b99d0e10bb07c6b0c3071e2db9dac3c68b9c0 --- src/coreclr/src/CMakeLists.txt | 4 ++-- src/coreclr/src/debug/createdump/createdump.cpp | 5 ++--- src/coreclr/src/debug/createdump/dumpwriter.h | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/coreclr/src/CMakeLists.txt b/src/coreclr/src/CMakeLists.txt index c2e0260..9598d0c 100644 --- a/src/coreclr/src/CMakeLists.txt +++ b/src/coreclr/src/CMakeLists.txt @@ -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) diff --git a/src/coreclr/src/debug/createdump/createdump.cpp b/src/coreclr/src/debug/createdump/createdump.cpp index 863b3ec..4f43d11 100644 --- a/src/coreclr/src/debug/createdump/createdump.cpp +++ b/src/coreclr/src/debug/createdump/createdump.cpp @@ -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 +} diff --git a/src/coreclr/src/debug/createdump/dumpwriter.h b/src/coreclr/src/debug/createdump/dumpwriter.h index 61e3936..272a2eb 100644 --- a/src/coreclr/src/debug/createdump/dumpwriter.h +++ b/src/coreclr/src/debug/createdump/dumpwriter.h @@ -24,6 +24,10 @@ #define PH_HDR_CANARY 0xFFFF +#ifndef NT_FILE +#define NT_FILE 0x46494c45 +#endif + class DumpWriter : IUnknown { private: -- 2.7.4