From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28195 invoked by alias); 1 Oct 2003 16:03:20 -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 28172 invoked from network); 1 Oct 2003 16:03:19 -0000 Received: from unknown (HELO artax.karlin.mff.cuni.cz) (195.113.31.125) by sources.redhat.com with SMTP; 1 Oct 2003 16:03:19 -0000 Received: by artax.karlin.mff.cuni.cz (Postfix, from userid 29129) id C52B33FB0; Wed, 1 Oct 2003 18:03:18 +0200 (CEST) Date: Wed, 01 Oct 2003 16:03:00 -0000 From: Josef Zlomek To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: Problem with location lists and variables on stack Message-ID: <20031001160318.GA17042@artax.karlin.mff.cuni.cz> References: <20031001144330.GA11707@artax.karlin.mff.cuni.cz> <20031001144937.GA4613@nevyn.them.org> <20031001154415.GA15387@artax.karlin.mff.cuni.cz> <20031001155417.GA13942@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031001155417.GA13942@nevyn.them.org> User-Agent: Mutt/1.5.4i X-SW-Source: 2003-10/txt/msg00032.txt.bz2 > > > > Let the local variables and (some) arguments be addressed using stack pointer, > > > > for example x86-64 architecture with variables addressed using %rsp. > > > > The address emitted for variables located on stack by my new patch is always > > > > DW_OP_fbreg + constant. > > > > > > > > When I was testing the emitted debug info with mainline GDB I found that > > > > GDB probably does not adjust addresses of variables when stack pointer changes > > > > (like because of "pushq" instruction) if using location lists. > > > > I think GDB should adjust the address of %rsp addressed variables according to > > > > change of %rsp (probably DWARF2 sais so for DW_OP_fbreg). I think it is a > > > > better solution than emitting new locations to location list for all variables > > > > located on stack after each "push" and "pop" which would cause too large debug > > > > info. > > > > > > > > When I looked to gdb/dwarf2loc.c I see there: > > > > /* FIXME: cagney/2003-03-26: This code should be using > > > > get_frame_base_address(), and then implement a dwarf2 specific > > > > this_base method. */ > > > > Probably this is related to my problem. > > > > > > The FIXME is a cleanliness problem. We do evaluate DW_AT_frame_base, > > > so it _ought_ to work. > > > > > > > I tested it on attached C file, assembler with debug info and x86-64 binary > > > > is attached too. > > > > > > Do you suppose you could produce an x86 (ia32) testcase? I don't have > > > x86-64 hardware available yet. The debug info looks right so I'd like > > > to get my fingers into the problem. > > > > Here is the x86 assembler. > > Thanks. I'll get back to you... Thanks. > Blast! Location list support for paramaters (as opposed to locals) was > added to GDB after 6.0 branched, and I never thought to move it over. > It's too late now, so it will have to go in 6.0.1. No problem. Josef