【发布时间】:2023-03-16 08:05:01
【问题描述】:
我想在Android机器等设备上调试ARM应用程序,我更喜欢使用gdb(ARM版本)而不是gdb和gdbserver来调试,因为有一个dashboard,一个Python中GDB的可视化界面。
必须与设备上的gdb(ARM版)配合,所以我需要用python交叉编译一个ARM版的gdb,使用的命令如下:
./configure --host=arm-linux-gnueabi --target=arm-linux-gnueabi --with-python=/usr/bin
但最后出现了错误信息:
configure:8096: checking whether to use python
configure:8098: result: /usr/bin/
configure:8316: checking for python2.7
configure:8334: arm-linux-gnueabi-gcc -o conftest -g -O2 -I/usr/include/python2.7 -I/usr/include/python2.7 conftest.c -ldl -ltermcap -lm -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions >&5
In file included from /usr/include/python2.7/Python.h:8:0,
from conftest.c:50:
/usr/include/python2.7/pyconfig.h:15:52: fatal error: arm-linux-gnueabi/python2.7/pyconfig.h: No such file or directory
compilation terminated.
然后在/usr/include/python2.7/pyconfig.h中找到第15行,如下:
# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
#include <arm-linux-gnueabi/python2.7/pyconfig.h>
重点是,我在/usr/include中只有x86_64-linux-gnu/python2.7/pyconfig.h,我怎么才能得到arm-linux-gnueabi/python2.7/pyconfig.h?我已经 apt-get install python2.7-dev.
【问题讨论】:
标签: python linux android-ndk cross-compiling