From: Luke D. <cod...@ho...> - 2003-09-25 04:30:02
|
What happens if you try "-g" instead of "-g2" ? Do you have another version of GCC/binutils/etc. (e.g. Cygwin) anywhere else on your system, especially if it is in your PATH? What happens if you put MinGW (either one) in your PATH? Luke ----- Original Message ----- From: "Parinya Thipchart" <thi...@ya...> To: <min...@li...> Sent: Thursday, September 25, 2003 12:22 PM Subject: [Mingw-users] Is this strange?? > Hello, > > I am stuck with these 2 problems I think I had better ask people in the > list. > I don't know what to start. Let start with my system. > > My system: Windows 2000 pro, gcc 3.3.1, binutils-2.14.90-20030807, > mingw-runtime 3.1, w32api 2.4 and gdb 5.21. > > This is the code I'm going to use for all problems. > > ---------->8--------- > > // winhello.cpp > > #include <windows.h> > > int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR > lpCmdLine, int nCmdShow) > { > MessageBox(NULL, "Hello, Windows!", "Hello!", MB_OK); > return 0; > } > > ---------->8--------- > > Strange 1. > ====== > > I have MinGW installed at "C:\MinGW" and "C:\MinGWStudio\MinGW" they both > are the same tools(as above) > None of them are in the "PATH". > > 1. Create a directory c:\test\mingw\winhello > 2. Create a file winhello.cpp(as above) in > c:\test\mingw\winhello\winhello.cpp > 3. Build winhello.exe in debug mode > - If I use this command > > c:\mingw\bin\g++ -g2 -o c:\test\mingw\winhello\winhello.exe > c:\test\mingw\winhello\winhello.cpp -mwindows > > I get winhello.exe size "710,332" > > - but if I use this command(Actually changed the tools directory) > > c:\mingwstudio\mingw\bin\g++ -g2 -o c:\test\mingw\winhello\winhello.exe > c:\test\mingw\winhello\winhello.cpp -mwindows > > I get winhello.exe size "710, 844" > > and if I move the whole "MinGW" directory to someware else and call from > this MinGW I will get the different size winhello.exe size in debug mode. > > My question: Does the tools directory matter for gdb debugging information? > > > Strange 2 > ====== > > If I debug the winhello.exe above with gdb > > 1. c:\>c:\mingw\bin\gdb -q -f winhello.exe > > 2. (gdb) break "c:/test/mingw/winhello/winhello.cpp:7" (line 7 is > MessageBox....) > Breakpoint 1 at 0x4012ee: file c:/test/mingw/winhello/winhello.cpp, line 7. > ( The answer from gdb ) > > 3. (gdb) run > Starting program: C:\test\mingw\winhello/winhello.exe > > Program exited normally. > > !!!! gdb didn't stop !!!! > > 4. Quit gdb and > c:\>copy c:\test\mingw\winhello\winhello.cpp c:\test > > 5. c:\>cd\test > 6. rebuilt winhello in c:\test directory with this command > > c:\>c:\mingw\bin\g++ -g2 -o c:\test\winhello.exe > c:\test\winhello.cpp -mwindows > > 7. c:\>c:\mingw\bin\gdb -q -f winhello.exe > > 8. (gdb) break "c:/test/winhello.cpp:7" > Breakpoint 1 at 0x4012ee: file c:/test/winhello.cpp, line 7. > > 9. (gdb) run > Starting program: C:\test/winhello.exe > > Breakpoint 1, WinMain (hInstance=0x400000, hPrevInstance=0x0, > lpCmdLine=0x232445 "", nCmdShow=10) at c:/test/winhello.cpp:7 > c:/test/winhello.cpp:7:140:beg:0x4012ee > Current language: auto; currently c++ > > !!!! This time gdb stopped at the breakpoint !!!! > > > I don't know if it happens with other MinGW tools or not. > > If anyone has any idea about this please let me know. > > Regards, > Parinya > |