From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25480 invoked by alias); 31 May 2011 20:25:49 -0000 Received: (qmail 25435 invoked by uid 22791); 31 May 2011 20:25:48 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mailrelay008.isp.belgacom.be (HELO mailrelay008.isp.belgacom.be) (195.238.6.174) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 May 2011 20:25:34 +0000 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkFAJdN5U1tgO4S/2dsb2JhbABTihecCXiIage9Ew6GEASfaw Received: from 18.238-128-109.adsl-dyn.isp.belgacom.be (HELO soleil) ([109.128.238.18]) by relay.skynet.be with SMTP; 31 May 2011 22:25:32 +0200 Message-ID: <79AD3C71A83B4BCFBEE30A225231B3F9@soleil> From: "Philippe Waroquiers" To: "Pedro Alves" , Cc: References: <201105312007.09956.pedro@codesourcery.com> Subject: Re: x86 watchpoints bug (Re: ping: Re: PATCH : allow to set length of hw watchpoints (e.g. for Valgrind gdbserver)) Date: Tue, 31 May 2011 20:25:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=original Content-Transfer-Encoding: 7bit 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-05/txt/msg00705.txt.bz2 > Not sure I understand what is different between GDB and GDBserver > here. A watchpoint, from breakpoint.c's perpective can be composed > of several low-level watchpoints. E.g., if the expression the user > wants to watch requires trapping accesses to two disjoint memory > regions for changes, each of those memory regions will correspond > to one low-level hardware watchpoint. In GDBserver's or i386-nat.c's > perpective, there will be two watchpoints. If the second fails to > insert, then breakpoint.c in GDB rolls back the first. This applies > to GDBserver as well. > ../../../src/gdb/gdbserver/linux-x86-low.c:511: A problem internal to GDBserver has been detected. > Assertion `DR_FIRSTADDR <= regnum && regnum < DR_LASTADDR' failed. Sorry for the somewhat wrong analysis of the bug. I have applied your patch in the assert, and tested again. The GDBserver does not crash anymore (but it still keeps a DR register busy for no reason). So, there is for sure still a difference of behaviour (probably in breakpoint.c placing a "local" watch and a "remote" watch). Note that there is another similar (but I believe correct) assert in the code, but slightly different. I am not sure to understand why regnum validity is tested differently in the below: if (! (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR)) fatal ("Invalid debug register %d", regnum); Thanks for looking at all this Philippe