• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v3 Breakpoint will not be hit, debugging dll gauge VS2015

Messages
393
Country
newzealand
Hi there,

I'm just getting into the world of aircraft dev and I'm playing around with making some instruments using c++ and Direct2D in Visual Studio Community 2015.

I'm trying to debug my gauge in P3Dv3 but when I
-set a breakpoint,
-build the solution (I've tried copying the .dll to the gauges folder and the entire debug output to the gauges folder)
-open P3Dv3
-select default AC
-Attach to process Prepar3D.exe

The breakpoint turns grey and hovering over it reveals: "The breakpoint will not currently be hit. No symbols have been loaded for this document."

Google returns a lot of suggestions about not set debugging flags. Has anyone experienced this with fsx/p3d?
 
Messages
393
Country
newzealand
Your gauge has to be loaded by an aircraft.
Ah ok.
Now I've loaded the aircraft (the gauge is defined in the panel cfg and the gauge draws on the display so it is being loaded and works correctly).

If I Debug > Attach to Process :prepar3D.exe before I load the aircraft or after I load the aircraft (doesn't seem to matter), the breakpoint still turns grey and says it won't be hit. The gauge doesn't stop and it continues to draw and update in p3d.

Here's an image of VS if it helps.
L3Ob29B.png



Is that the correct steps? I was going by this post

Cheers,

Nick
 
Last edited:

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
Check and make sure when attaching the debugger that your debugging mode is set to "Native" not "Managed".
 
Messages
393
Country
newzealand
Check and make sure when attaching the debugger that your debugging mode is set to "Native" not "Managed".
Unfortunately it's still the same result. I notice the Prepar3d.exe type is Managed though... is that the same for you?
Q5vLqcW.png



I did get the breakpoint to not turn grey once by attaching to process when I already had the aircraft loaded.....but then the sim crashed. I imagine that's what it's supposed to do? :)
 

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
The breakpoint will only go solid when your aircraft is loaded. The other thing to make double sure about is that you are using the latest module for your source code. And yes the P3D type is managed but your code is not managed and so the debugger must be set to native. Also, depending on the type of error that caused the crash, you can go into the Debug menu->Exceptions and enable break on that particular exception so it can show you which line of code is causing the crash.
 

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
The other alternative is to view the active modules list, find your dll, and try to manually load the pdb symbols file for it (should be in the same location as your build folder).
 
Messages
87
Country
russia
Of course, you'll need to set the target folder for the compiled Gauge to the actual Gauge folder used by that airplane in FSX.
Try to set Project Settings in VS for General -> OutputDirectory to your gauges folder. After project build check that there are *.pdb near the dll itself.
Also try to set breakpoint as early as possible in your code.
 
Top