From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3975 invoked by alias); 12 May 2002 16:03:48 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3968 invoked from network); 12 May 2002 16:03:46 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 12 May 2002 16:03:46 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 2AF993E08; Sun, 12 May 2002 12:03:55 -0400 (EDT) Message-ID: <3CDE926B.7020508@cygnus.com> Date: Sun, 12 May 2002 09:03:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0rc1) Gecko/20020429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com Cc: gdb@sources.redhat.com Subject: Re: ARM and virtual/raw registers References: <200205121439.PAA00494@cam-mail2.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-05/txt/msg00129.txt.bz2 > rearnsha@arm.com said: > >> See the code below (which is very much a work-in-progress..., so >> don't even expect it to compile ;-) > > > Of course, there was a major flaw in the WIP code I just posted, that > confuses what I was talking about in a significant way. The code for > arm_register_read, should be: (I guessed this :-) > static void > arm_register_read (struct gdbarch *gdbarch, int regno, char *buffer) > { > if (arm_register_info[regno].regcache != ARM_PHYS_NONE) > /* Recover the register directly from the cache. */ > regcache_read (arm_register_info[regno].regcache, buffer); > else > arm_pseudo_register_read (gdbarch, regno, buffer); > } If I had my way, it would read: > static void > arm_register_read (struct gdbarch *gdbarch, struct pseudoreg *pseudo, char *buffer) > { > arm_pseudo_register_read (gdbarch, pseudo, buffer); > } however, that is a long way off (and, to be honest, I suspect the amount of effort required would not give a reasonable return). In the mean time, I recommend: > static void > arm_register_read (struct gdbarch *gdbarch, int regno, char *buffer) > { > gdb_assert (regno >= NUM_REGS && regno < NUM_REGS+NUM_PSEUDO_REGS); > arm_pseudo_register_read (gdbarch, regno, buffer); > } Per, the other e-mail. Keeping the separation is very important. The next person to work on the code won't know if they are looking at a pseudo or raw register. Having debugged code that used this approach, this this is very important. enjoy, Andrew