From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22055 invoked by alias); 15 May 2002 20:01:35 -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 22034 invoked from network); 15 May 2002 20:01:32 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 15 May 2002 20:01:32 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id D1C183D61; Wed, 15 May 2002 16:01:40 -0400 (EDT) Message-ID: <3CE2BEA4.6050809@cygnus.com> Date: Wed, 15 May 2002 13:01: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: Elena Zannoni , gdb@sources.redhat.com Subject: Re: REGISTER_BYTE() and pseudos References: <200205151807.TAA18580@cam-mail2.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-05/txt/msg00183.txt.bz2 > OK, I see what you are doing. Basically, if a pseudo maps onto a real > register somewhere in the regcache, you return the address of that. > > However, what should be done if the pseudo doesn't exist as a single > entry, or if it is a manipulation of a real register? For example, on the > ARM, the CPSR may be just a few bits retrieved from the PC. > > Also, what would you do if you needed to address two non-adjacent > registers? Return ``not_lval''. I think that case can go in the too hard basket. First, I don't know if GDB's ``struct value'' system is rich enough to describe a value split across [disjoint] registers and memory. Second, even if it was, the current get_saved_register() doesn't make that knowledge available. An interface more like value_of_register() would be better. BTW, this code: > OK, I'll have another look. > > The bit I'm worried about though is if we call something like > generic_get_saved_register for a pseudo and we hit a call_dummy frame. > The code in there goes: > > if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) > { > if (lval) /* found it in a CALL_DUMMY frame */ > *lval = not_lval; > if (raw_buffer) > memcpy (raw_buffer, > generic_find_dummy_frame (frame->pc, frame->frame) + > REGISTER_BYTE (regnum), > REGISTER_RAW_SIZE (regnum)); > return; > > Which will try to look up the pseudo in the buffer even if it isn't there. Reveals a problem with the patch: http://sources.redhat.com/ml/gdb-patches/2002-05/msg00416.html For the moment a custom get_saved_register will get around this. Andrew