Adding more parameters to connect to mono runtime (#4261)
authorThays Grazia <thaystg@gmail.com>
Tue, 26 Sep 2023 13:25:17 +0000 (10:25 -0300)
committerGitHub <noreply@github.com>
Tue, 26 Sep 2023 13:25:17 +0000 (09:25 -0400)
Now it's tested on all platforms: Windows, Linux and Mac, connecting to
iOS and Android, devices and emulators.

src/dbgshim/dbgshim.cpp
src/dbgshim/dbgshim.h

index becdea9266c2240b99f743b917367334496af9c4..40c129c02b46dfc5963a7cbb18955047fdf96072 100644 (file)
@@ -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(
@@ -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;
@@ -2169,7 +2172,7 @@ 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;
 }
@@ -2177,22 +2180,25 @@ HRESULT CreateCoreDbgRemotePort(HMODULE hDBIModule, DWORD portId, LPCWSTR assemb
 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;
 }
index 43b44ef5c16bf8b8f599e1653448b84fcbe9d363..b85d8cf513682d274545a70ba0c32c590f287bcb 100644 (file)
@@ -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);