Issue 243801
Summary [clang][modules][lldb] -gmodules with C++20 modules breaks LLDB
Labels clang
Assignees
Reporter rdong8
    I'm not sure if `-gmodules` is intended to be used with C++20 modules (from the description it seems like a useful feature which is why I tried), but enabling it seems to cause some warnings with LLDB.

```
# 1. Compile C++20 module with -gmodules
clang++ -std=c++20 -x c++-module -gmodules --precompile -o test.pcm - << 'EOF'
export module test;
export struct MyStruct { int x; };
EOF

# 2. Compile consumer with -gmodules and link
clang++ -std=c++20 -gmodules -fmodule-file=test=test.pcm -x c++ -o test_app - << 'EOF'
import test;
int main() { MyStruct s{10}; return s.x; }
EOF

# 3. Inspect variable in LLDB
lldb --batch -o "b main" -o "run" -o "frame variable" -o "quit" test_app
```

Out:

```
(MyStruct) s = <incomplete type "MyStruct">
warning: test_app '.../test.pcm' does not exist
warning: test_app unable to locate module needed for external types.
Debugging will be degraded due to missing types.
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to