From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Fernando Nasser Cc: Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [PATCH RFA] ending-run.exp Date: Mon, 09 Jul 2001 13:47:00 -0000 Message-id: <3B4A1873.9000302@cygnus.com> References: <3B40EB11.A026F84D@cygnus.com> <3B4A132E.AA2DE377@cygnus.com> X-SW-Source: 2001-07/msg00210.html > Well, main() is normally called from inside crt0 from some sort of "start" function. When you step past the return from main you should return to the frame above main, i.e., to after the call to main inside the "start" function in crt0. > > If it is not stopping there it is either a bug or some new situation that did not use to exist. > > I don't think we should accept "Program exited normally" until we understand a little bit more of what is actually happening when we get this message. Ulgh, that problem. At present GDB's behavour is poorly define for when it comes to what to do with the bottom (outer most) stack frames. For instance backtrace code sometimes includes _start but sometimes does not. There needs to be a consistent story as to what is reasonable. With that in mind I can image a GDB that does something like: (gdb) 4: return 0; (gdb) list main () { printf ("Hello World\n"); return 0; } (gdb) step File has no symbols, single stepping until exit Program exited normally. (gdb) Andrew