From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64774 invoked by alias); 8 Aug 2018 23:36:40 -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 64763 invoked by uid 89); 8 Aug 2018 23:36:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 23:36:38 +0000 Received: by mail-wm0-f67.google.com with SMTP id o18-v6so4512361wmc.0 for ; Wed, 08 Aug 2018 16:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=km3JAU/aV8Abs5FAShe4LTR6eaMERB/CuMG9FQ/2exg=; b=lkdi/rLnuiaD0Yf7fTzQtiIY4JJlSdaVcpPw6wL1+7m8hbaNbc8MBsrZe51AV0lZan jNScnSoMSjmLVF8el1k+BVTqi1N72KgBGcoLj6v5X3nM5MGgdaUImQzuE4VEAMA4Glrs j0R/7VU1FvqPeZDalMhgtrZ5VAUB1QvHDs1Xoo4PsF1m8B1vjYGKdw8g1jO1AHE90Jxp VfUDqYszmGFRT6TkKuH/RLZz2wQPB0LNgrulVDSky4EnoiDNih52c5eoGu7BXykdKhjI +jH8k6paEbVUH/8d/JS7DYK37A8K72n1Pr0Na4kQg0+4Hr2otIE5eRgtGBlIG2Ybt0Me deYw== MIME-Version: 1.0 Received: by 2002:adf:e44b:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 16:36:35 -0700 (PDT) In-Reply-To: <20180808155833.GO3155@embecosm.com> References: <20180808021710.7779-1-jimw@sifive.com> <20180808155833.GO3155@embecosm.com> From: Jim Wilson Date: Wed, 08 Aug 2018 23:36:00 -0000 Message-ID: Subject: Re: [PATCH 4/5] RISC-V: Add native linux support. To: Andrew Burgess Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-08/txt/msg00195.txt.bz2 On Wed, Aug 8, 2018 at 8:58 AM, Andrew Burgess wrote: >> +class riscv_linux_nat_target final : public linux_nat_target > > This probably needs a comment. OK. >> +void >> +supply_gregset_regnum (struct regcache *regcache, const prgregset_t *gregs, >> + int regnum) > > Can this be static? Yes. >> +void >> +supply_fpregset_regnum (struct regcache *regcache, const prfpregset_t *fpregs, >> + int regnum) > > Can this be static? Yes. >> + if (regnum == RISCV_CSR_MISA_REGNUM) > > Should this also have a 'regnum == -1' check? I was going to worry about CSR support later, but it is harmless to add this now. I did so. >> + /* Access to other CSRs has potential security issues, don't support them for >> + now. */ > > Should we add a warning if regnum is NOT -1, but IS for a CSR? Would > this warning end up triggering all the time? Maybe if it does it > should just trigger once? > > I'm just thinking if a user specifically asks for a csr register, it > might be nice if GDB would say "can't" instead of silently failing... Gdb is tracking register info via regcache, so it knows that the register was not updated. I get for instance (gdb) print $mtvec $1 = (gdb) print $mtvec = 0x180 $2 = So I don't think we need anything in the riscv-linux-nat.c file to cover this. Jim