From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25918 invoked by alias); 29 Jun 2011 08:00:38 -0000 Received: (qmail 25910 invoked by uid 22791); 29 Jun 2011 08:00:37 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jun 2011 08:00:17 +0000 Received: (qmail 5133 invoked from network); 29 Jun 2011 08:00:16 -0000 Received: from unknown (HELO ?192.168.0.101?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Jun 2011 08:00:16 -0000 Message-ID: <4E0ADB87.20807@codesourcery.com> Date: Wed, 29 Jun 2011 08:00:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Terry Guo CC: gdb-patches@sourceware.org, pedro@codesourcery.com Subject: Re: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703) References: <000901cc34bc$fd1aa6a0$f74ff3e0$@guo@arm.com> <000101cc35fb$8d45ff60$a7d1fe20$@guo@arm.com> <4E0AB9B3.8060104@codesourcery.com> <000501cc362a$2e7f9020$8b7eb060$@guo@arm.com> In-Reply-To: <000501cc362a$2e7f9020$8b7eb060$@guo@arm.com> Content-Type: text/plain; charset=UTF-8 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: 2011-06/txt/msg00437.txt.bz2 On 06/29/2011 03:00 PM, Terry Guo wrote: > Hi, > > Here is my case. As for stack backtrace, I wonder whether it works for the function that only contains one single instruction and function that doesn't even has a valid prologue. I also saw that current prologue analyzer cannot handle all cases, so I try to avoid this in a more general way. > > register unsigned long guard asm("r5"); > > void bar (void); > void test (void) __attribute__((naked)); attribute naked on the ARM, AVR, MCORE, RX and SPU ports indicates that the specified function does not need prologue/epilogue sequences generated by the compiler, so there is no prologue in function test. Of course, prologue analyzer can't help here. However, this test case is not a correct program, because code after "test" is unknown. If you put correct epilogue in "test" to make it either return to main, or jump to bar, prologue analyzer can handle it correctly. Looks this test case is invalid. We have to find a valid/correct case to show gdb's bug on setting breakpoint, and your patch could fix this bug. -- Yao (齐尧)