summaryrefslogtreecommitdiff
path: root/xmake/core/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-08-25 11:50:52 +0800
committerGitHub <[email protected]>2023-08-25 11:50:52 +0800
commit5e46ce42e5d6ec7b829dd579cdc8c2cc29d4fc9a (patch)
tree8912ed1b41805e65b31de45caf6d7d2cbfee1c5c /xmake/core/main.lua
parentacbcf6923d556f0926f1e8f10d87e80f7a894be9 (diff)
parent52ac92a586cb42a008906ef67a921050d22a64bc (diff)
Merge pull request #4121 from xmake-io/luadbg
Add lua debugger
Diffstat (limited to 'xmake/core/main.lua')
-rw-r--r--xmake/core/main.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index bb883d659..796a69b44 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -40,6 +40,7 @@ local config = require("project/config")
local project = require("project/project")
local localcache = require("cache/localcache")
local profiler = require("base/profiler")
+local debugger = require("base/debugger")
-- init the option menu
local menu =
@@ -139,6 +140,14 @@ end
-- the init function for main
function main._init()
+ -- start debugger
+ if debugger:enabled() then
+ local ok, errors = debugger:start()
+ if not ok then
+ return false, errors
+ end
+ end
+
-- disable scheduler first
scheduler:enable(false)
@@ -148,9 +157,9 @@ function main._init()
-- e.g. `xmake f -c -P xxx` will be parsed as `-c=-P`, it's incorrect.
--
-- maybe we will improve this later
- local options, err = main._basicparse()
+ local options, errors = main._basicparse()
if not options then
- return false, err
+ return false, errors
end
-- init project paths only for xmake engine