From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28163 invoked by alias); 10 Nov 2004 23:57:04 -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 28103 invoked from network); 10 Nov 2004 23:56:58 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 10 Nov 2004 23:56:58 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CS2KX-0000D6-QX; Wed, 10 Nov 2004 18:56:49 -0500 Date: Wed, 10 Nov 2004 23:58:00 -0000 From: Daniel Jacobowitz To: Randolph Chung Cc: gdb@sources.redhat.com Subject: Re: dwarf2 and frame bases Message-ID: <20041110235649.GA741@nevyn.them.org> Mail-Followup-To: Randolph Chung , gdb@sources.redhat.com References: <20041110235149.GO15714@tausq.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041110235149.GO15714@tausq.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-11/txt/msg00101.txt.bz2 On Wed, Nov 10, 2004 at 03:51:49PM -0800, Randolph Chung wrote: > The "recurse" test has been failing on hppa for a long time. I think I > finally understand what is happening, but not sure of a fix.... > > the symptom of the problem is that watchpoints fail during recursion: > > (gdb) watch b > Watchpoint 2: b > (gdb) continue > Continuing. > Watchpoint 2: b > > Old value = 0 > New value = 10 > recurse (a=10) at ../../../gdb-cvs/gdb/testsuite/gdb.base/recurse.c:19 > 19 b *= recurse (a - 1); > (gdb) continue > Continuing. > Error evaluating expression for watchpoint 2 > Cannot access memory at address 0x8 > Watchpoint 2 deleted. > DW_AT_frame_base : 1 byte block: 53 (DW_OP_reg3) > what seems to happen is that, to implement the watchpoint, we singlestep > through the code and evaluate 'b' at every insn. If we do this in the > prologue, we fail. The dwarf location expression handler tries to get > the frame base by using DW_AT_frame_base, which points to register 3, > but register 3 is not yet initialized in the prologue, so when we read > it, we get garbage. argh... > > I don't know enough about dwarf to know how this is supposed to be > evaluated. Can someone please shed some light on this? 'b' is in some particular frame. It's up the stack from the current frame at the time of that error message, I get. So we should be unwinding reg3 and using the unwound copy to determine the value of b. Is the unwinding breaking? What's the actual PC at the time of the error? Is it in the prologue? Epilogue? What's the stack pointer - at the time of setting the watchpoint, and at the time of the error? -- Daniel Jacobowitz