我使用的是 Windows 10,使用 MSVC 16 编译了 llvm 11。
这是main.cpp:
#include <iostream>
int main()
{
std::cout << "Hello world" << std::endl;
}
这些是我运行的命令
clang -g -O0 main.cpp -o a.exe
lldb a.exe
(lldb) target create "a.exe
Current executable set to 'C:\a.exe' (x86_64).
(lldb) b main.cpp:5
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) b main
Breakpoint 2: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set --name main
Breakpoint 3: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
我究竟做错了什么?
我通过重新编译 llvm 成功了这些详细说明 https://lldb.llvm.org/resources/build.html用于在 Windows 上编译 lldb。
具体来说:
- 已安装 Visual Studio Community 2019 的 Visual Studio sdk
- 安装最新的Windows 10 sdk
- 使用 regsvr32 注册调试接口访问 DLL(C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\msdia140.dll 和 C:\Program Files (x86)\Microsoft Visual Studio\2019\社区\DIA SDK\bin\amd64\msdia140.dll)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)