From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3928 invoked by alias); 17 Jul 2011 20:29:15 -0000 Received: (qmail 3920 invoked by uid 22791); 17 Jul 2011 20:29:14 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=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-fx0-f54.google.com (HELO mail-fx0-f54.google.com) (209.85.161.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 17 Jul 2011 20:29:00 +0000 Received: by fxe4 with SMTP id 4so5007284fxe.13 for ; Sun, 17 Jul 2011 13:28:59 -0700 (PDT) Received: by 10.223.4.136 with SMTP id 8mr9000718far.16.1310934539381; Sun, 17 Jul 2011 13:28:59 -0700 (PDT) Received: from octofox.metropolis ([188.134.19.124]) by mx.google.com with ESMTPS id h10sm481926fai.43.2011.07.17.13.28.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 13:28:57 -0700 (PDT) From: Max Filippov To: Maxim Grigoriev Subject: xtensa: reading privileged special registers Date: Sun, 17 Jul 2011 20:29:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.34.9-69.fc13.x86_64; KDE/4.5.5; x86_64; ; ) Cc: gdb@sourceware.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201107180028.54700.jcmvbkbc@gmail.com> 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/msg00073.txt.bz2 Hello. I'm trying to read privileged SRs from a remote gdbserver by the gdb configured 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 xtensa_pseudo_register_read in the following block: [...] /* We have to find out how to deal with priveleged registers. Let's treat them as pseudo-registers, but we cannot read/write them. */ else if (regnum < gdbarch_tdep (gdbarch)->a0_base) { buffer[0] = (gdb_byte)0; buffer[1] = (gdb_byte)0; buffer[2] = (gdb_byte)0; buffer[3] = (gdb_byte)0; } [...] The question is is there any reason we cannot read/write them with the elf target? What would be the right way to make privileged SRs available to gdb? Thanks. -- Max