This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Share more common target structures between gdb and gdbserver


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]