VSCodeLuaDebug
VSCodeLuaDebug copied to clipboard
How debug cocos2dx lua using lua debugger?
This plugin is very pretty, Thank for author. I use it to learn lua and cocos2dx. But when i debug cocos2dx code, i fail. There are my steps.
(1) download vscode-debuggee.lua and dkjson.lua , put into my src folder.
(2) add follow code in main.lua:
cc.FileUtils:getInstance():setPopupNotify(false)
require "config"
require "cocos.init"
local json = require 'dkjson'
local debuggee = require 'vscode-debuggee'
local startResult, breakerType = debuggee.start(json)
print('debuggee start ->', startResult, breakerType)
local function main()
require("app.MyApp"):create():run()
end
local status, msg = xpcall(main, __G__TRACKBACK__)
if not status then
print(msg)
end
(3) launch.json:
{
"name": "launch-lua",
"type": "lua",
"request": "launch",
"workingDirectory": "${workspaceRoot}",
"sourceBasePath": "${workspaceRoot}/src",
"executable": "${workspaceRoot}/simulator/win32/MyGame.exe",
"listenPublicly": false,
"listenPort": 56789,
"encoding": "UTF-8",
"env": {}
},
When run it, the result is follow. I fail to debug.

hellow, bro have you handle this problem?