gdb 在 MacOS Ventura 上失败,提示 Python 库未加载。

huangapple go评论129阅读模式
英文:

gdb on MacOS Ventura fails with python library not loaded

问题

我有一个用于Ada工具链的gdb版本,似乎有一个引用Python动态库的问题,而该库在我的系统上不存在(Intel Mac,Ventura 13.4.1(c))。

  1. $ which gdb
  2. /opt/gcc-13.1.0/bin/gdb
  3. $ gdb
  4. dyld[19305]: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.9/Python
  5. Referenced from: <3FCB836C-8BBC-39C7-894C-6F9582FEAE7F> /opt/gcc-13.1.0/bin/gdb
  6. Reason: tried: '/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file, not in dyld cache)
  7. Abort trap: 6
  8. $ dyld_info /opt/gcc-13.1.0/bin/gdb
  9. /opt/gcc-13.1.0/bin/gdb [x86_64]:
  10. -platform:
  11. platform minOS sdk
  12. macOS 12.0 10.17
  13. -segments:
  14. load-offset segment section sect-size seg-size perm
  15. 0x00000000 __TEXT 7728KB r.x
  16. 0x00001090 __text 5025114
  17. 0x004CBDF0 __text_startup 23672
  18. 0x004D1A68 __text_cold 125143
  19. 0x004F0340 __stubs 9060
  20. 0x004F26A4 __stub_helper 6276
  21. 0x004F3F28 __cstring 899918
  22. 0x005CFA80 __const 155833
  23. 0x005F5B40 __info_plist 466
  24. 0x005F5D18 __eh_frame 1663704
  25. 0x0078C000 __DATA_CONST 1088KB rw.
  26. 0x0078C000 __got 5824
  27. 0x0078D6C0 __mod_init_func 800
  28. 0x0078D9E0 __const 1099176
  29. 0x0089C000 __DATA 304KB rw.
  30. 0x0089C000 __la_symbol_ptr 12080
  31. 0x0089EF30 __gcc_except_tab 118952
  32. 0x008BBFE0 __data 76000
  33. 0x008CE8C0 __bss 91000
  34. 0x008E4C40 __common 9104
  35. -dependents:
  36. attributes load path
  37. /usr/lib/libiconv.2.dylib
  38. /usr/lib/libncurses.5.4.dylib
  39. /Library/Frameworks/Python.framework/Versions/3.9/Python
  40. /usr/lib/libexpat.1.dylib
  41. /opt/gcc-13.1.0/lib/libmpfr.6.dylib
  42. /opt/gcc-13.1.0/lib/libgmp.10.dylib
  43. /opt/gcc-13.1.0/lib/libstdc++.6.dylib
  44. /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  45. /usr/lib/libSystem.B.dylib
  46. $ ls /Library/Frameworks/Python.framework
  47. ls: /Library/Frameworks/Python.framework: No such file or directory
  48. $ which python3
  49. /usr/bin/python3
  50. $ which python3.9
  51. /usr/local/bin/python3.9

我已经通过brew安装了Python。我应该在哪里寻找所需的库(以便设置DYLD_LIBRARY_PATH),或者如何安装正确的库?

英文:

I have a build of gdb for an Ada toolchain, and it appears there is a reference to a Python dynamic library that does not exist on my system (Intel Mac, Ventura 13.4.1 (c)).

  1. $ which gdb
  2. /opt/gcc-13.1.0/bin/gdb
  3. $ gdb
  4. dyld[19305]: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.9/Python
  5. Referenced from: <3FCB836C-8BBC-39C7-894C-6F9582FEAE7F> /opt/gcc-13.1.0/bin/gdb
  6. Reason: tried: '/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file, not in dyld cache)
  7. Abort trap: 6
  8. $ dyld_info /opt/gcc-13.1.0/bin/gdb
  9. /opt/gcc-13.1.0/bin/gdb [x86_64]:
  10. -platform:
  11. platform minOS sdk
  12. macOS 12.0 10.17
  13. -segments:
  14. load-offset segment section sect-size seg-size perm
  15. 0x00000000 __TEXT 7728KB r.x
  16. 0x00001090 __text 5025114
  17. 0x004CBDF0 __text_startup 23672
  18. 0x004D1A68 __text_cold 125143
  19. 0x004F0340 __stubs 9060
  20. 0x004F26A4 __stub_helper 6276
  21. 0x004F3F28 __cstring 899918
  22. 0x005CFA80 __const 155833
  23. 0x005F5B40 __info_plist 466
  24. 0x005F5D18 __eh_frame 1663704
  25. 0x0078C000 __DATA_CONST 1088KB rw.
  26. 0x0078C000 __got 5824
  27. 0x0078D6C0 __mod_init_func 800
  28. 0x0078D9E0 __const 1099176
  29. 0x0089C000 __DATA 304KB rw.
  30. 0x0089C000 __la_symbol_ptr 12080
  31. 0x0089EF30 __gcc_except_tab 118952
  32. 0x008BBFE0 __data 76000
  33. 0x008CE8C0 __bss 91000
  34. 0x008E4C40 __common 9104
  35. -dependents:
  36. attributes load path
  37. /usr/lib/libiconv.2.dylib
  38. /usr/lib/libncurses.5.4.dylib
  39. /Library/Frameworks/Python.framework/Versions/3.9/Python
  40. /usr/lib/libexpat.1.dylib
  41. /opt/gcc-13.1.0/lib/libmpfr.6.dylib
  42. /opt/gcc-13.1.0/lib/libgmp.10.dylib
  43. /opt/gcc-13.1.0/lib/libstdc++.6.dylib
  44. /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  45. /usr/lib/libSystem.B.dylib
  46. $ ls /Library/Frameworks/Python.framework
  47. ls: /Library/Frameworks/Python.framework: No such file or directory
  48. $ which python3
  49. /usr/bin/python3
  50. $ which python3.9
  51. /usr/local/bin/python3.9

I have installed Python via brew. Where should I look for the required library (so I can set DYLD_LIBRARY_PATH), or how can I install the proper one?

答案1

得分: 4

你最好的选择是前往这里,然后安装macOS 64位通用2安装程序(这是我的链接副本,如果出现问题,最好去原始页面下载,在“Files”部分的第4个链接下)。那是我使用的版本;下次我会选择更新一点的Python版本。

英文:

Your best bet is to go here and install the macOS 64-bit universal2 installer (that’s my copy of the link, in case of trouble may be best to go to the original page and download from there, under the Files section, 4th link down). That’s the one I used; next time I’ll go for a more up-to-date Python.

huangapple
  • 本文由 发表于 2023年7月20日 22:05:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76730720.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定