From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93802 invoked by alias); 28 Jun 2016 20:56:15 -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 93786 invoked by uid 89); 28 Jun 2016 20:56:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gproxy4-pub.mail.unifiedlayer.com Received: from gproxy4-pub.mail.unifiedlayer.com (HELO gproxy4-pub.mail.unifiedlayer.com) (69.89.23.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Tue, 28 Jun 2016 20:56:04 +0000 Received: (qmail 23029 invoked by uid 0); 28 Jun 2016 20:56:02 -0000 Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy4.mail.unifiedlayer.com with SMTP; 28 Jun 2016 20:56:02 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id CLvv1t00s2f2jeq01Lvy9g; Tue, 28 Jun 2016 14:56:01 -0600 X-Authority-Analysis: v=2.1 cv=OPe0g0qB 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=7XZj0uCbPdcA:10 a=pD_ry4oyNxEA:10 a=pGLkceISAAAA:8 a=zstS-IiYAAAA:8 a=qV3JghmqLFydxKw1RPMA:9 a=6kGIvZw6iX1k4Y-7sg4_:22 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from [75.171.172.174] (port=49776 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bI032-0001oq-Kr; Tue, 28 Jun 2016 14:55:56 -0600 From: Tom Tromey To: Yao Qi Cc: Tom Tromey , "gdb-patches\@sourceware.org" Subject: Re: [RFA 3/6] Comment out some unused overlay code References: <1465248812-23902-1-git-send-email-tom@tromey.com> <1465248812-23902-4-git-send-email-tom@tromey.com> Date: Tue, 28 Jun 2016 20:56:00 -0000 In-Reply-To: (Yao Qi's message of "Tue, 28 Jun 2016 15:36:12 +0100") Message-ID: <871t3huj6u.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 75.171.172.174 authed with tom+tromey.com} X-Exim-ID: 1bI032-0001oq-Kr X-Source-Sender: (bapiya) [75.171.172.174]:49776 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-06/txt/msg00474.txt.bz2 >>>>> "Yao" == Yao Qi writes: Yao> I am inclined to remove these commented-out statements. Sounds good. Here's the new patch. Tom commit 8c3dd5d738cbb40684d1210392ae540799906a84 Author: Tom Tromey Date: Mon Jun 6 13:45:59 2016 -0600 Remove some unused overlay code This patch removes some unneeded initializations in overlay code in symfile.c. It also deletes some old commented-out code. 2016-06-06 Tom Tromey * symfile.c (simple_overlay_update_1): Remove initialization of "size", and commented-out code. (simple_overlay_update): Likewise. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eacc3fa..ab545c8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2016-06-06 Tom Tromey + + * symfile.c (simple_overlay_update_1): Remove initialization + of "size", and commented-out code. + (simple_overlay_update): Likewise. + 2016-06-28 Tom Tromey * tui/tui-winsource.c (tui_show_source_line): Use getcurx. diff --git a/gdb/symfile.c b/gdb/symfile.c index d29e96c..7d7843e 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3584,25 +3584,22 @@ 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); 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) - /* && cache_ovly_table[i][OSIZE] == size */ ) + && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)) { read_target_long_array (cache_ovly_table_base + i * word_size, (unsigned int *) cache_ovly_table[i], 4, word_size, byte_order); if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) - && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) - /* && cache_ovly_table[i][OSIZE] == size */ ) + && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)) { osect->ovly_mapped = cache_ovly_table[i][MAPPED]; return 1; @@ -3660,15 +3657,13 @@ 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); 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) - /* && cache_ovly_table[i][OSIZE] == size */ ) + && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)) { /* obj_section matches i'th entry in ovly_table. */ osect->ovly_mapped = cache_ovly_table[i][MAPPED]; break; /* finished with inner for loop: break out. */