From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16919 invoked by alias); 20 Feb 2013 04:11:53 -0000 Received: (qmail 16889 invoked by uid 22791); 20 Feb 2013 04:11:50 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MIME_CHARSET_FARAWAY,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_EG X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Feb 2013 04:11:45 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1U8120-0000fu-9M from Yao_Qi@mentor.com ; Tue, 19 Feb 2013 20:11:44 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 19 Feb 2013 20:11:43 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Tue, 19 Feb 2013 20:11:42 -0800 Message-ID: <51244CBA.4000009@codesourcery.com> Date: Wed, 20 Feb 2013 04:11:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jiong Wang CC: Joel Brobecker , , Walter Lee Subject: Re: [RFC/TileGX 2/6] simplify the handling of skip prologue for plt stub References: <50F91516.6010204@tilera.com> <20130118131511.GF3564@adacore.com> <50F9664D.2090008@tilera.com> <511F0FE9.8030300@codesourcery.com> <51243991.4040304@tilera.com> In-Reply-To: <51243991.4040304@tilera.com> Content-Type: text/plain; charset="gb18030"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2013-02/txt/msg00526.txt.bz2 On 02/20/2013 10:48 AM, Jiong Wang wrote: > gdb/ChangeLog: > > * tilegx-tdep.c (tilegx_skip_prologue): when prefetching ^^^^ "When" > multiple instruction bundles, check section boundary > instead of page boundary. Is it possible that the section layouts on two pages? I mean, if is possible that NEXT_ADDR is within section FOO and page A, but the end of section FOO is within page A + 1. If this is true, we need to check to the min (page boundary, section boundary), otherwise, we don't have to worry about it. > --- > gdb/tilegx-tdep.c | 12 ++++++++---- > 1 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c > index 2c4e349..f8a6255 100644 > --- a/gdb/tilegx-tdep.c > +++ b/gdb/tilegx-tdep.c > @@ -424,15 +424,18 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch, > /* Retrieve the next instruction. */ > if (next_addr - instbuf_start >= instbuf_size) > { > - /* Figure out how many bytes to fetch. Don't span a page > + /* Figure out how many bytes to fetch. Don't span a section > boundary since that might cause an unnecessary memory > error. */ > - unsigned int size_on_same_page = 4096 - (next_addr & 4095); > + unsigned int size_on_same_section; > + struct obj_section *s = find_pc_section(next_addr); A space is needed between find_pc_section and "(". A blank line is needed here as well. > + gdb_assert(s != NULL); A space is needed between gdb_assert and "(". I have no other comments on this patch. It looks good now, but it still needs a review and approval from maintainers. -- Yao (ÆëÒ¢)