Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-91048: Fix _testexternalinspection.c on FreeBSD#132945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 1 commit intopython:mainfromvstinner:inspection_freebsd
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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
gh-91048: Fix _testexternalinspection.c on FreeBSD
  • Loading branch information
@vstinner
vstinner committedApr 25, 2025
commit139b97a04cabbc4e2a450a990edf0083c14d4e07
6 changes: 4 additions & 2 deletionsModules/_testexternalinspection.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,21 +49,23 @@ struct _Py_AsyncioModuleDebugOffsets {
static uintptr_t
_Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
{
uintptr_t address = 0;
uintptr_t address;

#ifdef MS_WINDOWS
// On Windows, search for asyncio debug in executable or DLL
address = search_windows_map_for_section(handle, "AsyncioD", L"_asyncio");
#elif defined(__linux__)
// On Linux, search for asyncio debug in executable or DLL
address = search_linux_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
#else
#elif defined(__APPLE__) && TARGET_OS_OSX
// On macOS, try libpython first, then fall back to python
address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
if (address == 0) {
PyErr_Clear();
address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
}
#else
address = 0;
#endif

return address;
Expand Down
8 changes: 5 additions & 3 deletionsPython/remote_debug.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -674,7 +674,7 @@ search_windows_map_for_section(proc_handle_t* handle, const char* secname, const
static uintptr_t
_Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t* handle)
{
uintptr_t address = 0;
uintptr_t address;

#ifdef MS_WINDOWS
// On Windows, search for 'python' in executable or DLL
Expand All@@ -690,14 +690,16 @@ _Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t* handle)
// Error out: 'python' substring covers both executable and DLL
PyErr_SetString(PyExc_RuntimeError, "Failed to find the PyRuntime section in the process.");
}
#else
#elif defined(__APPLE__) && TARGET_OS_OSX
// On macOS, try libpython first, then fall back to python
address = search_map_for_section(handle, "PyRuntime", "libpython");
if (address == 0) {
// TODO: Differentiate between not found and error
PyErr_Clear();
address = search_map_for_section(handle, "PyRuntime", "python");
}
#else
address = 0;
#endif

return address;
Expand DownExpand Up@@ -790,4 +792,4 @@ _Py_RemoteDebug_ReadDebugOffsets(

#ifdef __cplusplus
}
#endif
#endif
Loading

[8]ページ先頭

©2009-2025 Movatter.jp