From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30120 invoked by alias); 11 Sep 2009 18:48:18 -0000 Received: (qmail 30112 invoked by uid 22791); 11 Sep 2009 18:48:18 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Sep 2009 18:48:08 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8BIm4RN024235; Fri, 11 Sep 2009 14:48:04 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8BIm4SD032024; Fri, 11 Sep 2009 14:48:04 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n8BIm3aq031362; Fri, 11 Sep 2009 14:48:03 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 93EF6378188; Fri, 11 Sep 2009 12:48:02 -0600 (MDT) From: Tom Tromey To: dje@google.com (Doug Evans) Cc: gdb-patches@sourceware.org Subject: Re: [RFC] better dwarf checking for values on the stack References: <20090910231912.0733A843B9@localhost> Reply-To: Tom Tromey Date: Fri, 11 Sep 2009 18:48:00 -0000 In-Reply-To: <20090910231912.0733A843B9@localhost> (Doug Evans's message of "Thu, 10 Sep 2009 16:19:11 -0700 (PDT)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00326.txt.bz2 >>>>> "Doug" == Doug Evans writes: Doug> 2009-09-10 Doug Evans Doug> Add better checking for values on stack. Doug> * dwarf2expr.h (dwarf_value_location): Rename DWARF_VALUE_STACK to Doug> DWARF_VALUE_DWARF_STACK, all uses updated. Doug> New enum DWARF_VALUE_MEMORY_STACK. Doug> * dwarf2expr.c (execute_stack_op, case DW_OP_fbreg): Mark location Doug> as DWARF_VALUE_MEMORY_STACK. Doug> (execute_stack_op, case DW_OP_call_frame_cfa): Ditto. Doug> (execute_stack_op, cases DW_OP_deref, DW_OP_deref_size): Mark Doug> location as DWARF_VALUE_MEMORY. Doug> (execute_stack_op, case DW_OP_piece): Remove unused addr_or_regnum. 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: DW_OP_call_frame_cfa DW_OP_deref DW_OP_call_frame_cfa DW_OP_drop After the drop, ctx->location will be DWARF_VALUE_MEMORY_STACK. However, this is incorrect. Tom