Re: [Dev-C++] Using the debugger Topic 4
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2007-02-13 16:52:25
|
I would recommend that you ignore the built-in debugger in Dev-C++. Go for an external graphical front-end to gdb (for example Insight). That is what I do. /Per W On Tue, 13 Feb 2007, gary watson wrote: > I teach using Dev-C++ and had problems getting the debugger to include de= bugging code.=A0 Here's the recipe I tell my students to use. > Do the following one time only. > 1. Start up Dev-C++. > 2. Change the linker setting Generate debugging information to the value= no. To do this select the Tools/Compiler Options menu, then the > Linker option on the Settings tab. Select Generate debugging informat= ion and change to no if it is set to yes. > 3. Close Dev-C++. > > Now everytime you start Dev-C++, that linker mode will be off. It seems t= hat this must changed from no to yes when you want to debug. This is > done following the steps below for each program you want to debug. > > When you are ready to debug a program you have been working on do the fol= lowing. > > 1. Change Generate debugging information to yes using the Tools/Compiler= Options menu. > 2. Set a break point at the beginning of your program. > 3. Click on the debug tab at the bottom and then click the debug button = on this tab. > 4. You will get a message saying there is no debug information in the fi= le, and do you want to generate it:. Answer yes. This will close the > tabs at the bottom. > 5. Again click on the debug tab and debug button and you should get a co= nsole window up and can now continue stepping through your program. At > this point you can also add watch variables. This will allow you to s= ee how your variables are changing as you step through your program. > > =A0Gary Watson > Computer Science, OSU > > > > dev...@li... wrote: > > Send Dev-cpp-users mailing list submissions to > =09d...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > =09https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > or, via email, send a message with subject or body 'help' to > =09d...@li... > > You can reach the person managing the list at > =09d...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Dev-cpp-users digest..." > > > Today's Topics: > > 1. Re: undeclared constant (Per Westermark) > 2. Basic 'float' and Decimal Output (Ken Baratko) > 3. Compilation problem (Philip Bennefall) > 4. Set debugger ON (Raghavendra R) > 5. post (ricardo padilla) > 6. Huge executables (Philip Bennefall) > 7. Re: Huge executables (Per Westermark) > 8. Re: Huge executables (Philip Bennefall) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 1 Feb 2007 19:41:40 +0100 (CET) > From: Per Westermark <pw...@ia...> > Subject: Re: [Dev-C++] undeclared constant > To: k.a...@at... > Cc: Dev C++ <dev...@li...> > Message-ID: > =09<Pin...@ia...> > Content-Type: TEXT/PLAIN; charset=3DUS-ASCII > > The constant is defined in winbase.h. > winbase.h is also included from windows.h > > When in trouble - always do a grep in the include directories. > > /Per W > > On Thu, 1 Feb 2007 k.a...@at... wrote: > > > > I am trying to run a program but I keep getting an error message. The m= essage is STD_OUTPUT_HANDLE undeclared. The line of code that I have in my= program is > HANDLE hcon =3D Get Std Handle (STD_OUTPUT_HANDLE); > I am using Dev C++ version 4.9.8.0 can someone tell me if this version su= pports hcon? > > Kathy Elia > k.a...@at... > > > ------------------------------ > > Message: 2 > Date: Sat, 3 Feb 2007 09:20:11 -0800 (PST) > From: Ken Baratko <kba...@ya...> > Subject: [Dev-C++] Basic 'float' and Decimal Output > To: dev...@li... > Message-ID: <511...@we...> > Content-Type: text/plain; charset=3D"iso-8859-1" > > This is a very fundamental equation... > I put 2 'float's in my program and multiplied them... > I then used basic 'cout' to print out the decimals... > The program internally rounded all 3 outputs to basically integers... > It did not print the number to the right of the decimal... > I thought I could use setprecision() to see number of decimals to right= of decimals... > but that did not work... > ...so, why does dev4cpp do this...?... and... > how do I make simple corrections for printing of decimals from floats..= =2E? > Thks, ken > > > --------------------------------- > No need to miss a message. Get email on-the-go > with Yahoo! Mail for Mobile. Get started. > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 3 > Date: Wed, 7 Feb 2007 02:02:47 +0100 > From: "Philip Bennefall" <phi...@pb...> > Subject: [Dev-C++] Compilation problem > To: <dev...@li...> > Message-ID: <000801c74a53$af11f880$4800a8c0@Pbgames> > Content-Type: text/plain; charset=3D"iso-8859-1" > > Hey everyone, > > I am trying to compile a program that uses Direct input 8, and I believe = that I have done everything correctly, but the linker will not include dinp= ut8.lib for some reason. I am using the Microsoft Direct X October SDK rele= ase from 2006, so there should be no problem what so ever. It is finding th= e file, that's for sure, but it is giving me a strange error that I can't f= or the life of me figure out how to solve. The log is below. > > Compiler: Default compiler > Building Makefile: "C:\C++ tests\Direct input\Makefile.win" > Finding dependencies for file: C:\C++ tests\Direct input\Direct input.cpp > Executing make... > make.exe -f "C:\C++ tests\Direct input\Makefile.win" all > g++.exe -c "Direct input.cpp" -o "Direct input.o" -I"C:/Dev-Cpp/lib/gcc/m= ingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev= -Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/De= v-Cpp/include" > > g++.exe "Direct input.o" -o "Direct input.exe" -L"C:/Dev-Cpp/lib" -mwind= ows dxguid.lib dinput8.lib > > Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unreco= gnized > Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unreco= gnized > Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unreco= gnized > Direct input.o(.text+0x39):Direct input.cpp: undefined reference to `Dire= ctInput8Create@20' > collect2: ld returned 1 exit status > > make.exe: *** ["Direct] Error 1 > > Execution terminated > > I simply can't make any sense out of it. Can anyone help? > > Thanks in advance. > > Regards > Philip Bennefall > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 4 > Date: Thu, 8 Feb 2007 11:20:48 +0100 > From: "Raghavendra R" <mai...@gm...> > Subject: [Dev-C++] Set debugger ON > To: dev...@li... > Message-ID: > =09<9e7...@ma...> > Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed > > Hello, > I am not able to debug my code ie Not able to set the debugger ON > > I have looked into the FAQ list about the similar question and help > manual, I followed the same steps but it's not working. > > Steps I have followed, > 1.=09set break points in code and added even watch also > 2.=09compiled and run the program-F9 > 3.=09click ->debug- it asks that your project does not have debug > information whether to enable or not > click:::::: yes > 4.=09click -> debug again > or > =09click -> run time cursor > > The program is working fine. > Where is the problem? I have varied some of the steps with little > luck. Should I follow some extra steps? > Please help me in setting my debugger. If you can give me step by step > information, it will be of great help. > > Raghavendra > > > > ------------------------------ > > Message: 5 > Date: Mon, 12 Feb 2007 20:43:40 -0500 > From: "ricardo padilla" <ri...@gm...> > Subject: [Dev-C++] post > To: dev...@li... > Message-ID: > =09<6de...@ma...> > Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed > > hello to all you. > > > > ------------------------------ > > Message: 6 > Date: Tue, 13 Feb 2007 16:46:00 +0100 > From: "Philip Bennefall" <phi...@pb...> > Subject: [Dev-C++] Huge executables > To: <Dev...@li...> > Message-ID: <007501c74f86$10206940$4800a8c0@Pbgames> > Content-Type: text/plain; charset=3D"iso-8859-1" > > Hey folks, > > I've been feeling for a while that my executables have been much larger t= han they need to be, so I tried to make a very simple console application i= n C++ using iostream and nothing more. This code generates an executable th= at is over 400 kb! > > ---Code begin--- > #include <iostream> > > using namespace std; > > int main() > { > int year; > cout << "How old are you?\n"; > cin >> year; > cout << "Okay, you are " << year <<" years old.\n"; > fflush(stdin); > getchar(); > } > ---Code end--- > > This, I should imagine, would be something like 20 kb. I looked in the FA= Q of course, and it said that I should make sure that I don't have debuggin= g enabled. It does not look like it is, and I just can't figure out why the= files are so huge. iostream, that's really small. Can anyone help? I have = not modified any settings in compiler options at all. > > Regards > Philip Bennefall > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 7 > Date: Tue, 13 Feb 2007 16:53:50 +0100 (CET) > From: Per Westermark <pw...@ia...> > Subject: Re: [Dev-C++] Huge executables > To: Philip Bennefall <phi...@pb...> > Cc: Dev...@li... > Message-ID: > =09<Pin...@ia...> > Content-Type: TEXT/PLAIN; charset=3DUS-ASCII > > If I just copy your code to test_size.cpp and then do: > g++ test_size.cpp > on your source, I get a binary that is 475kB. > > If I strip the binary, it will shrink to 266kB. > > This with MinGW gcc 3.4.2. > > Alas, the c++ library is quite aggresive at adding stuff to hello-world > applications. The good part is of course that when you do add real code t= o > the project, a large part of the RTL is already included, so the binary > will not continue to grow at the same high speed. > > /Per W > > On Tue, 13 Feb 2007, Philip Bennefall wrote: > > > > Hey folks, > > I've been feeling for a while that my executables have been much larger t= han they need to be, so I tried to make a very simple console application i= n C++ using iostream and nothing more. This code generates an executable th= at is over 400 kb! > > ---Code begin--- > #include <iostream> > > using namespace std; > > int main() > { > int year; > cout << "How old are you?\n"; > cin >> year; > cout << "Okay, you are " << year <<" years old.\n"; > fflush(stdin); > getchar(); > } > ---Code end--- > > This, I should imagine, would be something like 20 kb. I looked in the FA= Q of course, and it said that I should make sure that I don't have debuggin= g enabled. It does not look like it is, and I just can't figure out why the= files are so huge. iostream, that's really small. Can anyone help? I have = not modified any settings in compiler options at all. > > Regards > Philip Bennefall > > > ------------------------------ > > Message: 8 > Date: Tue, 13 Feb 2007 17:08:08 +0100 > From: "Philip Bennefall" <phi...@pb...> > Subject: Re: [Dev-C++] Huge executables > To: <Dev...@li...> > Message-ID: <004b01c74f89$27383f60$4800a8c0@Pbgames> > Content-Type: text/plain; format=3Dflowed; charset=3D"iso-8859-1"; > =09reply-type=3Doriginal > > When you strip the executable, what is actually removed? Should all relea= se > versions of executables be stripped? I mean, the information that is remo= ved > from the binary, is that only good for debugging purposes? > > Regards > Philip Bennefall > ----- Original Message ----- > From: "Per Westermark" <pw...@ia...> > To: "Philip Bennefall" <phi...@pb...> > Cc: <Dev...@li...> > Sent: Tuesday, February 13, 2007 4:53 PM > Subject: Re: [Dev-C++] Huge executables > > > > > If I just copy your code to test_size.cpp and then do: > g++ test_size.cpp > on your source, I get a binary that is 475kB. > > If I strip the binary, it will shrink to 266kB. > > This with MinGW gcc 3.4.2. > > Alas, the c++ library is quite aggresive at adding stuff to hello-world > applications. The good part is of course that when you do add real code t= o > the project, a large part of the RTL is already included, so the binary > will not continue to grow at the same high speed. > > /Per W > > On Tue, 13 Feb 2007, Philip Bennefall wrote: > > > > Hey folks, > > I've been feeling for a while that my executables have been much larger > than they need to be, so I tried to make a very simple console > application in C++ using iostream and nothing more. This code generates > an executable that is over 400 kb! > > ---Code begin--- > #include <iostream> > > using namespace std; > > int main() > { > int year; > cout << "How old are you?\n"; > cin >> year; > cout << "Okay, you are " << year <<" years old.\n"; > fflush(stdin); > getchar(); > } > ---Code end--- > > This, I should imagine, would be something like 20 kb. I looked in the > FAQ of course, and it said that I should make sure that I don't have > debugging enabled. It does not look like it is, and I just can't figure > out why the files are so huge. iostream, that's really small. Can anyone > help? I have not modified any settings in compiler options at all. > > Regards > Philip Bennefall > > > ------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job ea= sier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > > ------------------------------ > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > End of Dev-cpp-users Digest, Vol 9, Issue 2 > ******************************************* > > > > |