From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29215 invoked by alias); 11 Aug 2009 23:24:53 -0000 Received: (qmail 29183 invoked by uid 22791); 11 Aug 2009 23:24:52 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Aug 2009 23:24:42 +0000 Received: from jupiter.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 7ECB32F009; Tue, 11 Aug 2009 16:24:38 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by jupiter.vmware.com (Postfix) with ESMTP id 71098DC058; Tue, 11 Aug 2009 16:24:38 -0700 (PDT) Message-ID: <4A81FD36.2040009@vmware.com> Date: Tue, 11 Aug 2009 23:24:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Julian Smith CC: "gdb@sources.redhat.com" Subject: Re: Some questions about gdb's remote protocol and reverse debugging References: <20090811224401.4d9e8942.jsmith@undo-software.com> In-Reply-To: <20090811224401.4d9e8942.jsmith@undo-software.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: 2009-08/txt/msg00079.txt.bz2 Julian Smith wrote: > Hello > > I've been trying out gdb-cvs's remote protocol, specifically the > commands for reverse debugging, and i have a couple of questions that i > was hoping someone might be able to help me with. I'm using Linux on > x86-32 and x86-64. Cool, welcome! Join the fun. > First, if i'm understanding things correctly, gdb appears to default to > software breakpoints, using the 'Z0' and 'z0' commands and, if these > aren't supported by the remote target, it then tries to use 'M' and 'm' > to write breakpoints directly into the inferior's memory. That's right... > Is there any way to tell gdb to try to use hardware breakpoints (with > the 'Z1' and 'z1' commands) before resorting to 'M' and 'm' ? [In the > environment i'm working in, UndoDB, hardware breakpoints are more > convenient because they don't require any patching up of %pc, and > poking breakpoints directly into memory is not supported.] Not as such, no. You use a different syntax to set a hardware breakpoint. The command is "hbreak" instead of "break". You should at least be able to try stuff out with that. You may need to enable the Z1 packet, like this (I'm not sure if it's enabled by default): set remote haredware-breakpoint-packet 1 > Second, am i right in thinking that gdb does things like reverse-step > and reverse-next by effectively doing many reverse-stepi's (with 'bs'), > interleaved with 'g' commands to get the registers? If so, are there > any plans to try to avoid the overhead of this somehow ? There are only the two actual reverse-execution packets -- 'bs' and 'bc'. Gdb uses them in exactly the same contexts that it would use 's' and 'c' if going forward. As such, "step" is always going to be implemented as one or more 's' requests, whereas "next" may involve a mixture of 's' and 'c' requests. The same is true going backward. Good luck, Michael