From patchwork Sun Oct 28 11:23:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 29924 Received: (qmail 80943 invoked by alias); 28 Oct 2018 11:23:34 -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 80918 invoked by uid 89); 28 Oct 2018 11:23:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=highlight X-HELO: mail-wm1-f67.google.com Received: from mail-wm1-f67.google.com (HELO mail-wm1-f67.google.com) (209.85.128.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 28 Oct 2018 11:23:31 +0000 Received: by mail-wm1-f67.google.com with SMTP id s10-v6so5407104wmc.5 for ; Sun, 28 Oct 2018 04:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Z67xeOR6bbpZt+7iMtYPN3qXkzDQifO5oaF+1lZ0OOQ=; b=R60hbnp0rqgSdZKq86iQGeeZl8kwVLRJ9Cq/0XCPjE0R8hVkjwelxf18QZ3HfK8LxF ayex0NkkrcLu5Rbl1A6m2dF70uMvIggMUhrdb7yX/sIk1vfxxUaCh0DD98jYg0+zsMCJ +Jq+woHgyXerPDVTjZKhDriqDk44ozwor91ow5F30mxI+A6SJHcVPeLUGFLWB/lm38AU 6X932eqagI97gT8wyZpM94PPxyPJ8dk3NEYfTSSPiXCQVCfReTNhqaCddDSxaNHV0VIO AjBnNCL4cGFcqvTl8fQvdkN1wlRyu85jxN0Ker0/neV8obYR2swB3ZMFu1C+icKV2+TC nraA== Return-Path: Received: from localhost (host81-148-252-35.range81-148.btcentralplus.com. [81.148.252.35]) by smtp.gmail.com with ESMTPSA id 18-v6sm11772046wmw.26.2018.10.28.04.23.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Oct 2018 04:23:27 -0700 (PDT) Date: Sun, 28 Oct 2018 11:23:26 +0000 From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Pedro Alves Subject: Re: [PATCH 4/5] RISC-V: Add native linux support. Message-ID: <20181028112326.GF15098@embecosm.com> References: <20180808233908.8149-1-jimw@sifive.com> <20181025110946.GN2929@embecosm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Fortune: You will be awarded the Nobel Peace Prize... posthumously. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes * Pedro Alves [2018-10-25 13:06:25 +0100]: > On 10/25/2018 12:09 PM, Andrew Burgess wrote: > > > > I removed the extra { ... } block in line with the coding standard > > while editing this area. > > Actually, this applies here: > > > Any two or more lines in code should be wrapped in braces, even if they are comments, as they look like separate statements: > > if (i) > > { > > /* Return success. */ > > return 0; > > } > > > > and not: > > > > if (i) > > /* Return success. */ > > return 0; > > From: > > https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards?highlight=%28coding%29%7C%28conventions%29#Whitespaces > Sorry for this mistake. I pushed the patch below to correct this. Thanks, Andrew --- gdb/riscv: Add back missing braces in riscv-linux-nat.c In this commit: commit ee67fd7f3f6ca78eede2862e309c0bcf266bbd7e Date: Thu Oct 25 12:03:31 2018 +0100 gdb/riscv: Use correct regnum in riscv_linux_nat_target::fetch_registers I incorrectly removed a set of braces in violation of the GDB coding standard. This commit adds them back. gdb/ChangeLog: * riscv-linux-nat.c (riscv_linux_nat_target::fetch_registers): Add missing braces. No functional change. --- gdb/ChangeLog | 5 +++++ gdb/riscv-linux-nat.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/riscv-linux-nat.c b/gdb/riscv-linux-nat.c index c09121d052b..d51f6e30218 100644 --- a/gdb/riscv-linux-nat.c +++ b/gdb/riscv-linux-nat.c @@ -201,8 +201,10 @@ riscv_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) if ((regnum == RISCV_CSR_MISA_REGNUM) || (regnum == -1)) - /* TODO: Need to add a ptrace call for this. */ - regcache->raw_supply_zeroed (RISCV_CSR_MISA_REGNUM); + { + /* TODO: Need to add a ptrace call for this. */ + regcache->raw_supply_zeroed (RISCV_CSR_MISA_REGNUM); + } /* Access to other CSRs has potential security issues, don't support them for now. */