[Lldb-commits] [lldb] [lldb] Support arbitrary precision integer registers (PR #166363)
Matej Košík via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 6 06:30:36 PST 2025
sedymrak wrote:
> It's not clear to me whether this supports arbitrary sizes where the register is for example, 6 bits (I saw a DSP once with these). "arbitrary" would mean yes, this is supported but please confirm.
>
> If you want to limit this to byte multiples and only > 64-bit total then fine as long as that's clear in comments and testing.
`RegisterValue` is able to store the value of a register that has any number of bits. It always uses at least as many bits as necessary. However, when `RegisterValue` object is initialized with `RegisterValue::SetValueFromData` method, the `RegisterValue` object may used more bits than it is necessary. It has no other option because the information concerning the exact number of bits is not provided. It (i.e. the `RegisterValue` object) is told only the number of bytes.
So, for example, LLDB converts:
- 6-bit values to 8-bit values
- 33-bit values to 64-bit values
- 65-bit values to 72-bit values.
This is demonstrated in the tests.
So `eTypeUIntN` registers do not break the convention estabilished by:
- `eTypeUInt8`
- `eTypeUInt16`
- `eTypeUInt32`
- `eTypeUInt64`
Hopefully, I haven't misinterpreted your question.
https://github.com/llvm/llvm-project/pull/166363
More information about the lldb-commits
mailing list