海思3519dv500 交叉编译GDB

一、交叉编译

wget http://ftp.gnu.org/gnu/gdb/gdb-8.1.tar.gz
tar xvzf gdb-8.1.tar.gz
./configure --host=aarch64-v01c01-linux-gnu --prefix=${PWD}/install
make -j 12
make install 

二、编译报错处理

报错如下

In file included from ../../gdb/nat/linux-ptrace.c:20:
../../gdb/nat/linux-ptrace.h:180:22: error:expected identifier before numeric constant
180 | # define TRAP_HWBKPT 4
| ^
../../gdb/nat/linux-ptrace.h:180:22: error:expected ‘}’ before numeric constant

修改代码:

vim gdb/nat/linux-ptrace.c ,注释24 25 行

 19 #include "common-defs.h"
 20 #include "linux-ptrace.h"
 21 #include "linux-procfs.h"
 22 #include "linux-waitpid.h"
 23 #include "buffer.h"
 24 //#include "gdb_wait.h"  
 25 //#include "gdb_ptrace.h"

vim gdb/nat/linux-ptrace.h 增加24行

 18 #ifndef COMMON_LINUX_PTRACE_H
 19 #define COMMON_LINUX_PTRACE_H
 20 
 21 struct buffer;
 22 
 23 #include "nat/gdb_ptrace.h"
 24 #include "gdb_wait.h"
 25 #ifdef __UCLIBC__

参考来源:

GDB 编译报错问题

修改后重新编译GDB即可

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱爬山的木木

佛系111

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值