From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17719 invoked by alias); 22 Dec 2010 11:27:07 -0000 Received: (qmail 17711 invoked by uid 22791); 22 Dec 2010 11:27:07 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Dec 2010 11:27:02 +0000 Received: (qmail 3036 invoked from network); 22 Dec 2010 11:27:00 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Dec 2010 11:27:00 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA/RFC] mips tracepoint: fix Bug 12013 Date: Wed, 22 Dec 2010 11:27:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.33-29-realtime; KDE/4.4.5; x86_64; ; ) Cc: Kevin Buettner References: <20101221230428.43315eea@mesquite.lan> In-Reply-To: <20101221230428.43315eea@mesquite.lan> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012221126.57873.pedro@codesourcery.com> 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/msg00392.txt.bz2 On Wednesday 22 December 2010 06:04:28, Kevin Buettner wrote: > You might consider implementing a new gdbarch method which provides a > mapping from pseudo register numbers to raw register numbers. The > trace machinery could use such a mapping to find the corresponding raw > register(s) when presented with a pseudo register. I can think of > several potential pitfalls with this approach, but I think the idea is > worth exploring. Such mapping will necessarily be a temporary kludge -- if such a mapping were always possible, then we wouldn't have gdbarch_pseudo_register_read/gdbarch_pseudo_register_read callbacks, but we'd instead have a gdbarch_pseudo_register_to_raw_register callback, or some such. If you're going to add support for collecting pseudo registers, I'd much rather you added a "gdbarch_pseudo_register_collect" callback, that emitted the agent expression bits required to collect whatever gdbarch_pseudo_register_read needs to "read" the pseudo register in question at trace buffer inspection time (tfind mode). In the mips case, you'd end up with only calls to ax_reg in that new callback, it looks to me. (Take a look at dwarf2loc.c:compile_dwarf_to_reg and it's ax_reg call, for example.) -- Pedro Alves