我正在尝试调试在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'.
我不明白的是,这种情况从未像现在这样发生过。突然间,这似乎正在出现。
热衷于您的输入