From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7359 invoked by alias); 6 Jul 2007 19:01:35 -0000 Received: (qmail 7349 invoked by uid 22791); 6 Jul 2007 19:01:34 -0000 X-Spam-Check-By: sourceware.org Received: from b.mail.sonic.net (HELO b.mail.sonic.net) (64.142.19.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Jul 2007 19:01:29 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l66J1P7k011095; Fri, 6 Jul 2007 12:01:25 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Fri, 6 Jul 2007 12:01:25 -0700 (PDT) Message-ID: <24208.12.7.175.2.1183748485.squirrel@webmail.sonic.net> In-Reply-To: References: <24899.12.7.175.2.1183676791.squirrel@webmail.sonic.net> Date: Fri, 06 Jul 2007 19:01:00 -0000 Subject: Re: [patch] stack.c, check return value of lookup_symbol From: msnyder@sonic.net To: "Jim Blandy" Cc: msnyder@sonic.net, gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070706120125_49884" 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: 2007-07/txt/msg00113.txt.bz2 ------=_20070706120125_49884 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 677 > > msnyder@sonic.net writes: >> Since it's known that lookup_symbol can return NULL, my first impulse >> was to call gdb_assert. That still might be the right thing to do, >> since it indicates some sort of internal fault -- but it seems to >> me that it isn't necessarily fatal, and simply doing nothing is an >> option... > > gdb_assert calls internal_error, so it's not going to sweep GDB out > from under the user. And the situation we're talking about here would > be one where we found a symbol in a block, and then looked up that > name in that block and didn't find the symbol. I definitely want to > see an internal error if that happens. OK then -- how's this? ------=_20070706120125_49884 Content-Type: text/plain; name="nsym.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="nsym.txt" Content-length: 754 2007-07-05 Michael Snyder * stack.c (print_frame_args): Check return value of lookup_symbol (Coverity). Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.149 diff -p -r1.149 stack.c *** stack.c 18 Jun 2007 18:28:29 -0000 1.149 --- stack.c 5 Jul 2007 22:57:59 -0000 *************** print_frame_args (struct symbol *func, s *** 247,252 **** --- 247,253 ---- struct symbol *nsym; nsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), b, VAR_DOMAIN, NULL, NULL); + gdb_assert (nsym); if (SYMBOL_CLASS (nsym) == LOC_REGISTER) { /* There is a LOC_ARG/LOC_REGISTER pair. This means ------=_20070706120125_49884--