Search code examples
breakpointslldb

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


I'm on Windows 10, compiled llvm 11 with MSVC 16.

This is main.cpp:

#include <iostream>

int main()
{
  std::cout << "Hello world" << std::endl;
}

These are the commands I run

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.

What am I doing wrong?


Solution

  • I succeeded by recompiling llvm with these detailed instructions for compiling lldb on windows.

    Specifically:

    • Installed Visual Studio sdk for Visual Studio Community 2019
    • Installed the latest Windows 10 sdk
    • Registered the Debug Interface Access DLLs with regsvr32 (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\msdia140.dll and C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\amd64\msdia140.dll)