Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: lgustavo@codesourcery.com
Cc: "'gdb-patches\@sourceware.org'" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Share more common target structures between gdb and gdbserver
Date: Mon, 22 Jul 2013 17:18:00 -0000	[thread overview]
Message-ID: <874nbm7bu3.fsf@fleche.redhat.com> (raw)
In-Reply-To: <51E595A0.6090500@codesourcery.com> (Luis Machado's message of	"Tue, 16 Jul 2013 15:49:04 -0300")

>>>>> "Luis" == Luis Machado <lgustavo@codesourcery.com> writes:

Luis> While doing some research about the remote fork following feature, i
Luis> noticed there was some duplication of target data structures for GDB
Luis> and gdbserver.

Luis> This patch moves the shareable code/data structures to
Luis> common/target-common.* and makes both GDB and gdbserver target files
Luis> reference the header common/target-common.h.

Thanks.

Luis> OK?

A couple of trivial nits.

Luis> diff --git a/gdb/common/target-common.c b/gdb/common/target-common.c
Luis> new file mode 100644
Luis> index 0000000..a7ee3e2
Luis> --- /dev/null
Luis> +++ b/gdb/common/target-common.c

Luis> +/* Return a pretty printed form of target_waitstatus.
Luis> +   Space for the result is malloc'd, caller must free.  */
Luis> +
Luis> +#include "target-common.h"

I think common .c files ought to start with:

#ifdef GDBSERVER
#include "server.h"
#else
#include "defs.h"
#endif

Not pretty, but it seems to be the standard.

Luis> +/* Generally, what has the program done?  */
Luis> +enum target_waitkind
Luis> +{
[...]
Luis> +  };

This line is mis-indented.
I thought at first that it was this way originally, but you've
reindented the body of the enum generally, just not this line.

Luis> @@ -429,6 +427,7 @@ vec_h = $(srcdir)/../common/vec.h
Luis>  gdb_vecs_h = $(srcdir)/../common/gdb_vecs.h
Luis>  host_defs_h = $(srcdir)/../common/host-defs.h
Luis>  libiberty_h = $(srcdir)/../../include/libiberty.h
Luis> +target_common_h = $(srcdir)/../common/target-common.h

I don't think this is needed.

This is ok with the above fixed.
Thanks for working on this.

Tom


  reply	other threads:[~2013-07-22 17:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 18:49 Luis Machado
2013-07-22 17:18 ` Tom Tromey [this message]
2013-07-22 18:23   ` Luis Machado
2013-07-30 17:48 ` Pedro Alves
2013-07-30 18:11   ` Tom Tromey
2013-07-31 12:16     ` Pedro Alves
2013-07-31 15:22       ` Tom Tromey
2013-07-31 18:43   ` Luis Machado
2013-07-31 19:03     ` Pedro Alves

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=874nbm7bu3.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lgustavo@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