From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21745 invoked by alias); 18 Jul 2003 19:13:38 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21738 invoked from network); 18 Jul 2003 19:13:37 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 18 Jul 2003 19:13:37 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h6IJDbH29745 for ; Fri, 18 Jul 2003 15:13:37 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h6IJDaI02006 for ; Fri, 18 Jul 2003 15:13:36 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h6IJDZ504226; Fri, 18 Jul 2003 15:13:36 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 70B442CA3E; Fri, 18 Jul 2003 15:20:49 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16152.18577.291423.463717@localhost.redhat.com> Date: Fri, 18 Jul 2003 19:13:00 -0000 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa:dwarf2] Use frame_unwind_address_in_block In-Reply-To: <3F15DE03.9000104@redhat.com> References: <3F15DE03.9000104@redhat.com> X-SW-Source: 2003-07/txt/msg00345.txt.bz2 Andrew Cagney writes: > Hello, > > This, finally, is the tweak to the dwarf2-unwind code, to use the > frame's address-in-block, instead of the frame's PC to select the CFI > info. Two test cases stop failing: > > 1gdb.base/corefile.exp: backtrace in corefile.exp FAIL PASS > 2gdb.base/gdb1250.exp: backtrace from abort KFAIL PASS > > Ok for the mainline? > Ok to pull something equivalent into 6.0 branch? seems sane. elena > > Andrew > 2003-07-16 Andrew Cagney > > * dwarf2-frame.c (dwarf2_frame_sniffer): Use > frame_unwind_address_in_block, instead of frame_pc_unwind. > (dwarf2_frame_cache): Ditto. > > Index: dwarf2-frame.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v > retrieving revision 1.9 > diff -u -r1.9 dwarf2-frame.c > --- dwarf2-frame.c 16 Jul 2003 22:29:13 -0000 1.9 > +++ dwarf2-frame.c 16 Jul 2003 23:13:29 -0000 > @@ -491,15 +491,12 @@ > done for "normal" frames and not for resume-type frames (signal > handlers, sentinel frames, dummy frames). > > - We don't do what GCC's does here (yet). It's not clear how > - reliable the method is. There's also a problem with finding the > - right FDE; see the comment in dwarf_frame_p. If dwarf_frame_p > - selected this frame unwinder because it found the FDE for the > - next function, using the adjusted return address might not yield > - a FDE at all. The problem isn't specific to DWARF CFI; other > - unwinders loose in similar ways. Therefore it's probably > - acceptable to leave things slightly broken for now. */ > - fs->pc = frame_pc_unwind (next_frame); > + frame_unwind_address_in_block does just this. > + > + It's not clear how reliable the method is though - there is the > + potential for the register state pre-call being different to that > + on return. */ > + fs->pc = frame_unwind_address_in_block (next_frame); > > /* Find the correct FDE. */ > fde = dwarf2_frame_find_fde (&fs->pc); > @@ -710,15 +707,11 @@ > const struct frame_unwind * > dwarf2_frame_sniffer (struct frame_info *next_frame) > { > - CORE_ADDR pc = frame_pc_unwind (next_frame); > - /* The way GDB works, this function can be called with PC just after > - the last instruction of the function we're supposed to return the > - unwind methods for. In that case we won't find the correct FDE; > - instead we find the FDE for the next function, or we won't find > - an FDE at all. There is a possible solution (see the comment in > - dwarf2_frame_cache), GDB doesn't pass us enough information to > - implement it. */ > - if (dwarf2_frame_find_fde (&pc)) > + /* Grab an address that is guarenteed to reside somewhere within the > + function. frame_pc_unwind(), for a no-return next function, can > + end up returning something past the end of this function's body. */ > + CORE_ADDR block_addr = frame_unwind_address_in_block (next_frame); > + if (dwarf2_frame_find_fde (&block_addr)) > return &dwarf2_frame_unwind; > > return NULL;