From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17687 invoked by alias); 24 Feb 2019 06:21:00 -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 17675 invoked by uid 89); 24 Feb 2019 06:21:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=expert, lack X-HELO: mail-ua1-f66.google.com Received: from mail-ua1-f66.google.com (HELO mail-ua1-f66.google.com) (209.85.222.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Feb 2019 06:20:58 +0000 Received: by mail-ua1-f66.google.com with SMTP id u1so4895065uae.12 for ; Sat, 23 Feb 2019 22:20:58 -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=zW7ET29U8qhmqatdW7tMjHxZwkG59aTqtnoekdvXneA=; b=TJjwRo2F/2Mk/kVcqRKt6m8IR64vhQ4B5rSdksx8W8Acl6Th882FPqaB6Y3LUUx24h 1zI+G2qYh272ZN5Alb+f/CaiUViKS666C4Wlez2q6fHq5n+rLYyUwv/F5I/rYJDB6ZcY HsSGX2b+d32tusy3mLGOMGxMdAYX3xIyq7eDtyEq7CIq0oecC4XuVjRqHJ+ZFkHtyLIT tTOqynI6H+/L0JTG9bOfANTyl19Gfl1ljaDDolu/EIkeak9ef86oFEa5YsI9imeT9KQn ySQdEhN5/Dkz8Uxk44bHOdToUZjO4ESzREg2e+7JYmdWPYFed+TSDgDr7onk2WPCcvtI SHxw== MIME-Version: 1.0 References: <20181108160745.24600-1-andrew.burgess@embecosm.com> <20181114145756.GM16539@embecosm.com> <87r2bz67ol.fsf@tromey.com> <20190223205116.GB15942@embecosm.com> In-Reply-To: <20190223205116.GB15942@embecosm.com> From: Jim Wilson Date: Sun, 24 Feb 2019 06:21:00 -0000 Message-ID: Subject: Re: [PATCH] gdb/riscv: Add target description support To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org, Palmer Dabbelt , John Baldwin Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-02/txt/msg00390.txt.bz2 On Sat, Feb 23, 2019 at 12:51 PM Andrew Burgess wrote: > I think we should be OK. The existing CSR feature file should > possibly be deleted, it's not actually used right now. I added the gdb CSR feature file to qemu in my patch. The lack of register numbers means I had to add a table to translate the xml CSR register numbers into actual hardware numbers inside qemu. But this does work. For the subset of CSRs that both qemu and gdb know about, I can print register values from gdb and it works. This is an important feature for people using system qemu to debug bootloaders, and maybe kernels. This is part of the reason I wrote the qemu gdbstub support. For user qemu, we don't allow CSR access of course, other than the ones readable from user space like fcsr. (gdb) target remote :1234 Remote debugging using :1234 0x0000000000001000 in ?? () (gdb) set debug remote 1 (gdb) info registers misa misa Sending packet: $pa0#01...Ack Packet received: 2d11140000000080 Packet p (fetch-register) is supported 0x800000000014112d RV64ACDFIMSU (gdb) I'm not sure what adding registers numbers to the gp and fp xml files will do to the qemu support. I will have to test that. Hopefully there is no effect unless I add the new files to qemu, in which case I might need to update the gdbstub support then to match the new numbers. My understanding is that the qemu copy of the files is supposed to be the same as the gdb copy of these files, but I'm not an expert on this. This is true for several targets that I checked. OpenOCD also has support for sending a csr xml file to gdb, though of course it does not use the gdb version of the file. It has (or creates) ifs own csr xml file. Jim Jim