<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/146536>146536</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang breaks debuggers when using c++ modules
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Yuria-Shikibe
</td>
</tr>
</table>
<pre>
Toolchain: LLVM 20.1.7 + MSVC STL; (Both clang and clang-cl are tested)
Build system: xmake;
OS: Windows11;
## The formatted view is broken: (Tried both vsdbg and clion embedded LLDB 9.0)
Using `#include <vector>`, formatted:


Using `import std`. broken:


Build System Log
```
[ 2%]: <mo_yanxi> generating.module.deps src\main.cpp
checking for D:\lib\LLVM\bin\clang-scan-deps.exe ... ok
[ 2%]: <mo_yanxi> generating.module.deps C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\modules\std.ixx
[ 2%]: <mo_yanxi> generating.module.deps C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\modules\std.compat.ixx
D:\lib\LLVM\bin\clang-scan-deps.exe --format=p1689 -- D:\lib\LLVM\bin\clang.exe -x c++ -Qunused-arguments -m64 --target=x86_64-windows-msvc -fms-runtime-lib=dll_dbg -g -Wall -O0 -std=c++23 -fexceptions -fcxx-exceptions -finput-charset=UTF-8 -fexec-charset=UTF-8 -c src\main.cpp -o build\.objs\mo_yanxi\windows\x64\debug\src\main.cpp.obj
D:\lib\LLVM\bin\clang-scan-deps.exe --format=p1689 -- D:\lib\LLVM\bin\clang.exe -x c++ -Qunused-arguments -m64 --target=x86_64-windows-msvc -fms-runtime-lib=dll_dbg -g -Wall -O0 -std=c++23 -fexceptions -fcxx-exceptions -finput-charset=UTF-8 -fexec-charset=UTF-8 -c "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\modules\\std.ixx" -o build\.objs\mo_yanxi\windows\x64\debug\a609f1d98a904a32bb8edcee0d1c8530\std.ixx.obj
D:\lib\LLVM\bin\clang-scan-deps.exe --format=p1689 -- D:\lib\LLVM\bin\clang.exe -x c++ -Qunused-arguments -m64 --target=x86_64-windows-msvc -fms-runtime-lib=dll_dbg -g -Wall -O0 -std=c++23 -fexceptions -fcxx-exceptions -finput-charset=UTF-8 -fexec-charset=UTF-8 -c "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\modules\\std.compat.ixx" -o build\.objs\mo_yanxi\windows\x64\debug\a609f1d98a904a32bb8edcee0d1c8530\std.compat.ixx.obj
checking for flags (clang_module_file) ... ok
checking for flags (clang_module_output) ... ok
[ 17%]: <mo_yanxi> compiling.module.bmi.debug std
D:\lib\LLVM\bin\clang.exe -c -Qunused-arguments -m64 --target=x86_64-windows-msvc -fms-runtime-lib=dll_dbg -g -Wall -O0 -std=c++23 -fexceptions -fcxx-exceptions -finput-charset=UTF-8 -fexec-charset=UTF-8 -x c++-module --precompile -Wno-include-angled-in-module-purview -Wno-reserved-module-identifier -Wno-deprecated-declarations -fmodule-output=build\.gens\mo_yanxi\windows\x64\debug\rules\bmi\cache\interfaces\5451787d\std.pcm -o build\.gens\mo_yanxi\windows\x64\debug\rules\bmi\cache\interfaces\5451787d\std.pcm "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\modules\\std.ixx"
checking for flags (-fdiagnostics-color=always) ... ok
checking for flags (-fansi-escape-codes) ... ok
[ 25%]: compiling.debug C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\modules\std.ixx
D:\lib\LLVM\bin\clang.exe -c -Qunused-arguments -m64 --target=x86_64-windows-msvc -fms-runtime-lib=dll_dbg -g -Wall -O0 -std=c++23 -fexceptions -fcxx-exceptions -finput-charset=UTF-8 -fexec-charset=UTF-8 -x c++ -Wno-include-angled-in-module-purview -Wno-reserved-module-identifier -Wno-deprecated-declarations -o build\.objs\mo_yanxi\windows\x64\debug\a609f1d98a904a32bb8edcee0d1c8530\std.ixx.obj "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\modules\\std.ixx"
[ 43%]: compiling.debug src\main.cpp
D:\lib\LLVM\bin\clang.exe -c -Qunused-arguments -m64 --target=x86_64-windows-msvc -fms-runtime-lib=dll_dbg -g -Wall -O0 -std=c++23 -fexceptions -fcxx-exceptions -finput-charset=UTF-8 -fexec-charset=UTF-8 -fmodule-file=std=build\.gens\mo_yanxi\windows\x64\debug\rules\bmi\cache\interfaces\5451787d\std.pcm -o build\.objs\mo_yanxi\windows\x64\debug\src\main.cpp.obj src\main.cpp
checking for flags (-MMD -MF) ... ok
checking for D:\lib\LLVM\bin\clang++.exe ... ok
checking for flags (clang_ms_runtime_lib) ... ok
[ 60%]: linking.debug mo_yanxi.exe
D:\lib\LLVM\bin\clang++.exe -o build\windows\x64\debug\mo_yanxi.exe build\.objs\mo_yanxi\windows\x64\debug\src\main.cpp.obj build\.objs\mo_yanxi\windows\x64\debug\a609f1d98a904a32bb8edcee0d1c8530\std.ixx.obj -m64 --target=x86_64-windows-msvc -nostdlib -g
checking for clang ... D:\lib\LLVM\bin\clang.exe
checking for the c compiler (cc) ... clang.exe
[100%]: build ok, spent 11.016s
```
## Complete lose track of some structs defined in modules:
Normal, complied by msvc:

Blind, complied by clang:

(Uses the same compile options as the above)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWV1v2zoS_TX0C0GBIkVZevBDLNfAAsneXSRtsU8BRY5k3kiiIVKJ8-8XlOTaSTdN7t30fhYwUNfUzBzNnDMkJ9I5U3cAKyTWSGwWcvA726_-M_RGkuuduTMlLEqrH1c31jZqJ02H-AW-vPx0hRmN4miJEVvjq-tPBb6-uUR8jRHL1tbvsGpkV2PZ6ekbUQ2WPWAPzoNGLEf0Yj2YRmP36Dy0we2h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