Skip to content
Snippets Groups Projects
Commit e3c493e3 authored by 最萌小汐's avatar 最萌小汐
Browse files

整理调试器代码

parent 88cdad49
No related branches found
No related tags found
No related merge requests found
...@@ -19,10 +19,7 @@ ...@@ -19,10 +19,7 @@
"type": "lua", "type": "lua",
"request": "attach", "request": "attach",
"stopOnEntry": true, "stopOnEntry": true,
"sourceCoding": "utf8",
"consoleCoding": "utf8",
"address": "127.0.0.1:11411", "address": "127.0.0.1:11411",
"outputCapture": []
}, },
{ {
"name": "编译", "name": "编译",
......
...@@ -44,9 +44,12 @@ local function tryDebugger() ...@@ -44,9 +44,12 @@ local function tryDebugger()
local addr = "127.0.0.1:" .. port local addr = "127.0.0.1:" .. port
local dbg = loadfile(entry)('windows', root) local dbg = loadfile(entry)('windows', root)
dbg:start(addr) dbg:start(addr)
--dbg:wait()
log.debug('Debugger startup, listen port:', port) log.debug('Debugger startup, listen port:', port)
log.debug('Debugger args:', addr, root, path, cpath) log.debug('Debugger args:', addr, root, path, cpath)
return dbg
end end
xpcall(tryDebugger, log.debug) local suc, dbg = xpcall(tryDebugger, log.debug)
if suc then
return dbg
end
...@@ -2,7 +2,7 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2) ...@@ -2,7 +2,7 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2)
local rootPath = currentPath:gsub('[/\\]*[^/\\]-$', '') local rootPath = currentPath:gsub('[/\\]*[^/\\]-$', '')
dofile(rootPath .. '/platform.lua') dofile(rootPath .. '/platform.lua')
local fs = require 'bee.filesystem' local fs = require 'bee.filesystem'
ROOT = fs.current_path() / rootPath ROOT = fs.path(rootPath)
LANG = LANG or 'en-US' LANG = LANG or 'en-US'
collectgarbage 'generational' collectgarbage 'generational'
...@@ -12,6 +12,6 @@ log.init(ROOT, ROOT / 'log' / 'service.log') ...@@ -12,6 +12,6 @@ log.init(ROOT, ROOT / 'log' / 'service.log')
log.info('Lua Lsp startup, root: ', ROOT) log.info('Lua Lsp startup, root: ', ROOT)
log.debug('ROOT:', ROOT:string()) log.debug('ROOT:', ROOT:string())
xpcall(dofile, log.debug, rootPath .. '/debugger.lua') dofile(rootPath .. '/debugger.lua'):wait()
local service = require 'service' local service = require 'service'
service.start() service.start()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment