Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging doesn't start #105

Open
muchitto opened this issue Dec 3, 2021 · 8 comments
Open

Debugging doesn't start #105

muchitto opened this issue Dec 3, 2021 · 8 comments

Comments

@muchitto
Copy link

muchitto commented Dec 3, 2021

I'm trying out the debugger after a short break from using Haxe/Hashlink and it seems to not work anymore. When I try to debug, it builds using the build.hxml file but doesn't start the actual program for debugging. It runs fine if I just run the .hl file from the command line, tho.

My build.hxml:

-cp src 
-m Main

-lib heaps
-lib hlsdl

--hl bin/app.hl

--debug

My src/Main.hx:

class Main extends hxd.App {
    public static function main () {
        new Main();
    }
}

My .vscode/launch.json:

{
    // 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",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        },
        {
            "name": "HashLink (attach)",
            "request": "attach",
            "port": 6112,
            "type": "hl",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        }
    ]
}

OS is Windows 10, Haxe version 4.2.4, Hashlink is the latest from github and my vscode version is 1.62.3.

@muchitto
Copy link
Author

Nobody? :)

@rcstuber
Copy link
Contributor

Try opening the developer console in VSCode – it's like the Chrome console – to see if any errors from the debugger plugin are being thrown

@muchitto
Copy link
Author

muchitto commented Dec 25, 2021

There was an error after the debugger controls (step over etc) disappear. In the bottom status bar it says "Debugging is Started" and turns to "Debugging is Stopped" and then back to "Debugging is Started" and it disappears after that.

mainThreadExtensionService.ts:63 [[object Object]]Cannot read property 'id' of undefined
        $onExtensionRuntimeError @ mainThreadExtensionService.ts:63
        _doInvokeHandler @ rpcProtocol.ts:472
        _invokeHandler @ rpcProtocol.ts:457
        _receiveRequest @ rpcProtocol.ts:373
        _receiveOneMessage @ rpcProtocol.ts:295
        (anonymous) @ rpcProtocol.ts:160
        fire @ event.ts:577
        fire @ ipc.net.ts:638
        _receiveMessage @ ipc.net.ts:958
        (anonymous) @ ipc.net.ts:831
        fire @ event.ts:577
        acceptChunk @ ipc.net.ts:382
        (anonymous) @ ipc.net.ts:338
        P @ ipc.net.ts:60
        emit @ events.js:315
        addChunk @ internal/streams/readable.js:309
        readableAddChunk @ internal/streams/readable.js:284
        Readable.push @ internal/streams/readable.js:223
        onStreamRead @ internal/stream_base_commons.js:188

mainThreadExtensionService.ts:64 TypeError: Cannot read property 'id' of undefined
	at t.ModuleTreeDataProvider.onChangedActiveDebugSession (c:\Users\trika\.vscode\extensions\vadimcn.vscode-lldb-1.6.10\extension.js:1:35266)
	at u.fire (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1732)
	at I.$acceptDebugSessionActiveChanged (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:100:34869)
	at t._doInvokeHandler (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:99:13802)
	at t._invokeHandler (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:99:13486)
	at t._receiveRequest (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:99:12148)
	at t._receiveOneMessage (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:99:11025)
	at c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:99:8922
	at u.fire (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712)
	at r.fire (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:18942)
	at c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:114:34341
	at u.fire (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712)
	at r.fire (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:18942)
	at n._receiveMessage (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:23523)
	at c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:21057
	at u.fire (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712)
	at w.acceptChunk (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:15770)
	at c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:14900
	at Socket.T (c:\Users\trika\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:114:13813)
	at Socket.emit (events.js:315:20)
	at Socket.EventEmitter.emit (domain.js:467:12)
	at addChunk (internal/streams/readable.js:309:12)
	at readableAddChunk (internal/streams/readable.js:284:9)
	at Socket.Readable.push (internal/streams/readable.js:223:10)
	at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
$onExtensionRuntimeError @ mainThreadExtensionService.ts:64
_doInvokeHandler @ rpcProtocol.ts:472
_invokeHandler @ rpcProtocol.ts:457
_receiveRequest @ rpcProtocol.ts:373
_receiveOneMessage @ rpcProtocol.ts:295
(anonymous) @ rpcProtocol.ts:160
fire @ event.ts:577
fire @ ipc.net.ts:638
_receiveMessage @ ipc.net.ts:958
(anonymous) @ ipc.net.ts:831
fire @ event.ts:577
acceptChunk @ ipc.net.ts:382
(anonymous) @ ipc.net.ts:338
P @ ipc.net.ts:60
emit @ events.js:315
addChunk @ internal/streams/readable.js:309
readableAddChunk @ internal/streams/readable.js:284
Readable.push @ internal/streams/readable.js:223
onStreamRead @ internal/stream_base_commons.js:188

@rcstuber
Copy link
Contributor

The error says LLDB for VSCode. This is not the Hashlink debugger. Are you sure you run the correct launch config for Hashlink debugging?

@muchitto
Copy link
Author

Eh... I had the CodeLLDB extension installed. I uninstalled it and the errors do not appear anymore, but the debugger still doesn't work. Yes I use the launch.json that I posted here.

@hoseyjoe
Copy link

hoseyjoe commented Jan 8, 2022

It didnt work when I had

{
            "name": "HashLink (launch)",
            "request": "launch",
            "type": "hl",
            "hxml": "hl.hxml",
            "hl": "C:/SDKs/hasklink/hl.exe",
            "program": "${workspaceFolder}/build/heaps/Simplified.hl",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        }

I removed "hxml": "hl.hxml"so I had

{
            "name": "HashLink (launch)",
            "request": "launch",
            "type": "hl",
            "hl": "C:/SDKs/hasklink/hl.exe",
            "program": "${workspaceFolder}/build/heaps/Simplified.hl",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        }

And for the first time in a year I had hl debugging

@alfredbaudisch
Copy link

Want to report the same, the Debugger just won't start. There's no output messages either.

  • Using both the extension from the Marketplace, then compiled from master next.
  • Changed the port in launch.json and also in adapter.js to a high number like 30001.
  • No effect in any case. The application is built but nothing else happens.
HashLinkDebuggerDead.mp4
-cp src
-m Main

-hl bin/Main.hl

--debug

imagen

        {
            "name": "HashLink (launch)",
            "request": "launch",
            "type": "hl",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        },
        {
            "name": "HashLink (attach)",
            "request": "attach",
            "port": 6112,
            "type": "hl",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        }

tasks.json

{
	"type": "haxe",
	"args": "active configuration",
	"label": "Build",
	"group": {
		"kind": "build",
		"isDefault": true
	}
}

@olichose123
Copy link

olichose123 commented Sep 6, 2023

I have a similar problem on windows 11. I know it worked before. I've tried versions of the debugger and vshaxe from a year ago, and also building the debugger. Sometimes I get a "Failed to connect on debug port" message. Logs do not show anything. I've checked my ports and it looks like nothing starts and listens on 6112. Is it possible that the debugger is not even starting, and the session attempts but fails to connect to it?

Edit: It works on my win11 laptop with the same haxe and hl version, and with extension syncing on vscode. Weird. I'll make sure everything is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants