From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28202 invoked by alias); 12 May 2009 13:02:12 -0000 Received: (qmail 27925 invoked by uid 22791); 12 May 2009 13:02:08 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 May 2009 13:01:59 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.14.3/8.13.8) with ESMTP id n4CD0xwD415160 for ; Tue, 12 May 2009 13:00:59 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4CD0xSc3149852 for ; Tue, 12 May 2009 15:00:59 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4CD0wJF003318 for ; Tue, 12 May 2009 15:00:59 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n4CD0vMQ003287; Tue, 12 May 2009 15:00:57 +0200 Message-Id: <200905121300.n4CD0vMQ003287@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 12 May 2009 15:00:57 +0200 Subject: Re: [RFC] Remove i386 low level debug register function from nm- header file. To: muller@ics.u-strasbg.fr (Pierre Muller) Date: Tue, 12 May 2009 13:02:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, pedro@codesourcery.com ('Pedro Alves'), eliz@gnu.org ('Eli Zaretskii') In-Reply-To: <005001c9d17f$302199d0$9064cd70$@u-strasbg.fr> from "Pierre Muller" at May 10, 2009 04:54:13 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-05/txt/msg00244.txt.bz2 Pierre Muller wrote: > Following my first RFC > http://sourceware.org/ml/gdb-patches/2009-03/msg00197.html > > and the following answers, I resubmit > a new version where all i386 low level debug register > is contained in a single struct defined in the > new i386-nat.h header (to comply with DOS file name restrictions > as asked for by Eli). This looks good to me. However, now that you've moved the prototypes to i386-nat.h, there is no longer any need for the config/i386/nm-i386.h file -- please get rid of that file (by removing the places where it is included into other nm- files). Also, it seems to me that now there is no need any more for the I386_USE_GENERIC_WATCHPOINTS define -- targets that use watchpoints call the i386_use_watchpoints routines, those that don't, do not. I think you should provide everything in i386-nat.c (and the new i386-nat.h) unconditionally, and eliminate the various definitions of I386_USE_GENERIC_WATCHPOINTS in the nm- header files. Note that in combination with removing nm-i386.h, this actually makes several nm- files completely empty, so they should be removed as well. > 2009-05-10 Pierre Muller > > Remove all i386 debug register low level macros in config tm files. Should read "nm" files, not tm. > +/* Targets should define this to use the generic x86 watchpoint support. > */ > +#ifdef I386_USE_GENERIC_WATCHPOINTS As mentioned above, please get rid of this conditional ... > + > +/* Add watchpoint methods to the provided target_ops. > + Targets defining I386_USE_GENERIC_WATCHPOINTS should call > + this. */ ... as well as the second sentence of the comment. > /* Support for 8-byte wide hw watchpoints. */ > #ifndef TARGET_HAS_DR_LEN_8 > -#define TARGET_HAS_DR_LEN_8 0 > +#define TARGET_HAS_DR_LEN_8 (i386_dr_low.debug_register_length == 8) > #endif Nobody should be defining this any more, so please eliminate the #ifndef ... conditional. > Index: src/gdb/i386fbsd-nat.c > =================================================================== > RCS file: /cvs/src/src/gdb/i386fbsd-nat.c,v > retrieving revision 1.18 > @@ -126,7 +127,19 @@ _initialize_i386fbsd_nat (void) > > /* Add some extra features to the common *BSD/i386 target. */ > t = i386bsd_target (); > + > +#ifdef I386_USE_GENERIC_WATCHPOINTS > + > i386_use_watchpoints (t); > + > + i386_dr_low.set_control = i386bsd_dr_set_control; > + i386_dr_low.set_addr = i386bsd_dr_set_addr; > + i386_dr_low.reset_addr = i386bsd_dr_reset_addr; > + i386_dr_low.get_status = i386bsd_dr_get_status; > + i386_set_debug_register_length (4); > +#endif /* I386_USE_GENERIC_WATCHPOINTS */ In this case, because the header file currently conditionally defines I386_USE_GENERIC_WATCHPOINTS: #ifdef HAVE_PT_GETDBREGS #define I386_USE_GENERIC_WATCHPOINTS #endif you should move that condition to the i386fbsd-nat.c file: #ifdef HAVE_PT_GETDBREGS i386_use_watchpoints (t); ... #endif > diff -u -p -r1.189 windows-nat.c > --- windows-nat.c 17 Apr 2009 15:44:28 -0000 1.189 > +++ windows-nat.c 8 May 2009 14:02:25 -0000 > @@ -2166,8 +2171,22 @@ init_windows_ops (void) > windows_ops.to_has_execution = 1; > windows_ops.to_pid_to_exec_file = windows_pid_to_exec_file; > windows_ops.to_get_ada_task_ptid = windows_get_ada_task_ptid; > + > +#ifdef I386_USE_GENERIC_WATCHPOINTS > + > i386_use_watchpoints (&windows_ops); > > + i386_dr_low.set_control = cygwin_set_dr7; > + i386_dr_low.set_addr = cygwin_set_dr; > + i386_dr_low.reset_addr = NULL; > + i386_dr_low.get_status = cygwin_get_dr6; Here, it seems every user of windows-nat.c unconditionally defines I386_USE_GENERIC_WATCHPOINTS, so there's no point in adding the #ifdef's to this file ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com