From patchwork Thu Oct 29 13:02:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 9444 Received: (qmail 15390 invoked by alias); 29 Oct 2015 13:02:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15358 invoked by uid 89); 29 Oct 2015 13:02:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 29 Oct 2015 13:02:23 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 6B38AC0AEE40; Thu, 29 Oct 2015 13:02:22 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9TD2K1A001586; Thu, 29 Oct 2015 09:02:21 -0400 Message-ID: <563218DC.5040100@redhat.com> Date: Thu, 29 Oct 2015 13:02:20 +0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Metzger, Markus T" , "gdb-patches@sourceware.org" Subject: Re: [PATCH 4/7] gdbserver: btrace enums References: <1446044362-8655-1-git-send-email-palves@redhat.com> <1446044362-8655-5-git-send-email-palves@redhat.com> In-Reply-To: On 10/28/2015 03:29 PM, Metzger, Markus T wrote: >> -----Original Message----- >> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- >> owner@sourceware.org] On Behalf Of Pedro Alves >> Sent: Wednesday, October 28, 2015 3:59 PM >> To: gdb-patches@sourceware.org >> Subject: [PATCH 4/7] gdbserver: btrace enums > > Hello Pedro, Hi Markus, > >> ../../../src/gdb/gdbserver/linux-low.c: In function ‘int >> linux_low_read_btrace(btrace_target_info*, buffer*, int)’: >> ../../../src/gdb/gdbserver/linux-low.c:6827:48: error: invalid conversion from >> ‘int’ to ‘btrace_read_type’ [-fpermissive] >> err = linux_read_btrace (&btrace, tinfo, type); >> ^ >> In file included from ../../../src/gdb/gdbserver/linux-low.c:98:0: >> ../../../src/gdb/gdbserver/../nat/linux-btrace.h:116:26: error: initializing >> argument 3 of ‘btrace_error linux_read_btrace(btrace_data*, >> btrace_target_info*, btrace_read_type)’ [-fpermissive] >> extern enum btrace_error linux_read_btrace (struct btrace_data *btrace, >> ^ >> >> I didn't spot the cyclic dependency the comment talks about. > > At that time, you had to include server.h/defs.h before vec.h. So I couldn't > include btrace-common.h (which includes vec.h and also server.h) into target.h, > which was in turn included in server.h. > > > The patch looks good to me. Thanks. I updated the git log to point to your explanation here, and pushed this in. Thanks. --- Subject: [PATCH] gdbserver: btrace enums Fixes: ../../../src/gdb/gdbserver/linux-low.c: In function ‘int linux_low_read_btrace(btrace_target_info*, buffer*, int)’: ../../../src/gdb/gdbserver/linux-low.c:6827:48: error: invalid conversion from ‘int’ to ‘btrace_read_type’ [-fpermissive] err = linux_read_btrace (&btrace, tinfo, type); ^ In file included from ../../../src/gdb/gdbserver/linux-low.c:98:0: ../../../src/gdb/gdbserver/../nat/linux-btrace.h:116:26: error: initializing argument 3 of ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’ [-fpermissive] extern enum btrace_error linux_read_btrace (struct btrace_data *btrace, ^ The cyclic dependency the comment talks about is no longer relevant: https://sourceware.org/ml/gdb-patches/2015-10/msg00643.html gdb/gdbserver/ChangeLog: 2015-10-29 Pedro Alves * linux-low.c (linux_low_read_btrace): Change type of 'type' parameter. * server.c (handle_qxfer_btrace): Change type of 'type' local. * target.h (struct target_ops) : Change type of 'type' parameter. Update comment. --- gdb/gdbserver/ChangeLog | 18 ++++++++++++++++++ gdb/gdbserver/linux-low.c | 2 +- gdb/gdbserver/server.c | 3 ++- gdb/gdbserver/target.h | 6 +++--- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 0dfecf1..9b8a7d7 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -16,6 +16,24 @@ * linux-x86-low.c (x86_regsets): Likewise. * linux-xtensa-low.c (xtensa_regsets): Likewise. +2015-10-29 Pedro Alves + + * linux-low.h (NULL_REGSET): Define. + * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET. + * linux-arm-low.c (arm_regsets): Likewise. + * linux-crisv32-low.c (cris_regsets): Likewise. + * linux-m68k-low.c (m68k_regsets): Likewise. + * linux-mips-low.c (mips_regsets): Likewise. + * linux-nios2-low.c (nios2_regsets): Likewise. + * linux-ppc-low.c (ppc_regsets): Likewise. + * linux-s390-low.c (s390_regsets): Likewise. + * linux-sh-low.c (sh_regsets): Likewise. + * linux-sparc-low.c (sparc_regsets): Likewise. + * linux-tic6x-low.c (tic6x_regsets): Likewise. + * linux-tile-low.c (tile_regsets): Likewise. + * linux-x86-low.c (x86_regsets): Likewise. + * linux-xtensa-low.c (xtensa_regsets): Likewise. + 2015-10-26 Doug Evans * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index e778c4c..41ab510 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -6815,7 +6815,7 @@ linux_low_encode_raw (struct buffer *buffer, const gdb_byte *data, static int linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer, - int type) + enum btrace_read_type type) { struct btrace_data btrace; struct btrace_block *block; diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index ad6626e..024399d 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -1608,7 +1608,8 @@ handle_qxfer_btrace (const char *annex, { static struct buffer cache; struct thread_info *thread; - int type, result; + enum btrace_read_type type; + int result; if (the_target->read_btrace == NULL || writebuf != NULL) return -2; diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index a14c6ff..769c876 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -399,11 +399,11 @@ struct target_ops Returns zero on success, non-zero otherwise. */ int (*disable_btrace) (struct btrace_target_info *tinfo); - /* Read branch trace data into buffer. We use an int to specify the type - to break a cyclic dependency. + /* Read branch trace data into buffer. Return 0 on success; print an error message into BUFFER and return -1, otherwise. */ - int (*read_btrace) (struct btrace_target_info *, struct buffer *, int type); + int (*read_btrace) (struct btrace_target_info *, struct buffer *, + enum btrace_read_type type); /* Read the branch trace configuration into BUFFER. Return 0 on success; print an error message into BUFFER and return -1