From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17369 invoked by alias); 15 Mar 2011 16:26:21 -0000 Received: (qmail 17342 invoked by uid 22791); 15 Mar 2011 16:26:19 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Mar 2011 16:26:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C73612BAFC4; Tue, 15 Mar 2011 12:26:12 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id heooVfQ9foET; Tue, 15 Mar 2011 12:26:12 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9AB5E2BAFA7; Tue, 15 Mar 2011 12:26:12 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id E1B3B1459B0; Tue, 15 Mar 2011 20:26:09 +0400 (RET) Date: Tue, 15 Mar 2011 16:49:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: "gdb-patches@sourceware.org" Subject: Re: [RFA] frame.c (find_frame_sal): Check return value of get_frame_function. Message-ID: <20110315162609.GM31264@adacore.com> References: <4D719288.6050301@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D719288.6050301@vmware.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00794.txt.bz2 > 2011-03-04 Michael Snyder > > * frame.c (find_frame_sal): Check return value of get_frame_function. I think that the change is correct, but I'm not completely sure, so a second pair of eyes would be nice. My thinking: It is entirely plausible that get_next_frame (frame) returns a frame with a PC for which there is no debugging info. In that case, it's the same as not having line info. > Index: frame.c > =================================================================== > RCS file: /cvs/src/src/gdb/frame.c,v > retrieving revision 1.291 > diff -u -p -r1.291 frame.c > --- frame.c 7 Jan 2011 19:36:17 -0000 1.291 > +++ frame.c 5 Mar 2011 01:27:39 -0000 > @@ -1892,15 +1892,16 @@ find_frame_sal (struct frame_info *frame > sym = inline_skipped_symbol (inferior_ptid); > > init_sal (sal); > - if (SYMBOL_LINE (sym) != 0) > + if (sym && SYMBOL_LINE (sym) != 0) > { > sal->symtab = SYMBOL_SYMTAB (sym); > sal->line = SYMBOL_LINE (sym); > } > else > - /* If the symbol does not have a location, we don't know where > - the call site is. Do not pretend to. This is jarring, but > - we can't do much better. */ > + /* If the symbol does not have a location (or we didn't find a > + symbol), we don't know where the call site is. Do not > + pretend to. This is jarring, but we can't do much > + better. */ > sal->pc = get_frame_pc (frame); > > return; -- Joel