My program has multiple files, and I compile with g++ -g.
When I try to break on WinMain, it says Function not defined, but when I show listing it appears right there.
(gdb) list Winmain.cpp:237
237 // WinMain
238 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance
pCmdLine, int nCmdShow) {
239
240 //Debuging mode
(gdb)
241
242 // IO thread ;;;; in charge of writing stuff to files
reak the mem thread
243 // /var/log/simulator.log
244 freopen ("debug.txt", "w", stdout);
245
246 // Strings
247 static TCHAR szWindowClass[] = TEXT("myWnd"); // std::s
indowClass = "myWnd";
248 static TCHAR szTitle[] = _T("Virtual Map"); // std::s
itle = "Virtual map";
249
250 // Windows Structure
(gdb) b Winmain.cpp:WinMain
Function "WinMain" not defined in "Winmain.cpp".
Make breakpoint pending on future shared library load? (y or [n]) n
I can break with b Winmain.cpp:238, but why doesn't it work by name?
mingw32 on windows7
GNU gdb (GDB) 7.6.1
WinMain()
is a __stdcall
function; (that knowledge is conveyed, with typical Microsoft obfuscation, by the WINAPI
qualifier). Thus, its publicly visible name becomes qualified as WinMain@16()
; you should set your gdb
breakpoint on this qualified name.