#undef CORECLR_HOSTING_API
-struct SequencePointInfo
-{
- int lineNumber, ilOffset;
- char16_t* fileName;
-};
-
-struct MethodDebugInfo
-{
- SequencePointInfo* points;
- int size;
-};
-
-typedef int (*GetInfoForMethodDelegate)(const char*, unsigned int, MethodDebugInfo& methodDebugInfo);
-extern GetInfoForMethodDelegate getInfoForMethodDelegate;
-
#endif // __CORECLR_HOST_H__
// If set to 1, server GC is enabled on startup. If 0, server GC is
// disabled. Server GC is off by default.
static const char* serverGcVar = "CORECLR_SERVER_GC";
-GetInfoForMethodDelegate getInfoForMethodDelegate = NULL;
#if defined(__linux__)
#define symlinkEntrypointExecutable "/proc/self/exe"
#elif !defined(__APPLE__)
}
else
{
-#ifdef FEATURE_GDBJIT
- coreclr_create_delegate_ptr CreateDelegate =
- (coreclr_create_delegate_ptr)dlsym(coreclrLib,
- "coreclr_create_delegate");
-
- // st = CreateDelegate(hostHandle, domainId, "System.Diagnostics.Debug.SymbolReader",
- // "System.Diagnostics.Debug.SymbolReader.SymbolReader", "GetLineByILOffset",
- // (void **)&getLineByILOffsetDelegate);
- st = CreateDelegate(hostHandle, domainId, "System.Diagnostics.Debug.SymbolReader",
- "System.Diagnostics.Debug.SymbolReader.SymbolReader", "GetInfoForMethod",
- (void **)&getInfoForMethodDelegate);
-
- if (!SUCCEEDED(st))
- {
- fprintf(stderr, "coreclr_create_delegate failed - status: 0x%08x\n", st);
- exitCode = -1;
- }
-#endif // FEATURE_GDBJIT
st = executeAssembly(
hostHandle,
domainId,
include_directories("../../inc")
+if(FEATURE_GDBJIT)
+ add_definitions(-DFEATURE_GDBJIT)
+endif(FEATURE_GDBJIT)
+
set(CLR_SOURCES
mscoree.cpp
unixinterface.cpp
extern "C" LPCWSTR g_CLRJITPath;
#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#ifdef FEATURE_GDBJIT
+GetInfoForMethodDelegate getInfoForMethodDelegate = NULL;
+extern "C" int coreclr_create_delegate(void*, unsigned int, const char*, const char*, const char*, void**);
+#endif //FEATURE_GDBJIT
+
//
// Initialize the CoreCLR. Creates and starts CoreCLR host and creates an app domain
//
{
host.SuppressRelease();
*hostHandle = host;
- }
+#ifdef FEATURE_GDBJIT
+ hr = coreclr_create_delegate(*hostHandle,
+ *domainId,
+ "System.Diagnostics.Debug.SymbolReader",
+ "System.Diagnostics.Debug.SymbolReader.SymbolReader",
+ "GetInfoForMethod",
+ (void**)&getInfoForMethodDelegate);
+
+ if (!SUCCEEDED(hr))
+ {
+ fprintf(stderr, "coreclr_create_delegate failed - status: 0x%08x\n", hr);
+ }
+#endif
+ }
return hr;
}
// ======================================================================================
+#ifdef FEATURE_GDBJIT
+struct SequencePointInfo
+{
+ int lineNumber, ilOffset;
+ char16_t* fileName;
+};
+
+struct MethodDebugInfo
+{
+ SequencePointInfo* points;
+ int size;
+};
+
+typedef int (*GetInfoForMethodDelegate)(const char*, unsigned int, MethodDebugInfo& methodDebugInfo);
+extern GetInfoForMethodDelegate getInfoForMethodDelegate;
+#endif // FEATURE_GDBJIT
+
#endif // __UtilCode_h__
//*****************************************************************************
#include "common.h"
-#include "../coreclr/hosts/inc/coreclrhost.h"
+#include "../inc/utilcode.h"
#include "gdbjit.h"
struct DebuggerILToNativeMap
StackScratchBuffer scratch;
const char* szModName = modName.GetUTF8(scratch);
- MethodDebugInfo *methodDebugInfo = new (nothrow )MethodDebugInfo();
+ MethodDebugInfo* methodDebugInfo = new (nothrow) MethodDebugInfo();
if (methodDebugInfo == nullptr)
return E_OUTOFMEMORY;
methodDebugInfo->points = (SequencePointInfo*) CoTaskMemAlloc(sizeof(SequencePointInfo) * numMap);