Skip to content

Commit 25955a0

Browse files
authored
Get debug attach to work for 3.12 (#1683)
* Get debug attach to work for 3.12 * Skip flakey test and update binaries * Fix the skip if to work correctly
1 parent ae6812b commit 25955a0

21 files changed

+30
-13
lines changed

src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def run_python_code_windows(pid, python_code, connect_debugger_tracing=False, sh
308308
args = [target_executable, str(pid), target_dll_run_on_dllmain]
309309
subprocess.check_call(args)
310310

311-
if not event.wait_for_event_set(15):
311+
if not event.wait_for_event_set(30):
312312
print("Timeout error: the attach may not have completed.")
313313
sys.stdout.flush()
314314
print("--- Finished dll injection ---\n")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ typedef PyThreadState* (PyInterpreterState_ThreadHead)(PyInterpreterState* inter
1111
typedef PyThreadState* (PyThreadState_Next)(PyThreadState *tstate);
1212
typedef PyThreadState* (PyThreadState_Swap)(PyThreadState *tstate);
1313
typedef PyThreadState* (_PyThreadState_UncheckedGet)();
14+
typedef PyThreadState* (_PyThreadState_GetCurrent)();
1415
typedef PyObject* (PyObject_CallFunctionObjArgs)(PyObject *callable, ...); // call w/ varargs, last arg should be nullptr
1516
typedef PyObject* (PyInt_FromLong)(long);
1617
typedef PyObject* (PyErr_Occurred)();

src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_version.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ enum PythonVersion {
2121
PythonVersion_38 = 0x0308,
2222
PythonVersion_39 = 0x0309,
2323
PythonVersion_310 = 0x030A,
24-
PythonVersion_311 = 0x030B
24+
PythonVersion_311 = 0x030B,
25+
PythonVersion_312 = 0x030C,
26+
PythonVersion_313 = 0x030D,
2527
};
2628

2729

@@ -70,6 +72,12 @@ static PythonVersion GetPythonVersion(void *module) {
7072
if(version[3] == '1'){
7173
return PythonVersion_311;
7274
}
75+
if(version[3] == '2'){
76+
return PythonVersion_312;
77+
}
78+
if(version[3] == '3'){
79+
return PythonVersion_313;
80+
}
7381
}
7482
return PythonVersion_Unknown; // we don't care about 3.1 anymore...
7583

0 commit comments

Comments
 (0)