From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3343 invoked by alias); 18 Sep 2009 00:32:07 -0000 Received: (qmail 3330 invoked by uid 22791); 18 Sep 2009 00:32:06 -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; Fri, 18 Sep 2009 00:32:01 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id DD3F913097; Thu, 17 Sep 2009 17:31:58 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost4.vmware.com (Postfix) with ESMTP id D3DF2C9B52; Thu, 17 Sep 2009 17:31:58 -0700 (PDT) Message-ID: <4AB2D4ED.3070804@vmware.com> Date: Fri, 18 Sep 2009 00:32:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "Garrod, David" CC: "gdb@sourceware.org" Subject: Re: How do I set a hard watchpoint with gdbserver? References: In-Reply-To: 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-09/txt/msg00223.txt.bz2 Garrod, David wrote: > I'm using a configuration of gdb and gdbserver. Both the host (gdb) and the target (gdbserver) are running on Linux on Intel 486 or 586 sytstems. > > I would like to be able to issue the command: > > watch *(int*)addr > > and have it set a "hard" watchpoint on the target. What seems to happening is that a soft watchpoint is being set since when I continue everything seems to hang until I ^C and remove the watchpoint. > > How do I persuade gdbserver to set a hard watchpoint rather than a soft watchpoint? Breakpoints work fine in that they get set hard. > > Thanks, > > Dave Garrod > When you give the "watch" command, does gdb respond by saying that it has set a "hardware watchpoint", or just a "watchpoint"? If it doesn't say "hardware watchpoint", then probably hardware watchpoints are disabled. You enable them like this: (gdb) set can-use-hw-watchpoints 1 If that doesn't solve your problem, then do this -- (gdb) set debug remote 1 right before you say "continue". You should see a number of messages, one of which should look like "Z2," followed by the address that you're trying to watch. If you don't see that, then gdb is still not trying to send a hardware watchpoint to gdbserver. At that point, we would need to ask what version of gdb, what version of gdbserver, etc.