From: Doug Evans <dje@google.com>
To: Yao Qi <yao@codesourcery.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: duplicated code in gdb and gdbserver
Date: Fri, 07 Jan 2011 16:37:00 -0000 [thread overview]
Message-ID: <AANLkTinMZ6hchkv1h+H265Eu7+Zsb4GizJ2XA5-VUnEO@mail.gmail.com> (raw)
In-Reply-To: <4D272FF6.3070402@codesourcery.com>
On Fri, Jan 7, 2011 at 7:23 AM, Yao Qi <yao@codesourcery.com> wrote:
> I noticed that sharing code of GDB and GDBServer is discussed in 2010
> GCC Summit.
> http://sourceware.org/gdb/wiki/2010_GCC_Summit_BoF
>
> Looks like one conclusion is that "it is likely to be quite complex". I
> don't understand this point fully, so I had a try by myself to create a
> new file linux-common.h in gdb/common/, move some duplicated macro
> definitions from gdb/linux-nat.c and gdb/gdbserver/linux-low.c to
> common/linux-common.h, and adjust *.h files include order. Then, both
> GDB and GDBServer can be build on x86. Totally, it costs me nearly half
> an hour to complete this experiment.
>
> Could anyone tell me which part of this work is "quite complex"? Am I
> missing something?
> Regardless of this potential complexity I haven't met, it is worthwhile
> moving obviously common/duplicated code into single file, isn't?
> Comments are welcome.
Complexity is in the eye of the beholder, so I'm sure there can be
reasonable disagreements.
There are no technical problems to solve, it's just code
reorganization (albeit on a non-trivial scale).
But for discussion's sake you need to dig deeper (IMO).
An easy example is tracepoints. Why does tracepoint support only
exist on gdbserver? There's no technical reason for that.
The end result (of more code sharing) should include tracepoint
support being available to both native gdb and gdbserver.
Another is the management of threads, gdb and gdbserver handle them a
little differently.
Another example is individual target support. E.g., merging common
bits of gdb's ${target}-nat.c files with gdbserver's ${target}-low.c
files.
A minor example is regcache.c.
And so on.
But for what it's worth, it's REAL NICE that the gdb community is at
least not balking at the idea!
What I'd like to see (repeated here for the list's sake, with
apologies to the irc crowd :-)), is a publicly usable library (or
collection of libraries) used by gdb and gdbserver. [I'd like to see
more of the gnu tools made available as libraries, btw.]
next prev parent reply other threads:[~2011-01-07 16:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 15:23 Yao Qi
2011-01-07 16:37 ` Doug Evans [this message]
2011-01-08 3:34 ` Yao Qi
2011-01-08 5:17 ` Joel Brobecker
2011-01-10 13:39 ` Frank Ch. Eigler
2011-01-10 14:09 ` Joel Brobecker
2011-01-10 15:10 ` Frank Ch. Eigler
2011-01-10 15:50 ` Paul Koning
2011-01-10 15:51 ` Doug Evans
2011-01-10 15:54 ` Frank Ch. Eigler
2011-01-10 16:35 ` Doug Evans
2011-01-10 19:02 ` Frank Ch. Eigler
2011-01-11 23:35 ` Joel Brobecker
2011-01-11 23:38 ` Joel Brobecker
2011-01-12 0:30 ` Frank Ch. Eigler
2011-01-12 17:54 ` Doug Evans
2011-01-12 18:06 ` Doug Evans
2011-01-12 18:43 ` Paul Koning
2011-01-12 19:04 ` Doug Evans
2011-01-12 20:09 ` Joel Brobecker
2011-01-12 20:48 ` Frank Ch. Eigler
2011-01-14 17:04 ` Doug Evans
2011-01-12 15:47 ` Tom Tromey
2011-01-07 17:17 ` Stan Shebs
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=AANLkTinMZ6hchkv1h+H265Eu7+Zsb4GizJ2XA5-VUnEO@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--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