-
Notifications
You must be signed in to change notification settings - Fork 19
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
debug with system lua 5.1 #5
Comments
I can give you a solution. But I'm not sure whether it is the best. If you want to debug a lua script located in the lrdb = require("lrdb_server")
lrdb.activate(21110) --21110 is using port number. waiting for connection by debug client.
--debuggee lua code
dofile("test.lua");
lrdb.deactivate() --deactivate debug server if you want. Then the {
"version": "0.2.0",
"configurations": [
{
"type": "lrdb",
"request": "launch",
"name": "Lua Launch",
"program": "lua5.1.exe", // here is your system lua location
"cwd": "${workspaceFolder}",
"stopOnEntry": false,
"useInternalLua": false,
"args": ["debug_script.lua"],
}
]
} It works for me. Maybe a better solution is create a batch file which can input with |
A better solution:
#!/usr/bin/env lua
if not arg[1] then
error("Please input a file name")
end
local lrdb = require("lrdb_server")
lrdb.activate(21110) --21110 is using port number. waiting for connection by debug client.
--debuggee lua code
dofile(arg[1]);
lrdb.deactivate() --deactivate debug server if you want. Then in {
"version": "0.2.0",
"configurations": [
{
"type": "lrdb",
"request": "launch",
"name": "Lua Launch",
"program": "lrdb",
"cwd": "${workspaceFolder}",
"stopOnEntry": false,
"useInternalLua": false,
"args": ["${relativeFile}"],
}
]
} Now you can debug any lua script in your VS Code without adding anything. |
how can i make it debug with system lua 5.1?
The text was updated successfully, but these errors were encountered: