From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95138 invoked by alias); 29 Jan 2020 23:39:46 -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 95128 invoked by uid 89); 29 Jan 2020 23:39:46 -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 autolearn=ham version=3.3.1 spammy= X-HELO: mail-vs1-f65.google.com Received: from mail-vs1-f65.google.com (HELO mail-vs1-f65.google.com) (209.85.217.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Jan 2020 23:39:45 +0000 Received: by mail-vs1-f65.google.com with SMTP id x18so992237vsq.4 for ; Wed, 29 Jan 2020 15:39:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vXROR9zgidQcd3su7E76Yw9FAaxSdHTGcFPHKZHfu+s=; b=l/0+OnEpiXlKhl0LaSV14+it9A4hp66GZuCZT5HjhTmlmXnhl4xeYM3ZXbGFiRliut T3mCCJPGTSu7IPYpkD/U0Qtr1cUkhq30mdmTNRTnYwdU6SlxbEFRqBOTKh5XnrwCr25m FvKQNodQLhyF+gS0hvYUSLYTSiQbukvAlgeO/4m7jFDPDpyufmGqaIGYOjcypmA0rRPa hgibyYJnBxJpp3f/W64KE8Mn5BRldaRG/HLEfclxZX4bnR648aSkddfry/5tFacauXg7 Eph/CP1FnQRX6kkby9FoGDwpl7y1UzTCECIQSB0fFU237d1OSYCDdG63RFiZGSomRDRy iq4A== MIME-Version: 1.0 References: In-Reply-To: From: Jim Wilson Date: Thu, 30 Jan 2020 00:00:00 -0000 Message-ID: Subject: Re: [PATCH v2 3/3] gdbserver: Add RISC-V/Linux support To: "Maciej W. Rozycki" Cc: "gdb-patches@sourceware.org" , Andrew Burgess , Palmer Dabbelt , Tom Tromey , "guoren@kernel.org" , "lifang_xia@c-sky.com" , "yunhai_shang@c-sky.com" , "jiangshuai_li@c-sky.com" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00963.txt.bz2 On Wed, Jan 29, 2020 at 10:14 AM Maciej W. Rozycki wrote: > gdb/ > * arch/riscv.h (riscv_create_target_description): Remove `const' > qualifier from the return type. > * arch/riscv.c (riscv_create_target_description): Likewise. > * nat/riscv-linux-tdesc.h (riscv_linux_read_description): > Likewise. > * nat/riscv-linux-tdesc.c (riscv_linux_read_description): > Likewise. > * configure.tgt : Set build_gdbserver=yes. > > gdb/gdbserver/ > * linux-riscv-low.c: New file. > * Makefile.in (SFILES): Add linux-riscv-low.c, arch/riscv.c, and > nat/riscv-linux-tdesc.c. > * configure.srv (srv_tgtobj) > (srv_linux_regsets, srv_linux_usrregs, srv_linux_thread_db): > Define. Looks good to me, though I'm not an official review. I noticed on the gdbserver console I'm getting a lot of ptrace warnings. ptrace(regsets_fetch_inferior_registers) PID=1678103: Invalid argument Warning: ptrace(regsets_store_inferior_registers): Invalid argument This looks like a side effect of having two FP regsets defined, it tries the first one, fails, and then tries the second one which is correct. If you mark them as OPTIONAL_REGS we would only get the warning once which would be OK, except that they can't be both FP_REGS and OPTIONAL_REGS at the same time. I don't know what if anything would break if they aren't marked as FP_REGS. I only see explicit checks for GENERAL_REGS and OPTIONAL_REGS; I don't see any checks for FP_REGS. Anyways, I would suggest as a future improvement that the linux gdbserver regset support be extended so that a regset can be marked as both FP_REGS and OPTIONAL_REGS. There are some new functions and structures that don't have explanatory comments before them, but this is a minor issue. Jim