From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10885 invoked by alias); 20 Oct 2004 17:27:50 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10564 invoked from network); 20 Oct 2004 17:27:47 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 20 Oct 2004 17:27:47 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9KHRk4S032145 for ; Wed, 20 Oct 2004 13:27:47 -0400 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9KHRkr27436; Wed, 20 Oct 2004 13:27:46 -0400 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id A2BBD7ACEF; Wed, 20 Oct 2004 13:27:20 -0400 (EDT) Message-ID: <41769FF3.7010801@gnu.org> Date: Wed, 20 Oct 2004 17:27:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 0.8 (X11/20041012) MIME-Version: 1.0 To: Jeff Johnston Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA]: Watchpoints per thread patch References: <4175A9C9.8040300@redhat.com> In-Reply-To: <4175A9C9.8040300@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00343.txt.bz2 Jeff Johnston wrote: > The following patch adds needed support for the ia64 and s390 > platforms. For these platforms, watchpoints need to be inserted / > removed on each thread so as to work across all threads. The patch adds > support for detecting this at configuration time and setting a new flag > WATCHPOINTS_PER_THREAD. This flag is used when inserting/removing > watchpoints and when a new thread event occurs. > > This patch in itself does not give these platforms threaded watchpoint > support to pass the watchthreads.exp test case, but I am breaking up my > bigger patch that works for x86, x86_64, and ia64. It still fails on > the S390 but gets part marks because threaded watchpoints actually > trigger properly however the S390 cannot determine which watchpoint gets > triggered when multiple watchpoint events occur. On ia64, the > watchthreads.exp test case will fail differently than before because the > low-level register and watchpoint code does not properly calculate the > LWP for accessing registers so we end up eating through the maximum > number of watchpoints quicker than anticipated. I have a subsequent > patch for getting the LWP reliably, but this subsequent patch may be > made unnecessary depending on what Daniel does with ptids and the > thread-db layer. Regardless of Daniel's redesign, the watchpoints still > must be inserted/removed on each thread. The controversy here appears to be with the target dependant code being added to breakpoint.c. For the target's that have the problem, modify target_insert_watchpoint to include the code your adding. That way, instead of: > + /* If watchpoints do not apply to all threads automatically, we have to insert > + and delete them for every thread. Otherwise, we can insert or delete them > + once from any thread. */ > +#ifdef WATCHPOINTS_PER_THREAD > + val = thread_switch_and_call (bpt->owner->thread, &insert_one_watchpoint, &args); > +#else > + val = insert_one_watchpoint (&args); > +#endif the underlying target (ia64-linux-nat, ...) can locally override the method and handle the problem. The code's the same, but how it is wired up is different Sound reasonable to all? Andrew