Skip to content
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
34 changes: 34 additions & 0 deletions src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8886,6 +8886,40 @@ void Debugger::ThreadStarted(Thread* pRuntimeThread)
}


void Debugger::SendCreateThreadAtInterpreterEntry(Thread *pRuntimeThread)
{
CONTRACTL
{
NOTHROW;
GC_TRIGGERS;
MODE_ANY;
PRECONDITION(pRuntimeThread != NULL);
PRECONDITION(pRuntimeThread == g_pEEInterface->GetThread());
}
CONTRACTL_END;

if (CORDBUnrecoverableError(this))
return;

if (!CORDebuggerAttached())
return;

{
GCX_PREEMP();
PollWaitingForHelper();
}

SENDIPCEVENT_BEGIN(this, pRuntimeThread);

if (CORDebuggerAttached())
{
ThreadStarted(pRuntimeThread);
}

SENDIPCEVENT_END;
Comment thread
kotlarmilos marked this conversation as resolved.
}


//---------------------------------------------------------------------------------------
//
// DetachThread is called by Runtime threads when they are completing
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/debug/ee/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,7 @@ class Debugger : public DebugInterface

void ThreadCreated(Thread* pRuntimeThread);
void ThreadStarted(Thread* pRuntimeThread);
void SendCreateThreadAtInterpreterEntry(Thread* pRuntimeThread);
void DetachThread(Thread *pRuntimeThread);

BOOL SuspendComplete(bool isEESuspendedForGC = false);
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/vm/dbginterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ class DebugInterface
virtual void ExternalMethodFixupNextStep(PCODE address) = 0;
virtual void ProcessAnyPendingEvals(Thread* pThread) = 0;

virtual void SendCreateThreadAtInterpreterEntry(Thread* pRuntimeThread) = 0;

#endif //DACCESS_COMPILE
};

Expand Down
9 changes: 8 additions & 1 deletion src/coreclr/vm/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6558,14 +6558,21 @@ InterpThreadContext* Thread::GetOrCreateInterpThreadContext()
CONTRACTL
{
THROWS;
GC_NOTRIGGER;
GC_TRIGGERS;
MODE_ANY;
}
CONTRACTL_END;

if (m_pInterpThreadContext == nullptr)
{
m_pInterpThreadContext = new InterpThreadContext();

#ifdef DEBUGGING_SUPPORTED
if (CORDebuggerAttached() && g_pDebugInterface != NULL)
{
g_pDebugInterface->SendCreateThreadAtInterpreterEntry(this);
}
Comment thread
kotlarmilos marked this conversation as resolved.
Comment thread
kotlarmilos marked this conversation as resolved.
#endif // DEBUGGING_SUPPORTED
}

return m_pInterpThreadContext;
Expand Down
Loading