<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/91996>91996</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb on windows: The debugger crashes when trying to print a `shared_ptr`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sigasigasiga
      </td>
    </tr>
</table>

<pre>
    ```cpp
#include <iostream>
#include <memory>

int main() {
    std::shared_ptr<void> p;
    std::cout << p << std::endl;
}
```

Given the code above which was compiled with `clang++ -g3 cpp.cpp` I'm unable to print the contents of `p`:
```gdb
$ lldb a.exe
(lldb) target create "a.exe"
(lldb) Current executable set to 'C:\dev\toy\a.exe' (x86_64).
(lldb) process launch -m
(lldb) Process 24372 launched: 'C:\dev\toy\a.exe' (x86_64)
Process 24372 stopped
* thread #1, stop reason = one-shot breakpoint 1
    frame #0: 0x00007ff71ba4bd60 a.exe`main at cpp.cpp:4
 1    #include <iostream>
   2    #include <memory>
   3
-> 4    int main() {
   5        std::shared_ptr<void> p;
   6        std::cout << p << std::endl;
   7    }
(lldb) n
Process 24372 stopped
* thread #1, stop reason = step over
    frame #0: 0x00007ff71ba4bd7a a.exe`main at cpp.cpp:5
   2    #include <memory>
   3
   4    int main() {
-> 5        std::shared_ptr<void> p;
   6        std::cout << p << std::endl;
   7    }
(lldb) p p
error: a.exe :: Class 'std::strong_ordering' has a member 'less' of type 'std::strong_ordering' which does not have a complete definition.
error: a.exe :: Class 'std::partial_ordering' has a member 'less' of type 'std::partial_ordering' which does not have a complete definition.
error: a.exe :: Class 'std::weak_ordering' has a member 'less' of type 'std::weak_ordering' which does not have a complete definition.
(lldb) LLDB diagnostics will be written to C:\Users\EGORBY~1\AppData\Local\Temp\diagnostics-dbd91a
Please include the directory content when filing a bug report
Exception Code: 0xC0000005
 #0 0x00007ffcc890e457 (C:\Program Files\LLVM\bin\liblldb.dll+0x12de457)
 #1 0x00007ffcc86a27dd (C:\Program Files\LLVM\bin\liblldb.dll+0x10727dd)
 #2 0x00007ffcc86a72d8 (C:\Program Files\LLVM\bin\liblldb.dll+0x10772d8)
 #3 0x00007ffcc86a6136 (C:\Program Files\LLVM\bin\liblldb.dll+0x1076136)
 #4 0x00007ffcc86a4d80 (C:\Program Files\LLVM\bin\liblldb.dll+0x1074d80)
 #5 0x00007ffcc7fdbc18 (C:\Program Files\LLVM\bin\liblldb.dll+0x9abc18)
 #6 0x00007ffcc86de283 (C:\Program Files\LLVM\bin\liblldb.dll+0x10ae283)
 #7 0x00007ffcc802756f (C:\Program Files\LLVM\bin\liblldb.dll+0x9f756f)
 #8 0x00007ffcc803b824 (C:\Program Files\LLVM\bin\liblldb.dll+0xa0b824)
 #9 0x00007ffcc803fc46 (C:\Program Files\LLVM\bin\liblldb.dll+0xa0fc46)
#10 0x00007ffcc8681c52 (C:\Program Files\LLVM\bin\liblldb.dll+0x1051c52)
#11 0x00007ffcc7fba997 (C:\Program Files\LLVM\bin\liblldb.dll+0x98a997)
#12 0x00007ffcc8041600 (C:\Program Files\LLVM\bin\liblldb.dll+0xa11600)
#13 0x00007ffcc7de0a32 (C:\Program Files\LLVM\bin\liblldb.dll+0x7b0a32)
#14 0x00007ff723dfe925 (C:\Program Files\LLVM\bin\lldb.exe+0xe925)
#15 0x00007ff723dff328 (C:\Program Files\LLVM\bin\lldb.exe+0xf328)
#16 0x00007ff723e0c790 (C:\Program Files\LLVM\bin\lldb.exe+0x1c790)
#17 0x00007ffdccc2257d (C:\Windows\System32\KERNEL32.DLL+0x1257d)
#18 0x00007ffdce94aa48 (C:\Windows\SYSTEM32\ntdll.dll+0x5aa48)
Segmentation fault
```

The diagnostics file is not very interesting, as it duplicates the information in the error output
```
a.exe :: Class 'std::strong_ordering' has a member 'less' of type 'std::strong_ordering' which does not have a complete definition.a.exe :: Class 'std::partial_ordering' has a member 'less' of type 'std::partial_ordering' which does not have a complete definition.a.exe :: Class 'std::weak_ordering' has a member 'less' of type 'std::weak_ordering' which does not have a complete definition.
```

---

Versions
```
> cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33519 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

> clang++ --version
clang version 18.1.4
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin

> lldb --version
lldb version 18.1.4
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMmN9v2zgSx_8a-mVgQaJ-WQ9-iOVksbjs7aLt7WGfCoocybxSokBSdnIP97cfKPmXkqBt3DugRuvIIr8fzQw5Q4rMWtl0iGuSbki6XbDB7bRZW9mw0_9FpcXzmmTh9I_3PQm3JLwjNJYdV4NAIHEptXUGWUvi-7eaW2y1eb40jt-yc9Ay2RG6IrQAkm-m-wAA1gkS35H4zu6YQfG5d4bE5V5LQeJ76En8Vl-uB-efRuIS-tPFuRU7oc46km-PFyfHri37Re6xA7dD4FogsErvEQ47yXdwYBa4bnupUMBBuh34oCjWNYRuCN3AsomB933gA5WF8CuheQtDxyqF4DT0xrs9oTuHnbOga8_wvb2hc6saUZ3imYBSogIW4BOe7q38LR88x0yDDrhB5hAIpVM3Sl_1LAdjsHOAT8gHN5pl0XnTCM1Lb0FaCtyTtHT6maTlEZQDoaunVfY5SwgtglfY3miO1oJiQ8d3sGxf9fjj2IMmcU6P_dCPzXsePFHnKOt036M4PfAO3M4gE0BoHBFaju1gkFndAYm3oDtc2p12UBlkX3rtByS6TKfasNaHMPbDAeFTGIZhXtd5VLGkEll4HIEs9HMXmDuPdnyXHCmR53wjQQCAvu72IlEAIJ6uln7eJ17wlbRJ4fh5R_pkrzTvSCMAyEcnzul0Ge_ufzFW1mEPeo_me8cnZ18Zn_Sm0AN8PfDj0PxUoe_hWKTRGG18mMaYwISBUjFrfdZdbHVGd81nbQQa6UtZDjtm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