File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed
Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 1+ ### 初始化流程
2+ 简单概述几种加载luadebug调试器的方式
3+
4+ 前端vscode的参数会被完整传递到前端程序lua-debug代理进程中,该进程负责加载lua-debug.so/.dll到lua虚拟机环境中.
5+
6+ 参数传递分为两个阶段,初始化阶段目前只传递了部分参数, 第二阶段调试器加载后DAP协议的initialized消息中传递了所有参数
7+
8+ ## Launch
9+ 1 . 应用程序支持标准lua支持的-e参数
10+ 2 . 注入器
11+
12+ ## Attach
13+ 1 . 主动连接调试器
14+ 2 . 注入器
15+
16+ ### 主动连接
17+ 在源代码里主动dofile debugger.lua
18+
19+ ## Details
20+
21+ ### '-e'
22+
23+ 通过` DBG 'address[/ansi]/luaversion' ` 在字符串中传递启动参数
24+
25+ 目前只能传递 address utf8 luaversion 三个参数
26+
27+ ### Injector
28+
29+ 使用注入器, 加载attach_lua函数作为主入口,最终挂载attach.lua
30+
31+ 通过ipc_send_luaversion传递参数
32+
33+ 实际上只能传递luaversion这个参数
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ if debug.getregistry()["lua-debug"] then
4747end
4848
4949local function detectLuaDebugPath (cfg )
50- local PLATFORM
51- do
50+ local PLATFORM = cfg . platform or os.getenv " LUA_DEBUG_PLATFORM "
51+ if not PLATFORM then
5252 local function shell (command )
5353 -- NOTICE: io.popen可能会多线程不安全
5454 local f = assert (io.popen (command , ' r' ))
You can’t perform that action at this time.
0 commit comments