Giter Club home page Giter Club logo

lua-debug's Introduction

lua-debug

Build Status

Requirements

  • Lua 5.1 - 5.4 or luajit (thanks @fesily)
  • Platform: Windows, macOS, Linux, Android, NetBSD, FreeBSD

Feature

  • Breakpoints
  • Function breakpoints
  • Conditional breakpoints
  • Hit Conditional breakpoints
  • Step over, step in, step out
  • Watches
  • Evaluate expressions
  • Exception
  • Remote debugging
  • Support WSL

Build

  1. Install luamake
git clone https://github.com/actboy168/luamake
pushd luamake
git submodule init
git submodule update
.\compile\install.bat(msvc)
./compile/install.sh (other)
popd
  1. Clone repo.
git clone https://github.com/actboy168/lua-debug
cd lua-debug
git submodule init
git submodule update
  1. Download deps.
luamake lua compile/download_deps.lua
  1. Build
luamake -mode release

Install to VSCode

  1. Install extension actboy168.lua-debug and actboy168.extension-path
  2. Open repo in VSCode
  3. Run task:Copy Publish

Todo

  • iOS example.

lua-debug's People

Contributors

actboy168 avatar bijanvakili avatar elliatab avatar fesily avatar olifink avatar pengdebin avatar rlnilsen avatar slaweknowy avatar sumneko avatar thewhitegoatcb avatar xiaobin83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lua-debug's Issues

io.read() doesn't work

img

When I try to use io.read() and debug with it, it doesn't work well. My expectation is

what's your name? asd
Hi asd

But result is not. I don't know why the output is like that. Is this the problem, or is there no way to debug with it?

Support for LuaJIT

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 :/

调试时偶尔会弹出lua窗口

在调试设置中指定了自己的lua.exe:
"luaexe": "${workspaceRoot}\server\bin\lua-language-server.exe",
"luadll": "${workspaceRoot}\server\bin\lua54.dll",

image

vscode最新版1.18.1debug报错

项目工程: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,帮看下,是我配置弄错了还是什么原因,谢谢!

启动一个使用lua53.dll的进程失败,能否给一个正确的配置样例

我使用的时候一直启动不成功,提示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"
}
]

English?

Would appreciate a README in english. Thx!

文件名大小写问题?

hi,我用 vscode 打开一个文件名区分大小写的lua文件,然后打个断点
然后开始调试,发现 vscode 又打开了一个文件名全部小写的同名文件,断点是断到了,但断点左边的红点提示不会显示

如何设置调试设置

我这边是将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代码是正确的,但是设置的断点无法断到。

求教如何设置。

程序一启动就终止运行了

我们公司使用的是内嵌lua运行的, 在配置完lanch.json后, 启动起来程序,立马就停止运行了,不止为何
"type":"lua",
"request":"launch"
"name":"Launch",
"runtimeExecutable"":"exe path",
"cwd":"script path",
"stopOnEntry":true,
"sourceMaps" [ [目录映射] ]

vscode正常连接 x64 debugger.dll 后,但调试断点无效

你好,
我自己编译了x64的debugger.dll, 启动程序后执行以下lua代码:

local dbg = require 'debugger'
dbg.listen('0.0.0.0', 4278)
dbg.start()

vscode启动"attach"模式正常连接到目标程序(TCP连接已建立),但无法触发断点进行调试。
请问,有遇见过这种问题吗?
谢谢

C++ attach 调试

我在C++中创建debugger,等待vscode链接,但是始终链接不上,请问我是哪里写错了么

	debugger_create("127.0.0.1:4278");
	debugger = debugger_get();
	debugger->wait_client();
	debugger->attach_lua(State);

Problems with the `__debugger_extand` feature

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?

debugger编译成Android和iOS版本

我们在使用Unity+lua开发一款大型手机游戏。
现阶段我们项目使用远程调试的方式通过vscode调试unity游戏。
debugger被编译成windows的dll可以正常的运作,但iOS版和Android版无法编译出来,我们希望可以通过远程调试的方式调试手机上的脚本,不知道能否支持?

lua socket issue

Hi!

after the upgrade, I have the issue with LUA socket

./libs/socket.lua':
%1 is not a valid Win32 application.

调试中遇到的问题

image
最近学习lua,这段输出个莫名其妙的东西,代码应该没问题吧,不知道怎么办

最近更新很频繁,但是你们没发现根本不能用吗,不能触发断点

    {
        "name": "launch",
        "type": "lua",
        "request": "launch",
        "stopOnEntry": false,
        "program": "${file}",
        "cwd": "${workspaceRoot}",
        "path": "${workspaceRoot}/?.lua",
        "cpath": "${workspaceRoot}/?.dll",
        "arg": [],
        "console": "utf8"
    },

这是debug的配置,一直都是可以用的,但是现在已经有2个多星期不能用了,不知道是vscode更新后不能用,还是插件更新不能用,
打的断点根本触发不了.

连续多次调试后出现无法保存修改后文件的问题

连续多次调试后出现无法保存修改后文件的问题,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}" ] ] } ] }

Debugging in windows not working since version 1.0.0

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}

0.8版本不能调试

昨天vscode升级到0.8版本后不能调试,今天回退到0.79又正常了,麻烦看看~

Attach LUA with processName not working

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

安装了后没法调试

最新版本的VSCode,安装了插件后点击调试没反应,原本应该有个配置按钮的也没有,不知道该怎么配置了,Launch.json应该放在哪里?不知道是VSCode的问题还是插件不兼容引起的?

snip_20170222091958
snip_20170222092029

cocos2d-lua调试

请问在这个调试插件在vscode下,如何调试cocos2d-lua的项目,如何加载vscode-debug.dll以及配置地址端口,百度上并没有vscode下调试cocos-lua的相关知识点,是否需要在项目代码中配置,请讲解下,谢谢,

调试 protobuf 反序列化时,鼠标提示信息导致 UI 失去响应

当调试 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对目录的操作主要依赖lfs库,所以头文件必须要require 'lfs'

这标题,是截取百度找到的一句话。
是这样的,我需要读取一个文件夹内的所有文件,所以想用方便的方式去读取,而不是手填文件路径,但是我试过能百度到的函数,都没有一个能直接读取的,比如标题那个,就会提示没有这个库 'lfs'
而我只会lua语言,其它都不会了,所以,只能请教别人怎么能做到。
不想学习c或者其它语言,因为只是一个读取功能而已,实在没办法,也可以手填路径,相对而言成本低点。

我想请问,就我这个条件,应该怎么去做,能用较低的成本达到这个目的呢? 0 0

Crash when require is called

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

Support Linux

From the topic discussion, it seems that only windows platform is supported. Can anyone confirm if it will work with Vscode in Ubuntu?

0.7.0 - 0.7.2 tcp attach bug

vscode 1.31.1,插件版本0.7.0 - 0.7.2 版本,tcp的attach模式,vscode启动lua-debuger.exe,如果attach的目标进程socket尚未开启监听,lua-debuger.exe会死循环且不会重连。另,非常感谢提供这个lua调试工具!

支持lua 5.1吗

如题,项目中用到5.1,请问支持这个版本吗?
我在VSCode中尝试后报错了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.