Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
On macOS, remote inspection in a framework build now searches for its
configured framework name.
13 changes: 10 additions & 3 deletions Python/remote_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -1173,8 +1173,15 @@ _Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t* handle)
}
}
#elif defined(__APPLE__) && defined(TARGET_OS_OSX) && TARGET_OS_OSX
// On macOS, try libpython first, then fall back to python
const char* candidates[] = {"libpython", "python", "Python", NULL};
// Search image names by the usual Python prefixes and the configured
// framework name.
const char* candidates[] = {
"libpython", "python", "Python",
#ifdef WITH_NEXT_FRAMEWORK
_PYTHONFRAMEWORK,
#endif
NULL
};
for (const char** candidate = candidates; *candidate; candidate++) {
PyErr_Clear();
address = search_map_for_section(handle, "PyRuntime", *candidate,
Expand All @@ -1188,7 +1195,7 @@ _Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t* handle)
PyObject *exc = PyErr_GetRaisedException();
PyErr_Format(PyExc_RuntimeError,
"Failed to find the PyRuntime section in process %d "
"on macOS platform (tried both libpython and python)",
"on macOS platform",
handle->pid);
_PyErr_ChainExceptions1(exc);
}
Expand Down
Loading