On 07/22/2013 02:18 PM, Tom Tromey wrote: >>>>>> "Luis" == Luis Machado 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. Agreed. I missed this. > > 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. Thanks Tom. Please find attached what i plan to commit soon. Luis