From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113435 invoked by alias); 23 May 2018 04:59:07 -0000 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 Received: (qmail 113215 invoked by uid 89); 23 May 2018 04:59:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.49.124) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 May 2018 04:59:01 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 4E720C4E3 for ; Tue, 22 May 2018 23:59:00 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id LLrYfCizH5CKDLLrYffi8P; Tue, 22 May 2018 23:59:00 -0500 X-Authority-Reason: nr=8 Received: from 174-29-44-154.hlrn.qwest.net ([174.29.44.154]:56108 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fLLrY-003S5D-1e; Tue, 22 May 2018 23:59:00 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 06/42] Move have_line_numbers to buildsym_compunit Date: Wed, 23 May 2018 04:59:00 -0000 Message-Id: <20180523045851.11660-7-tom@tromey.com> In-Reply-To: <20180523045851.11660-1-tom@tromey.com> References: <20180523045851.11660-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fLLrY-003S5D-1e X-Source-Sender: 174-29-44-154.hlrn.qwest.net (bapiya.Home) [174.29.44.154]:56108 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-05/txt/msg00577.txt.bz2 This moves the global have_line_numbers into buildsym_compunit. gdb/ChangeLog 2018-05-22 Tom Tromey * buildsym.c (struct buildsym_compunit) : New member. (have_line_numbers): Remove. (record_line, prepare_for_building, end_symtab_get_static_block) (augment_type_symtab): Update. --- gdb/ChangeLog | 8 ++++++++ gdb/buildsym.c | 16 +++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gdb/buildsym.c b/gdb/buildsym.c index c3961254da..d0dfa4cd02 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -192,6 +192,10 @@ struct buildsym_compunit /* The macro table for the compilation unit whose symbols we're currently reading. */ struct macro_table *m_pending_macros = nullptr; + + /* True if symtab has line number info. This prevents an otherwise + empty symtab from being tossed. */ + bool m_have_line_numbers = false; }; /* The work-in-progress of the compunit we are building. @@ -203,11 +207,6 @@ static struct buildsym_compunit *buildsym_compunit; static struct pending *free_pendings; -/* Non-zero if symtab has line number info. This prevents an - otherwise empty symtab from being tossed. */ - -static int have_line_numbers; - /* The mutable address map for the compilation unit whose symbols we're currently reading. The symtabs' shared blockvector will point to a fixed copy of this. */ @@ -934,7 +933,7 @@ record_line (struct subfile *subfile, int line, CORE_ADDR pc) xmalloc (sizeof (struct linetable) + subfile->line_vector_length * sizeof (struct linetable_entry)); subfile->line_vector->nitems = 0; - have_line_numbers = 1; + buildsym_compunit->m_have_line_numbers = true; } if (subfile->line_vector->nitems + 1 >= subfile->line_vector_length) @@ -1030,7 +1029,6 @@ prepare_for_building (CORE_ADDR start_addr) local_symbols = NULL; local_using_directives = NULL; within_function = 0; - have_line_numbers = 0; context_stack_depth = 0; @@ -1288,7 +1286,7 @@ end_symtab_get_static_block (CORE_ADDR end_addr, int expandable, int required) && pending_blocks == NULL && file_symbols == NULL && global_symbols == NULL - && have_line_numbers == 0 + && buildsym_compunit->m_have_line_numbers == 0 && buildsym_compunit->m_pending_macros == NULL && global_using_directives == NULL) { @@ -1595,7 +1593,7 @@ augment_type_symtab (void) complaint (&symfile_complaints, _("Blocks in a type symtab")); if (buildsym_compunit->m_pending_macros != NULL) complaint (&symfile_complaints, _("Macro in a type symtab")); - if (have_line_numbers) + if (buildsym_compunit->m_have_line_numbers) complaint (&symfile_complaints, _("Line numbers recorded in a type symtab")); -- 2.13.6