From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21456 invoked by alias); 9 Dec 2017 11:27:23 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 21443 invoked by uid 89); 9 Dec 2017 11:27:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Dec 2017 11:27:22 +0000 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB9BPF7H062003 for ; Sat, 9 Dec 2017 06:27:19 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2erewq82hg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 09 Dec 2017 06:27:17 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 9 Dec 2017 11:24:08 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 9 Dec 2017 11:24:05 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vB9BO5wW1179968; Sat, 9 Dec 2017 11:24:05 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B78E11C054; Sat, 9 Dec 2017 11:18:29 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0876611C050; Sat, 9 Dec 2017 11:18:29 +0000 (GMT) Received: from oc3748833570.ibm.com (unknown [9.164.167.243]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 9 Dec 2017 11:18:28 +0000 (GMT) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id D03C8D80222; Sat, 9 Dec 2017 12:24:04 +0100 (CET) Subject: Re: gdbarch_init, ABI, and registers To: tim@sifive.com (Tim Newsome) Date: Sat, 09 Dec 2017 11:27:00 -0000 From: "Ulrich Weigand" Cc: gdb@sourceware.org (gdb) In-Reply-To: from "Tim Newsome" at Dec 08, 2017 12:03:10 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17120911-0040-0000-0000-000003F82528 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120911-0041-0000-0000-000025FB27EC Message-Id: <20171209112404.D03C8D80222@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-09_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=465 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712090163 X-SW-Source: 2017-12/txt/msg00012.txt.bz2 Tim Newsome wrote: > Am I right in that riscv_gdbarch_init() can differentiate these two cases > based on whether a target description is passed in or not? Eg. if there is > a target description, register structures need to be set up, and if there > isn't then that's not necessary? Yes, exactly. > The problem I was seeing is that registers were showing up which shouldn't. > The reason (as I understand it now) is that I was depending on global > variables in riscv-tdep.c instead of putting them in gdbarch.data. I'll > make that change, and hopefully then everything will be better. I see. Global variables would indeed explain the problem ... Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com