Skip to content

Commit

Permalink
Adding more parameters to connect to mono runtime (#4261)
Browse files Browse the repository at this point in the history
Now it's tested on all platforms: Windows, Linux and Mac, connecting to
iOS and Android, devices and emulators.
  • Loading branch information
thaystg authored Sep 26, 2023
1 parent 0e72419 commit 5a19f28
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
24 changes: 15 additions & 9 deletions src/dbgshim/dbgshim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,11 @@ typedef HRESULT (STDAPICALLTYPE *FPCoreCLRCreateCordbObject3)(
IUnknown **ppCordb);

typedef HRESULT (STDAPICALLTYPE *FPCreateRemoteCordbObject)(
DWORD port,
LPCWSTR assemblyBasePath,
LPCWSTR szIp,
DWORD dwPort,
LPCWSTR szPlatform,
BOOL bIsServer,
LPCWSTR szAssemblyBasePath,
IUnknown **ppCordb);

HRESULT CreateCoreDbg(
Expand Down Expand Up @@ -2157,7 +2160,7 @@ CLRCreateInstance(
return pDebuggingImpl->QueryInterface(riid, ppInterface);
}

HRESULT CreateCoreDbgRemotePort(HMODULE hDBIModule, DWORD portId, LPCWSTR assemblyBasePath, IUnknown **ppCordb)
HRESULT CreateCoreDbgRemotePort(HMODULE hDBIModule, LPCWSTR szIp, DWORD dwPort, LPCWSTR szPlatform, BOOL bIsServer, LPCWSTR assemblyBasePath, IUnknown **ppCordb)
{
PUBLIC_CONTRACT;
HRESULT hr = S_OK;
Expand All @@ -2169,30 +2172,33 @@ HRESULT CreateCoreDbgRemotePort(HMODULE hDBIModule, DWORD portId, LPCWSTR assemb
return CORDBG_E_INCOMPATIBLE_PROTOCOL;
}

return fpCreate(portId, assemblyBasePath, ppCordb);
return fpCreate(szIp, dwPort, szPlatform, bIsServer, assemblyBasePath, ppCordb);

return hr;
}

DLLEXPORT
HRESULT
RegisterForRuntimeStartupRemotePort(
_In_ DWORD dwRemotePortId,
_In_ LPCWSTR mscordbiPath,
_In_ LPCWSTR assemblyBasePath,
_In_ LPCWSTR szIp,
_In_ DWORD dwPort,
_In_ LPCWSTR szPlatform,
_In_ BOOL bIsServer,
_In_ LPCWSTR szMscordbiPath,
_In_ LPCWSTR szAssemblyBasePath,
_Out_ IUnknown ** ppCordb)
{
PUBLIC_CONTRACT;
HRESULT hr = S_OK;
HMODULE hMod = NULL;

hMod = LoadLibraryW(mscordbiPath);
hMod = LoadLibraryW(szMscordbiPath);
if (hMod == NULL)
{
hr = CORDBG_E_DEBUG_COMPONENT_MISSING;
return hr;
}

hr = CreateCoreDbgRemotePort(hMod, dwRemotePortId, assemblyBasePath, ppCordb);
hr = CreateCoreDbgRemotePort(hMod, szIp, dwPort, szPlatform, bIsServer, szAssemblyBasePath, ppCordb);
return S_OK;
}
9 changes: 6 additions & 3 deletions src/dbgshim/dbgshim.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ CreateDebuggingInterfaceFromVersion3(

EXTERN_C HRESULT
RegisterForRuntimeStartupRemotePort(
_In_ DWORD dwRemotePortId,
_In_ LPCWSTR mscordbiPath,
_In_ LPCWSTR assemblyBasePath,
_In_ LPCWSTR szIp,
_In_ DWORD dwPort,
_In_ LPCWSTR szPlatform,
_In_ BOOL bIsServer,
_In_ LPCWSTR szMscordbiPath,
_In_ LPCWSTR szAssemblyBasePath,
_Out_ IUnknown ** ppCordb);

0 comments on commit 5a19f28

Please sign in to comment.