From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15303 invoked by alias); 20 Oct 2004 16:21:00 -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 15275 invoked from network); 20 Oct 2004 16:20:57 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 20 Oct 2004 16:20:57 -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 i9KGKvCc012614 for ; Wed, 20 Oct 2004 12:20:57 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9KGKlr32298; Wed, 20 Oct 2004 12:20:47 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i9KGKkbU002170; Wed, 20 Oct 2004 12:20:46 -0400 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 9980E800044; Wed, 20 Oct 2004 12:20:46 -0400 (EDT) Message-ID: <4176905E.2040100@redhat.com> Date: Wed, 20 Oct 2004 16:21:00 -0000 From: Jeff Johnston User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 MIME-Version: 1.0 To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA]: Watchpoints per thread patch References: <4175A9C9.8040300@redhat.com> <200410201102.i9KB2pA2021814@elgar.sibelius.xs4all.nl> In-Reply-To: <200410201102.i9KB2pA2021814@elgar.sibelius.xs4all.nl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00342.txt.bz2 Mark Kettenis wrote: > Date: Tue, 19 Oct 2004 19:56:57 -0400 > From: Jeff Johnston > > 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. > > Jeff, this is almost certainly the wrong way to implement this. > > Firstly you're treating this as a generic feature of the ia64 and s390 > platforms, while in fact it's a feature of the Linux kernel. It's > true that we don't really support anything but Linux on ia64 and s390, > but that will certainly change in the near feature when FreeBSD/ia64 > support will be integrated. > > Secondly, you're setting the flag whenever the host is ia64 or s390. > Have you thought about what will happen if you build a cross-debugger > on one of these platforms? > Hmm, aside from the observer suggestion below, would it have been ok if the autoconf test were to test for linux as well? There is another quirk with ia64 which I have also used a flag solution for because it affects the behavior of the former lin-lwp, now renamed. > Thirdly, I'm not really charmed about your choice to do this waith a > global #define that you set in configure. Eli already told you that > it's not very autoconfy, but it also causes us to conditionally > compile parts of the code only on certain platforms. This is not the > direction in which we're heading. Have you thought about implementing > an observer for new threads and using that to set the breakpoints in a > new thread? > The observer would certainly be cleaner for handling the new thread aspect of the problem as the observer could be kept within the respective linux nat files. There is still the problem of removing and inserting watchpoints per thread during a step. I could embed the thread looping in the lower level ia64 and s390 insert/remove linux watchpoint code. Does that seem reasonable or is that considered overloading the to_xxx_watchpoint functions? -- Jeff J.