From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16485 invoked by alias); 14 Feb 2003 14:58:55 -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 16471 invoked from network); 14 Feb 2003 14:58:54 -0000 Received: from unknown (HELO localhost.redhat.com) (193.41.215.82) by 172.16.49.205 with SMTP; 14 Feb 2003 14:58:54 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id AD19D3CE5; Fri, 14 Feb 2003 15:58:55 +0100 (CET) Message-ID: <3E4D042F.3060102@redhat.com> Date: Fri, 14 Feb 2003 14:58:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb@sources.redhat.com Subject: Re: frame_register_unwind(): "frame != NULL" assertion failure References: <1030213212349.ZM2427@localhost.localdomain> <20030213212904.GA14115@nevyn.them.org> <1030213213526.ZM2489@localhost.localdomain> <1030213214819.ZM2541@localhost.localdomain> <1030213232706.ZM8198@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00233.txt.bz2 > Here's one possible "fix" for the assertion failure. I've come to the > conclusion that the real culprit is get_next_frame(), but, unfortunately, > the rest of gdb is not yet ready for it to return the sentinel frame. > (See the comment in the patch for more info.) So, until it is, I propose > that we use this hack... > > * frame.c (create_sentinel_frame): Make static. Add forward > declaration. > (frame_register_unwind): Add hack for converting NULL frames > into a sentinel frame. I think, if there is going to be a hac, then it should be in read_next_frame_reg(). However, can you please first investigate modifying the start of mips_init_extra_frame_info() where it does: proc_desc = get_next_frame (fci) ? ..... to, when get_next_frame(fci) is null, call: find_proc_desc (get_frame_pc (fci), fci, 1); that is the current, and not prev frame. Andrew > Index: frame.c > =================================================================== > RCS file: /cvs/src/src/gdb/frame.c,v > retrieving revision 1.66 > diff -u -p -r1.66 frame.c > --- frame.c 2 Feb 2003 20:31:43 -0000 1.66 > +++ frame.c 13 Feb 2003 23:20:22 -0000 > @@ -39,6 +39,8 @@ > #include "command.h" > #include "gdbcmd.h" > > +static struct frame_info * create_sentinel_frame (struct regcache *regcache); > + > /* Flag to indicate whether backtraces should stop at main. */ > > static int backtrace_below_main; > @@ -180,6 +182,15 @@ frame_register_unwind (struct frame_info > gdb_assert (realnump != NULL); > /* gdb_assert (bufferp != NULL); */ > > + /* Note: kevinb/2003-02-13: This is a hack. The problem is that > + get_next_frame() can return NULL when it really ought to be > + returning the sentinel frame. So, when we detect frame == NULL, > + just use the sentinel frame instead. > + FIXME: Remove this hack once get_next_frame() has been fixed > + to never return NULL. */ > + if (frame == NULL) > + frame = create_sentinel_frame (current_regcache); > + > /* NOTE: cagney/2002-11-27: A program trying to unwind a NULL frame > is broken. There is always a frame. If there, for some reason, > isn't, there is some pretty busted code as it should have > @@ -429,7 +440,7 @@ frame_map_regnum_to_name (int regnum) > > /* Create a sentinel frame. */ > > -struct frame_info * > +static struct frame_info * > create_sentinel_frame (struct regcache *regcache) > { > struct frame_info *frame = FRAME_OBSTACK_ZALLOC (struct frame_info); > >