From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1745 invoked by alias); 31 Jul 2003 15:44:08 -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 1725 invoked from network); 31 Jul 2003 15:44:06 -0000 Received: from unknown (HELO sccrmhc12.comcast.net) (204.127.202.56) by sources.redhat.com with SMTP; 31 Jul 2003 15:44:06 -0000 Received: from lucon.org ([12.234.88.5]) by comcast.net (sccrmhc12) with ESMTP id <20030731154406012001skn9e>; Thu, 31 Jul 2003 15:44:06 +0000 Received: by lucon.org (Postfix, from userid 1000) id A4CF92C4EB; Thu, 31 Jul 2003 15:44:05 +0000 (UTC) Date: Thu, 31 Jul 2003 15:44:00 -0000 From: "H. J. Lu" To: GDB Subject: Re: Does DW_OP_deref work? Message-ID: <20030731154405.GA11592@lucon.org> References: <20030730215421.GA26408@lucon.org> <20030730215612.GB15640@nevyn.them.org> <20030731002306.GA28960@lucon.org> <20030731002753.GA18866@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030731002753.GA18866@nevyn.them.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2003-07/txt/msg00367.txt.bz2 On Wed, Jul 30, 2003 at 08:27:53PM -0400, Daniel Jacobowitz wrote: > On Wed, Jul 30, 2003 at 05:23:06PM -0700, H. J. Lu wrote: > > On Wed, Jul 30, 2003 at 05:56:12PM -0400, Daniel Jacobowitz wrote: > > > On Wed, Jul 30, 2003 at 02:54:21PM -0700, H. J. Lu wrote: > > > > Does DW_OP_deref work correctly with gdb? > > > > > > That depends on the context. Things that use decode_locdesc, probably > > > not. As we find time, things are being converted to the full > > > expression evaluator. Location descriptions and frame bases should > > > work. > > > > I don't think it does. Intel Fortran compiler generartes DW_OP_deref. > > I got > > Location descriptions for parameters may not work fully. Feel free to > fix it, or to investigate the reasons why more thoroughly - search for > LOC_COMPUTED_ARG, but I don't even think we generate those yet. > The problem is gdb has a different idea about DW_OP_deref than Intel compiler. From what I can tell in DWARF 3 draft, DW_OP_deref specifies an address. But dwarf2read.c and gdb doesn't support it at all. There is LOC_REF_ARG, which is an offset from the frame base register. new_symbol in dwarf2read.c has else if (offreg) { if (isderef) { if (basereg != frame_base_reg) dwarf2_complex_location_expr_complaint (); SYMBOL_CLASS (sym) = LOC_REF_ARG; } else { SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg); } } else { SYMBOL_CLASS (sym) = LOC_ARG; } Since DW_OP_deref doesn't use basereg nor frame_base_reg, SYMBOL_CLASS is set to LOC_ARG. DW_OP_deref needs something like LOC_DEREF_ARG, which works on address instead of offset from a base register. H.J.