0

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?

Percee
  • 449
  • 5
  • 25
  • I'm getting the exact same thing. I saw your answer bellow but I'm not 100% sure if this has to do with it. I'm guessing the main problem is that LLDB is not loading the symbols from the generated .pdb file. I wish I could find a way to load the .pdb file manually and see if that's the problem. If not, then maybe your steps bellow is the way to go. The main reason I want to use LLDB is to get rid of Visual Studio. If I have to depend on it to use LLDB, I just stick with VS. –  Aug 11 '20 at 16:37
  • 1
    That was my problem also, lldb not finding the .pdb right next to the .exe. You only need Visual Studio and its component sdk for the compilation of lldb, you don't have to use it afterwards. Once I did the steps I mentioned and recompiled lldb, it worked by only specifying the exe. – Percee Aug 11 '20 at 21:05
  • Yeah, you are right, once I compile my own lldb executable, I can keep it and use it in any machine, without VS. I'm going to give it a try today. Thanks man. –  Aug 12 '20 at 21:42
  • What about the python36.dll? Did you have the missing dll problem when first trying to launch LLDB? I had to install python 3.6.8 to solve this. Don't know why such an old version. When building LLDB from source, can I make LLDB use a newer python version like 3.8.*? –  Aug 12 '20 at 21:45
  • 1
    Yes I had the same issue when running lldb from precompiled sources. When I compiled it myself it used my python 3.8. – Percee Aug 17 '20 at 01:19

1 Answers1

1

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)
Percee
  • 449
  • 5
  • 25