Git Product home page Git Product logo

Comments (6)

waruqi avatar waruqi commented on July 23, 2024

断点你下了么,既然断下了,后面就跟 xmake 插件没啥关系了,完全由 vscode cpptools/codelldb 调试接管了,你得到他们那边反馈

from xmake-vscode.

poemdistance avatar poemdistance commented on July 23, 2024

装了的,新建launch.json,用以下配置,然后用左侧栏的调试按钮可以正常调试:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/build/windows/x64/debug/hello.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        },
    ]
}

请教下点击xmake的调试按钮后,发生了什么,怎么转交调试过程给vscode cpptools/codelldb 的,有没有方法打印出具体的调用信息

from xmake-vscode.

waruqi avatar waruqi commented on July 23, 2024

xmake-vscode 调试,不用外置的 launch.json,插件内部会生成 launch.json 自动调起 debugger 。。你可以调下插件源码

from xmake-vscode.

poemdistance avatar poemdistance commented on July 23, 2024

我只是举例说明不用xmake,自己创建launch.json调试没问题。
刚用xmake又试了下,target platform设置成mingw就可以,windows则不行

可顺利调试:

{
    __toolchains_mingw_x86_64 = {
        "envs",
        "mingw",
        "yasm",
        "nasm",
        "fasm",
        "go"
    },
    arch = "x86_64",
    buildir = "build",
    ccache = true,
    host = "windows",
    kind = "static",
    mingw = [[C:\MinGW]],
    mode = "release",
    ndk_stdcxx = true,
    plat = "mingw"
}

无法进入断点:

{
    __toolchains_windows_x64 = {
        "gcc"
    },
    arch = "x64",
    buildir = "build",
    ccache = true,
    host = "windows",
    kind = "static",
    mode = "release",
    ndk_stdcxx = true,
    plat = "windows",
    toolchain = "gcc"
}

这是什么原因

from xmake-vscode.

waruqi avatar waruqi commented on July 23, 2024

windows 平台主要是给 msvc 用的,你要用 gcc ,建议切到 mingw 平台,单纯切 gcc toolchain ,平台还是 windows 我不确定是否有其他问题,我现在也没类似的环境去调试。。既然 mingw 可以,就走 mingw,要么就 windows 平台 不要去切 gcc ,走 msvc

from xmake-vscode.

poemdistance avatar poemdistance commented on July 23, 2024

好的,感谢解答。
大佬这里能不能搞个检测,对于未预料的配置组合抛个警告,应该可以避免一部分我这样的情况

from xmake-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.