From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2287 invoked by alias); 6 Sep 2008 01:09:40 -0000 Received: (qmail 2278 invoked by uid 22791); 6 Sep 2008 01:09:40 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.113.40.141) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 06 Sep 2008 01:08:56 +0000 Received: from mailhost5.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id DBEFA6A49; Fri, 5 Sep 2008 18:08:54 -0700 (PDT) Received: from [10.20.92.218] (promb-2s-dhcp218.eng.vmware.com [10.20.92.218]) by mailhost5.vmware.com (Postfix) with ESMTP id D32D2DC056; Fri, 5 Sep 2008 18:08:54 -0700 (PDT) Message-ID: <48C1D803.9020602@vmware.com> Date: Sat, 06 Sep 2008 01:09:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Jason Molenda CC: "gdb@sourceware.org" Subject: Re: [remote protocol] step range? References: <48C05DAF.3070705@vmware.com> <61DDBF42-6D9B-4E8C-9B0C-CB9BB68F5F11@apple.com> <48C09B98.3010506@vmware.com> <693D921E-42E7-474A-9DCB-82FAA2DE3679@apple.com> In-Reply-To: <693D921E-42E7-474A-9DCB-82FAA2DE3679@apple.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00039.txt.bz2 Jason Molenda wrote: > On Sep 4, 2008, at 7:38 PM, Michael Snyder wrote: > >> I don't think that's necessarily true -- the remote agent >> could just do what gdb does, single-step repeatedly and >> check the stop pc against the range. > > Yeah, that'll work as long as you have some form of single-instruction- > step support in your target environment. If not, then you'll need a > disassembler to (a) determine the length of the current instruction so > you can overwrite the next instruction with a trap opcode, and (b) > determine if the current instruction branches/calls/jumps anywhere. > It quickly becomes Complicated. I'm assuming you have some form of > single-instruction-step in the target you're interested in, otherwise > I council against pursuing this. :) > > For what it's worth we use the remote protocol for debugging > applications on the iPhone / iPod Touch devices. When we first got it > up and running, we saw command-line level "step" commands taking > multiple (4-5!) seconds to complete. We optimized it to no end and > got this down to something like .2 seconds without doing anything too > weird to the protocol. We didn't have any single-instruction-step > feature so we didn't even consider trying to push range-stepping down > to the device. > > But I don't see any problems with adding this stepping capability for > environments that could make use of it. The first architecture I'll be interested in will be i386-linux. So single-stepping on the target will be no problem. If the target can't meet the request, it will just send back an empty reply, same as always, and gdb will fall back to some more generic method.