Debugging with VC2005 Express Edition

Enjo

Mostly harmless
Addon Developer
Tutorial Publisher
Donator
Joined
Nov 25, 2007
Messages
1,665
Reaction score
13
Points
38
Location
Germany
Website
www.enderspace.de
Preferred Pronouns
Can't you smell my T levels?
I can't properly debug Orbiter's module. I get this message:

"No symbols are loaded for any call stack frame. The source code cannot be displayed."
after I press Break at unhandled exception.

Here's what I've done so far:
1) In project's properties -> Debugging, I set Command to F:\cosmo\orbiter-new2\orbiter.exe and Working directory to F:\cosmo\orbiter-new2\
2) In C++ and Linker Command line I've added /DEBUG directive
3) Started debugging with F5

Intriguingly along with obvious information that other dlls have no symbols loaded, I get this message:
'orbiter.exe': Loaded 'F:\cosmo\orbiter-new2\Modules\Plugin\LaunchMFD.dll', Symbols loaded.

Can anybody help me? Maybe we could update OrbiterWiki article along the way.
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
Make sure that the output of the project is going to the orbiter plugins directory (ie, that when you build it and then debug, the you're debugging the output from the code without any modifications). The debugger can fail to tie the symbols up if the DLL doesn't tie up with the code. The easy way to check this is to delete the dll from the orbiter plugins directory and check that it's recreated when you build.

It could also be that it's complaning that it can't get the symbols for orbiter.exe, which is fine. You should still be able to debug the DLL code though. Stick a breakpoint somewhere in your code that you know gets called (Update function is a good one) and then check it breaks. Make sure you're running orbiter in a window!
 

Enjo

Mostly harmless
Addon Developer
Tutorial Publisher
Donator
Joined
Nov 25, 2007
Messages
1,665
Reaction score
13
Points
38
Location
Germany
Website
www.enderspace.de
Preferred Pronouns
Can't you smell my T levels?
I did all this, and still no go. Setting a breakpoint in code fails because "No symbols have been loaded for this document", even after the sim is started and the dll is loaded with its symbols.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,621
Reaction score
2,341
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
I think the problem is, that VC2005 and VC2008 have different expectations - they fail to debug a DLL, when the calling application does not have debug symbols. I have the same problem here with VC2008 Pro, have not yet found a way to disable this "feature".
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
I have not been able to get debugging working before but when I set the output directory per agentgonzo's post, I was able to debug OK. I am using VC++2005 Express.

Funny thing is that I was unable to add watches. Breakpoints and auto watches worked OK though.

Enjo, my VC++2005 Express setup is as per the OrbiterWiki article with same debug setup mentioned in your first & agentgonzo's posts. Perhaps there is some other setting you have changed from that default setup that is causing a problem? No ideas here, unfortunately.
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
Have you made sure that you set the project configuration to "Debug"?

http://www.orbiterwiki.org/wiki/Free_Compiler_Setup#Debugging_the_addon
VisualStudioDebugConfiguration.png
 

Enjo

Mostly harmless
Addon Developer
Tutorial Publisher
Donator
Joined
Nov 25, 2007
Messages
1,665
Reaction score
13
Points
38
Location
Germany
Website
www.enderspace.de
Preferred Pronouns
Can't you smell my T levels?
Oh thanks. That did the trick, and thanks for Wiki contribution.
 
Top