[Lldb-commits] [lldb] [lldb] Fix TypeSystemClang::GetBasicTypeEnumeration for 128-bit int types (PR #162278)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 8 09:44:55 PDT 2025
Michael137 wrote:
So IIUC, the issue is that `SBModule::FindFirstType` falls back to `TypeSystemClang::GetBuiltinTypeByName`. Since `__int128` and `unsigned __int128` are the de-facto names for the builtin types, we expect LLDB to find them. But LLDB registers the 128-bit integer builtins as being called `__int128_t` and `__uint128_t`.
Seems like this dates back quite a while:
```
commit b43165b7a5d59d8178dc803ec0351d3a62a38946
Author: Greg Clayton <gclayton at apple.com>
Date: Wed Dec 5 21:24:42 2012 +0000
<rdar://problem/12749733>
Always allows getting builtin types by name even if there is no backing debug information.
llvm-svn: 169424
```
And there weren't associated tests for it, so hard to say why `__int128_t` was chosen. IIUC, `__int128_t` is a typedef to `__int128`. So using it for the name of the basic type seems wrong.
> (lldb) script lldb.debugger.GetSelectedTarget().FindFirstType("__int128").size
> 16
> (lldb) script lldb.debugger.GetSelectedTarget().FindFirstType("unsigned __int128").size
> 16
Could you add a test for this?
E.g., you could add this to `lldb/test/API/functionalities/type_find_first/TestFindFirstType.py` or `lldb/test/API/python_api/sbtype_basic_type/TestSBTypeBasicType.py`
On the flip-side it looks like the following commands do currently work today:
```
(lldb) script lldb.debugger.GetSelectedTarget().FindFirstType("__int128_t").size
16
(lldb) script lldb.debugger.GetSelectedTarget().FindFirstType("__uint128_t").size
16
```
Do they still work after your patch?
https://github.com/llvm/llvm-project/pull/162278
More information about the lldb-commits
mailing list