[Lldb-commits] [PATCH] D85376: Fix how ValueObjectChild handles bit-fields stored in a Scalar in UpdateValue()

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 5 16:59:38 PDT 2020


shafik created this revision.
shafik added reviewers: aprantl, jingham, vsk.
shafik requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

When bit-field data was stored in a `Scalar` in `ValueObjectChild` during `UpdateValue()` it was extracting the bit-field value. Later on in `lldb_private::DumpDataExtractor(…)` we were again attempting to extract the bit-field:

  s->Printf("%" PRIu64,
              DE.GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size,
                                   item_bit_offset));

which would then not obtain the correct value. This will remove the extra extraction in `UpdateValue()`.

We hit this specific case when values are passed in registers, which we could only reproduce in an optimized build.


https://reviews.llvm.org/D85376

Files:
  lldb/source/Core/ValueObjectChild.cpp
  lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/Makefile
  lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/TestValueObjPassByRef.py
  lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/main.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85376.283288.patch
Type: text/x-patch
Size: 30951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200805/be94e47e/attachment-0001.bin>


More information about the lldb-commits mailing list