From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28134 invoked by alias); 18 Jul 2011 01:12:46 -0000 Received: (qmail 28123 invoked by uid 22791); 18 Jul 2011 01:12:45 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SARE_TOCC_CONS6s X-Spam-Check-By: sourceware.org Received: from mail-fx0-f54.google.com (HELO mail-fx0-f54.google.com) (209.85.161.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jul 2011 01:12:27 +0000 Received: by fxe4 with SMTP id 4so5184797fxe.13 for ; Sun, 17 Jul 2011 18:12:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.6.198 with SMTP id a6mr9008354faa.126.1310951546178; Sun, 17 Jul 2011 18:12:26 -0700 (PDT) Received: by 10.223.26.198 with HTTP; Sun, 17 Jul 2011 18:12:26 -0700 (PDT) In-Reply-To: <201107180028.54700.jcmvbkbc@gmail.com> References: <201107180028.54700.jcmvbkbc@gmail.com> Date: Mon, 18 Jul 2011 01:12:00 -0000 Message-ID: Subject: Re: xtensa: reading privileged special registers From: Maxim Grigoriev To: Max Filippov Cc: gdb@sourceware.org, Marc Gauthier Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 X-SW-Source: 2011-07/txt/msg00074.txt.bz2 Hello Max, Please, help us to precisely identify what exactly do you experience by answering some questions: 1) Did you apply a source overlay for your specific hardware ? Xtensa is a configurable and expendable architecture. It's impossible to maintain the data base of all supported Xtensa processors because it's potentially infinite. Many Tensilica customers keep their hardware secret even from Tensilica, but all the tools still work. So for every instance of Xtensa processor, a set of source overlay files have to be provided. By default, so-called Xtensa FSF processor (we call it config) is supported by FSF tools. It is checked-in into FSF tree. 2) What Xtensa processor do you work with ( if it's not a secret ) ? What privileged registers do you have problems with ? Thanks, -- Maxim On Sun, Jul 17, 2011 at 1:28 PM, Max Filippov wrote: > Hello. > > I'm trying to read privileged SRs from a remote gdbserver by the gdb conf= igured for the elf target. All gdb versions that I've tried (6.8, 7.2 and 7= .3) return 0 for those registers. > Running gdb under gdb showed that reading those registers ends inside xte= nsa_pseudo_register_read in the following block: > > [...] > =A0/* We have to find out how to deal with priveleged registers. > =A0 =A0 Let's treat them as pseudo-registers, but we cannot read/write th= em. =A0*/ > > =A0else if (regnum < gdbarch_tdep (gdbarch)->a0_base) > =A0 =A0{ > =A0 =A0 =A0buffer[0] =3D (gdb_byte)0; > =A0 =A0 =A0buffer[1] =3D (gdb_byte)0; > =A0 =A0 =A0buffer[2] =3D (gdb_byte)0; > =A0 =A0 =A0buffer[3] =3D (gdb_byte)0; > =A0 =A0} > [...] > > The question is is there any reason we cannot read/write them with the el= f target? > What would be the right way to make privileged SRs available to gdb? > > Thanks. > -- Max >