From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7144 invoked by alias); 12 Sep 2009 00:40:09 -0000 Received: (qmail 7134 invoked by uid 22791); 12 Sep 2009 00:40:09 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_14,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Sep 2009 00:40:02 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id n8C0dx5X026651 for ; Sat, 12 Sep 2009 01:40:00 +0100 Received: from ywh41 (ywh41.prod.google.com [10.192.8.41]) by wpaz33.hot.corp.google.com with ESMTP id n8C0dvxl017677 for ; Fri, 11 Sep 2009 17:39:57 -0700 Received: by ywh41 with SMTP id 41so2156587ywh.19 for ; Fri, 11 Sep 2009 17:39:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.238.4 with SMTP id l4mr5983463ybh.177.1252715997176; Fri, 11 Sep 2009 17:39:57 -0700 (PDT) In-Reply-To: References: <20090910231912.0733A843B9@localhost> Date: Sat, 12 Sep 2009 00:40:00 -0000 Message-ID: Subject: Re: [RFC] better dwarf checking for values on the stack From: Doug Evans To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2009-09/txt/msg00352.txt.bz2 On Fri, Sep 11, 2009 at 4:23 PM, Doug Evans wrote: > On Fri, Sep 11, 2009 at 2:19 PM, Doug Evans wrote: >>>Tom Tromey wrote: >>>[...] >>> It seems to me that the inferior-stack-ness of a value must be an >>> attribute carried alongside the value on the dwarf stack. >>>[...] >> >> Yeah, I was wondering about this. =A0[It's what prompted my question on = IRC.] > > How about this? > > 2009-09-11 =A0Doug Evans =A0 > > =A0 =A0 =A0 =A0* dwarf2expr.h (dwarf_value_location): Add more comments d= escribing > =A0 =A0 =A0 =A0enum values. > =A0 =A0 =A0 =A0(struct dwarf_stack_value): New struct. > =A0 =A0 =A0 =A0(struct dwarf_expr_context): Change type of `stack' from C= ORE_ADDR* > =A0 =A0 =A0 =A0to structd dwarf_stack_value*. > =A0 =A0 =A0 =A0(struct dwarf_expr_piece): Move `v.value' into its own str= uct, v.expr, > =A0 =A0 =A0 =A0all uses updated. > =A0 =A0 =A0 =A0Add v.expr.in_stack_memory. > =A0 =A0 =A0 =A0(dwarf_expr_push): Update declaration. > =A0 =A0 =A0 =A0(dwarf_expr_fetch_in_stack_memory): Declare. > =A0 =A0 =A0 =A0* dwarf2expr.c (dwarf_expr_grow_stack): Update calculation= of > =A0 =A0 =A0 =A0size of stack value. > =A0 =A0 =A0 =A0(dwarf_expr_push): New arg in_stack_memory, all callers up= dated. > =A0 =A0 =A0 =A0(dwarf_expr_fetch_in_stack_memory): New function. > =A0 =A0 =A0 =A0(add_piece): Set in_stack_memory for non-literal values. > =A0 =A0 =A0 =A0(execute_stack_op, case DW_OP_fbreg): Call dwarf_expr_push= ourselves, > =A0 =A0 =A0 =A0mark value as in stack memory. > =A0 =A0 =A0 =A0(execute_stack_op, case DW_OP_call_frame_cfa): Ditto. > =A0 =A0 =A0 =A0(execute_stack_op, cases DW_OP_swap, DW_OP_rot): Update ty= pe of > =A0 =A0 =A0 =A0dwarf stack value. > =A0 =A0 =A0 =A0* dwarf2loc.c (read_pieced_value): Call read_stack for val= ues known > =A0 =A0 =A0 =A0to be on the program's stack. > =A0 =A0 =A0 =A0(dwarf2_evaluate_loc_desc, case DWARF_VALUE_MEMORY): Call > =A0 =A0 =A0 =A0set_value_stack only for objects known to be in stack memo= ry. > =A0 =A0 =A0 =A0* dwarf2-frame.c (execute_stack_op): New arg initial_in_st= ack_memory, > =A0 =A0 =A0 =A0all callers updated. > For completeness' sake ... Yeah, I don't propagate in_stack_memory for DW_OP_dup, etc. etc. If ya like the basic idea, I'll add in all the other details.