It seems like the disconnect is this: The hxcpp debugger is NOT part of Haxe runtime or IntelliJ (or Lime or openfl); it is its own library
hxcpp-debugger. For the functionality to be included in your code, you have to reference it, and you have to start the debugger via code from within your program. (Otherwise, IntelliJ starts its half of the debugging session and waits for the app, which never connects.) That is what the block of code in the documentation does. It should be the very first thing that your program does (e.g. in
static function main()), so that the debugger can help you as early as possible.
It is supposed to be done with haxelib via lime, right? As you say in the following line:
C:/HaxeToolkit/haxe/haxelib.exe run lime run C:/temp/issue349/openfl_cpp_debug/openfl_cpp_debug/project.xml windows -verbose -Ddebug -debug -args -start_debugger -debugger_host=localhost:6972
That command is generated for you, with the proper directories to run your project. (The path
c:/temp/issue349/openfl_cpp_debug/openfl_cpp_debug/project.xml is the path to the
project.xml that you specify in your module configuration tab (File->Project Structure…->Modules(left panel)) OpenFL Project XML field.
Where do I get “openfl_cpp_debug” from?
Or is it supposed to be a placeholder for my project?
Those are placeholders from your project. See the image above.
Why does your set-up of the project differ from a set-up of a lime-.project?
As shown above, this is the standard way to set up an OpenFL/Lime project in IntelliJ.
Does your project include lime anyway?
If not, why is it mentioned in the haxelib line?
lime command is always used (actually
haxelib run lime ...) for commands to run and/or build OpenFL projects.
I am aware, that I need a graphical support from openFl/ lime to have the debugger be displayed within the GUI of IntelliJ.
That is incorrect. You need support from the hxcpp-debugger library – specifically, you must call
new debugger.HaxeRemote(true, hostname, port); to start the debugger. That will start up a couple of debugging threads and connect to IntelliJ for control commands (run, step), breakpoints, etc… IntelliJ will tell your program – on your program’s command line – what the hostname and port to connect to are, since it is in control of them (and you can set the port explicitly in the Run->Debug…->Edit Configuration dialog). The only difference between “OpenFL” and “Haxe Compiler” type projects is whether
haxelib run lime ... or
your_program_name, respectively, is used as the executable.
And as I haven’t worked with lime yet and as the lime documentations that I found do not offer a complete workflow from A-To-Z, I feel relatively helpless.
Well, Lime doesn’t really have anything to do with the debugger, so I don’t expect them to have much information. Plus, Joshua (the main author of OpenFL and Lime) doesn’t use IntelliJ IDEA, so he has very little reason to research and document it.
Be of good cheer, though. There are many in the community that use and rely upon this debugger every day. We will get you there!
P.S. It might be simpler to ensure that you can build and run a very small program in OpenFL before you start trying to use the debugger. Then you can be sure that OpenFL and Lime are not part of your problem.