From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8642 invoked by alias); 11 Nov 2004 00:09:40 -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 8609 invoked from network); 11 Nov 2004 00:09:30 -0000 Received: from unknown (HELO pippin.tausq.org) (64.81.244.94) by sourceware.org with SMTP; 11 Nov 2004 00:09:30 -0000 Received: by pippin.tausq.org (Postfix, from userid 1000) id 3FD71CE7E2; Wed, 10 Nov 2004 16:09:33 -0800 (PST) Date: Thu, 11 Nov 2004 03:09:00 -0000 From: Randolph Chung To: gdb@sources.redhat.com Subject: Re: dwarf2 and frame bases Message-ID: <20041111000933.GP15714@tausq.org> Reply-To: Randolph Chung References: <20041110235149.GO15714@tausq.org> <20041110235649.GA741@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041110235649.GA741@nevyn.them.org> X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-11/txt/msg00103.txt.bz2 > '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? but the unwound copy is wrong too... :) i explain more below.. > What's the actual PC at the time of the error? Is it in the prologue? first insn of the prologue. > Epilogue? What's the stack pointer - at the time of setting the > watchpoint, and at the time of the error? well, the frame_base dwarf descriptor points to r3, but the stack pointer is actually r30. r3 is the frame pointer. when compiled without optimization, gcc emits these prologues/epilogues for each function: prologue: stw rp, -14(%sp) copy %r3, %r1 copy %r30, %r3 stw,ma %r1, 80(%sp) /* or other frame size) epilogue: ldw -14(%r3), %rp ldw,mb -80(%sp), %r3 (remember also that on hppa the frame grows towards higher addresses) so in the function body, r3 is the frame base. 'b' is at *(r3 + 8) r3 is also a callee-saved register, so its contents are undefined on entry to the function. so even if you were to unwind r3, you won't get the right frame base. randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/