From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24193 invoked by alias); 22 Jul 2013 17:18:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24167 invoked by uid 89); 22 Jul 2013 17:18:57 -0000 X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_20,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 22 Jul 2013 17:18:22 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6MHIEHW022398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Jul 2013 13:18:14 -0400 Received: from barimba (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6MHICqx007143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 22 Jul 2013 13:18:13 -0400 From: Tom Tromey To: lgustavo@codesourcery.com Cc: "'gdb-patches\@sourceware.org'" Subject: Re: [PATCH] Share more common target structures between gdb and gdbserver References: <51E595A0.6090500@codesourcery.com> Date: Mon, 22 Jul 2013 17:18:00 -0000 In-Reply-To: <51E595A0.6090500@codesourcery.com> (Luis Machado's message of "Tue, 16 Jul 2013 15:49:04 -0300") Message-ID: <874nbm7bu3.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-07/txt/msg00509.txt.bz2 >>>>> "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. 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