This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb 6.4 - more packets sent for same command, any change in gdb internal logic ?


This query is for debugging a mips64 based target using remote serial protocol. A stub sits on the target responding to request packets.

gdb 6.4 takes more time:

Until gdb 6.3, a command may send a few packets for which it'll get responses and the command completes. The same command(s) from 6.4 onwards, sends more packets than before resulting in more time taken to complete a command. Let's take a simple eg. stepi:
In 6.3, a stepi command sends 15 pkts the log of which is given below:

(rmios-gdb)stepi
Sending packet: $m200790,4#ff...Ack
Packet received: 0000008d
Sending packet: $m200794,4#03...Ack
Packet received: 03e00008
Sending packet: $m200798,4#07...Ack
Packet received: 00000000
Sending packet: $vCont?#49...Ack
Packet received: 
Packet vCont (verbose-resume) is NOT supported
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $s#73...Ack
Packet received: S05
Sending packet: $p25#d7...Ack
Packet received: 0000000000200794
Sending packet: $p1d#05...Ack
Packet received: 0000000000877f48
Sending packet: $m200790,4#ff...Ack
Packet received: 0000008d
Sending packet: $m200794,4#03...Ack
Packet received: 03e00008
Sending packet: $m200798,4#07...Ack
Packet received: 00000000
Sending packet: $m200790,4#ff...Ack
Packet received: 0000008d
Sending packet: $m200794,4#03...Ack
Packet received: 03e00008
Sending packet: $m200798,4#07...Ack
Packet received: 00000000
Sending packet: $p1f#07...Ack
Packet received: 0000000000204b94
0x00200794      299     }

One important observation here is, after "p1d", it repeats the memory requests twice (ie. 200790, 200794, 200798, and again 200790, 200794, 200798). Can you explain why ?

In 6.4, the same image is debugged, and at the same point, I gave a stepi, it sends 58 packets !!, the log of which is given below:

(rmios-gdb)stepi
Sending packet: $p1d#05...Ack
Packet received: 0000000000877f48
Sending packet: $vCont?#49...Ack
Packet received: 
Packet vCont (verbose-resume) is NOT supported
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $s#73...Ack
Packet received: S05
Sending packet: $p25#d7...Ack
Packet received: 0000000000200794
Sending packet: $p1d#05...Ack
Packet received: 0000000000877f48
Sending packet: $m200790,4#ff...Ack
Packet received: 0000008d
Sending packet: $p1f#07...Ack
Packet received: 0000000000204b94
Sending packet: $m2045c0,4#2b...Ack
Packet received: 27bdffb8
Sending packet: $m2045c4,4#2f...Ack
Packet received: ffbf0040
Sending packet: $m2045c8,4#33...Ack
Packet received: ffb00038
Sending packet: $m2045cc,4#5e...Ack
Packet received: 0080102d
Sending packet: $m2045d0,4#2c...Ack
Packet received: 00a0182d
Sending packet: $m2045d4,4#30...Ack
Packet received: a7a20048
Sending packet: $m2045d8,4#34...Ack
Packet received: 0c080370
Sending packet: $m2045dc,4#5f...Ack
Packet received: a7a30050
Sending packet: $m2045e0,4#2d...Ack
Packet received: afa20020
Sending packet: $m2045e4,4#31...Ack
Packet received: 87a20048
Sending packet: $m2045e8,4#35...Ack
Packet received: 14400004
Sending packet: $m2045ec,4#60...Ack
Packet received: 00000000
Sending packet: $m2045f0,4#2e...Ack
Packet received: 3c020087
Sending packet: $m2045f4,4#32...Ack
Packet received: 08081227
Sending packet: $m2045f8,4#36...Ack
Packet received: a4402750
Sending packet: $m2045fc,4#61...Ack
Packet received: 87a20048
Sending packet: $m204600,4#f9...Ack
Packet received: afa2002c
Sending packet: $m204604,4#fd...Ack
Packet received: 24020001
Sending packet: $m204608,4#01...Ack
Packet received: 8fa3002c
Sending packet: $m20460c,4#2c...Ack
Packet received: 14620005
Sending packet: $m204610,4#fa...Ack
Packet received: 00000000
Sending packet: $m204614,4#fe...Ack
Packet received: 3c020087
Sending packet: $m204618,4#02...Ack
Packet received: 8fa3002c
Sending packet: $m20461c,4#2d...Ack
Packet received: 08081227
Sending packet: $m204620,4#fb...Ack
Packet received: a4432750
Sending packet: $m204624,4#ff...Ack
Packet received: 3c020087
Sending packet: $m204628,4#03...Ack
Packet received: 8c422964
Sending packet: $m20462c,4#2e...Ack
Packet received: 14400009
Sending packet: $m204630,4#fc...Ack
Packet received: 00000000
Sending packet: $m204634,4#00...Ack
Packet received: 3c020087
Sending packet: $m204638,4#04...Ack
Packet received: 8c422a04
Sending packet: $m20463c,4#2f...Ack
Packet received: 8c43001c
Sending packet: $m204640,4#fd...Ack
Packet received: 3c020024
Sending packet: $m204644,4#01...Ack
Packet received: 0060f809
Sending packet: $m204648,4#05...Ack
Packet received: 2444c8a8
Sending packet: $m20464c,4#30...Ack
Packet received: 080811b0
Sending packet: $m204650,4#fe...Ack
Packet received: 00000000
Sending packet: $m204654,4#02...Ack
Packet received: 40026000
Sending packet: $m204658,4#06...Ack
Packet received: 34410001
Sending packet: $m20465c,4#31...Ack
Packet received: 38210001
Sending packet: $m204660,4#ff...Ack
Packet received: 40816000
Sending packet: $m204664,4#03...Ack
Packet received: 00000040
Sending packet: $m204668,4#07...Ack
Packet received: 00000040
Sending packet: $m20466c,4#32...Ack
Packet received: 00000040
Sending packet: $m204670,4#00...Ack
Packet received: afa20024
Sending packet: $m204674,4#04...Ack
Packet received: 3c100087
Sending packet: $m204678,4#08...Ack
Packet received: 0c080995
Sending packet: $m20467c,4#33...Ack
Packet received: 8e042964
Sending packet: $m204680,4#01...Ack
Packet received: 3c020024
Sending packet: $m204684,4#05...Ack
Packet received: 0c08c492
0x00200794      299     }

Why it sends so many memory-read packets for the same image and at same location, leading to total no.of packets getting increased by a factor of 4 ??!! Because of these too many packets, more time is taken now to complete this command. Can you explain what change gdb 6.4 has undergone to achieve this and why it does this ? Is there any way to reduce these many packets (ie. any gdb command/option) to bring back it's 6.3 behaviour ?

>From this log, and from the debugged image object dump, what I understand is this :

Suppose f() calls f1(). Let's say f() contains 20 instructions and f1() contains 10 instructions and that the call to f1() is the 7th instruction inside f(). If the code is currently sitting at instruction 5 in f1(), a further stepi should take it to instruction 6 in f1(), assuming instruction 5 is not a jump. During this stepi command, it sends memory-read requests for addresses containg instructions 1-5 in f1(), and addresses containing instructions 1-8 in f(), instruction 8 being the next instruction after the call to f1() inside f(). Can you clarify if this is correct ? This is not the case in 6.3, where it does not ask for instructions in f().

Thanks,
Suresh



-- 

Search for products and services at: 
http://search.mail.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]