Sign in to follow this  
jcboliveira

Debug gauges with VC++

Recommended Posts

HiI'm doing my first attempts in c++ gauges, so far so good. But now I need to debug some IPC functions with an external program. The gauge is compiled with multithread debug option and when I run the project FS is launched as expected but VC++ always says that my breakpoints are invalid because "No executable code is loaded at current location". The startup situation is a 2D panel with my gauge.Any ideas?ThanksJos

Share this post


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

Hi Jose,I often use a brute force method where I need to trace useful information:FILE * fo;...fo=fopen("C:dbgTrace.txt","a");fprintf(fo,"expected %d read %f",vara,varb);fclose(fo);You have no idea how useful it may be!! :-)If not prone to a brute force method, you may consider this:http://home.t-online.de/home/Ollydbg/Hope this helps!

Share this post


Link to post
Share on other sites

If you've got his SDK on gauge creation, Dai Griffiths explains how to do it. If you don't have it, search flightsim.com for it.One thing you might need to do is not set any breakpoints until after your gauge is loaded. I'm not sure if this is true, but I think I've had to do that in the past.

Share this post


Link to post
Share on other sites

Hi Jose,When I was developing FSConnect, I found that I could easily debug my code using VC++. Just start FS, then from VC++, select Build / Start Debug / Attach to Process to attach to the running process, and then I could set breakpoints in my code. Of course that was a module and you're working with a gauge, but I think they are basically the same thing.Russ Dirks

Share this post


Link to post
Share on other sites

I had no problems to debug for Fs98 and Fs2000, but the described method for Fs2002 doesn't work any more on Win98SE. AFAIK it still works for newer Windows versions.Arne Bartels

Share this post


Link to post
Share on other sites

Thanks a lot for all the answers.The solution is indeed to attach the process instead of launching FS using VC++, don't know why, maybe something in the project properties could change that.Anyway, it really get's a nice environment for developing. Russ instead of attaching all the times one can go to the project properties and specify the attach. Now I can step by step the code. After change it only have to build it and reload airplane. When I have time I will try the same thing with a GNU IDE just to see if this can be made with GCC or BCC line command compiler.BestJos

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