From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3603 invoked by alias); 18 Nov 2009 17:01:09 -0000 Received: (qmail 3431 invoked by uid 22791); 18 Nov 2009 17:01:04 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Wed, 18 Nov 2009 17:00:15 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAIGxvKq026880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Nov 2009 11:59:58 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAIGxt7T008232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Nov 2009 11:59:57 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id nAIGxtjj023939; Wed, 18 Nov 2009 17:59:55 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id nAIGxrRO023936; Wed, 18 Nov 2009 17:59:53 +0100 Date: Wed, 18 Nov 2009 17:01:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: hardware watchpoints in non-stop - "moribund"/delayed watchpoint traps Message-ID: <20091118165952.GA23719@host0.dyn.jankratochvil.net> References: <200911181445.38897.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911181445.38897.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2009-11/txt/msg00407.txt.bz2 On Wed, 18 Nov 2009 15:45:38 +0100, Pedro Alves wrote: > This shouldn't be limited to non-stop mode. I'm thinking (but haven't > tried to reproduce it), that something like this will happen in > linux/all-stop mode when Jan's reordered-watchpoints patch goes in: > > > | Time/ | GDB | Target | > | Step | | | > |-------+-----------------------------------+--------------------------------| > | 1 | sets watchpoint | | > |-------+-----------------------------------+--------------------------------| > | | | two threads hit watchpoint. | > | 2 | | One event is reported, the | > | | | other left pending. | > |-------+-----------------------------------+--------------------------------| > | 3 | user deletes watchpoint, | | > | | continues | | > |-------+-----------------------------------+--------------------------------| > | 4 | | skips resuming --- has pending | > | | | status to report, and reports | > | | | that now | > |-------+-----------------------------------+--------------------------------| > | 5 | receives watchpoint hit | | > | | event, but there's no | | > | | watchpoint listed for this | | > | | stopped data address | | > |-------+-----------------------------------+--------------------------------| > | 6 | report random SIGTRAP to the user | | > > > We could probably tweak Jan' new test at > to trigger this. I agree, nice catch. Such patch to test it is at the bottom. > if (ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP) > ecs->random_signal > = !(bpstat_explains_signal (ecs->event_thread->stop_bpstat) > + || stopped_by_watchpoint > || ecs->event_thread->trap_expected > || (ecs->event_thread->step_range_end > && ecs->event_thread->step_resume_breakpoint == NULL)); This means forgotten triggers (as currently without the hw-watchpoints patch 1/4) would be hidden. As the is already the infrastructure for moribund locations isn't it better to enable them even for all-stop mode and check the address explicitly against them? Sorry for no such patch in this mail. Regards, Jan --- a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp +++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp @@ -88,6 +88,8 @@ foreach reorder {0 1} { gdb_test "rwatch unused1_rwatch" "Hardware read watchpoint \[0-9\]+: unused1_rwatch" gdb_test "rwatch unused2_rwatch" "Hardware read watchpoint \[0-9\]+: unused2_rwatch" } + gdb_test "delete 2" + gdb_test "delete 3" gdb_test "continue" \ "Hardware read watchpoint \[0-9\]+: thread\[12\]_rwatch\r\n\r\nValue = 0\r\n0x\[0-9a-f\]+ in thread\[12\]_func .*" \