From patchwork Mon Jun 6 21:33:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 12822 Received: (qmail 120176 invoked by alias); 6 Jun 2016 21:34:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 119935 invoked by uid 89); 6 Jun 2016 21:34:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, FSL_HELO_HOME, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=asection, Hx-languages-length:2289, sk:b244332 X-HELO: gproxy8-pub.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8-pub.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Mon, 06 Jun 2016 21:33:46 +0000 Received: (qmail 14436 invoked by uid 0); 6 Jun 2016 21:33:44 -0000 Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy8.mail.unifiedlayer.com with SMTP; 6 Jun 2016 21:33:44 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id 3ZZg1t0232f2jeq01ZZjoQ; Mon, 06 Jun 2016 15:33:44 -0600 X-Authority-Analysis: v=2.1 cv=ecGuId0H c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=-N9Dh3nx2ZYA:10 a=pD_ry4oyNxEA:10 a=zstS-IiYAAAA:8 a=uoiy64n7IkxXPk9uSeUA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from [65.128.48.199] (port=46482 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bA29U-0006Xd-Ja; Mon, 06 Jun 2016 15:33:40 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 3/6] Comment out some unused overlay code Date: Mon, 6 Jun 2016 15:33:29 -0600 Message-Id: <1465248812-23902-4-git-send-email-tom@tromey.com> In-Reply-To: <1465248812-23902-1-git-send-email-tom@tromey.com> References: <1465248812-23902-1-git-send-email-tom@tromey.com> X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 65.128.48.199 authed with tom+tromey.com} X-Exim-ID: 1bA29U-0006Xd-Ja X-Source-Sender: (bapiya.Home) [65.128.48.199]:46482 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== This patch comments out some unneeded initializations in overlay code in symfile.c. Normally I would not comment out code like this, but the uses of "size" in these functions are commented out. If you'd prefer I could just delete the comments. 2016-06-06 Tom Tromey * symfile.c (simple_overlay_update_1): Comment out initialization of "size". (simple_overlay_update): Likewise. --- gdb/ChangeLog | 6 ++++++ gdb/symfile.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fbd7051..9839c55 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2016-06-06 Tom Tromey + * symfile.c (simple_overlay_update_1): Comment out initialization + of "size". + (simple_overlay_update): Likewise. + +2016-06-06 Tom Tromey + * tui/tui-winsource.c (tui_show_source_line): Use ATTRIBUTE_UNUSED. * tui/tui-io.c (tui_puts): Use ATTRIBUTE_UNUSED. diff --git a/gdb/symfile.c b/gdb/symfile.c index b244332..5de2cbf 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3630,14 +3630,14 @@ simple_read_overlay_table (void) static int simple_overlay_update_1 (struct obj_section *osect) { - int i, size; + int i; bfd *obfd = osect->objfile->obfd; asection *bsect = osect->the_bfd_section; struct gdbarch *gdbarch = get_objfile_arch (osect->objfile); int word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - size = bfd_get_section_size (osect->the_bfd_section); + /* size = bfd_get_section_size (osect->the_bfd_section); */ for (i = 0; i < cache_novlys; i++) if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) @@ -3706,11 +3706,11 @@ simple_overlay_update (struct obj_section *osect) ALL_OBJSECTIONS (objfile, osect) if (section_is_overlay (osect)) { - int i, size; + int i; bfd *obfd = osect->objfile->obfd; asection *bsect = osect->the_bfd_section; - size = bfd_get_section_size (bsect); + /* size = bfd_get_section_size (bsect); */ for (i = 0; i < cache_novlys; i++) if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)