// If the debug info is incorrect, we could have multiple symbols with the
// same address. So use try_emplace instead of insert, and the first one
// will win.
- auto emplace_result = cci.m_symbols_by_va.try_emplace(va, cu_sym_uid);
- (void)emplace_result;
+ auto insert_result =
+ cci.m_symbols_by_va.insert(std::make_pair(va, cu_sym_uid));
+ (void)insert_result;
// The odds of an error in some function such as GetSegmentAndOffset or
// MakeVirtualAddress are much higher than the odds of encountering bad
// debug info, so assert that this item was inserted in the map as opposed
// to having already been there.
- lldbassert(emplace_result.second);
+ lldbassert(insert_result.second);
}
}
template <>
SegmentOffsetLength GetSegmentOffsetAndLength<Thunk32Sym>(const CVSymbol &sym) {
Thunk32Sym record = createRecord<Thunk32Sym>(sym);
- return {record.Segment, record.Offset, record.Length};
+ return SegmentOffsetLength{record.Segment, record.Offset, record.Length};
}
template <>
SegmentOffsetLength
GetSegmentOffsetAndLength<CoffGroupSym>(const CVSymbol &sym) {
CoffGroupSym record = createRecord<CoffGroupSym>(sym);
- return {record.Segment, record.Offset, record.Size};
+ return SegmentOffsetLength{record.Segment, record.Offset, record.Size};
}
SegmentOffsetLength lldb_private::npdb::GetSegmentOffsetAndLength(
namespace npdb {
struct SegmentOffset {
+ SegmentOffset() = default;
+ SegmentOffset(uint16_t s, uint32_t o) : segment(s), offset(o) {}
uint16_t segment = 0;
uint32_t offset = 0;
};
struct SegmentOffsetLength {
+ SegmentOffsetLength() = default;
+ SegmentOffsetLength(uint16_t s, uint32_t o, uint32_t l)
+ : so(s, o), length(l) {}
SegmentOffset so;
uint32_t length = 0;
};
}
// LLDB wants the index of the file in the list of support files.
- llvm::StringRef file_name = *efn;
auto fn_iter = llvm::find(cci->m_file_list, *efn);
lldbassert(fn_iter != cci->m_file_list.end());
uint32_t file_index = std::distance(cci->m_file_list.begin(), fn_iter);