From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16122 invoked by alias); 29 Jun 2011 01:26:54 -0000 Received: (qmail 16111 invoked by uid 22791); 29 Jun 2011 01:26:54 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_20,MSGID_MULTIPLE_AT,RCVD_IN_DNSWL_LOW,TW_OV,TW_VH X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (94.185.240.25) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 29 Jun 2011 01:26:30 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 29 Jun 2011 02:26:28 +0100 Received: from Terrysh02 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 29 Jun 2011 02:26:25 +0100 From: "Terry Guo" To: Cc: , References: <000901cc34bc$fd1aa6a0$f74ff3e0$@guo@arm.com> In-Reply-To: <000901cc34bc$fd1aa6a0$f74ff3e0$@guo@arm.com> Subject: RE: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703) Date: Wed, 29 Jun 2011 01:26:00 -0000 Message-ID: <000101cc35fb$8d45ff60$a7d1fe20$@guo@arm.com> MIME-Version: 1.0 X-MC-Unique: 111062902262800101 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable 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: 2011-06/txt/msg00433.txt.bz2 Hi, I slightly modified the test case and got the below code: 00008142 : 8142: 250a movs r5, #10 00008144 : 8144: b510 push {r4, lr} 8146: 2300 movs r3, #0 8148: 4c07 ldr r4, [pc, #28] ; (8168 ) 814a: 4908 ldr r1, [pc, #32] ; (816c ) 814c: 4808 ldr r0, [pc, #32] ; (8170 ) 814e: e001 b.n 8154 8150: 505a str r2, [r3, r1] 8152: 3304 adds r3, #4 8154: 185a adds r2, r3, r1 8156: 4282 cmp r2, r0 8158: 591a ldr r2, [r3, r4] 815a: d3f9 bcc.n 8150 815c: 42aa cmp r2, r5 815e: bf8c ite hi 8160: 2500 movhi r5, #0 8162: 2501 movls r5, #1 8164: bd10 pop {r4, pc} 8166: bf00 nop Without Yao's patch, the "b bar" sets the break point at 0x8158. With Yao's patch, the "b test" still sets the break point at 0x814e that is outside the function test body. But the "b bar" sets the break point at 0x814e which is better than 0x8158. IMHO, theoretically function test could have many other different kinds of instruction patterns. So I think it is better to have two enhancements one is Yao's patch which enhances the function thumb_analyze_prologue and make it more accurate, and another one is my patch which ensures the function break point to be always set inside the function body in a more general way. Does this solution sound good? Best regards, Terry