From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11799 invoked by alias); 10 Mar 2011 08:12:09 -0000 Received: (qmail 11788 invoked by uid 22791); 10 Mar 2011 08:12:07 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Mar 2011 08:11:59 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2A8BwAJ028014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Mar 2011 03:11:58 -0500 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2A8BtOK019945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 Mar 2011 03:11:57 -0500 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p2A8BtoS027665; Thu, 10 Mar 2011 09:11:55 +0100 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p2A8BsUb027659; Thu, 10 Mar 2011 09:11:54 +0100 Date: Thu, 10 Mar 2011 08:12:00 -0000 From: Jan Kratochvil To: robert song Cc: gdb@sourceware.org Subject: Re: Why no hwatch command in gdb ? Message-ID: <20110310081154.GA13603@host1.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-03/txt/msg00064.txt.bz2 On Thu, 10 Mar 2011 08:25:18 +0100, robert song wrote: > In gdb command line, we can use break or hbreak to set breakpoint or > hardware breakpoint. > > But I can only find watch command without hardware watch command, so > why watchpoint and breakpoint command are not united? Watchpoints are normally created by default as hardware ones. They should fallback to their software variants when you get out of the number of debug registers but that does not work well now. You can request hardware vs. software watchpoints by using: (gdb) help set can-use-hw-watchpoints Set debugger's willingness to use watchpoint hardware. If zero, gdb will not use hardware for new watchpoints, even if such is available. (However, any hardware watchpoints that were created before setting this to nonzero, will continue to use watchpoint hardware.) The difference is that software breakpoints are very cheap so GDB does not even attempt to create hardware breakpoints. While software watchpoints are very expensive so - in fact GDB does not normally try to fallback to software ones. When you have to use software watchpoints it is commonly even not viable to wait for so long. Thanks, Jan