From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19445 invoked by alias); 28 Aug 2002 13:39:17 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19433 invoked from network); 28 Aug 2002 13:39:14 -0000 Received: from unknown (HELO aragorn) (217.162.225.247) by sources.redhat.com with SMTP; 28 Aug 2002 13:39:14 -0000 Received: from wagi by aragorn with local (Exim 3.35 #1 (Debian)) id 17k34W-0000Eu-00 for ; Wed, 28 Aug 2002 15:41:24 +0200 From: Daniel Wagner Mail-Copies-To: wagi@gmx.ch To: gdb@sources.redhat.com Subject: gdb remote serial protocol Date: Wed, 28 Aug 2002 06:39:00 -0000 Message-ID: <878z2rdrss.fsf@gmx.ch> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2002-08/txt/msg00377.txt.bz2 [I'm not on the list, please CC me] Hi I have some problems with a recent gdb debugging oskit kernels over a serial line. Older gdb like 5.0 run flawlessly.=20 First, there is a new command 'e' which is not documented (Roland McGrath told me that). It would be good to have this command documented. Thanks. Now to the real problem. Here is small gdb session for demonstration: gdb version: woody debian oskit version: 20030317 remote maschine is a K6-2 Current directory is /home/wagi/rboot/ GNU gdb 2002-04-01-cvs Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"... (gdb) set debug target 1 (gdb) set debug remote 1 (gdb) set debug serial 1 (gdb) target remote /dev/ttyS1 Remote debugging using /dev/ttyS1 Sending packet: $Hc-1#09...[ r +]Ack [$][#][0][0]Packet received:=20 Sending packet: $qC#b4...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $qOffsets#4b...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $?#3f...[+]Ack [$][S][0][5][#][b][8]Packet received: S05 target_wait (-1, status) =3D 42000, status->kind =3D stopped, signal =3D = SIGTRAP Sending packet: $Hg0#df...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $g#67...[+]Ack [$][f][7][f][*]["][0][3][0][*]["][2][1][0][*]["][8][0][f][4][0][2][0][0][8]= [0][7][f][1][a][0][0][a][8][7][f][1][a][0][0][b][4][f][4][0][2][0][0][d][4]= [f][b][1][a][0][0][3][f][0][5][1][0][0][0][9][3][0][2][0][*][ ][1][1][0][*]= ["][1][9][0][*]["][1][8][0][*]["][1][8][0][*][2][#][d][9]Packet received: f= 7ffffff030000002100000080f40200807f1a00a87f1a00b4f40200d4fb1a003f0510009302= 0000110000001900000018000000180000000000000000000000 target_fetch_registers (eip) =3D 0x10053f 1049919 target_terminal_ours_for_output () target_terminal_ours () Sending packet: $m1a7fb0,4#8e...[+]Ack [$][0][6][0][*]["][#][e][2]Packet received: 06000000 target_xfer_memory (0x1a7fb0, xxx, 4, read, xxx) =3D 4, bytes =3D 06 00 00 = 00 Sending packet: $m1a7fb4,4#92...[+]Ack [$][0][*]["][0][1][#][d][d]Packet received: 00000001 target_xfer_memory (0x1a7fb4, xxx, 4, read, xxx) =3D 4, bytes =3D 00 00 00 01 main (argc=3D6, argv=3D0x1000000) at ../../../../oskit-20020317+pcmcia/examples/x86/pingreply.c:381 Sending packet: $qSymbol::#5b...[+]Ack [$][#][0][0]Packet received:=20 Packet qSymbol (symbol-lookup) is NOT supported (gdb) n Sending packet: $Z0,15c58c,1#ac...[+]Ack [$][#][0][0]Packet received:=20 Packet Z0 (software-breakpoint) is NOT supported Sending packet: $m15c58c,1#63...[+]Ack [$][8][b][#][9][a]Packet received: 8b target_xfer_memory (0x15c58c, xxx, 1, read, xxx) =3D 1, bytes =3D 8b Sending packet: $X15c58c,0:#87...[+]Ack [$][O][K][#][9][a]Packet received: OK binary downloading suppported by target Sending packet: $X15c58c,1:=CC#54...[+]Ack [$][O][K][#][9][a]Packet received: OK target_xfer_memory (0x15c58c, xxx, 1, write, xxx) =3D 1, bytes =3D cc target_insert_breakpoint (0x15c58c, xxx) =3D 0 Sending packet: $m100000,1#eb...[+]Ack [$][e][b][#][c][7]Packet received: eb target_xfer_memory (0x100000, xxx, 1, read, xxx) =3D 1, bytes =3D eb Sending packet: $X100000,1:=CC#dc...[+]Ack [$][O][K][#][9][a]Packet received: OK target_xfer_memory (0x100000, xxx, 1, write, xxx) =3D 1, bytes =3D cc target_insert_breakpoint (0x100000, xxx) =3D 0 target_terminal_inferior () Sending packet: $Hc0#db...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $s#73...[+]Ack target_resume (-1, step, 0) [$][S][0][5][#][b][8]Packet received: S05 target_wait (-1, status) =3D 42000, status->kind =3D stopped, signal =3D = SIGTRAP Sending packet: $g#67...[+]Ack [$][f][7][f][*]["][0][3][0][*]["][2][1][0][*]["][8][0][f][4][0][2][0][0][7]= [c][7][f][1][a][0][0][a][8][7][f][1][a][0][0][b][4][f][4][0][2][0][0][d][4]= [f][b][1][a][0][0][5][4][0][a][1][0][0][0][9][3][0][3][0][1][0][0][1][1][0]= [*]["][1][9][0][*]["][1][8][0][*]["][1][8][0][*][2][#][4][f]Packet received= : f7ffffff030000002100000080f402007c7f1a00a87f1a00b4f40200d4fb1a00540a10009= 3030100110000001900000018000000180000000000000000000000 target_fetch_registers (eip) =3D 0x100a54 1051220 target_terminal_ours_for_output () Sending packet: $m1a7f7c,4#96...[+]Ack [$][4][4][0][5][1][0][0][0][#][8][e]Packet received: 44051000 target_xfer_memory (0x1a7f7c, xxx, 4, read, xxx) =3D 4, bytes =3D 44 05 10 = 00 Sending packet: $m100544,1#f8...[+]Ack [$][8][3][#][6][b]Packet received: 83 target_xfer_memory (0x100544, xxx, 1, read, xxx) =3D 1, bytes =3D 83 Sending packet: $X100544,1:=CC#e9...[+]Ack [$][O][K][#][9][a]Packet received: OK target_xfer_memory (0x100544, xxx, 1, write, xxx) =3D 1, bytes =3D cc target_insert_breakpoint (0x100544, xxx) =3D 0 target_terminal_inferior () Sending packet: $c#63...[+]Ack target_resume (-1, continue, 0) [$][S][0][5][#][b][8]Packet received: S05 target_wait (-1, status) =3D 42000, status->kind =3D stopped, signal =3D = SIGTRAP Sending packet: $g#67...[+]Ack [$][0][1][0][*]["][4][0][6][4][1][8][0][0][4][0][6][4][1][8][0][0][8][0][f]= [4][0][2][0][0][8][0][7][f][1][a][0][0][a][8][7][f][1][a][0][0][b][4][f][4]= [0][2][0][0][d][4][f][b][1][a][0][0][4][5][0][5][1][0][0][0][0][3][0][2][0]= [*][ ][1][1][0][*]["][1][9][0][*]["][1][8][0][*]["][1][8][0][*][2][#][9][e]= Packet received: 01000000406418004064180080f40200807f1a00a87f1a00b4f40200d4= fb1a004505100003020000110000001900000018000000180000000000000000000000 target_fetch_registers (eip) =3D 0x100545 1049925 target_prepare_to_store () Sending packet: $P8=3D44051000#53...[+]Ack [$][O][K][#][9][a]Packet received: OK target_store_registers (eip) =3D 0x100544 1049924 target_prepare_to_store () Sending packet: $P29=3Dffffffff#28...[+]Ack <--- XXX [$][E][0][4][#][a][9]Packet received: E04 target_terminal_ours () Remote failure reply: E04 Sending packet: $X100544,1:\203#a0...[+]Ack [$][O][K][#][9][a]Packet received: OK target_xfer_memory (0x100544, xxx, 1, write, xxx) =3D 1, bytes =3D 83 target_remove_breakpoint (0x100544, xxx) =3D 0 (gdb) As you can see gdb expects a register which doesn't exist, therefore oskit returns an error. The same kernel with gdb-5.0 doesn't send this packet. Current directory is /home/wagi/rboot/ GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (gdb) set debug target 1 (gdb) set debug remote 1 (gdb) set debug serial 1 (gdb) target remote /dev/ttyS1 Remote debugging using /dev/ttyS1 Sending packet: $Hc-1#09...[ r +]Ack [$][#][0][0]Packet received:=20 Sending packet: $qC#b4...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $qOffsets#4b...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $?#3f...[+]Ack [$][S][0][5][#][b][8]Packet received: S05 target_wait (-1, status) =3D 42000, status->kind =3D stopped, signal =3D = SIGTRAP Sending packet: $Hg0#df...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $g#67...[+]Ack [$][f][7][f][*]["][0][3][0][*]["][2][1][0][*]["][8][0][f][4][0][2][0][0][8]= [0][7][f][1][a][0][0][a][8][7][f][1][a][0][0][b][4][f][4][0][2][0][0][d][4]= [f][b][1][a][0][0][3][f][0][5][1][0][0][0][9][3][0][2][0][*][ ][1][1][0][*]= ["][1][9][0][*]["][1][8][0][*]["][1][8][0][*][2][#][d][9]Packet received: f= 7ffffff030000002100000080f40200807f1a00a87f1a00b4f40200d4fb1a003f0510009302= 0000110000001900000018000000180000000000000000000000 target_fetch_registers (eip) =3D 0x10053f 1049919 target_terminal_ours_for_output () target_terminal_ours () Sending packet: $m1a7fb0,4#8e...[+]Ack [$][0][6][0][*]["][#][e][2]Packet received: 06000000 target_xfer_memory (0x1a7fb0, xxx, 4, read, xxx) =3D 4, bytes =3D 06 00 00 = 00 main (Sending packet: $m1a7fb4,4#92...[+]Ack [$][0][*]["][0][1][#][d][d]Packet received: 00000001 target_xfer_memory (0x1a7fb4, xxx, 4, read, xxx) =3D 4, bytes =3D 00 00 00 = 01 argc=3D6, argv=3D0x1000000) at ../../../../oskit-20020317+pcmcia/examples/x86/pingreply.c:381 (gdb) n target_terminal_inferior () Sending packet: $Hc0#db...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $s#73...[+]Ack target_resume (-1, step, 0) [$][S][0][5][#][b][8]Packet received: S05 target_wait (-1, status) =3D 42000, status->kind =3D stopped, signal =3D = SIGTRAP Sending packet: $g#67...[+]Ack [$][f][7][f][*]["][0][3][0][*]["][2][1][0][*]["][8][0][f][4][0][2][0][0][7]= [c][7][f][1][a][0][0][a][8][7][f][1][a][0][0][b][4][f][4][0][2][0][0][d][4]= [f][b][1][a][0][0][5][4][0][a][1][0][0][0][9][3][0][3][0][1][0][0][1][1][0]= [*]["][1][9][0][*]["][1][8][0][*]["][1][8][0][*][2][#][4][f]Packet received= : f7ffffff030000002100000080f402007c7f1a00a87f1a00b4f40200d4fb1a00540a10009= 3030100110000001900000018000000180000000000000000000000 target_fetch_registers (eip) =3D 0x100a54 1051220 target_terminal_ours_for_output () Sending packet: $m1a7f7c,4#96...[+]Ack [$][4][4][0][5][1][0][0][0][#][8][e]Packet received: 44051000 target_xfer_memory (0x1a7f7c, xxx, 4, read, xxx) =3D 4, bytes =3D 44 05 10 = 00 Sending packet: $Z0,100544,1#41...[+]Ack [$][#][0][0]Packet received:=20 Sending packet: $m100544,1#f8...[+]Ack [$][8][3][#][6][b]Packet received: 83 target_xfer_memory (0x100544, xxx, 1, read, xxx) =3D 1, bytes =3D 83 Sending packet: $X100544,0:#1c...[+]Ack [$][O][K][#][9][a]Packet received: OK binary downloading suppported by target Sending packet: $X100544,1:=CC#e9...[+]Ack [$][O][K][#][9][a]Packet received: OK target_xfer_memory (0x100544, xxx, 1, write, xxx) =3D 1, bytes =3D cc target_insert_breakpoint (0x100544, xxx) =3D 0 target_terminal_inferior () Sending packet: $c#63...[+]Ack target_resume (-1, continue, 0) [$][S][0][5][#][b][8]Packet received: S05 target_wait (-1, status) =3D 42000, status->kind =3D stopped, signal =3D = SIGTRAP Sending packet: $g#67...[+]Ack [$][0][1][0][*]["][4][0][6][4][1][8][0][0][4][0][6][4][1][8][0][0][8][0][f]= [4][0][2][0][0][8][0][7][f][1][a][0][0][a][8][7][f][1][a][0][0][b][4][f][4]= [0][2][0][0][d][4][f][b][1][a][0][0][4][5][0][5][1][0][0][0][0][3][0][2][0]= [*][ ][1][1][0][*]["][1][9][0][*]["][1][8][0][*]["][1][8][0][*][2][#][9][e]= Packet received: 01000000406418004064180080f40200807f1a00a87f1a00b4f40200d4= fb1a004505100003020000110000001900000018000000180000000000000000000000 target_fetch_registers (eip) =3D 0x100545 1049925 target_prepare_to_store () Sending packet: $P8=3D44051000#53...[+]Ack [$][O][K][#][9][a]Packet received: OK target_store_registers (eip) =3D 0x100544 1049924 Sending packet: $X100544,1:\203#a0...[+]Ack [$][O][K][#][9][a]Packet received: OK target_xfer_memory (0x100544, xxx, 1, write, xxx) =3D 1, bytes =3D 83 target_remove_breakpoint (0x100544, xxx) =3D 0 target_terminal_ours () (gdb)=20 BTW, the newest gdb 5.2.1 I've see the same problem. The question is now what's going wrong? I didn't send a bug, because I'm not totaly sure if it's really a bug, or just stupidy of me.