Hello, I use GDB to remotely debug a 2.6.30 linux kernel with KGDB. When I try to connect to KGDB with a 7.2 version of GDB, packaged by ubuntu, I get a : "trace API error : 0x2". When I use a 6.8 version, packaged by debian, I have no problem. This problem happens on connection, just after having typed "target remote $IP" or "target remote $DEVICE". It happens either with KGDB over ethernet (kgdboe driver) and over console (kgdboc embedded driver). Best regards
Please report this to ubuntu. ubuntu's gdb has local patches, hence we can't support it. (AFAIK, full kgdb support is not present on FSF's gdb.) That said, if you reproduce the problem with a pristine FSF gdb build, pasting a "set remote debug 1" log would perhaps help identifying what might have gone wrong.
Ok, seams obvious it's better to test with the original source. ;) I have built gdb 7.2 from the official mirror [ http://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.gz ]. I get the same result : (gdb) target remote /dev/ttyS0 Remote debugging using /dev/ttyS0 kgdb_breakpoint (new_kgdb_io_ops=0xffffffff80765530) at kernel/kgdb.c:1721 1721 wmb(); /* Sync point after breakpoint */ trace API error 0x2. (gdb) set remote debug 1 Undefined set remote command: "debug 1". Try "help set remote". As you can see, I have no "set remote debug" command. Is there something to enable in configure ? Best regards
Sorry, I make that braino often :-). It's "set debug remote 1". And you'll need to issue it before "target remote" so we can trace the connection.
It works much better with set debug remote :D Here is the debug output, some commands look they are no longer supported : (gdb) set debug remote 1 (gdb) target remote /dev/ttyS0 Remote debugging using /dev/ttyS0 Sending packet: $qSupported:qRelocInsn+#9a...Ack Packet received: Packet qSupported (supported-packets) is NOT supported Sending packet: $Hg0#df...Ack Packet received: OK Sending packet: $?#3f...Ack Packet received: S05 Sending packet: $Hc-1#09...Ack Packet received: OK Sending packet: $qC#b4...Ack Packet received: QC00000000000005f8 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: 420000000000000030557680ffffffffd76b000000000000009002010088ffff4600000000000000e0898580ffffffffc0409c7c0088ffff785ecd7a0088ffff02f4c27d0000000000000000000000000e0000000000000080f4c27d0088ffff402b3e7f0088ffffedffffff00000000c0c63d7f0088ffff00477480ffffffffe0dc2680ffffffff920200001000000018000000 kgdb_breakpoint (new_kgdb_io_ops=0xffffffff80765530) at kernel/kgdb.c:1721 1721 wmb(); /* Sync point after breakpoint */ Sending packet: $qSymbol::#5b...Ack Packet received: Packet qSymbol (symbol-lookup) is NOT supported Sending packet: $qTStatus#49...Ack Packet received: E22 trace API error 0x2.
> Packet qSymbol (symbol-lookup) is NOT supported > Sending packet: $qTStatus#49...Ack > Packet received: E22 > trace API error 0x2. Okay, that explains things. This is a kernel bug. I think I saw this being fixed recently... Here it is: http://kerneltrap.org/mailarchive/linux-kernel/2010/7/22/4596723 You'll need to have that patch in your kernel (or get a newer one that has that already fixed). Cheers!
Ok, thanks, I'll try it. :)