#include <vector>
// For `HRESULT` definition
+#ifdef FEATURE_PAL
#include <pal_mstypes.h>
+#else
+#include <windows.h>
+#endif
#include "protocol.h"
// Distributed under the MIT License.
// See the LICENSE file in the project root for more information.
+#ifndef FEATURE_PAL
+// Turn off macro definitions named max and min in <windows.h> header file
+// to avoid compile error for std::numeric_limits<uint64_t>::max().
+#define NOMINMAX
+#endif
+
#include "frames.h"
#include <sstream>
return;
std::string libName = exe.substr(0, dirSepIndex + 1);
-#ifdef FEATURE_PAL
-#if defined(__APPLE__)
+#ifdef WIN32
+ libName += "dbgshim.dll";
+#elif defined(__APPLE__)
libName += "libdbgshim.dylib";
#else
libName += "libdbgshim.so";
#endif
-#else
- libName += "dbgshim.dll";
-#endif
m_module = DLOpen(libName);
if (!m_module)
static std::string EscapeMIValue(const std::string &str);
static HRESULT PrintBreakpoint(const Breakpoint &b, std::string &output);
static void PrintVar(const std::string &varobjName, Variable &v, int threadId, int print_values, std::string &output);
+#ifdef _MSC_VER
+ static void Printf(_Printf_format_string_ const char *fmt, ...);
+#else
static void Printf(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
+#endif
public:
static const char *SymbolReaderDllName = "SymbolReader";
static const char *SymbolReaderClassName = "SOS.SymbolReader";
+#ifdef FEATURE_PAL
// Suppress undefined reference
// `_invalid_parameter(char16_t const*, char16_t const*, char16_t const*, unsigned int, unsigned long)':
// /coreclr/src/pal/inc/rt/safecrt.h:386: undefined reference to `RaiseException'
CONST ULONG_PTR *lpArguments)
{
}
+#endif
std::string SymbolReader::coreClrPath;
LoadSymbolsForModuleDelegate SymbolReader::loadSymbolsForModuleDelegate;
return E_FAIL;
}
+#ifdef FEATURE_PAL
sysAllocStringLen = (SysAllocStringLen_t)DLSym(coreclrLib, "SysAllocStringLen");
sysFreeString = (SysFreeString_t)DLSym(coreclrLib, "SysFreeString");
sysStringLen = (SysStringLen_t)DLSym(coreclrLib, "SysStringLen");
coTaskMemFree = (CoTaskMemFree_t)DLSym(coreclrLib, "CoTaskMemFree");
+#else
+ sysAllocStringLen = SysAllocStringLen;
+ sysFreeString = SysFreeString;
+ sysStringLen = SysStringLen;
+ coTaskMemFree = CoTaskMemFree;
+#endif
if (sysAllocStringLen == nullptr)
{
public:
static const int HiddenLine;
- struct __attribute__((packed)) SequencePoint {
+
+#ifdef _MSC_VER
+#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
+#else
+#define PACK( __Declaration__ ) __Declaration__ __attribute__((packed))
+#endif
+
+ PACK(struct SequencePoint {
int32_t startLine;
int32_t startColumn;
int32_t endLine;
int32_t endColumn;
int32_t offset;
- };
+ });
SymbolReader()
{