My kernel

3.13.11-ckt20 #2 SMP Tue Jun 30 17:10:47 BST 2015 x86_64 x86_64 x86_64 GNU/Linux

is compiled with Magic SysRq but writing echo g > sysrq-trigger on target won't return the control to host.

I boot with

vmlinuz root=(...) ro rhgb crashkernel=128M@16M kgdbwait kgdboc=ttyS0,115200

This works - host waits on gdb to attach and I can attach. I do continue then, and if I set some breakpoints, for example at vfs_read then yes - it is hit. But when I write g to /proc/sysrq-trigger on the target, the target halts (at least in userspace) but control is not returned to gdb over serial connection. I did debug remote 1 in gdb and it shows packets flowing up to the point when I do Continue, after this there is no packets in gdb console shown.

How to return the control to debugger? What can I test/verify/check? What additional info do you need? Please let me know.

GDB session:

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

EDIT:

Though it doesn't work when I try to debug Intel from Amd (both running the same kernel 3.13.11-ckt20 SMP 2015 x86_64 x86_64 x86_64 GNU/Linux ): target - Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz host - AMD FX(tm)-4100 Quad-Core Processor

it works in the opposite direction: target - AMD FX(tm)-4100 Quad-Core Processor host - Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz

Maybe it is related to hardware breakpoints, registers, cpu implementation?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.