llvm / llvm/llvm-project

[lldb] Arithmetic operations also consume implicit location descriptions as values

Open
#209,459 2 comments 0 reactions 0 assignees View on GitHub
accepts-invalid lldb
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

#203186 reports that LLDB arithmetic operations consume **register location descriptions** as value operands. The same missing kind validation also affects **implicit location descriptions** produced by `DW_OP_stack_value` or `DW_OP_implicit_value`.

lldb defines these results as implicit location descriptions, not values, and does not define an implicit-location-to-value conversion for arithmetic operations.

For example:

```text
DW_OP_lit1
DW_OP_stack_value
DW_OP_lit2
DW_OP_plus
```

The first operand of `DW_OP_plus` is an implicit location description. LLDB should reject the kind mismatch, but instead consumes its scalar implementation payload and returns `3`.

`DW_OP_implicit_value` records the same `Implicit` location state and reaches the same arithmetic handlers without a kind check, so the problem is not specific to `DW_OP_stack_value`.

Contributor guide

Open the contributing guide

Research direction

Start in LLDB's DWARF expression handling by tracing DW_OP_plus from the implicit location results produced by DW_OP_stack_value and DW_OP_implicit_value; compare this with the missing kind validation described in #203186. Run or add coverage for the shown DW_OP_lit1/DW_OP_stack_value/DW_OP_lit2/DW_OP_plus sequence and verify that both implicit-location operands are rejected rather than consumed as scalar values.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.