Jump to content
  • Advertisement
Sign in to follow this  
m4gnus

Can't use breakpoints in my application

This topic is 4872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I'm trying to debug my application because after adding new code it doesn't start properly (the window frame appears but it doesn't react). I thought i could just add some breakpoints to look where the application crashes but when i add one and press debug there's just a question mark inside my breakpoint and my app still crashes. I tried putting the breakpoint directly at the start of winmain but that didn't change anything... I'm using Visual C++ 2003. My debugger worked until now. How can i solve this problem? regards, m4gnus

Share this post


Link to post
Share on other sites
Advertisement
If there is a question mark on the breakpoint, it means the compiler can't find the associated code for the line you are attempting to break on. Either there is no code, or the compiler can't work out what the associated code is (you're missing your debugging database for that program probably).

Check:
- You're actually breaking on code - try breaking on lines around where you are setting breakpoints
- You're compiling in Debug mode, and not in Release mode.
- You are generating a PDB file when you compile (it should be in with your exe file).

Share this post


Link to post
Share on other sites
Quote:
Original post by m4gnus
My debugger worked until now.


In that case, I think it could be borked in some way. Does it do this with every program, or just the one you're working on just now?

I'd say that reinstallation of VC++, although possibly a last resort, could be the way forward here.

Share this post


Link to post
Share on other sites
it works with my maya exporter(a dll) and i reinstalled Vc++ last week on a completly new windows so i don't want to install again. I compile in debug mode and there are 2 pdb files(vc60.pdb, vc70.pdb).

hmm i never added compiler directions by hand...i don't even know where.

regards,
m4gnus

Share this post


Link to post
Share on other sites
Quote:
Original post by Andrew Russell
If there is a question mark on the breakpoint, it means the compiler can't find the associated code for the line you are attempting to break on. Either there is no code, or the compiler can't work out what the associated code is (you're missing your debugging database for that program probably).

Check:
- You're actually breaking on code - try breaking on lines around where you are setting breakpoints
- You're compiling in Debug mode, and not in Release mode.
- You are generating a PDB file when you compile (it should be in with your exe file).


I would agree with these suggestions. Additionally, you might want to do a clean and rebuild all and failing that, try exiting and restarting visual studio or even rebooting. I've had it get stuck before like that. When I get the ?'s, it's usually because I'm in release mode. However, I've also tried setting breakpoints in code that is not compiled due to some #ifdef that isn't set. That will give you a nice ? as well.

Share this post


Link to post
Share on other sites
This also happens if you put a breakpoint in a file that isn't part of the project. e.g. if you duplicate the project but open the files from the other copy in the IDE and put breakpoints in them. It will give you a red circled question mark.
Close all the files and open them via the solution pane, not by dragging them into the main window. That way you can be sure the breakpoint is in the correct file.

This happens all the time for the debugging I do, as that code is often in a dynamically loaded dll and when it loads that dll, the breakpoint goes to a solid circle.

Share this post


Link to post
Share on other sites
Quote:
Original post by Andrew Russell
...
Check:
- You're actually breaking on code - try breaking on lines around where you are setting breakpoints
- You're compiling in Debug mode, and not in Release mode.
- You are generating a PDB file when you compile (it should be in with your exe file).


1.I'm breaking on the first line of code in the winMain function.
2. Yes i'm compiling...at least the text box at the top of the VC++ windows says debug...
3.Yeah there are 2 pdb files: vc60.pdb (i compiled the project with VC++ 6.0 before i switched to VC++ .net 2003 i think this pdb is created by VC++ 6.0)
and vc70.pdb (this is the pdb file from VC++ .net 2003, right?)

So what can i do now? Where can i enter that -g flag? that would be the last suggestion made in this thread that i didn't try...or did i miss something?

Edit: btw i forgot to mention: with other projects it also didn't work properly...in my maya exporter i can set breakpoints but i can't look at the values of variable watches...it always said something like "<Variable>" not found though it is defined in the same code block.



regards,
m4gnus

[Edited by - m4gnus on July 15, 2005 12:16:11 PM]

Share this post


Link to post
Share on other sites
hmm i added the -g flag at additional options but the compiler doesn't know that flag...
ps:edited my last post...


Edit: Problem solved i needed to turn debugging on somwhere in the options...dunno why it has been turned off.


regards,
m4gnus

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!