xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.05k stars 787 forks source link

Support Lua Debugger #4122

Closed waruqi closed 1 year ago

waruqi commented 1 year ago

Is your feature request related to a problem? Please describe.

Debug xmake lua source

Describe the solution you'd like

patch: https://github.com/xmake-io/xmake/pull/4121

Debug xmake self-source code

  1. We need install https://github.com/EmmyLua/VSCode-EmmyLua for vscode first.

  2. Update xmake and repo

$ xmake update -s dev
$ xrepo update-repo
  1. Bind emmylua_debugger and run xmake command
$ xrepo env -b emmylua_debugger xmake --version

it will wait emmylua debugger.

  1. Open xmake source code in vscode, and click RunDebug -> Emmylua New Debug

image

Debug project configuraiton

add_rules("mode.debug", "mode.release")

target("test")
    set_kind("binary")
    add_files("src/*.cpp")
    before_build(function (target)
        print("hello")
    end)
$ xrepo env -b emmylua_debugger xmake 
image

Describe alternatives you've considered

No response

Additional context

No response

waruqi commented 1 year ago

Related issues: