From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29987 invoked by alias); 2 Mar 2013 01:40:45 -0000 Received: (qmail 29979 invoked by uid 22791); 2 Mar 2013 01:40:44 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RP_MATCHES_RCVD,TW_EG X-Spam-Check-By: sourceware.org Received: from usmamail.tilera.com (HELO USMAMAIL.TILERA.COM) (12.216.194.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 Mar 2013 01:40:40 +0000 Received: from localhost.localdomain (218.26.233.171) by USMAExch2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server (TLS) id 14.0.722.0; Fri, 1 Mar 2013 20:40:39 -0500 Message-ID: <51315892.1020801@tilera.com> Date: Sat, 02 Mar 2013 01:40:00 -0000 From: Jiong Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Pedro Alves CC: Yao Qi , Joel Brobecker , , Walter Lee Subject: [COMMITTED][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> <51244CBA.4000009@codesourcery.com> <512623BE.2030608@tilera.com> <51309167.5050608@redhat.com> <5130B63A.1060304@tilera.com> <5130D06A.9000701@redhat.com> In-Reply-To: <5130D06A.9000701@redhat.com> Content-Type: multipart/mixed; boundary="------------050005060403050903000108" 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-03/txt/msg00049.txt.bz2 --------------050005060403050903000108 Content-Type: text/plain; charset="gb18030"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 740 On 03/01/2013 11:59 PM, Pedro Alves wrote: > "improve" is a "Why?", and subjective. ChangeLogs are objective, and document > the "What" changed. I suggest: > > * tilegx-tdep.c (tilegx_analyze_prologue): Limit bundle reading to END_ADDR. > (tilegx_skip_prologue): Limit prologue analysis to section end. > >> tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) >> { >> - CORE_ADDR func_start; >> + CORE_ADDR func_start, end_pc; >> + struct obj_section *s = NULL; > No need to initialize 's' here, it's unconditionally initialized below. > >> + s = find_pc_section (start_pc); > OK with these changes. > > Thanks. > thanks, all fixed, and committed. -- Regards, Jiong. Wang Tilera Corporation. --------------050005060403050903000108 Content-Type: text/x-patch; name="committed.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="committed.patch" Content-length: 2022 Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.15197 diff -u -r1.15197 ChangeLog --- gdb/ChangeLog 1 Mar 2013 21:18:18 -0000 1.15197 +++ gdb/ChangeLog 2 Mar 2013 01:31:04 -0000 @@ -1,3 +1,10 @@ +2013-03-01 Jiong Wang + Pedro Alves + + * tilegx-tdep.c (tilegx_analyze_prologue): Limit bundle reading + to END_ADDR. + (tilegx_skip_prologue): Limit prologue analysis to section end. + 2013-03-01 Jan Kratochvil * dwarf2loc.c (call_site_find_chain_1): New variable save_callee_pc, Index: gdb/tilegx-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/tilegx-tdep.c,v retrieving revision 1.9 diff -u -r1.9 tilegx-tdep.c --- gdb/tilegx-tdep.c 1 Mar 2013 10:45:28 -0000 1.9 +++ gdb/tilegx-tdep.c 2 Mar 2013 01:31:29 -0000 @@ -433,6 +433,8 @@ if (instbuf_size > size_on_same_page) instbuf_size = size_on_same_page; + + instbuf_size = min (instbuf_size, (end_addr - next_addr)); instbuf_start = next_addr; status = safe_frame_unwind_memory (next_frame, instbuf_start, @@ -745,7 +747,8 @@ static CORE_ADDR tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) { - CORE_ADDR func_start; + CORE_ADDR func_start, end_pc; + struct obj_section *s; /* This is the preferred method, find the end of the prologue by using the debugging information. */ @@ -758,10 +761,16 @@ return max (start_pc, post_prologue_pc); } + /* Don't straddle a section boundary. */ + s = find_pc_section (start_pc); + end_pc = start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES; + if (s != NULL) + end_pc = min (end_pc, obj_section_endaddr (s)); + /* Otherwise, try to skip prologue the hard way. */ return tilegx_analyze_prologue (gdbarch, start_pc, - start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES, + end_pc, NULL, NULL); } --------------050005060403050903000108--