Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
OPTION(CLR_CMAKE_WARNINGS_ARE_ERRORS "Warnings are errors" ON)

# Ensure that python is present
find_program(PYTHON NAMES python3 python2 python)
find_program(PYTHON NAMES python3 python2 python py)
if (PYTHON STREQUAL "PYTHON-NOTFOUND")
message(FATAL_ERROR "PYTHON not found: Please install Python 2.7.9 or later from https://www.python.org/downloads/")
endif()
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export ghprbCommentBody=

# resolve python-version to use
if [ "$PYTHON" == "" ] ; then
if ! PYTHON=$(command -v python3 || command -v python2 || command -v python)
if ! PYTHON=$(command -v python3 || command -v python2 || command -v python || command -v py)
then
echo "Unable to locate build-dependency python!" 1>&2
exit 1
Expand Down
3 changes: 3 additions & 0 deletions configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ if (CLR_CMAKE_PLATFORM_UNIX)
# as x64 does. It has been causing issues in ARM (https://github.com/dotnet/coreclr/issues/4746)
add_compile_options(-fsigned-char)

# We mark the function which needs exporting with DLLEXPORT
add_compile_options(-fvisibility=hidden)

# Specify the minimum supported version of macOS
if(CLR_CMAKE_PLATFORM_DARWIN)
set(MACOS_VERSION_MIN_FLAGS "-mmacosx-version-min=10.12")
Expand Down
10 changes: 9 additions & 1 deletion src/ToolBox/SOS/Strike/exts.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,16 @@ inline BOOL IsInterrupt()
//
#undef DECLARE_API

#ifndef DLLEXPORT
#ifdef _MSC_VER
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __attribute__ ((visibility ("default")))
#endif // _MSC_VER
#endif // DLLEXPORT

#define DECLARE_API(extension) \
CPPMOD HRESULT CALLBACK extension(PDEBUG_CLIENT client, PCSTR args)
CPPMOD DLLEXPORT HRESULT CALLBACK extension(PDEBUG_CLIENT client, PCSTR args)

