Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-91048: Refactor _testexternalinspection and add Windows support#132852
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
+1,337 −1,481
Merged
Changes from1 commit
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
4b40cb2 gh-91048: Refactor _testexternalinspection and add Windows support
pablogsalfb069ed remove write function
pablogsal33598e8 Move everything to a heder file
pablogsalf6e124b windows fix
pablogsalbcd4acb windows fix
pablogsal1f61b55 windows fix
pablogsal0fc495f fix lint
pablogsale4e4e89 Fix test
pablogsal97beb5d fix macos
pablogsal22fdc33 Move header file
pablogsalFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
NextNext commit
gh-91048: Refactor _testexternalinspection and add Windows support
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit4b40cb2a2fd07984b7d18dc32a18a688d1aa9e84
There are no files selected for viewing
49 changes: 49 additions & 0 deletionsInclude/internal/pycore_remote_debug.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #ifndef Py_INTERNAL_REMOTE_DEBUG_H | ||
| #define Py_INTERNAL_REMOTE_DEBUG_H | ||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
| #ifndef Py_BUILD_CORE | ||
| # error "this header requires Py_BUILD_CORE define" | ||
| #endif | ||
| #include <stdio.h> | ||
| #ifndef MS_WINDOWS | ||
| #include <unistd.h> | ||
| #endif | ||
| // Define a platform-independent process handle structure | ||
| typedef struct { | ||
| pid_t pid; | ||
| #ifdef MS_WINDOWS | ||
| HANDLE hProcess; | ||
| #endif | ||
| } proc_handle_t; | ||
| // Initialize a process handle | ||
| PyAPI_FUNC(int) _Py_RemoteDebug_InitProcHandle(proc_handle_t *handle, pid_t pid); | ||
pablogsal marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| // Cleanup a process handle | ||
| PyAPI_FUNC(void) _Py_RemoteDebug_CleanupProcHandle(proc_handle_t *handle); | ||
| // Get the PyRuntime section address from a process | ||
| PyAPI_FUNC(uintptr_t) _Py_RemoteDebug_GetPyRuntimeAddress(proc_handle_t *handle); | ||
| // Get the PyAsyncioDebug section address from a process | ||
| PyAPI_FUNC(uintptr_t) _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t *handle); | ||
| // Read memory from a remote process | ||
| PyAPI_FUNC(int) _Py_RemoteDebug_ReadRemoteMemory(proc_handle_t *handle, uintptr_t remote_address, size_t len, void* dst); | ||
| // Write memory to a remote process | ||
| PyAPI_FUNC(int) _Py_RemoteDebug_WriteRemoteMemory(proc_handle_t *handle, uintptr_t remote_address, size_t len, const void* src); | ||
pablogsal marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| // Read debug offsets from a remote process | ||
| PyAPI_FUNC(int) _Py_RemoteDebug_ReadDebugOffsets(proc_handle_t *handle, uintptr_t *runtime_start_address, _Py_DebugOffsets* debug_offsets); | ||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
| #endif /* !Py_INTERNAL_DEBUG_OFFSETS_H */ | ||
25 changes: 11 additions & 14 deletionsLib/test/test_external_inspection.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionsMakefile.pre.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.