From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 397 invoked by alias); 1 Jun 2003 04:29:43 -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 389 invoked from network); 1 Jun 2003 04:29:43 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 1 Jun 2003 04:29:43 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h514TgH21514 for ; Sun, 1 Jun 2003 00:29:42 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h514TfT17926; Sun, 1 Jun 2003 00:29:41 -0400 Received: from dot.sfbay.redhat.com (dot.sfbay.redhat.com [172.16.24.7]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h514Te017310; Sat, 31 May 2003 21:29:40 -0700 Received: (from rth@localhost) by dot.sfbay.redhat.com (8.11.6/8.11.6) id h514RjA12175; Sat, 31 May 2003 21:27:45 -0700 X-Authentication-Warning: dot.sfbay.redhat.com: rth set sender to rth@redhat.com using -f Date: Sun, 01 Jun 2003 04:29:00 -0000 From: Richard Henderson To: Andrew Cagney Cc: gdb@sources.redhat.com Subject: [RFA] fix dwarf2 unwind of pc Message-ID: <20030601042745.GA12157@redhat.com> Reply-To: rth@twiddle.net References: <20030601013551.GA12120@redhat.com> <3ED96961.2030401@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ED96961.2030401@redhat.com> User-Agent: Mutt/1.4i X-SW-Source: 2003-06/txt/msg00003.txt.bz2 On Sat, May 31, 2003 at 10:48:01PM -0400, Andrew Cagney wrote: > The loss of control is likely from a dud return address (used for > setting the return breakpoint) being computed when the the code is first > stepped into dummy(). Indeed, a problem with the new dwarf2 unwinder. Neither of the targets Mark tested have the return address in a register. Ok? r~ * dwarf2-frame.c (dwarf2_frame_cache): Handle retaddr_column not overlapping PC_REGNUM. Index: dwarf2-frame.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v retrieving revision 1.1 diff -c -p -d -r1.1 dwarf2-frame.c *** dwarf2-frame.c 31 May 2003 19:18:05 -0000 1.1 --- dwarf2-frame.c 1 Jun 2003 04:26:17 -0000 *************** dwarf2_frame_cache (struct frame_info *n *** 550,558 **** cache->reg[regnum] = fs->regs.reg[reg]; } ! /* Stored the location of the return addess. */ ! if (fs->retaddr_column < fs->regs.num_regs) cache->reg[PC_REGNUM] = fs->regs.reg[fs->retaddr_column]; do_cleanups (old_chain); --- 550,570 ---- cache->reg[regnum] = fs->regs.reg[reg]; } ! /* Store the location of the return addess. If the return address ! column (adjusted) is not the same as gdb's PC_REGNUM, then this ! implies a copy from the ra column register. */ ! if (fs->retaddr_column < fs->regs.num_regs ! && fs->regs.reg[fs->retaddr_column].how != REG_UNSAVED) cache->reg[PC_REGNUM] = fs->regs.reg[fs->retaddr_column]; + else + { + reg = DWARF2_REG_TO_REGNUM (fs->retaddr_column); + if (reg != PC_REGNUM) + { + cache->reg[PC_REGNUM].loc.reg = reg; + cache->reg[PC_REGNUM].how = REG_SAVED_REG; + } + } do_cleanups (old_chain);