From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12007 invoked by alias); 11 Jan 2013 14:46:54 -0000 Received: (qmail 11921 invoked by uid 22791); 11 Jan 2013 14:46:53 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,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 14:46:44 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TtfsU-0006Wd-FK from Yao_Qi@mentor.com ; Fri, 11 Jan 2013 06:46:38 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 11 Jan 2013 06:46:38 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Fri, 11 Jan 2013 06:46:37 -0800 Message-ID: <50F025B5.2060203@codesourcery.com> Date: Fri, 11 Jan 2013 14:46:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Joel Brobecker CC: Subject: Re: [PATCH] Don't check PST is NULL in read_symtab References: <1357869440-23451-1-git-send-email-yao@codesourcery.com> <20130111045233.GK6143@adacore.com> In-Reply-To: <20130111045233.GK6143@adacore.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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/msg00220.txt.bz2 On 01/11/2013 12:52 PM, Joel Brobecker wrote: > 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... I see. Below is the patch to indent the code. Thanks for your suggestion, Joel. > >> >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. > IMO, we don't need an assertion to check PST, because the function is used in this way, (*pst->read_symtab) (objfile, pst); which guarantees PST cant' be NULL. "PST" here is analogous to "this" object in C++, and we don't have to document function read_symtab that "this object must not be NULL". -- Yao (齐尧) gdb: 2013-01-11 Yao Qi * dwarf2read.c (dwarf2_psymtab_to_symtab): Code indent. --- gdb/dwarf2read.c | 62 +++++++++++++++++++++++++++--------------------------- 1 files changed, 31 insertions(+), 31 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index f2d6a0a..2cefee9 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -6410,45 +6410,45 @@ locate_pdi_sibling (const struct die_reader_specs *reader, static void dwarf2_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst) { - if (pst->readin) + if (pst->readin) + { + warning (_("bug: psymtab for %s is already read in."), + pst->filename); + } + else + { + if (info_verbose) { - warning (_("bug: psymtab for %s is already read in."), - pst->filename); + printf_filtered (_("Reading in symbols for %s..."), + pst->filename); + gdb_flush (gdb_stdout); } - else - { - if (info_verbose) - { - printf_filtered (_("Reading in symbols for %s..."), - pst->filename); - gdb_flush (gdb_stdout); - } - /* Restore our global data. */ - dwarf2_per_objfile = objfile_data (objfile, dwarf2_objfile_data_key); + /* Restore our global data. */ + dwarf2_per_objfile = objfile_data (objfile, dwarf2_objfile_data_key); - /* If this psymtab is constructed from a debug-only objfile, the - has_section_at_zero flag will not necessarily be correct. We - can get the correct value for this flag by looking at the data - associated with the (presumably stripped) associated objfile. */ - if (objfile->separate_debug_objfile_backlink) - { - struct dwarf2_per_objfile *dpo_backlink - = objfile_data (objfile->separate_debug_objfile_backlink, - dwarf2_objfile_data_key); + /* If this psymtab is constructed from a debug-only objfile, the + has_section_at_zero flag will not necessarily be correct. We + can get the correct value for this flag by looking at the data + associated with the (presumably stripped) associated objfile. */ + if (objfile->separate_debug_objfile_backlink) + { + struct dwarf2_per_objfile *dpo_backlink + = objfile_data (objfile->separate_debug_objfile_backlink, + dwarf2_objfile_data_key); - dwarf2_per_objfile->has_section_at_zero - = dpo_backlink->has_section_at_zero; - } + dwarf2_per_objfile->has_section_at_zero + = dpo_backlink->has_section_at_zero; + } - dwarf2_per_objfile->reading_partial_symbols = 0; + dwarf2_per_objfile->reading_partial_symbols = 0; - psymtab_to_symtab_1 (pst); + psymtab_to_symtab_1 (pst); - /* Finish up the debug error message. */ - if (info_verbose) - printf_filtered (_("done.\n")); - } + /* Finish up the debug error message. */ + if (info_verbose) + printf_filtered (_("done.\n")); + } process_cu_includes (); } -- 1.7.7.6