ncsoft / Unreal.js

Unreal.js: Javascript runtime built for UnrealEngine
Other
3.67k stars 351 forks source link

Unable to debug, either with VS Code or VS 2015 #199

Open fbeyrout opened 6 years ago

fbeyrout commented 6 years ago

Hello, I am not able to attach to a debugger at all (UE 4.18)

Followed the steps correctly (AFAIK)

In the correct context I did

> Context.SetAsDebugContext()

Got back:

< undefined LogInit: WinSock: I am MACHINE13-W7 (172.16.16.162:0)

Then tried to connect with Visual Studio 2015 following the steps as described. And in the JS console, I immediately get:

< V8 Debugger session start < V8 Debugger session stop

If I do the same with VS code I get timed out. There I used the following config:

    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858,
        "address": "localhost",
        "restart": false,
        "sourceMaps": false,
        "outDir": null,
        "localRoot": "${workspaceRoot}",
        "remoteRoot": null
    }

Note in VS code I get this message from the debug console:

Debugging with legacy protocol because it was detected.

thejustinwalsh commented 6 years ago

+1

crocuis commented 6 years ago

Recommand use v8 inspector. https://github.com/ncsoft/Unreal.js/wiki/V8-inspector

hasezoey commented 6 years ago

Also for me it seems so that it dont set it to the port "5858"

Context.SetAsDebugContext()
undefined
LogInit: WinSock: I am Gaming (192.168.2.105:0)
Context.IsDebugContext()
true

here to see:

Context.SetAsDebugContext
function (InPort = 5858) { return fnprepatch_484.call(this, InPort) }

(testet in the JS-Console in UE)

lehyun commented 6 years ago

Seems like Context.SetAsDebugContext() is not working anymore.

I found the following comment in v8-debug.h: ATTENTION: The debugger API exposed by this file is deprecated and will be removed by the end of 2017. Please use the V8 inspector declared in include/v8-inspector.h instead.

So as you recommended, I was trying to use v8 inspector with chrome (UE 4.19.2). I was able to connect to localhost:9229 without any error but the source tab is empty so that I couldn't set any break points. I manually added script directory as a workspace but still no luck.

Am I missing something? Please help me to debug javascript.

unabletodebug

mflux commented 6 years ago

Same thing here, the source tab is just empty and I'm unable to set break points + step through.

geekrelief commented 4 years ago

I created a new wiki page "Debugging with Visual Studio 2019" with update instructions on how to debug.