plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

Simbol avatar image
Simbol asked Simbol answered

Imposible to get WASM debugging

I have spend a ridiculous amount of time trying to debug WASM gauge modules, despite of following the SDK instructions and all sort of things, not matter what I do, the VS 2017 debugger is just not hitting any break point lines on the code, and I am 100% sure the lines are being hit since the WASM module is working, I am overriding the airplane throttles to 30% and I see the behavior occurring in the sim correctly.

The question is, what on earth I have to do to be able to debug the code? I am attaching VS debugger to Flightsimulator.exe, and yet nothing happens.. what I am doing wrong? I am loosing my mind.


See the picture below, all attached, running.. and yet.. unable to debug WASM. Interesting enough the debbuger is flooded with this error when attaching to MSFS:

Exception thrown at 0x00007FF644326180 in FlightSimulator.exe: 0x80000004: Single step.

1627006534134.png


What I can do to be able to move forward? this can't be this hard surely?

Thanks in advance,
Simbol

aircraftgauges
1627006534134.png (110.5 KiB)
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

EPellissier avatar image
EPellissier answered

Hi there!

Which version of the sim are you currently using?

Are you 100% sure the module being used has been compiled in its Debug configuration and not its Release one?

Do you have the same problem with the GaugeAircraft sample?

Best regards,

Eric / Asobo


10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Simbol avatar image
Simbol answered Simbol edited

Hi Eric,


First many thanks for extending your help so quickly.

I am using MSFS version 1.17.3.0 and SDK version 0.13.0. As far as I am aware the module is compiled as debug.. and I am 100% sure the module is loading since when I change the code (for example throttle to 60%), I re-compile, re-copy the .wasm module inside the panel and reload the airplane, the throttles go at 60%, if I changed the code and repeat to 10%.. the behavior reflects in the sim.

The GaugeAircraft sample provided with the SDK is not compiling, it has lots of errors.. so I started a new module from scratch, which is compiling and working inside the sim as intended.

See pictures, project set to debug settings attached.1627033375894.png

1627033285697.png

1627033313988.png


1627033438008.png


Not sure what else to try..

Regards,
Simbol


1627033285697.png (66.9 KiB)
1627033313988.png (51.9 KiB)
1627033375894.png (77.2 KiB)
1627033438008.png (46.0 KiB)
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Simbol avatar image
Simbol answered Simbol edited

Eric,

Further update, I got it working finally!!

I compared the project properties 1:1 with the stand alone WASM module in the SDK and the problem is the highlighted property on the picture was NOT SET.

1627036719846.png

There must be some issue with the SDK + VS 2017 because if I am starting a project from scratch or migrate a project to MSFS WASM this properties should be set automatically for us no? if this is not the case, then we need to update the documentation so people is aware this is a requirement or they will struggle to be able to debug their modules properly.

Once again, many thanks for responding so fast to me.. hope we can investigate further why this setting is not being automatically set, so we can avoid further pain to others.

All the best,
Simbol



1627036719846.png (59.3 KiB)
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

EPellissier avatar image
EPellissier answered

Hi again!

How do you start a project from scratch with VS2017?

VS2019 has MSFS Templates that set all these settings for you.

You're right that we should add a line about this in the "Migrating a project" section of the online help. :)

Best regards,

Eric / Asobo

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Simbol avatar image
Simbol answered

Hi Eric,

Sorry for the delay, with VS 2017 there are not templates available for WASM as indicated in the SDK documentation..

So the only option is to create an empty C++project and migrate it to WASM, unfortunately the migration doesn't set anything automatically for your project either..


1627313316486.png


Regards,
Simbol


1627313316486.png (41.3 KiB)
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.