Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: yao@codesourcery.com, gdb-patches@sourceware.org
Subject: Re: [patch] Move common macros to i386-common.h
Date: Thu, 24 Feb 2011 05:11:00 -0000	[thread overview]
Message-ID: <20110224043208.GX2600@adacore.com> (raw)
In-Reply-To: <201102232117.p1NLHdhA015543@glazunov.sibelius.xs4all.nl>

> I'm particularly worried about changes I'll make myself.
[...]
> Sharing architecture-specific #define's is probably fine.  Sharing
> some simple basec support functions may also be ok.  But I don't think
> sharing more complicated code (such as the code manipulating the i386
> debug registers) is a good idea.

I think (hope!) that this would be a transitionary problem, and I am
willing to take on any breakage inadvertandly introduced - We do
gdbserver builds nightly and I update our sources every week or so.

But I think we should share the complicated code, simply because
it is getting increasingly complex, thanks to new features such as
non-stop, tracepoints, or older features such as threading support
which evolve as the kernel capabilities evolve. And while we're at it,
why would we want to continue writing the same code twice?

Right now, we have some bugs in GDB but not in GDBserver, some bugs in
GDBserver but not GDB, and some bugs in both.  Everytime we have a bug
in one of them, but not the other, we just look at how we deal with the
situation in the other, and back-port the idea. Or, when the bug is in
both, we have to fix the problem twice, except that the API is different,
and thus we do the work twice.

My view of the direction we should take is that we should have the
same API for doing all the target stuff: start inferior, next/step/cont,
read/write register/memory, get shared libraries, tracepoints,
watchpoints, etc. Once both use this API, then the remaining part
of GDBserver should be the common code that implements the stub-side
of the remote protocol, which should pretty much build out-of-the-box
on any OS. The consequence of that should be that, once you port GDB,
you pretty much get GDBserver for free.  And the other consequence is
if you decided to port GDBserver only as a first step, you wouldn't
have to do the work again when you decide to port GDB.

-- 
Joel


  parent reply	other threads:[~2011-02-24  4:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13  9:58 Yao Qi
2011-02-13 13:40 ` Mark Kettenis
2011-02-17  6:36   ` Yao Qi
2011-02-17  6:41     ` Joel Brobecker
2011-02-17 18:15       ` Jan Kratochvil
2011-02-23  5:36   ` Yao Qi
2011-02-23 21:35     ` Mark Kettenis
2011-02-24  4:32       ` Yao Qi
2011-02-24  5:11       ` Joel Brobecker [this message]
2011-02-28 18:12       ` Tom Tromey
2011-03-11  6:39 ` [try 2nd, patch] Move common macros to i386-dbg-reg.h Yao Qi
2011-03-29  7:54   ` Yao Qi
2011-04-07 14:07     ` Yao Qi
2011-04-07 15:54       ` Mark Kettenis
2011-04-11  2:01         ` Yao Qi
2011-04-13 17:05           ` Joel Brobecker
2011-04-13 18:48             ` Jan Kratochvil
2011-04-14  8:05             ` Yao Qi
2011-04-25 11:03             ` Yao Qi

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=20110224043208.GX2600@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=yao@codesourcery.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