我的内核
3.13.11-ckt20#2 SMP Tue Jun 30 17:10:47 BST 2015 x86_64 x86_64 x86_64 GNU / Linux
使用Magic SysRq编译,但编写echo g>目标上的sysrq-trigger不会将控件返回给主机。
我用
启动vmlinuz root=(...) ro rhgb crashkernel=128M@16M kgdbwait kgdboc=ttyS0,115200
这个工作 - 主机等待gdb附加,我可以附加。我确实继续,如果我设置了一些断点,例如在vfs_read
,那么是 - 它被击中了。但是当我在目标上写入/ proc / sysrq-trigger时,目标会暂停(至少在用户空间中),但控制不会通过串行连接返回到gdb。我在gdb中调试了远程1,它显示了当我执行Continue时流向该点的数据包,之后在gdb控制台中没有显示数据包。
如何将控件返回到调试器? 我可以测试/验证/检查什么? 您还需要哪些其他信息?请告诉我。
GDB会话:
peter@peterubuntu0:~/kernel$ sudo gdb vmlinux_intel
Reading symbols from vmlinux_intel...done.
(gdb) set serial baud 115200
(gdb) set debug remote 1
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
Sending packet: $qSupported:multiprocess+;xmlRegisters=i386;qRelocInsn+#b5...Ack
Packet received:
Packet qSupported (supported-packets) is NOT supported
Sending packet: $Hg0#df...Ack
Packet received: OK
Sending packet: $qTStatus#49...Ack
Packet received:
Packet qTStatus (trace-status) is NOT supported
Sending packet: $?#3f...Ack
Packet received: S05
Sending packet: $Hc-1#09...Ack
Packet received: OK
Sending packet: $qC#b4...Ack
Packet received: QC01
Sending packet: $qAttached#8f...Ack
Packet received:
Packet qAttached (query-attached) is NOT supported
Sending packet: $qOffsets#4b...Ack
Packet received:
Sending packet: $g#67...Ack
Packet received: 2f000000000000000000000000000000a80b0000000000006c1c0000000000006c1c000000000000460200000000000038de8b260388ffff38de8b260388ffff960000000000000022020000000000000100000000000000aaaaaa00000000002084ca81ffffffffe30000000000000000000000000000000000000000000000f4201081ffffffff0202000010000000000000000000000000000000
kgdb_breakpoint () at kernel/debug/debug_core.c:1042
1042 wmb(); /* Sync point after breakpoint */
Sending packet: $qSymbol::#5b...Ack
Packet received:
Packet qSymbol (symbol-lookup) is NOT supported
(gdb) c
Continuing.
Sending packet: $vCont?#49...Ack
Packet received:
Packet vCont (verbose-resume) is NOT supported
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $c#63...Ack
^Casync_remote_interrupt called // this is where I did Ctrl+C
remote_stop called
^Casync_remote_interrupt_twice called // and Ctrl-C again
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) y
Quit
编辑:
虽然当我尝试从Amd调试Intel时它不起作用(两者都运行相同的内核3.13.11-ckt20 SMP 2015 x86_64 x86_64 x86_64 GNU / Linux ): 目标 - 英特尔(R)Core(TM)2 Duo CPU E8500 @ 3.16GHz 主机 - AMD FX(tm)-4100四核处理器
它的作用相反: 目标 - AMD FX(tm)-4100四核处理器 主机 - 英特尔(R)酷睿(TM)2 Duo CPU E8500 @ 3.16GHz
可能它与硬件断点,寄存器,cpu实现有关吗?