【问题标题】:Windows 10 LLDB error: Unable to resolve breakpoint to any actual locationsWindows 10 LLDB 错误:无法将断点解析到任何实际位置
【发布时间】:2020-11-27 07:15:29
【问题描述】:

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

我做错了什么?

【问题讨论】:

  • 我得到了完全相同的东西。我在下面看到了您的答案,但我不确定这是否与此有关。我猜主要问题是 LLDB 没有从生成的 .pdb 文件中加载符号。我希望我能找到一种手动加载 .pdb 文件的方法,看看这是否是问题所在。如果没有,那么也许你下面的步骤就是要走的路。我想使用 LLDB 的主要原因是摆脱 Visual Studio。如果我必须依赖它来使用 LLDB,我只是坚持使用 VS。
  • 这也是我的问题,lldb 没有在 .exe 旁边找到 .pdb。 lldb的编译只需要Visual Studio及其组件sdk,以后不用再使用了。一旦我完成了我提到的步骤并重新编译了 lldb,它只需指定 exe 即可工作。
  • 是的,你是对的,一旦我编译了我自己的 lldb 可执行文件,我可以保留它并在任何机器上使用它,无需 VS。我今天要试一试。谢谢大佬。
  • python36.dll 怎么样?首次尝试启动 LLDB 时是否遇到缺少 dll 的问题?我必须安装 python 3.6.8 来解决这个问题。不知道为什么这么旧的版本。从源代码构建 LLDB 时,我可以让 LLDB 使用更新的 python 版本,如 3.8.*?
  • 是的,我在从预编译源运行 lldb 时遇到了同样的问题。当我自己编译它时,它使用了我的 python 3.8。

标签: breakpoints lldb


【解决方案1】:

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

具体来说:

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

【讨论】:

    猜你喜欢
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 2018-03-14
    • 2016-08-16
    • 2014-05-06
    • 2023-03-18
    • 2016-09-15
    相关资源
    最近更新 更多