From: Tristan Gingold <gingold@adacore.com>
To: Stan Shebs <stanshebs@earthlink.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Darwin/x86 port (v4 - part 3/4: i386-darwin files)
Date: Wed, 19 Nov 2008 22:53:00 -0000 [thread overview]
Message-ID: <9FB62107-EC84-4C65-B059-D553FECBDD87@adacore.com> (raw)
In-Reply-To: <49232795.90703@earthlink.net>
On Nov 18, 2008, at 9:37 PM, Stan Shebs wrote:
> 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. :-)
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.
prev parent reply other threads:[~2008-11-19 12:49 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
2008-11-19 22:53 ` Tristan Gingold [this message]
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=9FB62107-EC84-4C65-B059-D553FECBDD87@adacore.com \
--to=gingold@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=stanshebs@earthlink.net \
/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