From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5473 invoked by alias); 24 Jan 2006 04:33:12 -0000 Received: (qmail 5459 invoked by uid 22791); 24 Jan 2006 04:33:11 -0000 X-Spam-Check-By: sourceware.org Received: from ausmtp04.au.ibm.com (HELO ausmtp04.au.ibm.com) (202.81.18.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jan 2006 04:33:09 +0000 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp04.au.ibm.com (8.12.10/8.12.10) with ESMTP id k0O4ciB3075980 for ; Tue, 24 Jan 2006 15:38:44 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0112e0.au.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id k0O4aE3H106666 for ; Tue, 24 Jan 2006 15:36:14 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11/8.13.3) with ESMTP id k0O4X3M7015526 for ; Tue, 24 Jan 2006 15:33:04 +1100 Received: from wks190294wss.cn.ibm.com (wks190294wss.cn.ibm.com [9.181.133.242]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id k0O4WvF2015413; Tue, 24 Jan 2006 15:32:59 +1100 Date: Tue, 24 Jan 2006 04:33:00 -0000 From: Wu Zhou To: Daniel Jacobowitz cc: Eli Zaretskii , gdb-patches@sources.redhat.com, mark@xs4all.nl, bje@au1.ibm.com, anton@au1.ibm.com, pgilliam@us.ibm.com Subject: Re: [RFC] GDB patches for hw watchpoints - revised In-Reply-To: <20060124034304.GA4719@nevyn.them.org> Message-ID: References: <20060122205641.GF27224@nevyn.them.org> <20060124034304.GA4719@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00350.txt.bz2 On Mon, 23 Jan 2006, Daniel Jacobowitz wrote: > On Tue, Jan 24, 2006 at 11:40:16AM +0800, Wu Zhou wrote: > > p630 is one kind of POWER4 based pSeriese server. It is currently the only > > available ppc machine I can get. :-) > > > > In fact, I am not sure before if the ppc arch has nonsteppable watchpoints > > or not. But testing on my p630 box, it did had nonsteppable ones. Now > > that an architecture either have or doesn't have nonsteppable watchpoints, > > can we get from this test a result that ppc architecture has nonsteppable > > watchpoints? > > > > If so, maybe I can just remove the stupid conditional statement below. > > (my original intention is to verify that v->mach equals bfd_mach_ppc_630 :-) > > Well, it'd be nice to have some architectural reference for this. But > it's probably a safe bet to assume that this is generally true for all > PowerPC targets, so let's just assume it. OK. I will assume this then. > > Function to_region_ok_for_hw_watchpoint is not in the current target > > vector (I means struct target_ops). Maybe we can add it into > > target_ops? There are a few other archs also use this. But they had to > > include it in nm-xxx-yyy.h. If not, the only method I can think of is > > also include its definition in nm-ppc64-linux.h. So what about the > > following patch section? > > > > int (*to_region_size_ok_for_hw_watchpoint) (int); > > + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR *, int); > > void (*to_terminal_init) (void); > > I would recommend replacing to_region_size_ok_for_hw_watchpoint > with to_region_ok_for_hw_watchpoint. You'll have to update the > callers, including the non-multi-arch ones, to ignore the first > argument; shouldn't be hard? Do you means to make the following change in gdb/target.h? --- gdb/target.h 4 Sep 2005 16:18:20 -0000 1.76 +++ gdb/target.h 24 Jan 2006 04:17:13 -0000 @@ -345,7 +345,7 @@ int (*to_stopped_by_watchpoint) (void); int to_have_continuable_watchpoint; int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *); - int (*to_region_size_ok_for_hw_watchpoint) (int); + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR *, int); void (*to_terminal_init) (void); void (*to_terminal_inferior) (void); void (*to_terminal_ours_for_output) (void); @@ -1030,9 +1030,9 @@ (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE); #endif -#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT) -#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \ - (*current_target.to_region_size_ok_for_hw_watchpoint) (byte_count) +#if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT) +#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr, byte_count) \ + (*current_target.to_region_ok_for_hw_watchpoint) (addr, byte_count) #endif Then make responsive changes to the code where is referenced? such as (in config/i386/nm-i386sol2.h): -#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1 +#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(ADDR, SIZE) 1 or (in s390-nat.c): static int -s390_region_size_ok_for_hw_watchpoint (int cnt) +s390_region_ok_for_hw_watchpoint (CORE_ADDR *, int cnt) { return 1; } @@ -380,7 +380,7 @@ /* Add our watchpoint methods. */ t->to_can_use_hw_breakpoint = s390_can_use_hw_breakpoint; - t->to_region_size_ok_for_hw_watchpoint = s390_region_size_ok_for_hw_watchpoint; + t->to_region_ok_for_hw_watchpoint = s390_region_ok_for_hw_watchpoint; t->to_have_continuable_watchpoint = 1; t->to_stopped_by_watchpoint = s390_stopped_by_watchpoint; and so on. P.S: If I can understand and also I understand correctly, it is not hard. Sometimes I just need a little more time to understand the precise meaning of your words. Most of the time I attribute it to my english. ;-) Regards - Wu Zhou