[Lldb-commits] [lldb] r319580 - Prevent vain lldb::user_id_t 0xffffffff lookups
Jan Kratochvil via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 1 12:14:09 PST 2017
Author: jankratochvil
Date: Fri Dec 1 12:14:09 2017
New Revision: 319580
URL: http://llvm.org/viewvc/llvm-project?rev=319580&view=rev
Log:
Prevent vain lldb::user_id_t 0xffffffff lookups
I have found LLDB commonly looks up lldb::user_id_t 0xffffffff failing to find
its DIE. One would rather expect LLDB_INVALID_UID == 0xffffffffffffffff in such
case.
DWARFASTParserClang.cpp:495
492 type_sp.reset(
493 new Type(die.GetID(), dwarf, type_name_const_str, byte_size, NULL,
494 DIERef(encoding_uid).GetUID(dwarf), encoding_data_type,
495 &decl, clang_type, resolve_state));
encoding_uid = (DWARFFormValue) {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}}
-> DIERef::DIERef(const DWARFFormValue &form_value = {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}})
-> (DIERef) {cu_offset = 0xffffffff, die_offset = 0xffffffff}
-> lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf = 0x61d00000b480) const
-> Type::Type(lldb::user_id_t encoding_uid = 0xffffffff)
But 0xffffffff !=
#define LLDB_INVALID_UID UINT64_MAX
Differential revision: https://reviews.llvm.org/D37492
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp?rev=319580&r1=319579&r2=319580&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp Fri Dec 1 12:14:09 2017
@@ -65,7 +65,7 @@ lldb::user_id_t DIERef::GetUID(SymbolFil
//
// SymbolFileDWARFDwo sets the ID to the compile unit offset.
//----------------------------------------------------------------------
- if (dwarf)
+ if (dwarf && die_offset != DW_INVALID_OFFSET)
return dwarf->GetID() | die_offset;
else
return LLDB_INVALID_UID;
More information about the lldb-commits
mailing list