From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8261 invoked by alias); 23 Nov 2009 14:17:30 -0000 Received: (qmail 8253 invoked by uid 22791); 23 Nov 2009 14:17:29 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Mon, 23 Nov 2009 14:16:24 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id 70CD0B0054; Mon, 23 Nov 2009 09:16:22 -0500 (EST) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id nANEGMC8023800; Mon, 23 Nov 2009 09:16:22 -0500 Date: Tue, 24 Nov 2009 08:56:00 -0000 From: Jack Howarth To: Jan Kratochvil Cc: gdb@sourceware.org, Dodji Seketeli Subject: Re: check for valid location of zero length dwarf block forms? Message-ID: <20091123141622.GA23363@bromo.med.uc.edu> References: <20091121034258.GA6166@bromo.med.uc.edu> <20091122110259.GA9268@host0.dyn.jankratochvil.net> <20091122202148.GA12580@bromo.med.uc.edu> <20091123124226.GA7742@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091123124226.GA7742@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00177.txt.bz2 On Mon, Nov 23, 2009 at 01:42:26PM +0100, Jan Kratochvil wrote: > On Sun, 22 Nov 2009 21:21:48 +0100, Jack Howarth wrote: > > Is this being done in the following code from dwarf2out.c? > > Forwarded it to Dodji: > > On Mon, 23 Nov 2009 10:57:55 +0100, Dodji Seketeli wrote: > # My understanding is that the code of resolve_addr makes sure that a > # DW_OP_addr or a DW_AT_const_value does _NOT_ point to a "junk" address. > # I.E. the function makes sure that if the address does not point to either a > # const string in .rodata or an address in the current CU (for SYMBOL_REFs), > # then: > # - the location list containing the DW_OP_addr is removed > # or > # - the DW_AT_const_value is replaced by a DW_AT_location pointing to an > # empty location expression. > > > > The problem we have on darwin is that, while Apple will likely fix dsymutils > > for Xcode 3.2 (Snow Leopard), it probably will remain broken for Tiger and > > Leopard's devtools. So it would be helpful to find some way to suppress this > > offending dwarf code on darwin in the cases were the variable has a valid location > > but is zero length or doesn't have a location. > > I think you can put some workaround > to dwarf2out.c (output_die ) but I did not try it. > > > Regards, > Jan Jon, Are you referring to the section in output_die() of gcc/dwarf2out.c which has... case dw_val_class_loc: size = size_of_locs (AT_loc (a)); /* Output the block length for this list of location operations. */ dw2_asm_output_data (constant_size (size), size, "%s", name); output_loc_sequence (AT_loc (a)); break; I wonder if I could just do something like... case dw_val_class_loc: size = size_of_locs (AT_loc (a)); /* Output the block length for this list of location operations. */ dw2_asm_output_data (constant_size (size), size, "%s", name); if (dwarf_strict && (size == 0)) break; else output_loc_sequence (AT_loc (a)); break; Since only darwin currently defaults to dwarf_strict. Jack