3

我在为 MIPS n32 交叉编译 GDBServer 时遇到问题。我正在使用 GCC-4.7.2、binutils-2.22、glibc-2.11.1、glibc-ports-2.11 和 linux-2.6.32.61。我的主机是 x86_64-cross-linux-gnu。我的目标是 mips64-elf-linux。MIPS 的特定 ABI 是n32

当我去制作 GDBserver 时,在编译 regcache.c 时出现错误。regcache.c 在 gdb/gdbserver/ 中。gcc 正在尝试编译一个名为“reg”的结构。我已经包含了所有的 mips 包含文件。不过,我可以为 x86 编译 GDBServer。我对 /usr/include/ 中的所有包含文件进行了 grep 以尝试查找“struct reg”,但没有成功找到任何内容。我找到了这篇文章并更改了名称,希望它能解决问题,但这不起作用,因为 regcache.c 中的 reg 结构具有偏移和值等属性。我也尝试过在 ptrace.h 中弄乱 pt_regs。但是我不认为我应该弄乱 GDBServer 附带的文件。

我的配置命令是:

CC=mips64-elf-linux-gcc configure --host=x86_64-cross-linux-gnu --target=mips64-elf-linux 

有谁知道为什么我不能为 Mips n32 编译 GDBServer?

谢谢,

更新:

../gdb-7.6/gdb/gdbserver/regcache.c:207:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:207:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c:208:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:208:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c: In function 'find+_register_by_name'
../gdb-7.6/gdb/gdbserver/regcache.c:295:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:295:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c: In function 'find_regno'
../gdb-7.6/gdb/gdbserver/regcache.c:315:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:315:7: error: dereferencing pointer to incomplete type
4

0 回答 0