actboy168 / lua-debug Goto Github PK
View Code? Open in Web Editor NEWLua Debug Adapter for Visual Studio Code
License: MIT License
Lua Debug Adapter for Visual Studio Code
License: MIT License
Hello,
Is there a way to add love2D code support?
在家和公司的电脑突然都出现这个情况,前两天还是好用的。不知道是不是更新导致的呀
我用的是最新版本的VsCode,使用的是默认的调试配置,F5启动调试后只会停在入口,无法单步调试,停止也要按两次才行.
经过我不断的禁用启用我安装的扩展测试,最终锁定问题是这个插件与LiveShare插件有冲突,具体原因不明
https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare
连续多次调试后出现无法保存修改后文件的问题,vscode调试器也无法启动,必须重启vscode才行
##代码
``print("lua bit operation ")
axisMask=6
function isForbid(axisMask,idx)
if idx<1 or idx>64 then
print("idx cannot be less 1 or bigger than 64")
return false
end
if (1<<(idx-1))&axisMask==0 then
return false
else
return true
end
end
print(isForbid(axisMask,0));
print(isForbid(axisMask,1));
print(isForbid(axisMask,2));
print(isForbid(axisMask,3));
print(isForbid(axisMask,65));
``
###配置文件
{ "version": "0.2.0", "configurations": [ { "name": "launch", "type": "lua", "request": "launch", "stopOnEntry": true, "program": "${workspaceRoot}/bit.lua", "cwd": "${workspaceRoot}", "path": "${workspaceRoot}/?.lua", "cpath": "${workspaceRoot}/?.dll", "arg": [], "console": "utf8" }, { "name": "attach", "type": "lua", "request": "attach", "stopOnEntry": true, "ip": "localhost", "port": 4278, "sourceMaps": [ [ "./", "${workspaceRoot}" ] ] } ] }
昨天vscode升级到0.8版本后不能调试,今天回退到0.79又正常了,麻烦看看~
在mac下,直接错误了。
所以是否支持 Mac或者linux,还是仅Windows。
Hi, my program end normally, but it will still pop up a messagebox and say "Debug adapter process has terminated unexpectedly".
What does this "terminated unexpectedly" mean?
My test project is just a simple print.
test.zip
这标题,是截取百度找到的一句话。
是这样的,我需要读取一个文件夹内的所有文件,所以想用方便的方式去读取,而不是手填文件路径,但是我试过能百度到的函数,都没有一个能直接读取的,比如标题那个,就会提示没有这个库 'lfs'
而我只会lua语言,其它都不会了,所以,只能请教别人怎么能做到。
不想学习c或者其它语言,因为只是一个读取功能而已,实在没办法,也可以手填路径,相对而言成本低点。
我想请问,就我这个条件,应该怎么去做,能用较低的成本达到这个目的呢? 0 0
好像第二种 launch 模式跟我说的符合,但是我弄了半天好像还是不行,exe可以运行但是并不能调试,特来问一下
mac 系统不支持么?
I'm trying to attach to a process with Lua 5.3.5 embedded that works perfectly in launch mode, but when trying to attach to it using the processName attribute, the debugger hangs and doesn't connect / inject debugger.dll into the process.
This is my launch configuration:
{
"name": "Attach LUA",
"type": "lua",
"request": "attach",
"stopOnEntry": true,
"processName": "GoldenViewer.exe",
"consoleCoding": "utf8"
}
I've tried to debug the problem and what I've seen is that when using processName, the debugger (lua-debug.exe) uses stdio.lua module, that is implemented with bee.subprocess, and at the end a call to PeekNamedPipe(stdin, ...) is done, but in my case is always returning 0 bytes from the pipe, so never continues to the lua code proto.recv(STDIN:read(n), stat), and starts de update loop again.
I don't really understand the meaning of all this, I suppose vscode writes something in the stdin of the debugger to communicate with it, and lua-debug.exe is not receiving in stdin for some reason, but it's only a guess.
It's really an issue? I think I'm doing something wrong, can someone help me?
Thanks
我们公司使用的是内嵌lua运行的, 在配置完lanch.json后, 启动起来程序,立马就停止运行了,不止为何
"type":"lua",
"request":"launch"
"name":"Launch",
"runtimeExecutable"":"exe path",
"cwd":"script path",
"stopOnEntry":true,
"sourceMaps" [ [目录映射] ]
HI, @actboy168
My executable "tolua++" just call dofile for "src/toluapp/main.lua".
My debugger version is 4.1
The dbugger will abort silently if there is some error in my script
See the zip file below:
test_toluapp.zip
PS:
When I use "lua.exe" as "runtimeExecutable", it will prompt error message correctly
希望能加入debugger.dll的x64版本
项目工程:lua_workspace/test.lua
launch.json配置:
{
"version": "0.2.0",
"configurations": [
{
"name": "launch",
"type": "lua",
"request": "launch",
"stopOnEntry": true,
"program": "${workspaceRoot}/test.lua",
"cwd": "${workspaceRoot}",
"path": "${workspaceRoot}/?.lua",
"cpath": "${workspaceRoot}/?.dll",
"arg": [],
"console": "utf8"
},
{
"name": "attach",
"type": "lua",
"request": "attach",
"stopOnEntry": true,
"ip": "localhost",
"port": 4278,
"sourceMaps": [
[
"./",
"${workspaceRoot}"
]
]
}
]
}
debug 报错,提示:spawn EACCES,帮看下,是我配置弄错了还是什么原因,谢谢!
你好,
我自己编译了x64的debugger.dll, 启动程序后执行以下lua代码:
local dbg = require 'debugger'
dbg.listen('0.0.0.0', 4278)
dbg.start()
vscode启动"attach"模式正常连接到目标程序(TCP连接已建立),但无法触发断点进行调试。
请问,有遇见过这种问题吗?
谢谢
我在C++中创建debugger,等待vscode链接,但是始终链接不上,请问我是哪里写错了么
debugger_create("127.0.0.1:4278");
debugger = debugger_get();
debugger->wait_client();
debugger->attach_lua(State);
Hi!
after the upgrade, I have the issue with LUA socket
./libs/socket.lua':
%1 is not a valid Win32 application.
当调试 lua protobuf 反序列化过程时,示例代码如下
return function (buffer, pos, pend, message, field_dict)
local value = field_dict[key]
if value == nil then
value = new_default(message)
field_dict[key] = value
end
local size, new_pos
size, pos = DecodeVarint(buffer, pos)
new_pos = pos + size
if new_pos > pend then
error('Truncated message.')
end
return value:_InternalParse(buffer, pos, new_pos)
end
如果不用鼠标经过窗口变量,仍能继续单步调试,但如果鼠标不小心经过了窗口变量,则单步调试按钮失去响应,估计是拉取堆栈时发生了bug,大神有什么解决办法吗?
首先感谢作者~ 请问需要如何编译才能让其支持已有lua虚拟机的工程? 比如所用到的lua虚拟机版本为 4.0?
请问在这个调试插件在vscode下,如何调试cocos2d-lua的项目,如何加载vscode-debug.dll以及配置地址端口,百度上并没有vscode下调试cocos-lua的相关知识点,是否需要在项目代码中配置,请讲解下,谢谢,
Would appreciate a README in english. Thx!
Hi,
I have a custom Lua interpreter S4 (https://github.com/victorliu/S4).
Please, could you add sample of configuration file, how can I debug with help of S4?
thank you,
Igor.
hi,我用 vscode 打开一个文件名区分大小写的lua文件,然后打个断点
然后开始调试,发现 vscode 又打开了一个文件名全部小写的同名文件,断点是断到了,但断点左边的红点提示不会显示
你好,我在Ubuntu19.04下使用使用Lua Debug时出现了"convertToDto unexpected type"错误,我安装了vscode下的lua和lua debug插件并且系统安装了lua5.3,请问是要安装其他依赖还是什么问题?
The last version that is working properly for me is 0.9.8. Since version 1.0.0 there is some problem when launching debugger in Windows.
I can see my app lauching but only during a second, after that the app is closed and the debugger keeps waiting to connect. My app crashes in the call to luaL_newstate() launching a "Module not found" exception in the remotedebug.dll.
This is the client.log contents when I launch the debugger. I hope it helps. Tell me if you need more info:
[2019-05-06 07:36:49:069][...ons\actboy168.lua-debug-1.0.4\script\common\protocol.lua: 37][INFO ] [recv] {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lua","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"},"type":"request","seq":1}
[2019-05-06 07:36:49:073][...ons\actboy168.lua-debug-1.0.4\script\common\protocol.lua: 51][INFO ] [send] {"command":"initialize","request_seq":1,"type":"response","success":true,"body":{"supportsConfigurationDoneRequest":true,"supportsEvaluateForHovers":true,"supportsTerminateRequest":true,"supportsSetVariable":true,"exceptionBreakpointFilters":[{"filter":"pcall","label":"Exception: Lua pcall","default":false},{"filter":"xpcall","label":"Exception: Lua xpcall","default":false},{"filter":"lua_pcall","label":"Exception: C lua_pcall","default":true},{"filter":"lua_panic","label":"Exception: C lua_panic","default":true}],"supportsConditionalBreakpoints":true,"supportsExceptionInfoRequest":true,"supportsLoadedSourcesRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsDelayedStackTraceLoading":true},"seq":1}
[2019-05-06 07:36:49:128][...ons\actboy168.lua-debug-1.0.4\script\common\protocol.lua: 37][INFO ] [recv] {"command":"launch","arguments":{"name":"Debug LUA","type":"lua","request":"launch","stopOnEntry":true,"runtimeExecutable":"D:\\Nebula-GoldenViewer\\Data/../Code/Src/build/Debug/Win32/v142/GoldenViewer.exe","runtimeArgs":"","cwd":"D:\\Nebula-GoldenViewer\\Data/../_Output/win32/","consoleCoding":"utf8","workspaceFolder":"D:\\Nebula-GoldenViewer\\Data","sourceCoding":"ansi","outputCapture":["print","io.write","stderr"],"pathFormat":"path","__sessionId":"2c943b10-ca09-4589-8b93-9f5105c1a06c"},"type":"request","seq":2}
Looking through the code I implemented support for the __debugger_extand
metatable entry in our binding generator to support inspection of userdata types (not sure if that was the intended use case).
It works ok for the common case but crashes when a userdata has another userdata as a member.
I am not sure about how I should format the children userdata.
Can you give me some insight on that feature?
Hi
The debugger crashes when requiring a dll
for i, lib in ipairs( _module ) do
_ = _global[ lib ] or require( lib )
As soon as it hits require( lib ) then the debugger stops
There has been made another use called "love2D support" by dpMerchant here, though support for LuaJIT would be very useful, as it is widely used (including love2D), and I was not able to find any other debugger that doesn't suck for VSCode :(
It would be nice for you to consider adding support for LuaJIT, but if it isn't possible, then we might just have to live with that :/
我们在使用Unity+lua开发一款大型手机游戏。
现阶段我们项目使用远程调试的方式通过vscode调试unity游戏。
debugger被编译成windows的dll可以正常的运作,但iOS版和Android版无法编译出来,我们希望可以通过远程调试的方式调试手机上的脚本,不知道能否支持?
{
"name": "launch",
"type": "lua",
"request": "launch",
"stopOnEntry": false,
"program": "${file}",
"cwd": "${workspaceRoot}",
"path": "${workspaceRoot}/?.lua",
"cpath": "${workspaceRoot}/?.dll",
"arg": [],
"console": "utf8"
},
这是debug的配置,一直都是可以用的,但是现在已经有2个多星期不能用了,不知道是vscode更新后不能用,还是插件更新不能用,
打的断点根本触发不了.
如题,项目中用到5.1,请问支持这个版本吗?
我在VSCode中尝试后报错了。
0.3.0版本debug必定暂停
在最新的vscode上debug会报调试适配器进程已意外终止
我使用的时候一直启动不成功,提示Launch failed ,配置如下:
"configurations": [
{
"name": "launch process",
"type": "lua",
"request": "launch",
"cwd": "${workspaceRoot}",
"stopOnEntry": true,
"luadll" : "${workspaceRoot}/../external/lib/lua5.3.dll",
"runtimeExecutable": "${workspaceRoot}/sanguo.win32/Debug/sanguo.win32.exe",
"consoleCoding": "utf8"
}
]
luamake仓库究竟应该放哪
From the topic discussion, it seems that only windows platform is supported. Can anyone confirm if it will work with Vscode in Ubuntu?
我这边是将lua5.3做为lib集成到游戏的exe。
我尝试用launch模式调试exe,配置如下:
"configurations" : [
{
"type":"lua",
"request":"launch"
"name":"Launch",
"runtimeExecutable"":"exe path",
"cwd":"script path",
"stopOnEntry":true,
}
]
现在问题是,调试的时候断点的地方提示:未验证的断点。
stopOnEntry是有效的,能够断到脚本代码,但是似乎内存的lua代码没有映射到实际的lua代码。
所以内存看到的lua代码是正确的,但是设置的断点无法断到。
求教如何设置。
0.7.X 是否能保留launch模式下也支持tcp链接模式?我们使用了自己定制的exe作为调试器,不放在插件目录,unix连接方式不太方便....
谢谢
vscode 1.31.1,插件版本0.7.0 - 0.7.2 版本,tcp的attach模式,vscode启动lua-debuger.exe,如果attach的目标进程socket尚未开启监听,lua-debuger.exe会死循环且不会重连。另,非常感谢提供这个lua调试工具!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.