From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27158 invoked by alias); 11 Jan 2013 01:57:55 -0000 Received: (qmail 27147 invoked by uid 22791); 11 Jan 2013 01:57:54 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_BJ X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Jan 2013 01:57:48 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TtTsR-0000jr-EP from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 10 Jan 2013 17:57:47 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 10 Jan 2013 17:57:46 -0800 Received: from qiyao.dyndns.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Thu, 10 Jan 2013 17:57:46 -0800 From: Yao Qi To: Subject: [PATCH] Don't check PST is NULL in read_symtab Date: Fri, 11 Jan 2013 01:57:00 -0000 Message-ID: <1357869440-23451-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes 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/msg00206.txt.bz2 Hi, 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. This patch is to remove the checking that PST is NULL. I'll re-indent dwarf2_psymtab_to_symtab when check this patch in. Rebuild GDB for all targets. Is it OK? gdb: 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. --- gdb/dbxread.c | 3 --- gdb/dwarf2read.c | 3 --- gdb/mdebugread.c | 3 --- gdb/xcoffread.c | 3 --- 4 files changed, 0 insertions(+), 12 deletions(-) diff --git a/gdb/dbxread.c b/gdb/dbxread.c index ebe4237..8305a5d 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2406,9 +2406,6 @@ dbx_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst) struct cleanup *old_chain; int i; - if (!pst) - return; - if (pst->readin) { fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. " diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e2088f1..f2d6a0a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -6410,8 +6410,6 @@ locate_pdi_sibling (const struct die_reader_specs *reader, static void dwarf2_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst) { - if (pst != NULL) - { if (pst->readin) { warning (_("bug: psymtab for %s is already read in."), @@ -6451,7 +6449,6 @@ dwarf2_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst) if (info_verbose) printf_filtered (_("done.\n")); } - } process_cu_includes (); } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 856ca9d..0be1095 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -278,9 +278,6 @@ static char *mdebug_next_symbol_text (struct objfile *); static void mdebug_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst) { - if (!pst) - return; - if (info_verbose) { printf_filtered (_("Reading in symbols for %s..."), pst->filename); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 9fe8621..f4dcae2 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1860,9 +1860,6 @@ xcoff_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst) static void xcoff_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst) { - if (!pst) - return; - if (pst->readin) { fprintf_unfiltered -- 1.7.7.6