用于Numba调试的MacOS上的GDB

2024-10-03 13:18:48 发布

您现在位置:Python中文网/ 问答频道 /正文

根据Numba文档,调试Numba的唯一方法是使用GDB调试器。我试着在我的MacOS上安装它。你知道吗

为了检查所有设置是否正确以及是否具有调试功能,我创建了一个test2.py文件(这是从Numba Docs中的示例1.17.7.1中提取的):

from numba import njit
@njit(debug=True)
def foo(a):
    b = a + 1
    c = a * 2.34
    d = (a, b, c)
    print(a, b, c, d)

r= foo(123)
print(r)

但是,当我键入:

NUMBA_OPT=1 gdb -q python

我得到以下警告:

warning: `/tmp/lto.o': can't open to read symbols: No such file or directory. (No debugging symbols found in python)

因此,当我执行test2.py脚本时,会得到一个非常大的警告列表:

(gdb) run test2.py
Starting program: /opt/anaconda3/bin/python test2.py
[New Thread 0x1803 of process 2968]
[New Thread 0x1903 of process 2968]
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/bsd.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/darwin_vers.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/dirstat.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/dirstat_collection.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/err.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/exception.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/init.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/mach.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/stdio.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/stdlib.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/string.o': can't open to read symbols: No such file or directory.
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/variant.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/assembly-6f19a9.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/bitcode-3f56e4.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/core-70ee6f.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/dylib-0422b7.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/executionengine-62314e.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/initfini-78a054.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/linker-fc2df4.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/module-3b7ba2.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/object_file-acebfa.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/passmanagers-f81afc.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/targets-a4f486.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/transforms-88aa26.o': can't open to read symbols: Permission denied.
warning: `/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/value-25e76f.o': can't open to read symbols: Permission denied.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/opt/concourse/worker/volumes/live/dc188bc3-6f5d-46f7-5e8d-450aadab5fdc/volume/numba_1565198720292/work/build/temp.macosx-10.9-x86_64-3.7/numba/_dynfuncmod.o': can't open to read symbols: No such file or directory.
warning: `/opt/concourse/worker/volumes/live/dc188bc3-6f5d-46f7-5e8d-450aadab5fdc/volume/numba_1565198720292/work/build/temp.macosx-10.9-x86_64-3.7/numba/_helpermod.o': can't open to read symbols: No such file or directory.
warning: `/opt/concourse/worker/volumes/live/dc188bc3-6f5d-46f7-5e8d-450aadab5fdc/volume/numba_1565198720292/work/build/temp.macosx-10.9-x86_64-3.7/numba/_math_c99.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
warning: `/tmp/lto.o': can't open to read symbols: No such file or directory.
123 124 287.82 (123, 124, 287.82)
None
[Inferior 1 (process 2968) exited normally]

根据这个question的答案,似乎绑定所有.o文件的临时lto文件没有被保留。你知道吗

还有什么想法吗?你知道吗


Tags: ortonobuildreadopencandirectory