This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/10112] do not stop on function
- From: "pedro at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 29 Apr 2009 11:48:32 -0000
- Subject: [Bug breakpoints/10112] do not stop on function
- References: <20090429113846.10112.dushistov@mail.ru>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From pedro at codesourcery dot com 2009-04-29 11:48 -------
Subject: Re: New: do not stop on function
On Wednesday 29 April 2009 12:38:48, dushistov at mail dot ru wrote:
> here simple example:
>
> #include <stdio.h>
>
> void f(int gwk, double gsec)
> {
> while (gsec < 0.0) {
> gwk--;
> gsec += 604800.0;
> }
> while (gsec >= 604800.0) {
> gwk++;
> gsec -= 604800.0;
> }
>
> printf("done\n");
> }
>
> int main()
> {
> f(1322, 555198.9375);
> return 0;
> }
> -------------------------------------
>
> gcc -ggdb -Wall test.c -o test_gdb && gdb test_gdb
Most likely, the function wasn't called at all. The
compiler probably inlined it in main. You can confirm
that by looking at the disassembly of test_gdb.
Try recompiling, but this time, disabling optimizations:
gcc -O0 -ggdb -Wall test.c -o test_gdb && gdb test_gdb
^^
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10112
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.