Skip to content

调试时是否可以自由选择 Target 和怎样自动切换为 Debug 模式编译 #11

Answered by Mythos-404
MasterBalll asked this question in Q&A
Discussion options

You must be logged in to vote
  1. 这个无法实现用 ui 选择, 因为 ui 是异步的
  2. 解决方法, 可以凑合使用
dap.configurations.cpp = {
     {
        name = "Launch file",
        type = "codelldb",
        request = "launch",
        program = function()
            require("xmake.async").exec_commnd({ "xmake", "config", "--mode=debug" }, "")
            vim.cmd([[ XmakeBuid ]])
            return require("xmake.project").info.target.exec_path
        end,
        cwd = "${workspaceFolder}",
        stopOnEntry = false,
    },
}

这个插件我会近期重构, 整个代码和 api 都会改变, 这些功能我会加上

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MasterBalll
Comment options

Answer selected by MasterBalll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request good first issue Good for newcomers
2 participants