This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +45
-12
lines changed Expand file tree Collapse file tree 4 files changed +45
-12
lines changed Original file line number Diff line number Diff line change @@ -890,15 +890,6 @@ ShutdownTransport()
890
890
g_pDbgTransport = NULL;
891
891
}
892
892
}
893
-
894
- void
895
- AbortTransport()
896
- {
897
- if (g_pDbgTransport != NULL)
898
- {
899
- g_pDbgTransport->AbortConnection();
900
- }
901
- }
902
893
#endif // FEATURE_DBGIPC_TRANSPORT_VM
903
894
904
895
@@ -1895,6 +1886,16 @@ void NotifyDebuggerOfStartup()
1895
1886
1896
1887
#endif // !FEATURE_PAL
1897
1888
1889
+ void Debugger::CleanupTransportSocket(void)
1890
+ {
1891
+ #if defined(FEATURE_PAL) && defined(FEATURE_DBGIPC_TRANSPORT_VM)
1892
+ if (g_pDbgTransport != NULL)
1893
+ {
1894
+ g_pDbgTransport->AbortConnection();
1895
+ }
1896
+ #endif // FEATURE_PAL && FEATURE_DBGIPC_TRANSPORT_VM
1897
+ }
1898
+
1898
1899
//---------------------------------------------------------------------------------------
1899
1900
//
1900
1901
// Initialize Left-Side debugger object
@@ -2047,9 +2048,6 @@ HRESULT Debugger::Startup(void)
2047
2048
ShutdownTransport();
2048
2049
ThrowHR(hr);
2049
2050
}
2050
- #ifdef FEATURE_PAL
2051
- PAL_SetShutdownCallback(AbortTransport);
2052
- #endif // FEATURE_PAL
2053
2051
#endif // FEATURE_DBGIPC_TRANSPORT_VM
2054
2052
2055
2053
RaiseStartupNotification();
Original file line number Diff line number Diff line change @@ -1852,6 +1852,8 @@ class Debugger : public DebugInterface
1852
1852
1853
1853
HRESULT StartupPhase2 (Thread * pThread);
1854
1854
1855
+ void CleanupTransportSocket ();
1856
+
1855
1857
void InitializeLazyDataIfNecessary ();
1856
1858
1857
1859
void LazyInit (); // will throw
Original file line number Diff line number Diff line change @@ -596,6 +596,31 @@ do { \
596
596
#define IfFailGoLog (EXPR ) IfFailGotoLog(EXPR, ErrExit)
597
597
#endif
598
598
599
+
600
+ #ifndef CROSSGEN_COMPILE
601
+ #ifdef FEATURE_PAL
602
+ void EESocketCleanupHelper ()
603
+ {
604
+ CONTRACTL
605
+ {
606
+ GC_NOTRIGGER;
607
+ MODE_ANY;
608
+ } CONTRACTL_END;
609
+
610
+ // Close the debugger transport socket first
611
+ if (g_pDebugInterface != NULL )
612
+ {
613
+ g_pDebugInterface->CleanupTransportSocket ();
614
+ }
615
+
616
+ // Close the diagnostic server socket.
617
+ #ifdef FEATURE_PERFTRACING
618
+ DiagnosticServer::Shutdown ();
619
+ #endif // FEATURE_PERFTRACING
620
+ }
621
+ #endif // FEATURE_PAL
622
+ #endif // CROSSGEN_COMPILE
623
+
599
624
void EEStartupHelper (COINITIEE fFlags )
600
625
{
601
626
CONTRACTL
@@ -653,8 +678,13 @@ void EEStartupHelper(COINITIEE fFlags)
653
678
#ifdef FEATURE_PERFTRACING
654
679
// Initialize the event pipe.
655
680
EventPipe::Initialize ();
681
+
656
682
#endif // FEATURE_PERFTRACING
657
683
684
+ #ifdef FEATURE_PAL
685
+ PAL_SetShutdownCallback (EESocketCleanupHelper);
686
+ #endif // FEATURE_PAL
687
+
658
688
#ifdef FEATURE_GDBJIT
659
689
// Initialize gdbjit
660
690
NotifyGdb::Initialize ();
Original file line number Diff line number Diff line change @@ -399,6 +399,9 @@ class DebugInterface
399
399
virtual LONG FirstChanceSuspendHijackWorker (PCONTEXT pContext, PEXCEPTION_RECORD pExceptionRecord) = 0;
400
400
#endif
401
401
402
+ // Helper method for cleaning up transport socket
403
+ virtual void CleanupTransportSocket (void ) = 0;
404
+
402
405
#endif // #ifndef DACCESS_COMPILE
403
406
404
407
#ifdef DACCESS_COMPILE
You can’t perform that action at this time.
0 commit comments