llvm-c166/lldb/source/Expression
MrEven132 f34b49eb72
[lldb] Evaluate DW_OP_mod with unsigned arithmetic (#218383)
LLDB currently passes the signed `Scalar` values produced by
`DW_OP_consts`
directly to `Scalar::operator%`. As a result, the issue expression
evaluates
`-1 % 2` as signed remainder `-1` instead of interpreting the all-one
address-sized value modulo 2 as `1`.

Make local copies of the `DW_OP_mod` dividend and divisor unsigned
before
applying the existing modulo operator. The change is contained entirely
in
the opcode evaluator and does not alter the global `Scalar`
implementation.

Update the `DW_OP_mod` unit test with the issue reproducer.

Tests:

- `DWARFExpression.DW_OP_mod`
- `DWARFExpression.*`
- `ExpressionTests`
- `check-lldb-unit`
- `clang-format --dry-run --Werror`
- `git diff --check`

Fixes #207015
2026-08-25 17:30:39 +08:00
..
CMakeLists.txt
DiagnosticManager.cpp
DWARFExpression.cpp [lldb] Evaluate DW_OP_mod with unsigned arithmetic (#218383) 2026-08-25 17:30:39 +08:00
DWARFExpressionList.cpp [LLDB] Add an API to check whether a variable is writable (#208042) 2026-07-08 15:50:14 -07:00
Expression.cpp [lldb] Fix misconstructed log/formatv calls (#196129) 2026-05-06 21:33:03 +00:00
ExpressionParser.cpp
ExpressionTypeSystemHelper.cpp
ExpressionVariable.cpp Reapply "Make result variables obey their dynamic values in subsequent expressions" (#211321) (#213308) 2026-07-31 11:13:06 -07:00
FunctionCaller.cpp [lldb] Push ExpressionEvaluation policy and remove identity check fallbacks (#195775) 2026-07-08 00:51:14 +00:00
IRExecutionUnit.cpp [lldb] std::move unique_ptrs, rather than calling .release. (#213525) 2026-08-02 21:04:18 +10:00
IRInterpreter.cpp [lldb][NFC] Remove various Stream::Printf calls with constants (#210294) 2026-07-20 10:16:42 +01:00
IRMemoryMap.cpp [lldb] Handle partial memory region coverage in IRMemoryMap::FindSpace (#194001) 2026-04-24 17:34:09 -07:00
LLVMUserExpression.cpp Reapply "Make result variables obey their dynamic values in subsequent expressions" (#211321) (#213308) 2026-07-31 11:13:06 -07:00
Materializer.cpp [lldb] Fix incorrect formatv format strings in logging (#215024) 2026-08-10 10:36:36 -07:00
ObjectFileJIT.cpp [LLDB] Add a GetTargetSP() accessor to ObjectFileJITDelegate. (NFC) (#215893) 2026-08-13 10:57:37 -07:00
REPL.cpp [lldb][NFC] Remove various Stream::Printf calls with constants (#210294) 2026-07-20 10:16:42 +01:00
UserExpression.cpp [lldb] Directly access object variable in GetObjectPointerValueObject (NFC) (#193120) 2026-04-21 14:50:14 -07:00
UtilityFunction.cpp