From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9346 invoked by alias); 12 May 2009 15:00:53 -0000 Received: (qmail 9219 invoked by uid 22791); 12 May 2009 15:00:47 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.29.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 May 2009 15:00:42 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.14.3/8.13.8) with ESMTP id n4CF0aFE492008 for ; Tue, 12 May 2009 15:00:36 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 n4CF0aih3473466 for ; Tue, 12 May 2009 17:00:37 +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 n4CF0aR0016685 for ; Tue, 12 May 2009 17:00:36 +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 n4CF0Z1B016661; Tue, 12 May 2009 17:00:35 +0200 Message-Id: <200905121500.n4CF0Z1B016661@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 12 May 2009 17:00:35 +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 15:00:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, pedro@codesourcery.com ('Pedro Alves'), eliz@gnu.org ('Eli Zaretskii') In-Reply-To: <003701c9d30f$1cea0a00$56be1e00$@u-strasbg.fr> from "Pierre Muller" at May 12, 2009 04:37:01 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/msg00246.txt.bz2 Pierre Muller wrote: > > 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). > > OK, but how do I commit a file deletion? > I never did this before! That's an easy three steps :-) 1. Delete the file in your local copy: "rm nm-i386.h" 2. Announce the deletion to CVS: "cvs remove nm-i386.h" 3. Commit the deletion (together with the rest of your changes): "cvs commit" B.t.w. there'll be some follow-on changes, because some of the other nm- files in config/i386 will become (nearly) empty. If an nm- file after your changes is completely empty (e.g. nm-go32.h), you should remove all references to it (e.g. remove the line NAT_FILE= nm-go32.h from go32.mh) and delete the file as well. If an nm- file after your changes consists solely of including some other file (e.g. nm-linux64.h which will consist solely of including "config/nm-linux.h"), you should update the references to this file to refer to that other file (e.g. change the line NAT_FILE= nm-linux64.h to NAT_FILE= config/nm-linux.h in linux64.mh) and then delete the file as well. Your patch should bring us quite a bit closer to the goal of completely eliminating all nm- header files! Thanks! > > 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. > > The only drawback is that "maint show-debug--regs" command > will then also appear on target that do not support > debug registers... Anyhow, it will just be a no-op in that case. > Is that a problem? I don't think so. The command simply says: "whenever the hardware debug registers are changed, display their contents". Being able to set that flag on a system that happens to never use hardware debug register should be fine, the condition just never occurs. > > 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 ... > > I don't know here, the problem is that windows-nat is full of i386 > specific code that should be moved to i386-windows-nat and/or > amd64-windows-nat so that supporting other processors will be easier. Right. For now, this is not an issue as windows-nat.c is only used by those three hosts: ./config/i386/mingw64.mh:NATDEPFILES= i386-nat.o windows-nat.o amd64-windows-nat.o ./config/i386/cygwin.mh:NATDEPFILES= i386-nat.o windows-nat.o i386-windows-nat.o ./config/i386/mingw.mh:NATDEPFILES= i386-nat.o windows-nat.o i386-windows-nat.o which are all i386. If we want to support non-i386 Windows at some point, I guess this should be done similarly to how we support Linux hosts for different platforms: Instead of having a global "windows_ops" structure, have windows-nat.c provide a routine "windows_target ()" that allocates and fills in a target structure, and passes it to its caller (which would be i386-windows-nat.c etc.) for further customization. See how the routine "linux_target ()" is used today ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com