Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-28749

Use lldb.exe from LLVM package with Visual C++ compiler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 9.0.1
    • Debugger
    • None
    • Windows

    Description

      On Windows cdb debugger is pretty slow. One alternative is to use LLVM's lldb debugger.

      One VSCode extension CodeLLDB mentions this in their wiki:

      On Windows, there are two debug information formats in common use: the Microsoft PDB ("msvc" ABI), used primarily by Microsoft toolchains, and DWARF ("gnu" ABI), originating from Unix toolchains (GCC, LLVM, etc).

      LLDB supports both of these formats, however, being a relatively recent addition, PDB support is still somewhat buggy and you may experience problems with it, up to and including debugger crashes. For this reason, when there is a choice, using "-gnu" ABI compilation targets is recommended (e.g. "x86_64-pc-windows-gnu").

      LLVM Windows installation comes with lldb.exe but the (python) batteries are not included.

      c:\Program Files\LLVM\bin
      $ lldb.exe --version
      lldb version 15.0.5
      

      Is lacking python310.dll. This can be obtained from the Python Embeddable Package 3.10 (x64).

      Simply extract python-3.10.9-embed-amd64.zip somewhere and copy python310.dll and python310.zip into "c:\Program Files\LLVM\bin".

      lldb knows about the MS PDB format via the Debug Interface Access SDK.

      I had to copy msdia140.dll from "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\DIA SDK\bin\amd64\msdia140.dll" into "c:\Program Files\LLVM\bin" to have lldb.exe stop at breakpoints.

      Qt Creator doesn't recognize the ABI correctly for lldb.exe, it actually knows about the Python issue so I had to patch the
      c:\Users\Cristian\AppData\Roaming\QtProject\qtcreator\debuggers.xml and set:

      <value type="QString">x86-windows-msvc2019-pe-64bit</value>
      

      as ABI.

      Now Qt Creator was able to debug a "Hello World" example. Unfortunately the pretty printes didn't work.

      A Qt application is crashing the debugger with:

      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QtPrivate::QPodArrayOps<char16_t>' has a base class 'QArrayDataPointer<char16_t>' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QtPrivate::QPodArrayOps<char>' has a base class 'QArrayDataPointer<char>' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QByteArray::FromBase64Result' has a member 'decoded' of type 'QByteArray' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QtPrivate::QPodArrayOps<unsigned int>' has a base class 'QArrayDataPointer<unsigned int>' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QtPrivate::QGenericArrayOps<QString>' has a base class 'QArrayDataPointer<QString>' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'const QLocale' has a member 'staticMetaObject' of type 'const QMetaObject' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QPartialOrdering' has a member 'Less' of type 'const QPartialOrdering' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QBitmap' has a base class 'QPixmap' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QtPrivate::QPodArrayOps<QPointF>' has a base class 'QArrayDataPointer<QPointF>' which does not have a complete definition.
      eERROR: Lldb stderr: error: hello-qt.exe :: Class 'QtPrivate::QPodArrayOps<QPoint>' has a base class 'QArrayDataPointer<QPoint>' which does not have a complete definition.
      
      eERROR: Lldb stderr: error: Qt6Cored.dll :: Class 'QObject' has a member 'staticMetaObject' of type 'const QMetaObject' which does not have a complete definition.
      eERROR: Lldb stderr: error: Qt6Cored.dll :: Class 'QtPrivate::QPodArrayOps<QObject *>' has a base class 'QArrayDataPointer<QObject *>' which does not have a complete definition.
      eERROR: Lldb stderr: error: Qt6Cored.dll :: Class 'QIODevice' has a base class 'QObject' which does not have a complete definition.
      eERROR: Lldb stderr: error: Qt6Cored.dll :: Class 'QtPrivate::QPodArrayOps<char16_t>' has a base class 'QArrayDataPointer<char16_t>' which does not have a complete definition.
      eERROR: Lldb stderr: error: Qt6Cored.dll :: Class 'QtPrivate::QPodArrayOps<char>' has a base class 'QArrayDataPointer<char>' which does not have a complete definition.
      eERROR: Lldb stderr: error: Qt6Cored.dll :: Class 'QtPrivate::QGenericArrayOps<QByteArray>' has a base class 'QArrayDataPointer<QByteArray>' which does not have a complete definition.
      eERROR: Lldb stderr: error: Qt6Cored.dll :: Class 'QByteArray::FromBase64Result' has a member 'decoded' of type 'QByteArray' which does not have a complete definition.
      
      eERROR: Lldb stderr: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
      eStack dump:
      e0.	Program arguments: "C:\\Program Files\\LLVM\\bin\\lldb.exe"
      eException Code: 0xC00000FD
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              hjk hjk
              cadam Cristian Adam
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes