This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/10112] do not stop on function


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]