From: Pedro Alves <palves@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Always include defs.h first.
Date: Thu, 08 Nov 2012 18:55:00 -0000 [thread overview]
Message-ID: <509C0016.80909@redhat.com> (raw)
In-Reply-To: <CADPb22R1+-LVsre62Mm6HJgpiR+4KLktskMvcZG4nYESfvVMwQ@mail.gmail.com>
On 11/08/2012 06:12 PM, Doug Evans wrote:
>
> Another thing to consider:
> I'd like to move gdb to being more componentized (for lack of a better word).
> i.e., made up of application independent pieces.
> common/ is a minor step in this direction.
Yeah. I recently wrote the below in an internal discussion. Allow me to
just paste it here, as it just fits. This was about the direction
of local/remote parity project once we reach a state where we can consider
reusing gdbserver's backend within gdb, instead of the
linux-nat.c/linux-low.c & friends duplication.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The division depends on how much of gdbserver we'd put into GDB. One idea is to
split at the target_ops level, where gdb's target_ops vector calls gdbserver's
target_ops methods (bypassing most of "core" gdbserver code, RSP etc.)
But gdbserver's backends make use of e.g., breakpoints, behind gdb's back. It
may prove to be better to keep core gdb agnostic of this, and import gdbserver's
breakpoints and regcache modules into gdb too (strictly for target side stuff),
instead of adapting the backends use the main gdb's breakpoints list and regcaches.
I never liked the "common" moniker much. It is a bit artificial and an
artifact. It tells us that the code is used by more than one something,
but it doesn't tell us really what's inside. IMO, it's not much different
from saying the gdb/ is the new common and allowing gdb/gdbserver/ to refer
to files under gdb/ . In the extreme, we could end up with half of gdb
under common/ in a few years... I was hoping we could so a better split,
say, start by putting the native target code (target_ops&friends) into
its own dir. Or maybe call it "libbackend/"...
In any case, I think we have two kinds of "common" stuff. There's the
native target backends (ptrace and friends), but there's also the
host side common stuff. If you strip both gdb and gdbserver of their
native target backends (e.g, in gdbserver, you end up with "main()", command
line option processing, the event loop, the RSP mashalling, etc.., you'll
still find things that are common between the two programs. The event
loop is an obvious example. So it feels to me that we could take the
opportunity to do a better code division.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Note that gdbserver doesn't have defs.h and lots of files in common/ do the
Well aware. :-)
--
Pedro Alves
next prev parent reply other threads:[~2012-11-08 18:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-07 20:11 Pedro Alves
2012-11-08 1:34 ` Doug Evans
2012-11-08 16:49 ` Pedro Alves
2012-11-08 18:12 ` Doug Evans
2012-11-08 18:39 ` Joel Brobecker
2012-11-08 18:50 ` Pedro Alves
2012-11-08 18:55 ` Pedro Alves [this message]
2012-11-08 19:00 ` Doug Evans
2012-11-08 19:15 ` Joel Brobecker
2012-11-08 19:21 ` Tom Tromey
2012-11-08 3:49 ` Yao Qi
2012-11-08 5:04 ` Joel Brobecker
2012-11-08 16:56 ` Pedro Alves
2012-11-09 8:12 ` Yao Qi
2012-11-08 17:04 ` Pierre Muller
2012-11-08 17:16 ` Pedro Alves
2012-11-08 19:37 ` Tom Tromey
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=509C0016.80909@redhat.com \
--to=palves@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/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