This is the mail archive of the gdb@sources.redhat.com 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]

GDB is stepping past main()


Hello, all.

Why doesn't gdb stop at the main() end and continues to step further?
Ok, it's not a big problem for human, but what should the frontend 
debugger do with unknown functions w/o source file positions?

Test case: gcc 3.2.2 and gdb 6.3 on RH Linux, session log here:

(gdb) br main
Breakpoint 1 at 0x8048618: file tmp.cpp, line 7.
(gdb) run
Starting program: /home/kostik/Work/a.out
                                                                                
Breakpoint 1, main (argc=1, argv=0xbffff2f4) at tmp.cpp:7
7               cout<<" Hello world! "<<endl;
(gdb) l
2
3       using namespace std;
4
5       int main(int argc,char* argv[])
6       {
7               cout<<" Hello world! "<<endl;
8       }
9
(gdb) step
 Hello world!
8       }
(gdb) step
0x42015574 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) step
Single stepping until exit from function __libc_start_main,
which has no line number information.
                                                                                
Program exited normally.
(gdb)

What the hell "__libc_start_main" is doing here?
The same happens using "next" instead of "step" and when using a MI 
interface...

Best regards,
Konstantin.



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