Debugging C++ targets in haxe/OpenFL

Hi,
My company and I have been using haxe/OpenFL for several years now and have released a few games using it, but there’s a question I’ve been trying to find information about:

Does haxe/OpenFL support debugging for C++ targets? What I mean by that is, can you set breakpoints in your haxe code and then step through the code, inspecting variables etc…

Obviously you can do this in FlashDevelop if you use the Flash targets, which is great and it integrates well with the FlashDevelop IDE, but can you do a similar thing with C++ targets?

I get that it might be hard because the haxe code is converted to C++ code first by hxcpp and ideally you would want the debugger to show you the original haxe code, not the c++ code.

I feel this would be very important as C++ targets can behave very differently to Flash, but currently we are working blind with no proper way of debugging.

I’ve read some old web pages which talk about this, for example:
http://gamehaxe.com/2012/09/14/hxcpp-built-in-debugging/

But I haven’t seen anything recent… I just wondered what the current state of play is on this?

Thanks,
Greg

Check out: http://gamehaxe.com/2012/09/14/hxcpp-built-in-debugging/

AFAIK (which is not very far!), currently debugging is possible, but it’s not terribly pretty.

I’m hoping to add hxcpp support to hxscout for profiling. A GUI debugging tool would be pretty cool, though!

Best,
-Jeff

Hi Jeff,

Thanks for your reply. I did some further digging and found this:

If you follow the instructions you end up with a special version of FlashDevelop which I can confirm does actually let you debug C++ targets! It works pretty well actually, much like the Flash debugger.

I had not heard about hxscout before, it looks very good! Is this a project you’ve been working on? I’d love to see it working with CPP targets, that would be incredibly useful!

Greg

2 Likes

I also believe the TiVo fork of the IntelliJ plugin supports the HXCPP debugger.

It would be awesome to get the FlashDevelop debugger support into the main builds, I wonder what the issues were there

Yeah it would be nice if they added this to the main FlashDevelop builds… it seems to run ok and work pretty well.

I guess the main issues we are running into are that Android compilation/deployment takes a really really long time still so we’re trying to do as much debugging/profiling on the Windows C++ target as possible as that’s faster to compile for and uses more of the same code as the Android version.

Obviously we try and do a lot of initial debugging and profiling on the Flash target as that has the best compilation times and the best tools at the moment, but it’s not really using the same backend so it’s always going to run a bit differently than when it’s on an actual device.

I have been trying to get this working for what seems to be an eternity now. If anyone has managed to get IDEA to do HXCPP debugging, and can help me out, I would be willing to create a nice tutorial so that people can avoid the pain that I have been going through for the last few days.

2 Likes