From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11466 invoked by alias); 11 Jan 2013 04:52:50 -0000 Received: (qmail 11445 invoked by uid 22791); 11 Jan 2013 04:52:49 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO 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; Fri, 11 Jan 2013 04:52:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id ED2522E5A0; Thu, 10 Jan 2013 23:52:39 -0500 (EST) 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 I+EaNapbKrSr; Thu, 10 Jan 2013 23:52:39 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 81E4A2E0E8; Thu, 10 Jan 2013 23:52:39 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B8F3EC3755; Fri, 11 Jan 2013 08:52:33 +0400 (RET) Date: Fri, 11 Jan 2013 04:52:00 -0000 From: Joel Brobecker To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Don't check PST is NULL in read_symtab Message-ID: <20130111045233.GK6143@adacore.com> References: <1357869440-23451-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1357869440-23451-1-git-send-email-yao@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2013-01/txt/msg00211.txt.bz2 > The "method" read_symtab of 'struct partial_symtab" is called in this > way, > > (*pst->read_symtab) (objfile, pst); > > so argument PST can't be NULL. I confirmed it using a quick grep. > I'll re-indent dwarf2_psymtab_to_symtab when check this patch in. FWIW, you can also do the re-indent, and then post two parallel patches: One is the actual patch, the second is a sub-part of the actual patch where whitespace differences are ignored. That's usually how I verify that my reformatting did not cause any intentional changes... > 2013-01-11 Yao Qi > > * dbxread.c (dbx_psymtab_to_symtab_1): Don't check PST is NULL. > * dwarf2read.c (dwarf2_psymtab_to_symtab): Likewise. > * mdebugread.c (mdebug_psymtab_to_symtab): Likewise. > * xcoffread.c (xcoff_psymtab_to_symtab_1): Likewise. If PST must not be NULL, I think that it should be documented in psympriv.h. I am also wondering whether an assertion would be useful or not; maybe not, just thinking out loud. Tom and Doug are more involved in this area, so they'll probably have a more definitive answer. -- Joel