Unreal.js icon indicating copy to clipboard operation
Unreal.js copied to clipboard

Unable to debug, either with VS Code or VS 2015

Open fbeyrout opened this issue 8 years ago • 6 comments

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.

fbeyrout avatar Nov 07 '17 16:11 fbeyrout

+1

thejustinwalsh avatar Nov 07 '17 18:11 thejustinwalsh

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

crocuis avatar Nov 08 '17 09:11 crocuis

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)

hasezoey avatar Nov 09 '17 11:11 hasezoey

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

lehyun avatar May 24 '18 16:05 lehyun

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

mflux avatar Jun 15 '18 23:06 mflux

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

geekrelief avatar Feb 21 '20 23:02 geekrelief