Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stan Shebs <stanshebs@earthlink.net>
To: Tristan Gingold <gingold@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Darwin/x86 port (v4 - part 3/4: i386-darwin files)
Date: Wed, 19 Nov 2008 01:47:00 -0000	[thread overview]
Message-ID: <49232795.90703@earthlink.net> (raw)
In-Reply-To: <BA03F615-5971-4D37-BD3C-EA203CA532F8@adacore.com>

Tristan Gingold wrote:
> i386-darwin-tdep.h:
>
>
> #include <mach/thread_status.h>
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. :-)

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.

Stan


  reply	other threads:[~2008-11-18 20:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 18:43 Tristan Gingold
2008-11-19  1:47 ` Stan Shebs [this message]
2008-11-19 22:53   ` Tristan Gingold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49232795.90703@earthlink.net \
    --to=stanshebs@earthlink.net \
    --cc=gdb-patches@sourceware.org \
    --cc=gingold@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox