class raw_ostream;
class DWARFFormValue {
-public:
struct ValueType {
- ValueType() : data(NULL), IsDWOIndex(false) {
+ ValueType() : data(NULL) {
uval = 0;
}
const char* cstr;
};
const uint8_t* data;
- bool IsDWOIndex;
};
-private:
uint16_t Form; // Form for this value.
ValueType Value; // Contains all data for the form.
case DW_FORM_GNU_addr_index:
case DW_FORM_GNU_str_index:
Value.uval = data.getULEB128(offset_ptr);
- Value.IsDWOIndex = true;
break;
default:
return false;
if (!CU)
return NULL;
uint32_t Offset = Value.uval;
- if (Value.IsDWOIndex) {
+ if (Form == DW_FORM_GNU_str_index) {
uint32_t StrOffset;
if (!CU->getStringOffsetSectionItem(Offset, StrOffset))
return NULL;
uint64_t DWARFFormValue::getAsAddress(const DWARFUnit *CU) const {
if (!CU)
return 0;
- if (Value.IsDWOIndex) {
+ if (Form == DW_FORM_GNU_addr_index) {
uint32_t Index = Value.uval;
uint64_t Address;
if (!CU->getAddrOffsetSectionItem(Index, Address))