From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11778 invoked by alias); 9 Jul 2002 22:47:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11771 invoked from network); 9 Jul 2002 22:47:35 -0000 Received: from unknown (HELO www.dberlin.org) (138.88.46.115) by sources.redhat.com with SMTP; 9 Jul 2002 22:47:35 -0000 Received: by www.dberlin.org (Postfix, from userid 503) id 22B75181BE80; Tue, 9 Jul 2002 18:47:35 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by www.dberlin.org (Postfix) with ESMTP id 7764818006C2; Tue, 9 Jul 2002 18:47:29 -0400 (EDT) Date: Tue, 09 Jul 2002 16:00:00 -0000 From: Daniel Berlin To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA]: LOC_COMPUTED + abstracted dwarf2 evaluator, again In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-1.6 required=5.0 tests=IN_REP_TO,NO_MX_FOR_FROM,AWL version=2.31 X-Spam-Level: X-SW-Source: 2002-07/txt/msg00170.txt.bz2 On 9 Jul 2002, Jim Blandy wrote: > > Daniel Berlin writes: > > > > + if (ctx->in_reg) > > > > + { > > > > + store_typed_address (VALUE_CONTENTS_RAW (retval), > > > > + SYMBOL_TYPE (var), dwarf_expr_fetch (ctx, 0)); > > > > + VALUE_LVAL (retval) = not_lval; > > > > + } > > > > + else > > > > + { > > > > + result = dwarf_expr_fetch (ctx, 0); > > > > + VALUE_LAZY (retval) = 1; > > > > + VALUE_ADDRESS (retval) = result; > > > > + } > > > > > > This looks wrong. If evaluating the Dwarf location expression yields > > > an `in_reg' result, shouldn't the value be an lval_register, with its > > > the address set to the register number? > > > > This doesn't work, in reality. > > > > IIRC, you run into problems dereferencing the value, because it > > thinks it *only* lives in a register (IE it's not really a memory > > location), regardless of what you tell it. > > > > I may be misremembering the exact reason why, but I know things don't work > > if you do this, even though it would seem to make sense (I had originally > > written it to do what you suggest). > > The `in_reg' case needs to call value_from_register, not explicitly > set the value's `lval' and `address' fields, as I implied. Calling > value_from_register will take care of finding registers that have been > spilled to the stack. As you wish, but this is what i had tried next (or was it a cousin of value_from_register). I ran into problems with pointers vs non-pointer types, and pass by reference vs pass by value. I had to special case pointers and references, and do something slightly difference or else it wouldn't let us deref them. Though it looks like value_from_register handles this, so maybe it was a sibling. I wish i still had the old code to look at. > >