你好 !
我是在用 C 語言編程時使用 VS Code 的新手,我正在嘗試使用“Makefile Tools”插件除錯我的程式,但它似乎沒有考慮我的任何斷點。
配置/環境:
- Mac M1 2021,MacOS 蒙特雷
- C 編程語言
- Makefile 編譯 (GCC)
- 運行:./binary test_file
以下是我已完成的步驟:
- 首先,我下載了適用于 VS Code 的C/C IntelliSense和Makefile 工具。
- 然后我使用檔案對其進行了配置,如下所示:
{
"makefile.extensionOutputFolder": "./.vscode",
"makefile.configurations": [
{
"name": "Default",
"makeArgs": []
},
],
"makefile.launchConfigurations": [
{
"cwd": "/Path/to/workdir",
"binaryPath": "/Path/to/binary",
"binaryArgs": [
"/Path/to/test_file"
]
}
],
"C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools"
}
我在樹中選擇了我的二進制和規則: 像這樣
最后我構建然后運行并且我的斷點沒有被命中。
也許可以在這個日志中找到一些線索,我不確定:
2022-05-06 15:04:22.645419 0200 fdf[99469:2207846] [default] error finding potential wrapper bundle for node <FSNode 0x60000021c0a0> { isDir = ?, path = '/Users/julian/Documents/42/fdf' }: Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=1579, _LSFunction=wrapperBundleNodeForWrappedNode}
但是我在互聯網上沒有找到任何關于它的資訊。
有人可以幫我在 VS Code 中使用除錯模式嗎?
uj5u.com熱心網友回復:
您是否在 Makefile 中使用 -g 標志進行編譯?
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/471118.html
下一篇:無法跟蹤堆疊跟蹤
