简体   繁体   English

gdb无法在Mac OS X 10.10中打开已编译的python

[英]gdb won't open a compiled python in Mac OS X 10.10

I can't open my compiled Python file in my Mac OS X 10.10 in gdb . 我无法在Mac OS X 10.10的gdb打开编译的Python文件。

I tried these two options to open the file but it still not work: 我尝试了以下两个选项来打开文件,但仍然无法正常工作:

p0sxs-iMac:~ p0sx$ gdb --args /usr/bin/python 

Giving the error: 给出错误:

Error message from gdb: not in executable format: File format not recognized 来自gdb的错误消息:不在可执行文件格式:无法识别文件格式

Second option: 第二种选择:

gdb --args python ./ReaFile.py 

Giving the error: 给出错误:

Error message from gdb : not in executable format: File format not recognized 来自gdb的错误消息:不是可执行文件格式:无法识别文件格式

Hope someone can help me. 希望可以有人帮帮我。

It seems like gdb is not capable of running a Universal binary. 似乎gdb无法运行通用二进制文件。 See post: 看到帖子:

file /usr/bin/python /usr/bin/python: Mach-O universal binary with 2 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386 文件/ usr / bin / python / usr / bin / python:具有2种架构的Mach-O通用二进制文件/ usr / bin / python(对于架构x86_64):Mach-O 64位可执行文件x86_64 / usr / bin / python(对于架构i386):Mach-O可执行文件i386

Is there a way to build gdb to work around this? 有没有一种方法可以构建gdb来解决此问题?

No. Currently gdb is not able to debug fat binary. 否。当前,gdb无法调试胖二进制文件。 Use lipo to extract the architecture you want to use. 使用lipo提取要使用的体系结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM