From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9428 invoked by alias); 1 Jun 2011 15:15:30 -0000 Received: (qmail 9416 invoked by uid 22791); 1 Jun 2011 15:15:29 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Jun 2011 15:15:07 +0000 Received: (qmail 16739 invoked from network); 1 Jun 2011 15:15:06 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Jun 2011 15:15:06 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver) Date: Wed, 01 Jun 2011 15:15:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.2; x86_64; ; ) Cc: "Philippe Waroquiers" , "Yao Qi" , "Tom Tromey" References: <201105311830.59328.pedro@codesourcery.com> <1A6A06B5CD4346FEB0EAE0998527F07D@soleil> In-Reply-To: <1A6A06B5CD4346FEB0EAE0998527F07D@soleil> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106011615.03444.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00005.txt.bz2 On Tuesday 31 May 2011 19:06:17, Philippe Waroquiers wrote: > > > If that was the only problem, than it'd be okay --- the user just > > shouldn't use the command then. GDB will just do what the > > user told it to. But, it looks like the patch changes the > > behavior _even_ if the user doesn't use the command. > > Effectively, the patch changes the behaviour (but I believe in a more > consistent way). But if that is considered as not good, I can change > the patch so as to keep by default the old behaviour. Thinking more about this, I agree. The current default is making it so that e.g., a single watchpoint on char s16[16]; is a sofware watchpoint against x86 gdbserver, but it's a hardware watchpoint against native x86 gdb. gdbserver knows how to make that a hardware watchpoint, but gdb is not giving it a chance --- the current default assumes you can only set a hardware watchpoint on a single word, but that's not true on x86 gdbserver, given that the target knows to use more than one debug register for a single watchpoint if necessary. > Note that one other thing that I find confusing in the current behaviour > is that if you have a certain set of hw watchpoints that were accepted > and you add a new one, you might obtain an error back referencing > an "old" accepted watchpoint. > > I think it would be better if the watchpoints would always be re-inserted > by gdb in the same order. I suppose that if we made insert_breakpoint_locations walk breakpoints by increasing number instead of walking by breakpoint locations, it'd be good enough. -- Pedro Alves