Skip to content
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

Add support for attaching to native arm64 on macOS #201

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions _pydevd_bundle/pydevd_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def get_frame():
IS_MAC = sys.platform == 'darwin'

IS_64BIT_PROCESS = sys.maxsize > (2 ** 32)
IS_MAC_ARM64 = IS_MAC and IS_64BIT_PROCESS and platform.processor() == 'arm'

IS_JYTHON = pydevd_vm_type.get_vm_type() == pydevd_vm_type.PydevdVmType.JYTHON
IS_JYTH_LESS25 = False
Expand Down
Binary file added pydevd_attach_to_process/attach_arm64.dylib
Binary file not shown.
6 changes: 6 additions & 0 deletions pydevd_attach_to_process/linux_and_mac/compile_mac.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
g++ -fPIC -D_REENTRANT -std=c++11 -arch arm64 -c -o attach_arm64.o attach.cpp
g++ -dynamiclib -nostartfiles -arch arm64 -o attach_arm64.dylib attach_arm64.o -lc
rm attach_arm64.o
mv attach_arm64.dylib ../attach_arm64.dylib


g++ -fPIC -D_REENTRANT -std=c++11 -arch x86_64 -c -o attach_x86_64.o attach.cpp
g++ -dynamiclib -nostartfiles -arch x86_64 -o attach_x86_64.dylib attach_x86_64.o -lc
rm attach_x86_64.o
Expand Down
6 changes: 4 additions & 2 deletions pydevd_tracing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _pydevd_bundle.pydevd_constants import get_frame, IS_CPYTHON, IS_64BIT_PROCESS, IS_WINDOWS, \
from _pydevd_bundle.pydevd_constants import get_frame, IS_CPYTHON, IS_64BIT_PROCESS, IS_MAC_ARM64, IS_WINDOWS, \
IS_LINUX, IS_MAC, IS_PY2, DebugInfoHolder, LOAD_NATIVE_LIB_FLAG, \
ENV_FALSE_LOWER_VALUES, GlobalDebuggerHolder, ForkSafeLock
from _pydev_imps._pydev_saved_modules import thread, threading
Expand Down Expand Up @@ -147,7 +147,9 @@ def _load_python_helper_lib_uncached():
filename = os.path.join(os.path.dirname(__file__), 'pydevd_attach_to_process', 'attach_linux_%s.so' % (suffix,))

elif IS_MAC:
if IS_64BIT_PROCESS:
if IS_MAC_ARM64:
suffix = 'arm64.dylib'
elif IS_64BIT_PROCESS:
suffix = 'x86_64.dylib'
else:
suffix = 'x86.dylib'
Expand Down