Skip to content

Remote debugger should be checked only if interpreter paused on STW #145970

@sergey-miryanov

Description

@sergey-miryanov

Feature or enhancement

Proposal:

Now it is checked every _Py_HandlePending call.

cpython/Python/ceval_gil.c

Lines 1361 to 1368 in 1dfe99a

/* Stop-the-world */
if ((breaker & _PY_EVAL_PLEASE_STOP_BIT) != 0) {
_Py_unset_eval_breaker_bit(tstate, _PY_EVAL_PLEASE_STOP_BIT);
_PyThreadState_Suspend(tstate);
/* The attach blocks until the stop-the-world event is complete. */
_PyThreadState_Attach(tstate);
}

cpython/Python/ceval_gil.c

Lines 1431 to 1433 in 1dfe99a

#if defined(Py_REMOTE_DEBUG) && defined(Py_SUPPORTS_REMOTE_DEBUG)
_PyRunRemoteDebugger(tstate);
#endif

Should we move this under if ((breaker & _PY_EVAL_PLEASE_STOP_BIT) != 0)? If yes, I have a PR ready.

cc @pablogsal

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions