-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-131591: Handle includes for iOS in remote_debugging.c #132050
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -20,24 +20,17 @@ | |||||||||||||||||||||||||||||||
# include <sys/mman.h> | ||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#if defined(__APPLE__) | ||||||||||||||||||||||||||||||||
# include <TargetConditionals.h> | ||||||||||||||||||||||||||||||||
// Older macOS SDKs do not define TARGET_OS_OSX | ||||||||||||||||||||||||||||||||
# if !defined(TARGET_OS_OSX) | ||||||||||||||||||||||||||||||||
# define TARGET_OS_OSX 1 | ||||||||||||||||||||||||||||||||
# endif | ||||||||||||||||||||||||||||||||
# if TARGET_OS_OSX | ||||||||||||||||||||||||||||||||
# include <libproc.h> | ||||||||||||||||||||||||||||||||
# include <mach-o/fat.h> | ||||||||||||||||||||||||||||||||
# include <mach-o/loader.h> | ||||||||||||||||||||||||||||||||
# include <mach-o/nlist.h> | ||||||||||||||||||||||||||||||||
# include <mach/mach.h> | ||||||||||||||||||||||||||||||||
# include <mach/mach_vm.h> | ||||||||||||||||||||||||||||||||
# include <mach/machine.h> | ||||||||||||||||||||||||||||||||
# include <sys/mman.h> | ||||||||||||||||||||||||||||||||
# include <sys/proc.h> | ||||||||||||||||||||||||||||||||
# include <sys/sysctl.h> | ||||||||||||||||||||||||||||||||
# endif | ||||||||||||||||||||||||||||||||
#if defined(__APPLE__) && TARGET_OS_OSX | ||||||||||||||||||||||||||||||||
# include <libproc.h> | ||||||||||||||||||||||||||||||||
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will break on older macOS versions (essentially any macOS version that predates the existence of iPhone) because
Suggested change
I can see there's a couple of other places (L99 of this file; L352 of pycore_eval.h) where an analogous change would be required. I guess the other option would be to modify the code that sets
to
This works because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you may be missing the context that this file is importing this header where we are doing the dance: cpython/Include/internal/pycore_ceval.h Lines 350 to 360 in 0dbaeb9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - I did miss that import would be in effect. Given that imported definition, the form you've got in the PR at present should work - but it still makes me a bit twitchy because it's redefining an Apple-provided constant that has otherwise well defined behavior. This is essentially what bit me here - the logic didn't make sense because I didn't notice the import where the behavior of the Apple-provided constant was being redefined). We've also had examples in the past where someone adds/removes an import of an otherwise unrelated file, and suddenly things break because that file has redefined basic platform constants (or has removed an import that was making those constants work in a predictable way). If we're going to go down the path of redefining the constant, it might be worth looking at a top-level replacement for So - call my preference for using the definitions-as-provided a "strong opinion, weakly held". With the indentation nitpick flagged in |
||||||||||||||||||||||||||||||||
# include <mach-o/fat.h> | ||||||||||||||||||||||||||||||||
# include <mach-o/loader.h> | ||||||||||||||||||||||||||||||||
# include <mach-o/nlist.h> | ||||||||||||||||||||||||||||||||
# include <mach/mach.h> | ||||||||||||||||||||||||||||||||
# include <mach/mach_vm.h> | ||||||||||||||||||||||||||||||||
# include <mach/machine.h> | ||||||||||||||||||||||||||||||||
# include <sys/mman.h> | ||||||||||||||||||||||||||||||||
# include <sys/proc.h> | ||||||||||||||||||||||||||||||||
# include <sys/sysctl.h> | ||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#ifdef MS_WINDOWS | ||||||||||||||||||||||||||||||||
|
@@ -65,6 +58,8 @@ | |||||||||||||||||||||||||||||||
# define HAVE_PROCESS_VM_READV 0 | ||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#if defined(Py_REMOTE_DEBUG) && defined(Py_SUPPORTS_REMOTE_DEBUG) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
// Define a platform-independent process handle structure | ||||||||||||||||||||||||||||||||
typedef struct { | ||||||||||||||||||||||||||||||||
pid_t pid; | ||||||||||||||||||||||||||||||||
|
@@ -101,8 +96,6 @@ cleanup_proc_handle(proc_handle_t *handle) { | |||||||||||||||||||||||||||||||
handle->pid = 0; | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#if defined(Py_REMOTE_DEBUG) && defined(Py_SUPPORTS_REMOTE_DEBUG) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#if defined(__APPLE__) && TARGET_OS_OSX | ||||||||||||||||||||||||||||||||
static uintptr_t | ||||||||||||||||||||||||||||||||
return_section_address( | ||||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.