From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6306 invoked by alias); 19 Nov 2008 12:49:32 -0000 Received: (qmail 6284 invoked by uid 22791); 19 Nov 2008 12:49:30 -0000 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Nov 2008 12:48:55 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id A0BD6290005; Wed, 19 Nov 2008 13:48:52 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FcfzBNjnM5ni; Wed, 19 Nov 2008 13:48:52 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.0.139]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id E4D8D290002; Wed, 19 Nov 2008 13:48:51 +0100 (CET) Cc: gdb-patches@sourceware.org Message-Id: <9FB62107-EC84-4C65-B059-D553FECBDD87@adacore.com> From: Tristan Gingold To: Stan Shebs In-Reply-To: <49232795.90703@earthlink.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: [RFA] Darwin/x86 port (v4 - part 3/4: i386-darwin files) Date: Wed, 19 Nov 2008 22:53:00 -0000 References: <49232795.90703@earthlink.net> X-Mailer: Apple Mail (2.929.2) X-IsSubscribed: yes 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: 2008-11/txt/msg00500.txt.bz2 On Nov 18, 2008, at 9:37 PM, Stan Shebs wrote: > Tristan Gingold wrote: >> i386-darwin-tdep.h: >> >> >> #include > This code is a little mixed up, I've been studying the situation but > am not yet sure how to proceed. > > The high-order bit is that we can't allow native-only headers to be > included into *-tdep.c files - they must be able to be compiled on > any host. One either precalculates offsets and such and uses, or > defines lookalike structs. The alternative is to move code into a > nat.c file. Given that Apple's GDB isn't correctly set up to be a > cross-debugger either, the easiest path is to migrate code into i386- > darwin-nat.c . When you can compile i386-darwin-tdep.c on a Sparc > Linux host, you're done. :-) I have migrated all the register stuff to i386-darwin-nat.c which makes i386-darwin-tdep.c much smaller. I haven't checked it could be compiled on Sparc Linux (as I don't have access to such a machine :-) but looking at the file it should be. > The other thing that is problematic is the large-scale use of macros > like FIRST_GP_REGNUM and friends. This is an unfortunate > consequence of being diverged from FSF for so long - this method of > handling registers was left behind years ago, and has only survived > in Apple's GDB due to inertia. Even though the files are isolated > into being Darwin-specific, it still brings obsolete technique back > into the trunk, confusing developers and increasing support burden. > > > So since a bunch of code has to be moved anyway, I'd like you to > take the opportunity to look at regsets as used in i386-linux-nat.c > and i386-linux-tdep.c and see how much work it would be to switch > over. I think you'll find it a win, and that a lot of this code will > simply go away. I have looked at i386-linux-nat.c and amd64-linux-nat.c and switched over. This makes the code smaller (and much different from Apple's GDB). Thank you very much for pointing this issue. Very useful to improve the code. Tristan.