From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12039 invoked by alias); 13 Jul 2011 08:26:22 -0000 Received: (qmail 12013 invoked by uid 22791); 13 Jul 2011 08:26:21 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,RCVD_IN_DNSWL_LOW 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, 13 Jul 2011 08:25:55 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 13 Jul 2011 09:25:52 +0100 Received: from Terrysh02 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 13 Jul 2011 09:25:48 +0100 From: "Terry Guo" To: "'Pedro Alves'" , Cc: "Richard Earnshaw" , "Yao Qi" References: <000901cc34bc$fd1aa6a0$f74ff3e0$@guo@arm.com> <4E0AF7A6.1040800@codesourcery.com> <4E0D8C5B.2090407@arm.com> <201107011046.36650.pedro@codesourcery.com> In-Reply-To: <201107011046.36650.pedro@codesourcery.com> Subject: RE: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703) Date: Wed, 13 Jul 2011 13:21:00 -0000 Message-ID: <000001cc4136$74ec62b0$5ec52810$@guo@arm.com> MIME-Version: 1.0 X-MC-Unique: 111071309255200801 Content-Type: text/plain; charset=UTF-8 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-07/txt/msg00340.txt.bz2 Hi, Sorry for bringing this topic back after so long time. Recently I met a case which I think may have relation with this topic. Please see my embedded comments and if I am wrong please correct me. > Indeed. Well, GDB is not a compiler; it is supposed to be able to > debug buggy code. :-) Turning things upside down, the root question > is > whether there are valid cases where when setting a breakpoint > at "foo", when GDB goes analysing the prologue, GDB should cross > function boundaries into the next function, which would get > broken by Terry's proposal. E.g., say, foo and bar get merged > by some smart compiler/linker: >=20 > foo: > > bar: > > >=20 > I guess setting a break on "foo" should set a breakpoint > on "". Or (another user of prologue skipping,) I have a bunch of interrupt response functions in my source whose layout lo= oks like: ext_isr_100: nop ext_isr_101: nop ext_isr_102: nop bar: If breakpoints of function ext_isr_100, ext_isr_101 and ext_isr_102 are all= set on bar's . Then I think I have no way to figure out which interrupt is tr= igged. For this case, I still think it is better to set breakpoint inside the func= tion body. > stepping into a foo() call should only stop on "". > Or, should GDB be conservative, and never cross the function > body when skipping the prologue the hard way, and only > cross it if debug info says so. >=20 > -- > Pedro Alves Best regards, Terry