There was an error while loading. Please reload this page.
1 parent 670b6cc commit 17718b0Copy full SHA for 17718b0
2 files changed
Modules/_testexternalinspection.c
@@ -49,21 +49,23 @@ struct _Py_AsyncioModuleDebugOffsets {
49
static uintptr_t
50
_Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
51
{
52
- uintptr_t address = 0;
+ uintptr_t address;
53
54
#ifdef MS_WINDOWS
55
// On Windows, search for asyncio debug in executable or DLL
56
address = search_windows_map_for_section(handle, "AsyncioD", L"_asyncio");
57
#elif defined(__linux__)
58
// On Linux, search for asyncio debug in executable or DLL
59
address = search_linux_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
60
-#else
+#elif defined(__APPLE__) && TARGET_OS_OSX
61
// On macOS, try libpython first, then fall back to python
62
address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
63
if (address == 0) {
64
PyErr_Clear();
65
66
}
67
+#else
68
+ address = 0;
69
#endif
70
71
return address;
Python/remote_debug.h
@@ -674,7 +674,7 @@ search_windows_map_for_section(proc_handle_t* handle, const char* secname, const
674
675
_Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t* handle)
676
677
678
679
680
// On Windows, search for 'python' in executable or DLL
@@ -690,14 +690,16 @@ _Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t* handle)
690
// Error out: 'python' substring covers both executable and DLL
691
PyErr_SetString(PyExc_RuntimeError, "Failed to find the PyRuntime section in the process.");
692
693
694
695
address = search_map_for_section(handle, "PyRuntime", "libpython");
696
697
// TODO: Differentiate between not found and error
698
699
address = search_map_for_section(handle, "PyRuntime", "python");
700
701
702
703
704
705
@@ -790,4 +792,4 @@ _Py_RemoteDebug_ReadDebugOffsets(
790
792
791
793
#ifdef __cplusplus
794
-#endif
795
+#endif
0 commit comments