Sign in to follow this  
Guest zip

debugging....

Recommended Posts

first of all, thanks for the help everyone has been giving me, i really appreciate it. i finally got everything working and i am starting to play around with the code and learn the macros and stuff.anyway, i started to make my own macros and when i run it in fs9 with the panel, it boots me out of fs9 with no warnings or anything.my real question is...how can i debug my code while it is running in flight sim?conventionally with .exe files you can run them and set breakpoints and walkthrough your code as it runs, can i do that within fs9?thanks

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Debugging is blocked by the SafeDisc copy protection. As soon as it detects a debugger in the system, FS9 won't start.

Share this post


Link to post
Share on other sites

so....theres no way to debug my code?what about without fs9, just run through it?

Share this post


Link to post
Share on other sites

Tip 1: do a web search on keywords "FS9 nocd".Tip 2: if you use visual studio, do an advanced search on "debugging" in this forum. You will find information on how to debug.Hope this helps.

Share this post


Link to post
Share on other sites

is ti imperative that you make the output file into the gauge directory of FS9?reason i ask is because i cannot figure out how to make microsoft visual C++ to export the release file to the fs9 directory?i have my project in a different directory out of program files.thanks

Share this post


Link to post
Share on other sites

Yes, you need to place the .gau file where FS9 can load it, which is usually the main gauges folder (do not use a cab file). It can also be a sub folder.You compile the debug .gau to that folder, and you will end up with a .PDB and .LIB file in the folder as well (the PDB holding debugger information).Because you are debugging a DLL file (which a .gau file is), you must first setup the debugger to start FS9.EXE as the main Windows executable. You will see a list of modules being loaded by FS9, including yours.I actually recommend debugging because it gives you a lot of insight as to what gets called in what order, and also the frequency of updates. It is also crucial to obtain an in depth understanding of what FS9 actually does, given the rather "light" documentation on the subject.If you use Visual Studio, you should also use the debug runtime library, so you have access to the _RPT functions. The _RPT functions are macros that evaluate to nothing in the non-debug version, but in the debug version of the C or C++ runtime library, it allows you to output statements to the debugger's output window (console) using statements similar to sprintf. This is very similar to the debugging instrumentation in .NET. This way, you can instrument your entire gauge and it all goes away when you produce the release version just by changing the mode from debug to release when you compile.Note that you may not distribute the debug versions of the runtime libraries with your product.Hope this helps,

Share this post


Link to post
Share on other sites

For once you can check out the project properties, Linker options to specify an output file, as described in the most usual tutorials (sd2gauxx,idehowto...). You can also just move the .gau file to the gauges folder (also the .ilk, or was it the .pdb?). The debugger has to start with FS9 as the debug session, the gauge is loaded by FS later.If you don't work too much with function (for basic to pretty high complex gauges often not needed), the debugger won't help you much. The main structure of gauges is in the MAKE_.. structures and similar. These are loaded at startup and all the debugger will be able to say that it does fail, but not too exactly where. So better check the structure of your gauge beforeheand or do only small adjustments, compile, test, change etc. Sooner or later you'll notice that the gauges structure is more or less always the same and quite logical, hard to make errors that crash FS then. There are enough samples in the SDK and the sd2gauxx series to play with and get the hang of it.Arne Bartels

Share this post


Link to post
Share on other sites

well,my next question is how to setup VS to output a file to that folder. everything i try, screws up the linking process.and yes, what you said does a help a lot!joe

Share this post


Link to post
Share on other sites

In my project, there's a property that says "project output" and I enter the full path to FS9's gauges folder there including the name of the file. Look for the entry where you specify the .gau file as the output, and add the full path to the gauges folder there. Example:C:program filesmicrosoft gamesflight simulator 9gaugesblah.gau

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this