0

我正在尝试调试在 virtualbox 上运行的实时 Linux 内核。我在内核中添加了适当的设置(使用该.config文件,通过启用 KGDB 并在内核中添加调试信息)。

我的串行端口是一个命名管道(套接字),然后我使用它重定向socat以获取相应的 PTY。

$ socat -d -d ./slackpipe PTY
2015/03/16 00:04:02 socat[2723] N opening connection to AF=1 "./slackpipe"
2015/03/16 00:04:02 socat[2723] N successfully connected from local address AF=1 "\x82q\xEE\x7E"
2015/03/16 00:04:02 socat[2723] N successfully connected via <anon>
2015/03/16 00:04:02 socat[2723] N PTY is /dev/pts/15
2015/03/16 00:04:02 socat[2723] N starting data transfer loop with FDs [3,3] and [4,4]

然后我用相应的 vmlinux 文件启动 gdb 并针对从上面的 socat 获得的 PTY

$ gdb vmlinux 
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from vmlinux...done.
(gdb) c
The program is not being run.
(gdb) target remote /dev/pts/15
Remote debugging using /dev/pts/15
qTStatus: Target returns error code '22'.
kgdb_breakpoint () at kernel/kgdb.c:1748
1748    kernel/kgdb.c: No such file or directory.
qTStatus: Target returns error code '22'.

我不明白的是,这种情况以前从未发生过。突然之间,这似乎出现了。

渴望您的意见

4

0 回答 0