Comments (6)
断点你下了么,既然断下了,后面就跟 xmake 插件没啥关系了,完全由 vscode cpptools/codelldb 调试接管了,你得到他们那边反馈
from xmake-vscode.
装了的,新建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.
xmake-vscode 调试,不用外置的 launch.json,插件内部会生成 launch.json 自动调起 debugger 。。你可以调下插件源码
from xmake-vscode.
我只是举例说明不用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.
windows 平台主要是给 msvc 用的,你要用 gcc ,建议切到 mingw 平台,单纯切 gcc toolchain ,平台还是 windows 我不确定是否有其他问题,我现在也没类似的环境去调试。。既然 mingw 可以,就走 mingw,要么就 windows 平台 不要去切 gcc ,走 msvc
from xmake-vscode.
好的,感谢解答。
大佬这里能不能搞个检测,对于未预料的配置组合抛个警告,应该可以避免一部分我这样的情况
from xmake-vscode.
Related Issues (20)
- vscode下的xmake插件调试CPP工程出现bug HOT 2
- Introduce setting to hide certain status bar options
- 通过vscode的xmake插件debug运行程序时,未尊重xmake.lua 中 set_runargs 设置的命令行参数 HOT 2
- 在容器内使用(或者vscode以root权限运行时), xmake-vscode 会提示xmake not found! HOT 4
- 工程脚本域调用 print 会导致无法调试 HOT 4
- 当workspace里面有多个目录的时候,不能够自动检测目录,打开xmake文件也不能自动激活 HOT 2
- Make lsp backend configurable HOT 2
- 设置xmake build目录后调整不回去默认的 HOT 2
- vscode 调试配置launch.json无法添加visualizerFile属性 HOT 6
- C++设置xmake build目录重启虚拟机后编译可能检测不到代码变化 HOT 8
- cuda 项目生成的compile_commands貌似无法正常提示 HOT 6
- `project directory (/path/dir) is not empty!` error when using VSCode and auto generated `.vscode` directory. HOT 2
- 记住上次关闭时选中的target HOT 1
- 将生成"compile_commands.json"文件的默认地址从".vscode"文件夹移动到"build"文件夹 HOT 3
- 无法正常生成compile_commands,以及“Error:there is no registered task type 'cppbuild'” HOT 1
- option() to be visible in xmake vscode extension HOT 1
- "stopAtEntry" option from launch.json is not respected HOT 3
- VSCode 插件不生效 HOT 3
- Target里on_load打印消息,会导致run或debug无法运行 HOT 1
- 当使用set_targetdir设置输出目录后,在vscode中使用lanunch.json开启程序会报target program not found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmake-vscode.