小编use*_*481的帖子

将GDB通过串口连接到KGDB构建内核的问题


我想通过串口ttyS0从我的64位suse机器调试MIPS linux驱动程序.使用的gdb通过LAN调试应用程序而不是kgdb over serial.我使用此页面和其他一些内容来启动调试,但没有最终结果.

我的内核使用以下设置编译:

CONFIG_MAGIC_SYSRQ=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
# CONFIG_KGDB_TESTS is not set
CONFIG_CMDLINE="kgdboc=ttyS0,115200"
Run Code Online (Sandbox Code Playgroud)

如果我运行gdb:

gdb vmlinux
(gdb) set remotebaud 115200
(gdb) set debug remote 1
(gdb) target remote /dev/ttyS0
Run Code Online (Sandbox Code Playgroud)

我可以观察以下输出:

输出(GDB_TERMINAL):

(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
Sending packet: $qSupported:qRelocInsn+#9a...Ack
Timeout in mid-packet, retrying
Timed out.
Timed out.
Ignoring packet error, continuing...
Packet qSupported (supported-packets) is supported
warning: unrecognized item "qSupported:qRelocIns" in "qSupported" response
Sending packet: $Hg0#df...Nak
Sending packet: $Hg0#df...Ack
Packet received: Hg0
Sending …
Run Code Online (Sandbox Code Playgroud)

c linux kernel linux-kernel kgdb

7
推荐指数
1
解决办法
6140
查看次数

标签 统计

c ×1

kernel ×1

kgdb ×1

linux ×1

linux-kernel ×1