From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway36.websitewelcome.com (gateway36.websitewelcome.com [192.185.197.22]) by sourceware.org (Postfix) with ESMTPS id 348ED385E016 for ; Sun, 22 Mar 2020 18:45:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 348ED385E016 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 cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 36A35400C6C4A for ; Sun, 22 Mar 2020 13:01:41 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id G5bDjE0gNSl8qG5bDjm0y0; 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=K+2bWp1Ggp0lt8y5kr6BzoulfF5HPR11lGJkJnIFSqA=; b=ykZsZQxET3fKzpmRCF99qgRg9y H1FkrLJpdn8duDPpODJz1a/TW2v6cj4jKjRgfGAM6IIcmQzYIGIulRrEWQ2fZztTHctyLOhg01EBT nP3NRVhbyNHzB/vZQ5wcjRaMm; 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-MZ; Sun, 22 Mar 2020 12:45:27 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 11/22] Use a const dwarf2_section_info in macro reader Date: Sun, 22 Mar 2020 12:45:12 -0600 Message-Id: <20200322184523.28959-12-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-MZ 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: 12 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-23.6 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:30 -0000 This changes the DWARF macro reader to use a const dwarf2_section_info. gdb/ChangeLog 2020-03-22 Tom Tromey * dwarf2/macro.h (dwarf_decode_macros): Make section parameter const. * dwarf2/macro.c (skip_form_bytes, skip_unknown_opcode) (dwarf_decode_macro_bytes, dwarf_decode_macros): Make section parameter const. --- gdb/ChangeLog | 8 ++++++++ gdb/dwarf2/macro.c | 11 ++++++----- gdb/dwarf2/macro.h | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gdb/dwarf2/macro.c b/gdb/dwarf2/macro.c index 01af58de29f..49586399673 100644 --- a/gdb/dwarf2/macro.c +++ b/gdb/dwarf2/macro.c @@ -231,7 +231,7 @@ static const gdb_byte * skip_form_bytes (bfd *abfd, const gdb_byte *bytes, const gdb_byte *buffer_end, enum dwarf_form form, unsigned int offset_size, - struct dwarf2_section_info *section) + const struct dwarf2_section_info *section) { unsigned int bytes_read; @@ -322,7 +322,7 @@ skip_unknown_opcode (unsigned int opcode, const gdb_byte *mac_ptr, const gdb_byte *mac_end, bfd *abfd, unsigned int offset_size, - struct dwarf2_section_info *section) + const struct dwarf2_section_info *section) { unsigned int bytes_read, i; unsigned long arg; @@ -424,7 +424,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile, const gdb_byte *mac_ptr, const gdb_byte *mac_end, struct macro_source_file *current_file, const struct line_header *lh, - struct dwarf2_section_info *section, + const struct dwarf2_section_info *section, int section_is_gnu, int section_is_dwz, unsigned int offset_size, htab_t include_hash) @@ -634,7 +634,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile, LONGEST offset; void **slot; bfd *include_bfd = abfd; - struct dwarf2_section_info *include_section = section; + const struct dwarf2_section_info *include_section = section; const gdb_byte *include_mac_end = mac_end; int is_dwz = section_is_dwz; const gdb_byte *new_mac_ptr; @@ -710,7 +710,8 @@ 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, + buildsym_compunit *builder, + const dwarf2_section_info *section, const struct line_header *lh, unsigned int offset_size, unsigned int offset, int section_is_gnu) { diff --git a/gdb/dwarf2/macro.h b/gdb/dwarf2/macro.h index b92987cf0d1..cb66a6f50cd 100644 --- a/gdb/dwarf2/macro.h +++ b/gdb/dwarf2/macro.h @@ -24,7 +24,7 @@ struct buildsym_compunit; extern void dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile, buildsym_compunit *builder, - dwarf2_section_info *section, + const dwarf2_section_info *section, const struct line_header *lh, unsigned int offset_size, unsigned int offset, -- 2.17.2