Issue 110273
Summary '<Unable to determine byte size.>' in LLDB for `_BitInt`s larger than 128.
Labels new issue
Assignees
Reporter samw-improbable
    When I compile the code below with `clang main.cc -o main --std=c++23 -stdlib=libc++ -lc++ -g -O0`.
```c++
#include <iostream>

int main(int argc, char **argv) {
  _BitInt(64) i64 = 42;   // Works
  _BitInt(128) i128 = 42; // Works
  _BitInt(129) i129 = 42; // LLDB says '<Unable to determine byte size.>'
  _BitInt(256) i256 = 42; // LLDB says '<Unable to determine byte size.>'

  std::cout << "Hello, world!" << std::endl;
}
```

When I inspect these variables with LLDB, I get `<Unable to determine byte size.>` for the `_BitInt`s with a size larger than 128.

```
(lldb) target create "main"
Current executable set to '/home/sam/dev/lldb-bug/main' (x86_64).
(lldb) b main
Breakpoint 1: where = main`main + 15 at main.cc:4:15, address = 0x000000000000123f
(lldb) r
Process 1784543 launched: '/home/sam/dev/lldb-bug/main' (x86_64)
Process 1784543 stopped
* thread #1, name = 'main', stop reason = breakpoint 1.1
    frame #0: 0x000055555555523f main`main(argc=1, argv=0x00007fffffffddd8) at main.cc:4:15
   1    #include <iostream>
   2   
   3    int main(int argc, char **argv) {
-> 4      _BitInt(64) i64 = 42;   // Works
   5      _BitInt(128) i128 = 42; // Works
   6      _BitInt(129) i129 = 42; // LLDB says '<Unable to determine byte size.>'
   7 _BitInt(256) i256 = 42; // LLDB says '<Unable to determine byte size.>'
(lldb) frame variable
(int) argc = 1
(char **) argv = 0x00007fffffffddd8
(long) i64 = 140737353812080
(__int128) i128 = 115647419195831250335205442705798252522
(void) i129 = <Unable to determine byte size.>

(void) i256 = <Unable to determine byte size.>
```

I'm working in a codebase that makes wide use of `_BitInt(256)`, so fixing this would be super helpful! Or even if there's some plugin or something I can use with LLDB as a temporary fix would be much appreciated.

I've reproduced this bug in versions 18.1.8 and 19.1.0 of both clang and lldb.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to