From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10355 invoked by alias); 13 May 2006 19:44:20 -0000 Received: (qmail 10346 invoked by uid 22791); 13 May 2006 19:44:19 -0000 X-Spam-Check-By: sourceware.org Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO duck.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 13 May 2006 19:44:15 +0000 Received: from [::1] (duck.specifix.com [64.220.152.99]) by duck.specifix.com (Postfix) with ESMTP id E4AE4FCE5; Sat, 13 May 2006 12:44:12 -0700 (PDT) From: Fred Fish Reply-To: fnf@specifix.com To: Mark Kettenis Subject: Re: [RFA] Patch to skip_prologue_using_sal() for oneline stub functions Date: Sat, 13 May 2006 20:04:00 -0000 User-Agent: KMail/1.9.1 Cc: gdb-patches@sourceware.org References: <200605101113.50267.fnf@specifix.com> <200605130928.k4D9S1dP032654@elgar.sibelius.xs4all.nl> In-Reply-To: <200605130928.k4D9S1dP032654@elgar.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605131545.04705.fnf@specifix.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00306.txt.bz2 On Saturday 13 May 2006 05:28, Mark Kettenis wrote: > That said, how does this handle functions like: > > Did you check that? I retested with the following sourcefile, printed here with line numbers for reference: 1 void first () 2 { 3 } 4 5 void oneline1(void) { } 6 7 void oneline2(void) { return; } 8 9 void twoline1(void) { 10 } 11 12 void twoline2(void) { 13 return; } 14 15 void threeline1 (void) 16 { 17 } 18 19 void fourline (void) 20 { 21 return; 22 } 23 24 void last (void) 25 { 26 } Here is the .gdbinit file I used: br first br oneline1 br oneline2 br twoline1 br twoline2 br threeline1 br fourline br last First try the old gdb prior to the change: Notice that every breakpoint gets set at the function AFTER the one it was supposed to be set at: $ ./gdb-old -nw -nx -x x.gdb x GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=sb1-elf"... Breakpoint 1 at 0xa0020330: file x1.c, line 5. Breakpoint 2 at 0xa0020338: file x1.c, line 7. Breakpoint 3 at 0xa0020340: file x1.c, line 10. Breakpoint 4 at 0xa0020348: file x1.c, line 13. Breakpoint 5 at 0xa0020350: file x1.c, line 17. Breakpoint 6 at 0xa0020358: file x1.c, line 22. Breakpoint 7 at 0xa0020360: file x1.c, line 26. Breakpoint 8 at 0xa0020368 (gdb) quit BTW, for the above, breakpoint 8 actually gets set at the function followoing last(): (gdb) x/i 0xa0020368 0xa0020368 <__do_global_ctors_aux>: lui v0,0xa002 Now after the change. They are all correct, I believe, although the breakpoint for fourline would probably look better from a source perspective if it said line 21 instead of line 22. $ ./gdb-new -nw -nx -x x.gdb x GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=sb1-elf"... Breakpoint 1 at 0xa0020328: file x1.c, line 3. Breakpoint 2 at 0xa0020330: file x1.c, line 5. Breakpoint 3 at 0xa0020338: file x1.c, line 7. Breakpoint 4 at 0xa0020340: file x1.c, line 10. Breakpoint 5 at 0xa0020348: file x1.c, line 13. Breakpoint 6 at 0xa0020350: file x1.c, line 17. Breakpoint 7 at 0xa0020358: file x1.c, line 22. Breakpoint 8 at 0xa0020360: file x1.c, line 26. (gdb) For reference, here is a disassembly: (gdb) x/30i 0xa0020328 0xa0020328 : jr ra 0xa002032c : nop 0xa0020330 : jr ra 0xa0020334 : nop 0xa0020338 : jr ra 0xa002033c : nop 0xa0020340 : jr ra 0xa0020344 : nop 0xa0020348 : jr ra 0xa002034c : nop 0xa0020350 : jr ra 0xa0020354 : nop 0xa0020358 : jr ra 0xa002035c : nop 0xa0020360 : jr ra 0xa0020364 : nop 0xa0020368 <__do_global_ctors_aux>: lui v0,0xa002 -Fred