SU12: added -AllowDebugger to the Steam Properties tab. It’s being recognised
because the sim is no longer freezing on Attach. Using the myGaugeAircraft
sample and quoting the WASM debug steps: - Open your project in Visual Studio
[2019][ Project is 64-bit and is in Debug mode with MSFS as the solution
platform ] Check - Build it and copy the WebAssembly module to the panel
folder of your SimObject. Check. I get one warning per cpp file “unused
variable ‘p_install_data’ [-Wunused-variable]”. Build is successful, no errors
- Launch Microsoft Flight Simulator. Check - When the game is running, use
the Debug > Attach to process command of Visual Studio. Check - In the
processes list, select Microsoft Flight Simulator.exe and press the Attach
button. Check - Once in the main menu, open your project. - Build the
package. Check - no errors, no warnings - Launch a flight with your
SimObject. Check - Once the game has loaded your SimObject, the breakpoints
set in the project become active and you can step into your code. Failed
‘The breakpoint will not currently be hit. No symbols have been loaded for
this document’. Looks like the .pdb files are either not being generated or
are being put somewhere that Visual Studio doesn’t expect. Any ideas? -Dai,
PILOT’S developer.
This: ‘FlightSimulator.exe’ (Win32): Loaded
‘C:\Users\daig\AppData\Roaming\Microsoft Flight Simulator\packages\mycompany-
aircraft-wasm-gauge\m9eebd22b09f908b9_0.dll’. Module was built without
symbols. I checked the walkthrough for setting up a WASM gauge on the
‘Creating WASM Gauges’ page of the SDK and the project properties are
identical, so why is the module being built without symbols? The .obj, .lib
and .dll files exist at that location. -Dai
It works for me, maybe your break point code is not running? be sure to put
the breakpoint in a place in your source code that would run on every frame
and check? Best, Raul
Raul; can you check to see if a .pdb file is being generated for you? It’s not
that a breakpoint isn’t being hit - according to the VS Output window it isn’t
even building the .pdb file.
Fixed it. I manually cleaned the C:\Users\AppData\Roaming\Microsoft Flight
Simulator\packages\ (i.e. in my case) C:\Users\daig\AppData\Roaming\Microsoft
Flight Simulator\packages\mycompany-aircraft-wasm-gauge\ folder and then re-
compiled. This time it dropped a .pdb file as expected. Neither the Rebuild
All nor the Clean Project emptied that folder as they should have done.
Also note this: the SDK states that you can rebuild the SimObject multiple
times while in the sim. What it fails to say - and what was the root of the
problem - is that you MUST detach the debugger BEFORE recompiling the
SimObject, then re-attach the debugger before loading the SimObject. I own up
to feeling slightly stupid for missing the obvious.