From: Pedro Alves <pedro@codesourcery.com>
To: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Mingw Windows 64-bit gdbserver
Date: Sat, 17 Apr 2010 10:58:00 -0000 [thread overview]
Message-ID: <201004171158.08327.pedro@codesourcery.com> (raw)
In-Reply-To: <001f01caddf0$6d4246b0$47c6d410$@muller@ics-cnrs.unistra.fr>
On Saturday 17 April 2010 06:40:02, Pierre Muller wrote:
> > How about instead merging the files, like
> > linux-x86-low.c handles both 64-bit and 32-bit? There's
> > a lot of common stuff between both archs support, it
> > seems.
>
> Of course, I agree with you that the two files
> share a very large common portion that is identical.
> There are only two places where they really differ:
> For the call to the init_registers_XXX
> and for the register mappings array.
>
> The main question is how should we split these parts
> off if we want to keep a common part:
>
> I would propose this:
> rename win32-i386-low.c to win-x86-low.c
Lets avoid someone reading this and getting religious
against "win", and go with windows-*-low.c, just
like gdb/windows-nat.c was renamed from win32-nat.c, and
gdb has i386-windows-nat.c and amd64-windows-nat.c.
> Create win32-i386-low.h and win64-amd64-low.h
> that would have the register mappings and
> a macro to define their local init_registers.
Yes, much better, if nothing else because that's how
gdb handles this as well. It's always good to have the
code bases solve the same problem in the same way, so
that we can more easily keep them in sync or merge them.
Take a look at gdb/amd64-windows-nat.c, it also does something
similar to handle the common stuff, though since we have
a win32_target_ops in gdbserver, we can put the register mappings
array pointer directly in win32_target_ops instead of making it
a global.
Let's avoid macros. Use for example the `arch_setup' callback
in the win32_target_ops vector for this, keeping the arrays
defined in the corresponding arch specific .c files.
--
Pedro Alves
next prev parent reply other threads:[~2010-04-17 10:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-16 15:32 Pierre Muller
2010-04-16 15:59 ` Pedro Alves
2010-04-16 16:20 ` Pierre Muller
2010-04-16 16:27 ` Pedro Alves
2010-04-16 16:38 ` Pierre Muller
2010-04-16 17:15 ` Pedro Alves
2010-04-17 5:39 ` [RFA] Use winsock2 for mingw gdbserver Pierre Muller
2010-04-17 8:28 ` Pedro Alves
2010-04-17 20:44 ` Pierre Muller
2010-04-17 5:40 ` [RFC] Mingw Windows 64-bit gdbserver Pierre Muller
2010-04-17 10:58 ` Pedro Alves [this message]
2010-04-17 23:18 ` [RFC-v2] " Pierre Muller
2010-04-17 23:46 ` Pedro Alves
2010-04-19 6:37 ` [RFA] Prepare for " Pierre Muller
[not found] ` <6200558430975530197@unknownmsgid>
2010-04-19 13:56 ` H.J. Lu
2010-04-19 14:13 ` Pierre Muller
2010-04-16 16:27 [RFC] " Ozkan Sezer
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=201004171158.08327.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=pierre.muller@ics-cnrs.unistra.fr \
/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