class __ExtensionCleanUp
{
Expand Down
10 changes: 5 additions & 5 deletions src/ToolBox/SOS/Strike/sos_stacktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct StackTrace_SimpleContext
extern "C" {
#endif // __cplusplus

HRESULT CALLBACK _EFN_StackTrace(
DLLEXPORT HRESULT CALLBACK _EFN_StackTrace(
PDEBUG_CLIENT client,
__out_ecount(*puiTextLength) WCHAR wszTextOut[],
size_t *puiTextLength,
Expand All @@ -119,7 +119,7 @@ HRESULT CALLBACK _EFN_StackTrace(
// cbString - number of characters available in the string buffer.
//
// The output will be truncated of cbString is not long enough for the full stack trace.
HRESULT CALLBACK _EFN_GetManagedExcepStack(
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedExcepStack(
PDEBUG_CLIENT client,
ULONG64 StackObjAddr,
__out_ecount(cbString) PSTR szStackString,
Expand All @@ -128,7 +128,7 @@ HRESULT CALLBACK _EFN_GetManagedExcepStack(

// _EFN_GetManagedExcepStackW - same as _EFN_GetManagedExcepStack, but returns
// the stack as a wide string.
HRESULT CALLBACK _EFN_GetManagedExcepStackW(
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedExcepStackW(
PDEBUG_CLIENT client,
ULONG64 StackObjAddr,
__out_ecount(cchString) PWSTR wszStackString,
Expand All @@ -141,7 +141,7 @@ HRESULT CALLBACK _EFN_GetManagedExcepStackW(
// szName - a buffer to be filled with the full type name
// cbName - the number of characters available in the buffer
//
HRESULT CALLBACK _EFN_GetManagedObjectName(
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedObjectName(
PDEBUG_CLIENT client,
ULONG64 objAddr,
__out_ecount(cbName) PSTR szName,
Expand All @@ -158,7 +158,7 @@ HRESULT CALLBACK _EFN_GetManagedObjectName(
// pOffset - the offset from objAddr to the field. This parameter can be NULL.
//
// At least one of pValue and pOffset must be non-NULL.
HRESULT CALLBACK _EFN_GetManagedObjectFieldInfo(
DLLEXPORT HRESULT CALLBACK _EFN_GetManagedObjectFieldInfo(
PDEBUG_CLIENT client,
ULONG64 objAddr,
__out_ecount (mdNameLen) PSTR szFieldName,
Expand Down
6 changes: 3 additions & 3 deletions src/ToolBox/SOS/Strike/strike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15149,7 +15149,7 @@ DECLARE_API(ExposeDML)
// According to kksharma the Windows debuggers always sign-extend
// arguments when calling externally, therefore StackObjAddr
// conforms to CLRDATA_ADDRESS contract.
HRESULT CALLBACK
HRESULT CALLBACK
_EFN_GetManagedExcepStack(
PDEBUG_CLIENT client,
ULONG64 StackObjAddr,
Expand Down Expand Up @@ -15196,7 +15196,7 @@ _EFN_GetManagedExcepStackW(
// According to kksharma the Windows debuggers always sign-extend
// arguments when calling externally, therefore objAddr
// conforms to CLRDATA_ADDRESS contract.
HRESULT CALLBACK
HRESULT CALLBACK
_EFN_GetManagedObjectName(
PDEBUG_CLIENT client,
ULONG64 objAddr,
Expand Down Expand Up @@ -15224,7 +15224,7 @@ _EFN_GetManagedObjectName(
// According to kksharma the Windows debuggers always sign-extend
// arguments when calling externally, therefore objAddr
// conforms to CLRDATA_ADDRESS contract.
HRESULT CALLBACK
HRESULT CALLBACK
_EFN_GetManagedObjectFieldInfo(
PDEBUG_CLIENT client,
ULONG64 objAddr,
Expand Down
2 changes: 1 addition & 1 deletion src/ToolBox/SOS/lldbplugin/sosplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "sosplugin.h"

namespace lldb {
bool PluginInitialize (lldb::SBDebugger debugger);
DLLEXPORT bool PluginInitialize (lldb::SBDebugger debugger);
}

bool
Expand Down
3 changes: 0 additions & 3 deletions src/corefx/System.Globalization.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ add_definitions(-DBIT64=1)

set(ICU_HOMEBREW_INC_PATH "/usr/local/opt/icu4c/include")

# We mark the function which needs exporting with DLLEXPORT
add_compile_options(-fvisibility=hidden)

find_path(UTYPES_H "unicode/utypes.h" PATHS ${ICU_HOMEBREW_INC_PATH})
if(UTYPES_H STREQUAL UTYPES_H-NOTFOUND)
message(FATAL_ERROR "Cannot find utypes.h, try installing libicu-dev (or the appropriate package for your platform)")
Expand Down
1 change: 1 addition & 0 deletions src/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ HINSTANCE g_thisModule;

extern VOID STDMETHODCALLTYPE TLS_FreeMasterSlotIndex();

DLLEXPORT
EXTERN_C BOOL WINAPI
DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
{
Expand Down
1 change: 1 addition & 0 deletions src/debug/daccess/dacdbiimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

// Prototype for creation function
STDAPI
DLLEXPORT
DacDbiInterfaceInstance(
ICorDebugDataTarget * pTarget,
CORDB_ADDRESS baseAddress,
Expand Down
2 changes: 1 addition & 1 deletion src/debug/daccess/nidump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static OptionDependencies g_dependencies[] =
//

// This function gets the Dispenser interface given the CLSID and REFIID.
STDAPI MetaDataGetDispenser(
DLLEXPORT STDAPI MetaDataGetDispenser(
REFCLSID rclsid, // The class to desired.
REFIID riid, // Interface wanted on class factory.
LPVOID FAR * ppv) // Return interface pointer here.
Expand Down
8 changes: 4 additions & 4 deletions src/debug/di/cordb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ STDAPI CreateCordbObject(int iDebuggerVersion, IUnknown ** ppCordb)
// Notes:
// It's inconsistent that this takes a (handle, pid) but hands back an ICorDebug instead of an ICorDebugProcess.
// Callers will need to call *ppCordb->DebugActiveProcess(pid).
STDAPI CoreCLRCreateCordbObjectEx(int iDebuggerVersion, DWORD pid, LPCWSTR lpApplicationGroupId, HMODULE hmodTargetCLR, IUnknown ** ppCordb)
STDAPI DLLEXPORT CoreCLRCreateCordbObjectEx(int iDebuggerVersion, DWORD pid, LPCWSTR lpApplicationGroupId, HMODULE hmodTargetCLR, IUnknown ** ppCordb)
{
if (ppCordb == NULL)
{
Expand Down Expand Up @@ -180,7 +180,7 @@ STDAPI CoreCLRCreateCordbObjectEx(int iDebuggerVersion, DWORD pid, LPCWSTR lpApp
// Notes:
// It's inconsistent that this takes a (handle, pid) but hands back an ICorDebug instead of an ICorDebugProcess.
// Callers will need to call *ppCordb->DebugActiveProcess(pid).
STDAPI CoreCLRCreateCordbObject(int iDebuggerVersion, DWORD pid, HMODULE hmodTargetCLR, IUnknown ** ppCordb)
STDAPI DLLEXPORT CoreCLRCreateCordbObject(int iDebuggerVersion, DWORD pid, HMODULE hmodTargetCLR, IUnknown ** ppCordb)
{
return CoreCLRCreateCordbObjectEx(iDebuggerVersion, pid, NULL, hmodTargetCLR, ppCordb);
}
Expand Down Expand Up @@ -309,7 +309,7 @@ const GUID IID_IDebugRemoteCorDebug = {0x83C91210, 0xA34F, 0x427c, {0xB3, 0x5F,
// Called by COM to get a class factory for a given CLSID. If it is one we
// support, instantiate a class factory object and prepare for create instance.
//*****************************************************************************
STDAPI DllGetClassObjectInternal( // Return code.
STDAPI DLLEXPORT DllGetClassObjectInternal( // Return code.
REFCLSID rclsid, // The class to desired.
REFIID riid, // Interface wanted on class factory.
LPVOID FAR *ppv) // Return interface pointer here.
Expand Down Expand Up @@ -369,7 +369,7 @@ STDAPI DllGetClassObjectInternal( // Return code.
// (we went through the shim). CoreCLR doesn't have a shim and we go back to the COM model so we re-expose
// DllGetClassObject to make that work.

STDAPI DllGetClassObject( // Return code.
STDAPI DLLEXPORT DllGetClassObject( // Return code.
REFCLSID rclsid, // The class to desired.
REFIID riid, // Interface wanted on class factory.
LPVOID FAR *ppv) // Return interface pointer here.
Expand Down
8 changes: 4 additions & 4 deletions src/debug/di/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extern RSDebuggingInfo * g_pRSDebuggingInfo;
// @dbgtodo attach-bit: need to determine fate of attach bit.
//
//---------------------------------------------------------------------------------------
STDAPI OpenVirtualProcessImpl(
STDAPI DLLEXPORT OpenVirtualProcessImpl(
ULONG64 clrInstanceId,
IUnknown * pDataTarget,
HMODULE hDacModule,
Expand Down Expand Up @@ -172,7 +172,7 @@ STDAPI OpenVirtualProcessImpl(
// Return Value:
// S_OK on success. Else failure
//---------------------------------------------------------------------------------------
STDAPI OpenVirtualProcessImpl2(
STDAPI DLLEXPORT OpenVirtualProcessImpl2(
ULONG64 clrInstanceId,
IUnknown * pDataTarget,
LPCWSTR pDacModulePath,
Expand All @@ -195,7 +195,7 @@ STDAPI OpenVirtualProcessImpl2(
// We'd like a beta1 shim/VS to still be able to open dumps using a CLR v4 Beta2+ mscordbi.dll,
// so we'll leave this in place (at least until after Beta2 is in wide use).
//---------------------------------------------------------------------------------------
STDAPI OpenVirtualProcess2(
STDAPI DLLEXPORT OpenVirtualProcess2(
ULONG64 clrInstanceId,
IUnknown * pDataTarget,
HMODULE hDacModule,
Expand All @@ -213,7 +213,7 @@ STDAPI OpenVirtualProcess2(
// Public OpenVirtualProcess method to get an ICorDebugProcess4 instance
// Used directly in CLR v4 pre Beta1 - can probably be safely removed now
//---------------------------------------------------------------------------------------
STDAPI OpenVirtualProcess(
STDAPI DLLEXPORT OpenVirtualProcess(
ULONG64 clrInstanceId,
IUnknown * pDataTarget,
REFIID riid,
Expand Down
20 changes: 17 additions & 3 deletions src/dlls/dbgshim/dbgshim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ if it exists, it will:
// that can be supported cross-platform.
//
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
CreateProcessForLaunch(
__in LPWSTR lpCommandLine,
Expand Down Expand Up @@ -137,6 +138,7 @@ CreateProcessForLaunch(
// ResumeProcess - to be used with the CreateProcessForLaunch resume handle
//
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
ResumeProcess(
__in HANDLE hResumeHandle)
Expand All @@ -155,6 +157,7 @@ ResumeProcess(
// CloseResumeHandle - to be used with the CreateProcessForLaunch resume handle
//
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
CloseResumeHandle(
__in HANDLE hResumeHandle)
Expand Down Expand Up @@ -692,6 +695,7 @@ StartupHelperThread(LPVOID p)
// ppUnregisterToken -- pointer to put the UnregisterForRuntimeStartup token.
//
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
RegisterForRuntimeStartup(
__in DWORD dwProcessId,
Expand Down Expand Up @@ -732,6 +736,7 @@ RegisterForRuntimeStartup(
// ppUnregisterToken -- pointer to put the UnregisterForRuntimeStartup token.
//
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
RegisterForRuntimeStartupEx(
__in DWORD dwProcessId,
Expand Down Expand Up @@ -780,6 +785,7 @@ RegisterForRuntimeStartupEx(
//
// pUnregisterToken -- unregister token from RegisterForRuntimeStartup or NULL.
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
UnregisterForRuntimeStartup(
__in PVOID pUnregisterToken)
Expand Down Expand Up @@ -815,8 +821,9 @@ const int cchEventNameBufferSize = (sizeof(StartupNotifyEventNamePrefix) + sizeo
+ 8 // + hex process id DWORD
+ 10 // + decimal session id DWORD
+ 1; // '\' after session id

HRESULT

DLLEXPORT
HRESULT
GetStartupNotificationEvent(
__in DWORD debuggeePID,
__out HANDLE* phStartupEvent)
Expand Down Expand Up @@ -1210,6 +1217,7 @@ EnumProcessModulesInternal(
// Notes:
// Callers use code:CloseCLREnumeration to free the returned arrays.
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
EnumerateCLRs(
DWORD debuggeePID,
Expand Down Expand Up @@ -1347,6 +1355,7 @@ EnumerateCLRs(
// dwArrayLength -- array length originally returned by EnumerateCLRs
//
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
CloseCLREnumeration(
__in HANDLE* pHandleArray,
Expand Down Expand Up @@ -1473,6 +1482,7 @@ const WCHAR *c_versionStrFormat = W("%08x;%08x;%p");
// The version string is an opaque string that can only be passed back to other
// DbgShim APIs.
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
CreateVersionStringFromModule(
__in DWORD pidDebuggee,
Expand Down Expand Up @@ -1707,6 +1717,7 @@ CheckDbiAndRuntimeVersion(
// the right debug pack is not installed.
// else Error. (*ppCordb will be null)
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersionEx(
__in int iDebuggerVersion,
Expand Down Expand Up @@ -1735,7 +1746,8 @@ CreateDebuggingInterfaceFromVersionEx(
// the right debug pack is not installed.
// else Error. (*ppCordb will be null)
//-----------------------------------------------------------------------------
HRESULT
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion2(
__in int iDebuggerVersion,
__in LPCWSTR szDebuggeeVersion,
Expand Down Expand Up @@ -1867,6 +1879,7 @@ CreateDebuggingInterfaceFromVersion2(
// the right debug pack is not installed.
// else Error. (*ppCordb will be null)
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion(
__in LPCWSTR szDebuggeeVersion,
Expand Down Expand Up @@ -1960,6 +1973,7 @@ GetContinueStartupEvent(
// Return:
// S_OK on success.
//-----------------------------------------------------------------------------
DLLEXPORT
HRESULT
CLRCreateInstance(
REFCLSID clsid,
Expand Down
Loading