From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32674 invoked by alias); 11 Sep 2009 21:19:17 -0000 Received: (qmail 32659 invoked by uid 22791); 11 Sep 2009 21:19:16 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Sep 2009 21:19:12 +0000 Received: from wpaz9.hot.corp.google.com (wpaz9.hot.corp.google.com [172.24.198.73]) by smtp-out.google.com with ESMTP id n8BLJAlV025954 for ; Fri, 11 Sep 2009 14:19:10 -0700 Received: from yxe31 (yxe31.prod.google.com [10.190.2.31]) by wpaz9.hot.corp.google.com with ESMTP id n8BLIskh012610 for ; Fri, 11 Sep 2009 14:19:08 -0700 Received: by yxe31 with SMTP id 31so1880185yxe.29 for ; Fri, 11 Sep 2009 14:19:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.169.18 with SMTP id r18mr5749559ybe.111.1252703948064; Fri, 11 Sep 2009 14:19:08 -0700 (PDT) In-Reply-To: References: <20090910231912.0733A843B9@localhost> Date: Fri, 11 Sep 2009 21:19: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/msg00340.txt.bz2 On Fri, Sep 11, 2009 at 11:48 AM, Tom Tromey wrote: >>>>>> "Doug" =3D=3D Doug Evans writes: > > Doug> 2009-09-10 =A0Doug Evans =A0 > Doug> =A0 Add better checking for values on stack. > Doug> =A0 * dwarf2expr.h (dwarf_value_location): Rename DWARF_VALUE_STACK= to > Doug> =A0 DWARF_VALUE_DWARF_STACK, all uses updated. > Doug> =A0 New enum DWARF_VALUE_MEMORY_STACK. > Doug> =A0 * dwarf2expr.c (execute_stack_op, case DW_OP_fbreg): Mark locat= ion > Doug> =A0 as DWARF_VALUE_MEMORY_STACK. > Doug> =A0 (execute_stack_op, case DW_OP_call_frame_cfa): Ditto. > Doug> =A0 (execute_stack_op, cases DW_OP_deref, DW_OP_deref_size): Mark > Doug> =A0 location as DWARF_VALUE_MEMORY. > Doug> =A0 (execute_stack_op, case DW_OP_piece): Remove unused addr_or_reg= num. > > I think the tracking idea is sound, but I think this implementation has > a flaw. > > It seems to me that the inferior-stack-ness of a value must be an > attribute carried alongside the value on the dwarf stack. > > Here's a really bogus example that I hope still shows what I mean: > > =A0DW_OP_call_frame_cfa > =A0DW_OP_deref > =A0DW_OP_call_frame_cfa > =A0DW_OP_drop > > After the drop, ctx->location will be DWARF_VALUE_MEMORY_STACK. > However, this is incorrect. > > Tom > Yeah, I was wondering about this. [It's what prompted my question on IRC.]