From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20501 invoked by alias); 18 Jul 2011 08:38:14 -0000 Received: (qmail 20492 invoked by uid 22791); 18 Jul 2011 08:38:13 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_LOW,SARE_FROM_CONS6S X-Spam-Check-By: sourceware.org Received: from mail-yw0-f41.google.com (HELO mail-yw0-f41.google.com) (209.85.213.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jul 2011 08:37:54 +0000 Received: by ywm39 with SMTP id 39so1349119ywm.0 for ; Mon, 18 Jul 2011 01:37:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.111.3 with SMTP id o3mr2080647yam.0.1310978274164; Mon, 18 Jul 2011 01:37:54 -0700 (PDT) Received: by 10.147.32.11 with HTTP; Mon, 18 Jul 2011 01:37:54 -0700 (PDT) In-Reply-To: <522C1DF17AF50042AD8AE87F7887BD3D01E849DCB7@exch.hq.tensilica.com> References: <201107180028.54700.jcmvbkbc@gmail.com> <522C1DF17AF50042AD8AE87F7887BD3D01E849DCB7@exch.hq.tensilica.com> Date: Mon, 18 Jul 2011 08:38:00 -0000 Message-ID: Subject: Re: xtensa: reading privileged special registers From: Max Filippov To: Marc Gauthier Cc: Maxim Grigoriev , "gdb@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00078.txt.bz2 Maxim, Marc, thank you for the answers. > To see privileged registers, you'd want a setup that can e.g. debug a ker= nel or raw hardware. That's my case: I have a gdbserver built into qemu, it has full access to the processor state. > For simplicity, the same register set is generated both for user and kern= el situations, so GDB lists privileged registers even for user processes (e= .g. via gdbserver or Linux native), even though they're not accessible. =A0= Maybe one day we'll fix that. I can try to fix it, but I'm not sure what's the right way. I'd query these registers from within xtensa_pseudo_register_read and fall back to returning 0 if that query fails. Does that makes sense? --=20 Thanks. -- Max