使用 gdb 调试 xv6 内核 - 所选架构 i386 与报告的目标架构不兼容

Debugging xv6 kernel with gdb - Selected architecture i386 is not compatible with reported target architecture

我 运行正在 Ubuntu 20.04 主机上并尝试在 qemu 模拟器下本地远程调试 xv6 内核 运行。

我运行:

  1. gdb 内核
  2. 远程目标localhost:26000

我得到:

远程调试使用localhost:26000 警告:所选架构 i386 与报告的目标架构不兼容 i386:x86-64 警告:体系结构拒绝了目标提供的描述 Remote 'g' packet reply is too long (expected 312 bytes, got 608 bytes): 0000000000000000000000000000000000000000000000006306000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0ff0000000000000200000000f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f03000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801f0000 (gdb)

知道如何解决这个问题吗?

谢谢!

吉尔

在gdb中使用以下命令:

(gdb) set architecture i386:x86-64

这帮我解决了。