Recommendations for Debugging Tools in Haxe

Hi everyone, :heart_eyes:

I’m relatively new to Haxe and currently working on a cross-platform project. I’m finding it a bit challenging to debug efficiently across different targets (JavaScript, C++, etc.).

Could anyone recommend some good debugging tools or practices that work well with Haxe? Are there any IDEs or plugins that offer robust debugging features for Haxe projects? Any tips on setting up a productive debugging environment would be greatly appreciated!
I also check this: https://community.haxe.org/t/haxe-cs-resolving-native-methoeds-to-base-class-instead-of-overriden-methodqliksense But I have not found any solution.

Thanks for your help!

Best, :smiling_face_with_three_hearts:

I’ve been using javascript with -D source-maps, so haxe generate source maps, these source maps work with vscode both from js debug terminal, and with chrome debugger, so it was very solid.
VS code has a feature to switch from the haxe to the javascript code (enable/disable source map stepping) so in case something didn’t made sense, I was jumping to the js code to see the real variable/function names etc.

The quistion you mentioned, have been debugged using Visual Studio on the generated cs code, not on the haxe code.

GitHub - vshaxe/hashlink-debugger: Visual Studio Code Debugger for Haxe/HashLink applications is also not bad, not as powerfull as javascript debugger.
for some issues with hashlink, I had to load it with gdb to get better stacktrace, or run with strace to understand what it is doing, this obviously doesn’t fall into the “robust debugging features”

There is GitHub - vshaxe/hxcpp-debugger: Visual Studio Code Debugger for Haxe/HXCPP applications, but doesn’t have any experiance with it.

A few years ago when I sought mentioned on the haxe docs, that the trace function (can be later removed with -D no-traces) is very good for debugging, it made me think that such a statement could be written only on absance of real runtime debuggers, however as you see there are many good options for debugging.

As with any OOP language, it is very easy to seperate the logic in classes, and use these classes #1 from the main class #2 from the unit tests #3 from the debugger,.
In haxe you can write the classes cross platform, your main in your language of runtime, tests in a language with good testing tools, debug them in javascript so you have good tools.

I’ve been using Chrome debugger with VS Code. I didn’t have much luck with the Firefox one. You have to make sure you launch Chrome in debugger mode, then use the “Connect” command in VS Code.
/Applications/browsers/Google\ Chrome.app/Contents/MacOS /Google\ Chrome --remote-debugging-port=9222