COMMUNITY

Hashlink VSCode Debugger Problem

Hi,

Wanted to give HL and tink_X a test run and set up a sample program in vscode. I validated that the program debugs ok using “haxe-eval” as the launch option for launch.json and can hit my breakpoints ok. I also validated that command line HL works fine (output is expected).

However, when I try to debug HL from inside vscode I am running into problems. I think there’s probably some unique something on my system that is crashing out vshaxe-hl debugger. I’d love if someone could spot check my launch json entry first.

       {
           "name": "HashLink Debug",
           "request": "launch",
           "type": "hl",
           "hxml": "build.hxml",
           "cwd": "${workspaceFolder}",
           "program": "export/test.hl",
           "preLaunchTask": "Build HL"
       }

The vscode output I’m getting is:

[2020-03-01 16:12:03.633] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms
    at t.RawDebugSession.handleErrorResponse (file:///D:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2892:728)
    at file:///D:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2892:159
    at async t.RawDebugSession.shutdown (file:///D:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2890:248)

This is all on windows 7. I’m seeing a new “conhost.exe” launch for each debug launch, but I’m never seeing an HL instance. I know hl is available as part of SYSTEM_PATH, as I can launch it without problems from the command line.
“haxe.exe --version” yields “4.0.5”.
“hl.exe --version” yields “1.10.0”.

Any Ideas? Would like to avoid having to debug the vxhaxe extension if at all possible.

Best,

What does the preLaunchTask look like? You’re sure that test.hl is getting built successfully?

Does it have -debug? Not 100% sure if that was required for HL debugging or not.

it’s seem current vshaxe hl debug plugin or haxe have a bug with pretask .

here is what I use


 {

        // Use IntelliSense to learn about possible attributes.

        // Hover to view descriptions of existing attributes.

        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

        "version": "0.2.0",

        "configurations": [

            {

                "name": "HashLink (launch)",

                "request": "launch",

                "type": "hl",

                "hxml": "buildDebug.hxml",

                "cwd": "${workspaceFolder}"

            },

            {

                "name": "HashLink (attach)",

                "request": "attach",

                "port": 6113,

                "type": "hl",

                "hxml": "buildDebug.hxml",

                "cwd": "${workspaceFolder}"

            }

        ]

    }

of course, you need to add -debug in you *.hxml.

Thanks for the reply Jens and Zhan.

build.hxml

-cp src
-lib tink_core
-lib tink_state
-lib tink_streams
-debug
-main Main

tasks.json

        {
            "label": "Build HL",
            "command":"haxe",
            "args": ["build.hxml", "-hl", "export/test.hl"],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$haxe-absolute",
                "$haxe",
                "$haxe-error",
                "$haxe-trace"
            ]

As I said before everything runs fine from the command line. test.hl is build successfully from inside vscode using the above task. The command line execution of test.hl runs, and outputs the expected trace() results. However, when launched from inside vscode it does not work. Zhan, I saw your old topic about this issue and tried multiple times to resolve using that discussion, without success.

EDIT: I also tried attaching to an existing waiting hl debug session, without success. The behavior inside vscode seemed identical to the “launch” option. Also, I build seperately and can verify that the build task works ok. If I remove/retain the preLaunchTask option does not matter; I receive the same result either way. BTW, HashLink extension is 1.0.0. Haxe extension is 2.18.0

@Prarrot

which platform did you tested?

I’m use Windows ,everything seem well.

can you replace your task.json to my launch.json? and remove task.json .try again.

Hi Zhan,

So I tried your launch version and it behaves the same way on Windows 7. I may have to try to get another command line debugger working with vxhaxe and see what I can figure out. I think there’s hidden variable here somewhere. Did you have any issue with SYSTEM_PATH or other configuration issues?

no, I think there is a simple way that copy all hl files to haxe.exe folder, and cmd test :hl -version

So I installed everything on my Windows 8 laptop and everything works fine. I am assuming its some issue with Windows 7. I’ll post more if/as I get it.