[lldb-dev] Support for smaller types in Scalar class

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Tue Sep 8 10:53:02 PDT 2015

Yes, Scalar used to support the smaller sizes correctly. Revision 245547 changed Scalar over to use llvm::APInt and llvm::APFloat and it might have messed up char/short support. Please do fix Scalar so it can support it. I believe llvm::APInt should be able to correctly support this. I will watch for your patch.


> On Sep 7, 2015, at 8:50 AM, Abid, Hafiz via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> Adding lldb-dev. I used wrong address for list in the last emails.
>> -----Original Message-----
>> From: Abid, Hafiz
>> Sent: 07 September 2015 17:07
>> To: Greg Clayton (gclayton at apple.com)
>> Cc: lldb-dev at cs.uiuc.edu
>> Subject: Support for smaller types in Scalar class
>> Hi Greg,
>> I am working on a target with a lot of 16-bit (and 8-bit) registers. So
>> DW_OP_piece is frequently used in the DWARF for handling not only the
>> basic types but also aggregate types. When a Scalar class variable is created
>> for a 16-bit (or 8-bit) data read from the register, it promotes it to int as
>> Scalar class does not have support for short (or char). So in the calculation of
>> the size of that piece in value::AppendDataToHostBuffer, the scalar instance
>> will return 4 instead of 2 (or 1) from Scalar::GetByteSize(). This messes up the
>> calculation of piece size and variable evaluation fails.
>> Adding support of 16-bit (and 8-bit) in Scalar class solve this problem.
>> Although it needs a lot of changes in this class, but most of them are
>> mechanical. If this this approach seems right to you then I will send patches
>> for review.
>> Thanks,
>> Abid
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

More information about the lldb-dev mailing list