From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id FgJ+E6rN4mJ9EhwAWB0awg (envelope-from ) for ; Thu, 28 Jul 2022 13:55:54 -0400 Received: by simark.ca (Postfix, from userid 112) id 41D571E9ED; Thu, 28 Jul 2022 13:55:54 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=iA19hhbD; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A7B3F1E87E for ; Thu, 28 Jul 2022 13:55:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 49AD43857B9F for ; Thu, 28 Jul 2022 17:55:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49AD43857B9F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1659030953; bh=0BNAQrHmUmrh2o+ndf5DTMyiweQ7CNk71g5LnJe8Cec=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=iA19hhbDyOEfl3wTK+ff290qUnbV+aeP1NAFhompbSDfNgvaClisAS1VGJEhzd7O8 ApH2s67AwZbZ5zTgLM+ERHbQ0rtZCwX1wJhFzXqkvJFWBtTm8LI0LTY2cdf5JMocbv DWR9boUJcuDDIfqwDtRYvbLvVuUdzudyhizgBXxw= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D4E873858D33 for ; Thu, 28 Jul 2022 17:55:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D4E873858D33 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-438-xUPNbqEUOlK-bHK3Bz3uIg-1; Thu, 28 Jul 2022 13:55:30 -0400 X-MC-Unique: xUPNbqEUOlK-bHK3Bz3uIg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0BF8285A586; Thu, 28 Jul 2022 17:55:30 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.16.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBB61492C3B; Thu, 28 Jul 2022 17:55:29 +0000 (UTC) Date: Thu, 28 Jul 2022 10:55:28 -0700 To: "jiangshuai_li" Subject: Re: [PATCH v2] gdb/csky support .reg2 for kernel 4.x and later Message-ID: <20220728105528.7338737f@f35-zws-1> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Kevin Buettner via Gdb-patches Reply-To: Kevin Buettner Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On Wed, 27 Jul 2022 15:29:17 +0800 "jiangshuai_li" wrote: > >> + /* Supply vr0~vr15. */ > >> + for (i = 0; i < 16; i ++) > >> + { > >> + if (gdbarch_register_name (gdbarch, (CSKY_VR0_REGNUM + i))) > >> + { > >> + offset = 16 * i; > >> + regcache->raw_supply (CSKY_VR0_REGNUM + i, > >> + fregs + offset); > >> + } > >> + } > >> + /* Supply fr0~fr15. */ > >> + for (i = 0; i < 16; i ++) > >> + { > >> + if (gdbarch_register_name (gdbarch, (CSKY_FR0_REGNUM + i))) > >> + { > >> + offset = 16 * i; > > > >Are these offsets correct? I.e. do the fr0~fr15 registers use > >the same offsets as vr0~vr15? > > Yes. The bit width of floating-point register is 64bits, and the bit width of vector > register is 128bit. In fr0~fr15 and vr0~vr15, each FRx is the lower 64 bits of > the corresponding VRx. Thanks for the explanation. You might consider adding a comment about this if one doesn't already exist. > >Also, not related to this patch, but while trying to figure this out, > >I found this line in csky-tdep.h - it looks fishy to me since it's > >way bigger than CSKY_MAX_REGS: > > > > CSKY_FR16_REGNUM = 1172, > > Actually, the max regs number should be 1187, but if the gdb stub does not send a > tdesc-xml file to gdb, 253 works. Again, a comment regarding this fact would be nice... Kevin