Windows 10 LLDB error: Unable to resolve breakpoint to any actual locations

Windows 10 LLDB error: Unable to resolve breakpoint to any actual locations

我在 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.

我做错了什么?

我成功地使用 these detailed instructions 重新编译 llvm,以便在 windows 上编译 lldb。

具体来说:

  • 已为 Visual Studio Community 2019 安装 Visual Studio SDK
  • 安装了最新的Windows10 sdk
  • 使用 regsvr32 注册了调试接口访问 DLL(C:\Program Files (x86)\Microsoft Visual Studio19\Community\DIA SDK\bin\msdia140.dll 和 C:\Program Files (x86)\Microsoft Visual Studio19\Community\DIA SDK\bin\amd64\msdia140.dll)