[LLDB] fix lldb breg adress width (#216291)
`DW_OP_breg0..31` and `DW_OP_bregx` preserved the scalar width supplied
by the register backend and added their displacement as a `uint64_t`. On
32-bit targets this could leave a 64-bit value on the expression stack,
so later generic address arithmetic did not wrap at the target address
size.
Perform the register-plus-offset calculation using the evaluator's
address-sized generic representation. This keeps `DW_OP_breg*` results
at the target address width without changing shared register reading or
the generic
operand compatibility rule.
Add unit tests for both compact and extended breg opcodes. They cover a
32-bit register value, a backend-provided 64-bit register value on i386,
a negative displacement, and modulo-32-bit overflow.
Fixes #209728
GitOrigin-RevId: 23e0cbe9a37fdd7addfd461ace6b480ad423e36b
2 files changed