next/step after main() function's return

Joel Brobecker brobecker@adacore.com
Tue Dec 28 05:21:00 GMT 2010


> when issuing a next or step after main() function's return statement,
> gdb drops to __libc_start_main() from libc on x86 (or
> generic_start_main() on ppc and so on, depending on the arch if I'm
> not mistaken). Is it considered a bug or it's just the expected
> behavior?

I'd say that this is expected behavior. `main' is called by
__libc_start_main, so "next"-ing out of main will land in that function.

-- 
Joel



More information about the Gdb mailing list