How to Debug JSBSim with UE5? #761
Replies: 4 comments 3 replies
-
I wonder if there is some mismatch between the JSBSim module and the UE module in terms of the assumption regarding Character Set (Unicode or not). In particular possibly a different setting for Character Set between the debug and release builds of JSBSim? |
Beta Was this translation helpful? Give feedback.
-
What do you see if you start stepping through the code from the call to Looks like a corrupted string in a couple of your screenshots. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hmm, certain combinations of the C/C++ runtime between different modules (JSBSim and Unreal) can cause issues depending on what sorts of data is passed between the modules. So there is a good chance that Unreal has been built with the release DLL version of the runtime, i.e. Multi-threaded DLL (/MD) and that's causing issues when some data is passed into JSBSim which is built with the debug DLL version of the runtime when you generate a debug build of JSBSim, i.e. Multi-threaded Debug DLL (/MDd). One option to try is to switch JSBSim to using the static rather than DLL versions of the runtime, i.e. Multi-threaded Debug (/MTd) for the debug build of JSBSim and Multi-threaded (/MT) for the release build of JSBSim. |
Beta Was this translation helpful? Give feedback.
-
So I'm trying to get Debugging working for JSBSim as part of the UE5 plugin. I can get the Symbols loaded for the JSBSim.dll but it crashes during the first stages of initializing JSBSim. Release build works fine with UE5, it is just debug version that causes some strange crashes. I will summarize the experience and info below:
@AlbanBERGERET-Epic
Suggests that Debug builds should work, as mentioned here. #623 (reply in thread)
But first the debug symbols and version of JSBSim don't actually seem to get built with UE5 DebugGame_Editor. So I make a quick edit to the UE5 project's JSBSim.Build.cs file, and just comment out the line below to force debug build.
After this JSBSim.dll is built and loads debug symbols. UE5 starts and JSBSim can begin to initialize.
In the above picture UE5 calls the various set paths. Everything is fine until it reaches SetSystemsPath.
This is then called:
And then this is called and it crashes:
I'm not sure I really understand why there is some error with strings when in release build everything works fine. Is there some debug build settings that changes some compiler settings on how string conversion are handled?
Interestingly, if build the UE5 as Development instead of Debug but keep JSBSim as debug, I can get debug asserts that happen starting before the crash, starting with SetAircraftPath. I can ignore these asserts until it finally crashes as the same point as shown in the snippets above.
Beta Was this translation helpful? Give feedback.
All reactions