From: Fred Fish <fnf@specifix.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Patch to skip_prologue_using_sal() for oneline stub functions
Date: Sat, 13 May 2006 20:04:00 -0000 [thread overview]
Message-ID: <200605131545.04705.fnf@specifix.com> (raw)
In-Reply-To: <200605130928.k4D9S1dP032654@elgar.sibelius.xs4all.nl>
On Saturday 13 May 2006 05:28, Mark Kettenis wrote:
> That said, how does this handle functions like:
> <examples>
> 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 <first>: jr ra
0xa002032c <first+4>: nop
0xa0020330 <oneline1>: jr ra
0xa0020334 <oneline1+4>: nop
0xa0020338 <oneline2>: jr ra
0xa002033c <oneline2+4>: nop
0xa0020340 <twoline1>: jr ra
0xa0020344 <twoline1+4>: nop
0xa0020348 <twoline2>: jr ra
0xa002034c <twoline2+4>: nop
0xa0020350 <threeline1>: jr ra
0xa0020354 <threeline1+4>: nop
0xa0020358 <fourline>: jr ra
0xa002035c <fourline+4>: nop
0xa0020360 <last>: jr ra
0xa0020364 <last+4>: nop
0xa0020368 <__do_global_ctors_aux>: lui v0,0xa002
-Fred
prev parent reply other threads:[~2006-05-13 19:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-10 15:13 Fred Fish
2006-05-10 22:22 ` Jim Blandy
2006-05-11 0:58 ` Fred Fish
2006-05-11 4:11 ` Jim Blandy
2006-05-13 9:47 ` Mark Kettenis
2006-05-13 20:04 ` Fred Fish [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605131545.04705.fnf@specifix.com \
--to=fnf@specifix.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox