From patchwork Thu Nov 19 13:00:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 9739 Received: (qmail 121442 invoked by alias); 19 Nov 2015 13:01:11 -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 121419 invoked by uid 89); 19 Nov 2015 13:01:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 19 Nov 2015 13:01:09 +0000 Received: by pacdm15 with SMTP id dm15so80845020pac.3 for ; Thu, 19 Nov 2015 05:01:08 -0800 (PST) X-Received: by 10.68.251.170 with SMTP id zl10mr10305017pbc.106.1447938067894; Thu, 19 Nov 2015 05:01:07 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id ag1sm10658559pbc.41.2015.11.19.05.01.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 05:01:07 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/4] Cast void * to struct user_pt_regs * Date: Thu, 19 Nov 2015 13:00:59 +0000 Message-Id: <1447938062-29624-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1447938062-29624-1-git-send-email-yao.qi@linaro.org> References: <1447938062-29624-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes This patch fixes the following GDBserver build errors in C++. gdb/gdbserver/linux-aarch64-low.c:108:33: error: invalid conversion from 'void*' to 'user_pt_regs*' [-fpermissive] struct user_pt_regs *regset = buf; ^ gdb/gdbserver/linux-aarch64-low.c: In function 'void aarch64_store_gregset(regcache*, const void*)': gdb/gdbserver/linux-aarch64-low.c:121:39: error: invalid conversion from 'const void*' to 'const user_pt_regs*' [-fpermissive] const struct user_pt_regs *regset = buf; gdb/gdbserver: 2015-11-19 Yao Qi * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to struct user_pt_regs *. (aarch64_store_gregset): Likewise. --- gdb/gdbserver/linux-aarch64-low.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 4f23392..8d22218 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -105,7 +105,7 @@ aarch64_cannot_fetch_register (int regno) static void aarch64_fill_gregset (struct regcache *regcache, void *buf) { - struct user_pt_regs *regset = buf; + struct user_pt_regs *regset = (struct user_pt_regs *) buf; int i; for (i = 0; i < AARCH64_X_REGS_NUM; i++) @@ -118,7 +118,7 @@ aarch64_fill_gregset (struct regcache *regcache, void *buf) static void aarch64_store_gregset (struct regcache *regcache, const void *buf) { - const struct user_pt_regs *regset = buf; + const struct user_pt_regs *regset = (const struct user_pt_regs *) buf; int i; for (i = 0; i < AARCH64_X_REGS_NUM; i++)