From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23234 invoked by alias); 19 Dec 2010 12:16:29 -0000 Received: (qmail 23221 invoked by uid 22791); 19 Dec 2010 12:16:28 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_CP,TW_EG,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Dec 2010 12:16:23 +0000 Received: by wyj26 with SMTP id 26so2180050wyj.0 for ; Sun, 19 Dec 2010 04:16:21 -0800 (PST) Received: by 10.216.176.138 with SMTP id b10mr6064379wem.75.1292760979501; Sun, 19 Dec 2010 04:16:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.182.206 with HTTP; Sun, 19 Dec 2010 04:15:59 -0800 (PST) In-Reply-To: <201012191039.oBJAdNBN010655@glazunov.sibelius.xs4all.nl> References: <201012191039.oBJAdNBN010655@glazunov.sibelius.xs4all.nl> From: Hui Zhu Date: Sun, 19 Dec 2010 12:16:00 -0000 Message-ID: Subject: Re: [RFA/RFC] mips tracepoint: fix Bug 12013 To: gdb-patches@sourceware.org Cc: Mark Kettenis Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00357.txt.bz2 On Sun, Dec 19, 2010 at 18:39, Mark Kettenis wrot= e: >> From: Hui Zhu >> Date: Sun, 19 Dec 2010 16:35:59 +0800 >> >> http://sourceware.org/bugzilla/show_bug.cgi?id=3D12013 >> >> This bug make mips tracepoint cannot trace the backtrace. >> >> This patch to fix this issue with a directly way just remove the >> decline of access to the raw register names. >> >> If you think it's not OK. =A0What about add a new interface to gdbarch >> to access to the raw register names. > > It is a common trick to return an empty register name for a (raw) > register to hide the register from the user. =A0So I don't think this > diff is ok, since the goal obviously is to hide the raw registers in > mips in favour of the pseudo registers. Could you tell me what this hide for? I didn't find who get some advantage form this part? > > I'd say the proper way forward is to teach the trace code to handle > pseudo registers. void regcache_cooked_read (struct regcache *regcache, int regnum, gdb_byte *buf) { gdb_assert (regnum >=3D 0); gdb_assert (regnum < regcache->descr->nr_cooked_registers); if (regnum < regcache->descr->nr_raw_registers) regcache_raw_read (regcache, regnum, buf); else if (regcache->readonly_p && regnum < regcache->descr->nr_cooked_registers && regcache->register_valid_p[regnum]) /* Read-only register cache, perhaps the cooked value was cached? */ memcpy (buf, register_buffer (regcache, regnum), regcache->descr->sizeof_register[regnum]); else gdbarch_pseudo_register_read (regcache->descr->gdbarch, regcache, regnum, buf); } For now, even if gdb doesn't how to handle pseudo, it put it to gdbarch. I need add a new interface to gdbarch to handle it if we really need. Thanks, Hui > >> 2010-12-19 =A0Hui Zhu =A0 >> >> =A0 =A0 =A0 * mips-tdep.c (mips_register_name): Remove the check. >> =A0 =A0 =A0 (mips_print_registers_info): Remove the gdb_assert. >> >