================ @@ -696,6 +696,87 @@ llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { return llvm::StringRef(); } +llvm::Error DWARFUnit::GetDIEBitSizeAndSign(uint64_t die_offset, + uint64_t &bit_size, bool &sign) { + // Retrieve the type DIE that the value is being converted to. This + // offset is compile unit relative so we need to fix it up. + const uint64_t abs_die_offset = die_offset + GetOffset(); + // FIXME: the constness has annoying ripple effects. + DWARFDIE die = GetDIE(abs_die_offset); + if (!die) + return llvm::createStringError("cannot resolve DW_OP_convert type DIE"); + uint64_t encoding = + die.GetAttributeValueAsUnsigned(DW_AT_encoding, DW_ATE_hi_user); + bit_size = die.GetAttributeValueAsUnsigned(DW_AT_byte_size, 0) * 8; + if (!bit_size) + bit_size = die.GetAttributeValueAsUnsigned(DW_AT_bit_size, 0); + if (!bit_size) + return llvm::createStringError("unsupported type size in DW_OP_convert"); ---------------- slydiman wrote:
Done. https://github.com/llvm/llvm-project/pull/131645 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits