From patchwork Wed Nov 15 17:20:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 24258 Received: (qmail 40426 invoked by alias); 15 Nov 2017 17:20:37 -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 39499 invoked by uid 89); 15 Nov 2017 17:20:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:static. X-HELO: mail-wm0-f47.google.com Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Nov 2017 17:20:34 +0000 Received: by mail-wm0-f47.google.com with SMTP id n74so22497707wmi.1 for ; Wed, 15 Nov 2017 09:20:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=7EXPCBH34NWOTIlBG0CsfC53Ze00GZ7sJMMc6W13a4k=; b=D6AhtdKN6RHLnxJQxbfZSt0cyWSx82CWQ0UscbQFROsz6OqNk8jyq0LgzndHbHLLQO JuPF+Gpn7Y6NkZS/ChOR26LBj3VGowXmvbvxOcuzu8zW/hmwlSF/xNIY/DhbaWYyNMW9 LGTvDyi7ZCu4LPpzqsWqRpBBmPk2Rks0My0Docf5xROQrKeETfPIsYP4fKnccQahih3V j2MbV4LWWaJj4G+YEGVHvnfnDPAlVRMnZNRgKdJF27BRebULYf6agmSZw9Lqldq6wI8M HYswfKmjXSjUkbXQ/Q2VWFDeiJ6b21kol7NBr3gIXqhqmb9LkRjsTuIC6yQ3RZFlbMZ6 0knA== X-Gm-Message-State: AJaThX6hxEJVdYKl/kg9IjdipPptcExSund0/jMjNQ5BUNSOohRsxuww wuhEbQr2FAzl/005dCJeJbg2lg== X-Google-Smtp-Source: AGs4zMboxPsx7Nw7l6E5G2Gcwm4CzPiTqIHlhN/e8U9C4OC1LyAoNMa/fNrkqAvpDJgYI1iqcasHmw== X-Received: by 10.28.9.197 with SMTP id 188mr9934638wmj.20.1510766432339; Wed, 15 Nov 2017 09:20:32 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id p15sm5771088wre.24.2017.11.15.09.20.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Nov 2017 09:20:31 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Fix tic6x-uclinux GDBserver build failure Date: Wed, 15 Nov 2017 17:20:27 +0000 Message-Id: <1510766427-8146-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes I can't find a c6x-uclinux c++ compiler, so I use my host g++ to build tic6x-uclinux GDBserver, and find the following build failures. They are not target specific, so I believe they are real errors. This patch fixes them. ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:313:34: error: invalid conversion from 'void*' to 'tic6x_register*' [-fpermissive] union tic6x_register *regset = buf; ^ ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c: In function 'void tic6x_store_gregset(regcache*, const void*)': ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:324:40: error: invalid conversion from 'const void*' to 'const tic6x_register*' [-fpermissive] const union tic6x_register *regset = buf; ^ ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c: At global scope: ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:359:28: error: redefinition of 'usrregs_info tic6x_usrregs_info' static struct usrregs_info tic6x_usrregs_info = ^ ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:186:28: note: 'usrregs_info tic6x_usrregs_info' previously declared here static struct usrregs_info tic6x_usrregs_info; ^ gdb/gdbserver: 2017-11-15 Yao Qi * linux-tic6x-low.c (tic6x_fill_gregset): Cast buf. (tic6x_store_gregset): Likewise. (tic6x_usrregs_info): Move it up. --- gdb/gdbserver/linux-tic6x-low.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gdb/gdbserver/linux-tic6x-low.c b/gdb/gdbserver/linux-tic6x-low.c index 7a32f7e..6dda52e 100644 --- a/gdb/gdbserver/linux-tic6x-low.c +++ b/gdb/gdbserver/linux-tic6x-low.c @@ -182,8 +182,11 @@ tic6x_sw_breakpoint_from_kind (int kind, int *size) return (const gdb_byte *) &tic6x_breakpoint; } -/* Forward definition. */ -static struct usrregs_info tic6x_usrregs_info; +static struct usrregs_info tic6x_usrregs_info = + { + TIC6X_NUM_REGS, + NULL, /* Set in tic6x_read_description. */ + }; static const struct target_desc * tic6x_read_description (void) @@ -310,7 +313,7 @@ tic6x_supply_register (struct regcache *regcache, int regno, static void tic6x_fill_gregset (struct regcache *regcache, void *buf) { - union tic6x_register *regset = buf; + auto regset = static_cast (buf); int i; for (i = 0; i < TIC6X_NUM_REGS; i++) @@ -321,7 +324,7 @@ tic6x_fill_gregset (struct regcache *regcache, void *buf) static void tic6x_store_gregset (struct regcache *regcache, const void *buf) { - const union tic6x_register *regset = buf; + const auto regset = static_cast (buf); int i; for (i = 0; i < TIC6X_NUM_REGS; i++) @@ -356,12 +359,6 @@ static struct regsets_info tic6x_regsets_info = NULL, /* disabled_regsets */ }; -static struct usrregs_info tic6x_usrregs_info = - { - TIC6X_NUM_REGS, - NULL, /* Set in tic6x_read_description. */ - }; - static struct regs_info regs_info = { NULL, /* regset_bitmap */