[Lldb-commits] [lldb] r147634 - in /lldb/trunk/source/Plugins/SymbolFile/DWARF: DWARFCompileUnit.cpp HashedNameToDIE.h LogChannelDWARF.cpp LogChannelDWARF.h SymbolFileDWARF.cpp
Greg Clayton
gclayton at apple.com
Thu Jan 5 16:17:16 PST 2012
Author: gclayton
Date: Thu Jan 5 18:17:16 2012
New Revision: 147634
URL: http://llvm.org/viewvc/llvm-project?rev=147634&view=rev
Log:
We finalized on the new .apple_types accelerator table format where we don't
emit fully qualified names, so now we make sure the DW_TAG values match and
still lookup using the basename.
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=147634&r1=147633&r2=147634&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Thu Jan 5 18:17:16 2012
@@ -167,7 +167,7 @@
// Keep a flat array of the DIE for binary lookup by DIE offset
if (!cu_die_only)
{
- LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
+ LogSP log (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO | DWARF_LOG_LOOKUPS));
if (log)
{
m_dwarf2Data->GetObjectFile()->GetModule()->LogMessage (log.get(),
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h?rev=147634&r1=147633&r2=147634&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h Thu Jan 5 18:17:16 2012
@@ -71,6 +71,27 @@
}
static void
+ ExtractDIEArray (const DIEInfoArray &die_info_array,
+ const dw_tag_t tag,
+ DIEArray &die_offsets)
+ {
+ if (tag == 0)
+ {
+ ExtractDIEArray (die_info_array, die_offsets);
+ }
+ else
+ {
+ const size_t count = die_info_array.size();
+ for (size_t i=0; i<count; ++i)
+ {
+ const dw_tag_t die_tag = die_info_array[i].tag;
+ if (die_tag == 0 || tag == die_tag)
+ die_offsets.push_back (die_info_array[i].offset);
+ }
+ }
+ }
+
+ static void
ExtractTypesFromDIEArray (const DIEInfoArray &die_info_array,
uint32_t type_flag_mask,
uint32_t type_flag_value,
@@ -720,6 +741,17 @@
}
size_t
+ FindByNameAndTag (const char *name,
+ const dw_tag_t tag,
+ DIEArray &die_offsets)
+ {
+ DIEInfoArray die_info_array;
+ if (FindByName(name, die_info_array))
+ DWARFMappedHash::ExtractDIEArray (die_info_array, tag, die_offsets);
+ return die_info_array.size();
+ }
+
+ size_t
FindCompleteObjCClassByName (const char *name, DIEArray &die_offsets)
{
DIEInfoArray die_info_array;
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp?rev=147634&r1=147633&r2=147634&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp Thu Jan 5 18:17:16 2012
@@ -204,6 +204,16 @@
return LogSP();
}
+LogSP
+LogChannelDWARF::GetLogIfAny (uint32_t mask)
+{
+ if (g_log_channel && g_log_channel->m_log_sp)
+ {
+ if (g_log_channel->m_log_sp->GetMask().AnySet(mask))
+ return g_log_channel->m_log_sp;
+ }
+ return LogSP();
+}
void
LogChannelDWARF::LogIf (uint32_t mask, const char *format, ...)
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h?rev=147634&r1=147633&r2=147634&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h Thu Jan 5 18:17:16 2012
@@ -79,7 +79,10 @@
static lldb::LogSP
GetLogIfAll (uint32_t mask);
-
+
+ static lldb::LogSP
+ GetLogIfAny (uint32_t mask);
+
static void
LogIf (uint32_t mask, const char *format, ...);
};
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=147634&r1=147633&r2=147634&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Thu Jan 5 18:17:16 2012
@@ -3984,11 +3984,7 @@
{
if (m_apple_types_ap->GetHeader().header_data.atoms.size() > 1)
{
- std::string qualified_name;
- const char *qualified_cstr = die->GetQualifiedName(this, cu, qualified_name);
- DWARFMappedHash::DIEInfoArray hash_data_array;
- m_apple_types_ap->FindByName (qualified_cstr, hash_data_array);
- DWARFMappedHash::ExtractDIEArray (hash_data_array, die_offsets);
+ m_apple_types_ap->FindByNameAndTag (type_name.GetCString(), die->Tag(), die_offsets);
}
else
{
More information about the lldb-commits
mailing list