-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
//*****************************************************************************
// CorDB.cpp
//
#include "dbgtransportmanager.h"
#endif // FEATURE_DBGIPC_TRANSPORT_DI
-// Helper function returns the instance handle of this module.
-HINSTANCE GetModuleInst();
-
//********** Globals. *********************************************************
+#ifndef FEATURE_PAL
HINSTANCE g_hInst; // Instance handle to this piece of code.
+#endif
//-----------------------------------------------------------------------------
// SxS Versioning story for Mscordbi (ICorDebug + friends)
//*****************************************************************************
STDAPI CreateCordbObject(int iDebuggerVersion, IUnknown ** ppCordb)
{
-#if defined(FEATURE_CORECLR) && !defined(FEATURE_DBGIPC_TRANSPORT_DI) && !defined(FEATURE_CORESYSTEM)
+#if !defined(FEATURE_DBGIPC_TRANSPORT_DI) && !defined(FEATURE_CORESYSTEM)
// This API should not be called for Windows CoreCLR unless we are doing interop-debugging
// (which is only supported internally). Use code:CoreCLRCreateCordbObject instead.
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_DbgEnableMixedModeDebugging) == 0)
_ASSERTE(!"Deprecated entry point CreateCordbObject() is called on Windows CoreCLR\n");
return E_NOTIMPL;
}
-#endif // FEATURE_CORECLR && !FEATURE_DBGIPC_TRANSPORT_DI
+#endif // !defined(FEATURE_DBGIPC_TRANSPORT_DI) && !defined(FEATURE_CORESYSTEM)
if (ppCordb == NULL)
{
return Cordb::CreateObject((CorDebugInterfaceVersion)iDebuggerVersion, IID_ICorDebug, (void **) ppCordb);
}
-#if defined(FEATURE_CORECLR)
//
// Public API.
// Telesto Creation path - only way to debug multi-instance.
return hr;
}
-#endif // FEATURE_CORECLR
case DLL_PROCESS_ATTACH:
{
+#ifndef FEATURE_PAL
g_hInst = hInstance;
-
-#ifdef FEATURE_PAL
+#else
int err = PAL_InitializeDLL();
if(err != 0)
{
#if defined(LOGGING)
{
- WCHAR rcFile[_MAX_PATH];
- WszGetModuleFileName(hInstance, rcFile, NumItems(rcFile));
+ PathString rcFile;
+ WszGetModuleFileName(hInstance, rcFile);
LOG((LF_CORDB, LL_INFO10000,
"DI::DbgDllMain: load right side support from file '%s'\n",
- rcFile));
+ rcFile.GetUnicode()));
}
#endif
case DLL_PROCESS_DETACH:
{
-#ifdef RSCONTRACTS
- TlsFree(DbgRSThread::s_TlsSlot);
- DbgRSThread::s_TlsSlot = TLS_OUT_OF_INDEXES;
-#endif
-
#if defined(FEATURE_DBGIPC_TRANSPORT_DI)
if (g_pDbgTransportTarget != NULL)
{
g_pDbgTransportTarget = NULL;
}
#endif // FEATURE_DBGIPC_TRANSPORT_DI
-
+
+#ifdef RSCONTRACTS
+ TlsFree(DbgRSThread::s_TlsSlot);
+ DbgRSThread::s_TlsSlot = TLS_OUT_OF_INDEXES;
+#endif
}
break;
}
}
-
-
-
//*****************************************************************************
// This helper provides access to the instance handle of the loaded image.
//*****************************************************************************
+#ifndef FEATURE_PAL
HINSTANCE GetModuleInst()
{
return g_hInst;
}
+#endif
//-----------------------------------------------------------------------------
DT_CONTEXT *lpContext)
{
// if we aren't local debugging this isn't going to work
-#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI)
+#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || defined(__ANDROID__)
_ASSERTE(!"Can't use local GetThreadContext remotely, this needed to go to datatarget");
return FALSE;
#else
DbiSetThreadContext(HANDLE hThread,
const DT_CONTEXT *lpContext)
{
-#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI)
+#if !defined(_ARM_) || defined(FEATURE_DBGIPC_TRANSPORT_DI) || defined(__ANDROID__)
_ASSERTE(!"Can't use local GetThreadContext remotely, this needed to go to datatarget");
return FALSE;
#else