View Full Version : Debug problems!

19th June 2009, 09:52

I'm trying to set breakpoints in my application that if I run doesn't have any problems, to learn watching the program code step by step.

How can I see the program step by step?

19th June 2009, 10:14
It isn't clear from your post what tool are you using for debugging.

19th June 2009, 10:25
My compiler is MinGW.

To run the application I push "Run" button.
At the moment, I want to set breakpoints. To get this goal I go to Run tab, I choose toogle Line Breakpoint and I put in the line that I want to see.
Now the problem is: what more I have to do to be able to see what the program does step by step?


19th June 2009, 10:27
which IDE u are using?

19th June 2009, 10:39
Sorry but I don't understand you what you are asking me!

In the computer I have Windows XP and I'm programming with QT 4.4.3.

19th June 2009, 10:48
1. You told us that you push 'Run' button. Where is it located?
2. What are you using to edit source code?

19th June 2009, 11:04
The code that i had programmed is written with C++.

The Run button that I press is which appear in the document that I have attached you

19th June 2009, 11:11
so, you are using the Eclipse. IDE it's a Integrated Development Environment.
so, you should add in your pro-file

CONFIG += debug

then rerun (import) your project again in the Eclipse and try to debug again.

19th June 2009, 11:16
Ok, now it is understood that you use Eclipse as your IDE. (But it was not obvious at the very beginning).
As for debugging, I believe I remember seeing "Step into instruction", "Step over instruction" actions in Eclipse. After debugging hits your first breakpoint it pauses, and from that point you can run it step by step using those actions.

19th June 2009, 11:56
I can't add to my .pro what they said to me.

Can you explain me a little bit more?

19th June 2009, 12:16
I can't add to my .pro what they said to me.
Yes, you can! Can I kick it? Yes, you can!...

In Eclipse right mouse click on the *.pro -> open with -> Text Editor. Voilà , you can add the CONFIG variable!

19th June 2009, 14:01
ok,i have add it!

now I run the application, I push debug and I take these errors:

Error creating session
Cannot run program "gdb": Launching failed
Cannot run program "gdb": Launching failed
Cannot run program "gdb": Launching failed


19th June 2009, 14:04
You need to install gdb. It is not in you mingw bin directory.
Get it from here https://sourceforge.net/project/showfiles.php?group_id=2435&package_id=20507&release_id=594520

19th June 2009, 14:34

the problem is solved!