From: Brandon S. <br...@oq...> - 2007-06-14 22:27:40
|
Hi All, Has anyone noticed any problems debugging windows console apps built w/ GCC 4.2? Here's what i'm seeing... i have a console app that consists of: int main (int argc, char * const argv[]) { printf("Hello, World!\n"); return 0; } linked w/o "-mwindows". if i try to debug this app with GDB 6.3-2 (from the mingw downloads page on sf.net) i run into some issues. i set a breakpoint on the printf line, and it stops there just fine. however, if i try to step over that (via "next") it breaks again at the C function "puts" which printf calls internally. if i keep stepping it keeps digging further down into printf despite that not being what it *should* be doing. if i change it to look like... int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPreInst, LPSTR lpszCmdLine, int nCmdShow) { printf("Hello, World!\n"); return 0; } still linking w/o "-mwindows", GDB then behaves as one would expect it. the app appears to run fine outside of GDB just fine despite how the entry point is declared. it prints to the console, etc. Any ideas of what's going on here or anyone else experience this? as a side note, i can declare it like this too: int main(HINSTANCE hInst, HINSTANCE hPreInst, LPSTR lpszCmdLine, int nCmdShow) that one gives the odd gdb behavior as well, but i would've expected a compiler error with anything other than "int main(int argc, char * const argv[])", but my expectations might be out of whack. Brandon Sneed OQO, Inc. |