Article View: gnu.gdb.bug
Article #10141Slowness of step command (especially when cross debugging)
From: Ron Guilmette
Date: Fri, 15 Jun 1990 23:59
Date: Fri, 15 Jun 1990 23:59
41 lines
2695 bytes
2695 bytes
Reply-To: <rfg@ncd.com> Hey boys and girls! Has anyone ever noticed how the step command is implemented? It seems that if you want to step forward by a single source line that this is implemented by gdb as a series of single instruction steps (perhaps a whose lots of them, depending upon the complexity of the next line of source code). After each and every one of the single instruction steps used to slowly sneak up on the next line of source code, gdb asks for (and gets) a fresh copy of *all* of the inferior registers! For a 68000 processor, we are talking about 186 bytes of register data. If we are talking about a cross debug situation (where debugging occurs over a relatively slow serial connection) each byte of register data gets converted to a pair of ascii-hex-digit characters for trans-shipment over the serial line. So now we are talking about 372 bytes (minimally) for each one of these transactions. (Of course you must add in the overhead of the request packet and the size of both the request & response packet headers & trailers... perhaps 8-15 additional bytes per transaction.) So we are talking in the neighborhood of 400 bytes back & forth per single instruction stepped. If the source line you happen to be stepping over was a complex one, and if it compiled down to say 50 or so instructions... Well I hope you get the idea that this could get (and in fact does get) a bit slow due to all of the unnecessary transactions and the size of each one. It seems to me that it would make more sense if (when doing a step or next over a *source* line) gdb was to figure out where the first instruction of the next following line resides and set a temporary (silent) breakpoint there and then just continue the program until that breakpoint is executed. Has anyone already implemented this in any recent version of gdb? Will you please send me the patches at the address given below if you have? If nobody has implemented this "efficiency enhancement" I guess that means that I'll be doing it myself. // rfg <rfg@ncd.com>
Technical Details
Message-ID:
<9006152359.AA06635@hansen.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!rfg%ncdShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,9d502c39d45c1986,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1990-06-15 22:55:14 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!rfg%ncd From: rfg%ncd@UUNET.UU.NET (Ron Guilmette) Newsgroups: gnu.gdb.bug Subject: Slowness of step command (especially when cross debugging) Message-ID: <9006152359.AA06635@hansen.com> Date: 15 Jun 90 23:59:41 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41 Posted: Sat Jun 16 00:59:41 1990