HomePhabricator

[lldb] Fix "frame var" for large bitfields

Authored by labath on Oct 7 2020, 8:57 AM.

Description

[lldb] Fix "frame var" for large bitfields

The problem here is in the "sliding" code in
ValueObjectChild::UpdateValue. It modifies m_bitfield_bit_offset and
m_value to ensure the bitfield value fits the window given by the
underlying type.

However, this is broken next time UpdateValue is called, because it
updates the m_value value from the parent. However, the value cannot be
slid again because the m_bitfield_bit_offset is already modified.

It seems this can happen only under specific circumstances. One way to
trigger is is to run an expression which can be interpreted (jitting it
causes a new StackFrame and ValueObject variables to be created).

I fix this bug by modifying m_byte_offset instead of m_scalar, and
ensuring the changes are folded into m_scalar regardless of how many
times UpdateValue is called.

Differential Revision: https://reviews.llvm.org/D88992

Details

Committed
labathOct 8 2020, 9:42 AM
Differential Revision
D88992: [lldb] Fix "frame var" for large bitfields
Parents
rGd4a7c70751cf: [lldb] Add a cmake warning about the python/swig incompatibility
Branches
Unknown
Tags
Unknown