From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway22.websitewelcome.com (gateway22.websitewelcome.com [192.185.47.65]) by sourceware.org (Postfix) with ESMTPS id 07822385E001 for ; Sun, 22 Mar 2020 18:45:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 07822385E001 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway22.websitewelcome.com (Postfix) with ESMTP id AAAE1BB3 for ; Sun, 22 Mar 2020 13:45:27 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id G5bDjxjUK1s2xG5bDjfaz6; Sun, 22 Mar 2020 13:45:27 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xYY8OYKMhQu8Bj+IHqIlN11ZfFhOxqGZKrzJo32qY9k=; b=FoAHYjSXtatW/3NfbIHapkFIBd 47oTlQl4gigwimdUroT1I/Z0keQfA0aQV7oNQW+k5M7cSw5Xddv+T7bnH4cRKkJurABLuWRJNFUeg SFAIGiOoLO50C7ZXgc4iXKFWr; Received: from 97-118-117-21.hlrn.qwest.net ([97.118.117.21]:48304 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jG5bD-000LNS-Fd; Sun, 22 Mar 2020 12:45:27 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 10/22] Use a const line_header in macro reader Date: Sun, 22 Mar 2020 12:45:11 -0600 Message-Id: <20200322184523.28959-11-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200322184523.28959-1-tom@tromey.com> References: <20200322184523.28959-1-tom@tromey.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.117.21 X-Source-L: No X-Exim-ID: 1jG5bD-000LNS-Fd X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-117-21.hlrn.qwest.net (bapiya.Home) [97.118.117.21]:48304 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-23.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2020 18:45:29 -0000 This changes the DWARF macro reader to use a const line_header. gdb/ChangeLog 2020-03-22 Tom Tromey * dwarf2/read.c (dwarf_decode_macros): Make "lh" const. * dwarf2/macro.h (dwarf_decode_macros): Constify "lh" parameter. * dwarf2/macro.c (macro_start_file): Constify "lh" parameter. (dwarf_decode_macro_bytes, dwarf_decode_macros): Likewise. --- gdb/ChangeLog | 7 +++++++ gdb/dwarf2/macro.c | 6 +++--- gdb/dwarf2/macro.h | 2 +- gdb/dwarf2/read.c | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gdb/dwarf2/macro.c b/gdb/dwarf2/macro.c index 1f1cca858c1..01af58de29f 100644 --- a/gdb/dwarf2/macro.c +++ b/gdb/dwarf2/macro.c @@ -48,7 +48,7 @@ static struct macro_source_file * macro_start_file (buildsym_compunit *builder, int file, int line, struct macro_source_file *current_file, - struct line_header *lh) + const struct line_header *lh) { /* File name relative to the compilation directory of this source file. */ gdb::unique_xmalloc_ptr file_name = lh->file_file_name (file); @@ -423,7 +423,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile, bfd *abfd, const gdb_byte *mac_ptr, const gdb_byte *mac_end, struct macro_source_file *current_file, - struct line_header *lh, + const struct line_header *lh, struct dwarf2_section_info *section, int section_is_gnu, int section_is_dwz, unsigned int offset_size, @@ -711,7 +711,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile, void dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile, buildsym_compunit *builder, dwarf2_section_info *section, - struct line_header *lh, unsigned int offset_size, + const struct line_header *lh, unsigned int offset_size, unsigned int offset, int section_is_gnu) { bfd *abfd; diff --git a/gdb/dwarf2/macro.h b/gdb/dwarf2/macro.h index 3937c550088..b92987cf0d1 100644 --- a/gdb/dwarf2/macro.h +++ b/gdb/dwarf2/macro.h @@ -25,7 +25,7 @@ struct buildsym_compunit; extern void dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile, buildsym_compunit *builder, dwarf2_section_info *section, - struct line_header *lh, + const struct line_header *lh, unsigned int offset_size, unsigned int offset, int section_is_gnu); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index ca90418e45e..13fa63bff57 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -23045,7 +23045,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, struct dwarf2_per_objfile *dwarf2_per_objfile = cu->per_cu->dwarf2_per_objfile; struct objfile *objfile = dwarf2_per_objfile->objfile; - struct line_header *lh = cu->line_header; + const struct line_header *lh = cu->line_header; unsigned int offset_size = cu->header.offset_size; struct dwarf2_section_info *section; const char *section_name; -- 2.17.2