Bug 12146 - GDB 7.2 breaks compatibility from GDB 6.8 with KGDB
Summary: GDB 7.2 breaks compatibility from GDB 6.8 with KGDB
Status: RESOLVED INVALID
Alias: None
Product: gdb
Classification: Unclassified
Component: remote (show other bugs)
Version: 7.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-21 09:52 UTC by Emmanuel Thierry
Modified: 2013-03-22 19:47 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Thierry 2010-10-21 09:52:01 UTC
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
Comment 1 Pedro Alves 2010-10-21 10:23:04 UTC
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.
Comment 2 Emmanuel Thierry 2010-10-21 12:17:47 UTC
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
Comment 3 Pedro Alves 2010-10-21 13:12:00 UTC
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.
Comment 4 Emmanuel Thierry 2010-10-21 13:55:57 UTC
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.
Comment 5 Pedro Alves 2010-10-21 14:07:13 UTC
> 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!
Comment 6 Emmanuel Thierry 2010-10-21 14:37:19 UTC
Ok, thanks, I'll try it. :)