Skip to main content
gamedev.net
🔒 Locked

Debug

Started by ELFanatic 8 replies 1k views
Original Post
ELFanatic
ELFanatic
For some reason the debugger will break on breakpoints on half the time. It tends to not work more often then it does. Is there anywhere where I can make sure that I set up the debugger right?
superpig
superpig
If it's breaking at all then it's probably working fine. Are you sure that the code with those breakpoints is is actually getting called?
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
ELFanatic
ELFanatic
yep it is. I just had it where it wasn't breaking on a line of code and then it did once and now it's not anymore.

[edit]
wait maybe your right.

hmm... isn't there a way to view the the last function calls. I forget when you call it but it'll give you a listing of where you've been in your code. I know java can do it. am I making sense?

[edit]
nevermind, it's not working again and for no reason.

[Edited by - ELFanatic on September 17, 2006 8:03:03 PM]
COleException
COleException
Quote:
hmm... isn't there a way to view the the last function calls.


If you work with Visual Studio, go to "Debug/Windows" and add the "Call Stack" to your Workspace.
TheAdmiral
TheAdmiral
Are you sure you're running a debug build and not a release build?
If, for some reason, MSVS can't resolve the address of one of your breakpoints (and hence can't place an INT3 there), the breakpoint will appear with a question mark inside at runtime.
If you have no question mark, then the code probably isn't being called.

Regards
Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
ELFanatic
ELFanatic
To TheAdmiral: yeah, I looked into that, and I thought it was good but I just now noticed something. When I run it I get this message in the debug window "D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO" How do I fix that?

COleException: I went to debug->windows but I didn't see call stack. I have break points and immediate. I'm using the Direct3D debugger. Do you think that might be why I can't select call stack. maybe I have to do something different?
COleException
COleException
Quote:
COleException: I went to debug->windows but I didn't see call stack. I have break points and immediate. I'm using the Direct3D debugger. Do you think that might be why I can't select call stack. maybe I have to do something different?


The "Call Stack"-entry in "Debug - Windows" is only visible, when your program already runs in debug-mode.

First make sure, that you really are in Debug-Build-mode, as TheAdmiral mentioned:

1. Go to "Build/Configuration Manager..." and choose "Debug" for "Active Solution Configuration".

2. Press "F5". That builds your solution and starts debugging. When the program runs, and/or you are staying in a breakpoint (I think, at least some breakpoints are working at your solution, are they?), go to "Debug - Windows" again, then you see a lot more options. One of it is "Call Stack".

Please tell us, what configuration you have now, when you open The "Configuration Manager", I can't believe it's on "Debug" now.

When everything else in your solution is right, means when you really are in debug-mode and you are SURE your code, where the breakpoint is, is really called: perhaps your ncb-File is corrupted. It has the same name and is in the same folder as your solution, e.g.

"mysolution.sln"
then the ncb-file is called
"mysolution.ncb"

Close your Visual Studio, delete the *.ncb-file and start the solution again.

HTH


jpetrie
jpetrie
The PDB's are where debugging information gets stored. NCB's hold information for Intellisense and class view, et cetera. You'll want to delete the PDB's if you suspect your debug information is corrupt, and then check the settings related to PDB generation in the configuration manager.
COleException
COleException
Quote:
Original post by jpetrie
The PDB's are where debugging information gets stored.


Aaaargh, of course you are right, big sorry!

ELFanatic
ELFanatic
sorry for the delay in my reply. school and work, I never have time for anything! anyways. I double checked the configuration manager and it does indeed say debug and I deleted the pdb file and rebuilt and ran it and still problems but here's something I figured out. The debugger is crashing on the break points. my code concealed this from me at first because it was crashing on it's own but I fixed the problem and now it runs fine until I set a break point. I figured that out by bringing up the task manager. It says
after my project name so I assume that to mean that it is indeed breaking plus when I end the runtime through task manager when I go back to visual studio it pops up with a message that says something about no source code to read so I'm thinking that it was at a break point but now that I ended the program it has nothing to read.

my god, I just read through this and I don't think I mentioned that I'm using DirectX and thus using the DirectX debugger. I'm pretty confident that I didn't set it up right.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.