diff options
Diffstat (limited to 'lldb/source/Plugins')
14 files changed, 267 insertions, 263 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp index a7f6ce64d67..a964ebd9fb2 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -251,7 +251,7 @@ ABIMacOSX_arm64::PrepareTrivialCall (Thread &thread, (uint64_t)return_addr); for (size_t i = 0; i < args.size(); ++i) - s.Printf (", arg%d = 0x%" PRIx64, i + 1, args[i]); + s.Printf (", arg%d = 0x%" PRIx64, static_cast<int>(i + 1), args[i]); s.PutCString (")"); log->PutCString(s.GetString().c_str()); } @@ -268,7 +268,8 @@ ABIMacOSX_arm64::PrepareTrivialCall (Thread &thread, { const RegisterInfo *reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1 + i); if (log) - log->Printf("About to write arg%d (0x%" PRIx64 ") into %s", i + 1, args[i], reg_info->name); + log->Printf("About to write arg%d (0x%" PRIx64 ") into %s", + static_cast<int>(i + 1), args[i], reg_info->name); if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, args[i])) return false; } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp index a7bb68005c1..254dc75fc7d 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp @@ -29,7 +29,7 @@ public: m_type_vendor(type_vendor) { } - + bool FindExternalVisibleDeclsByName (const clang::DeclContext *decl_ctx, clang::DeclarationName name) @@ -43,34 +43,33 @@ public: { log->Printf("AppleObjCExternalASTSource::FindExternalVisibleDeclsByName[%u] on (ASTContext*)%p Looking for %s in (%sDecl*)%p", current_id, - &decl_ctx->getParentASTContext(), - name.getAsString().c_str(), - decl_ctx->getDeclKindName(), - decl_ctx); + static_cast<void*>(&decl_ctx->getParentASTContext()), + name.getAsString().c_str(), decl_ctx->getDeclKindName(), + static_cast<const void*>(decl_ctx)); } - + do { const clang::ObjCInterfaceDecl *interface_decl = llvm::dyn_cast<clang::ObjCInterfaceDecl>(decl_ctx); - + if (!interface_decl) break; - + clang::ObjCInterfaceDecl *non_const_interface_decl = const_cast<clang::ObjCInterfaceDecl*>(interface_decl); if (!m_type_vendor.FinishDecl(non_const_interface_decl)) break; - + clang::DeclContext::lookup_const_result result = non_const_interface_decl->lookup(name); - + return (result.size() != 0); } while(0); - + SetNoExternalVisibleDeclsForName(decl_ctx, name); return false; } - + clang::ExternalLoadResult FindExternalLexicalDecls (const clang::DeclContext *DC, bool (*isKindWeWant)(clang::Decl::Kind), @@ -78,7 +77,7 @@ public: { return clang::ELR_Success; } - + void CompleteType (clang::TagDecl *tag_decl) { @@ -86,20 +85,20 @@ public: unsigned int current_id = invocation_id++; Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel? - + if (log) { log->Printf("AppleObjCExternalASTSource::CompleteType[%u] on (ASTContext*)%p Completing (TagDecl*)%p named %s", current_id, - &tag_decl->getASTContext(), - tag_decl, + static_cast<void*>(&tag_decl->getASTContext()), + static_cast<void*>(tag_decl), tag_decl->getName().str().c_str()); - + log->Printf(" AOEAS::CT[%u] Before:", current_id); ASTDumper dumper((clang::Decl*)tag_decl); dumper.ToLog(log, " [CT] "); } - + if (log) { log->Printf(" AOEAS::CT[%u] After:", current_id); @@ -108,30 +107,30 @@ public: } return; } - + void CompleteType (clang::ObjCInterfaceDecl *interface_decl) { static unsigned int invocation_id = 0; unsigned int current_id = invocation_id++; - + Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel? - + if (log) { log->Printf("AppleObjCExternalASTSource::CompleteType[%u] on (ASTContext*)%p Completing (ObjCInterfaceDecl*)%p named %s", current_id, - &interface_decl->getASTContext(), - interface_decl, + static_cast<void*>(&interface_decl->getASTContext()), + static_cast<void*>(interface_decl), interface_decl->getName().str().c_str()); - + log->Printf(" AOEAS::CT[%u] Before:", current_id); ASTDumper dumper((clang::Decl*)interface_decl); dumper.ToLog(log, " [CT] "); } - + m_type_vendor.FinishDecl(interface_decl); - + if (log) { log->Printf(" [CT] After:"); @@ -140,7 +139,7 @@ public: } return; } - + bool layoutRecordType(const clang::RecordDecl *Record, uint64_t &Size, @@ -151,7 +150,7 @@ public: { return false; } - + void StartTranslationUnit (clang::ASTConsumer *Consumer) { clang::TranslationUnitDecl *translation_unit_decl = m_type_vendor.m_ast_ctx.getASTContext()->getTranslationUnitDecl(); diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 105a87d2b01..051f409348f 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -335,7 +335,9 @@ ObjectContainerBSDArchive::CreateInstance Timer scoped_timer (__PRETTY_FUNCTION__, "ObjectContainerBSDArchive::CreateInstance (module = %s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")", module_sp->GetFileSpec().GetPath().c_str(), - file, (uint64_t) file_offset, (uint64_t) length); + static_cast<const void*>(file), + static_cast<uint64_t>(file_offset), + static_cast<uint64_t>(length)); // Map the entire .a file to be sure that we don't lose any data if the file // gets updated by a new build while this .a file is being used for debugging @@ -457,7 +459,7 @@ ObjectContainerBSDArchive::ParseHeader () void ObjectContainerBSDArchive::Dump (Stream *s) const { - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<const void*>(this)); s->Indent(); const size_t num_archs = GetNumArchitectures(); const size_t num_objects = GetNumObjects(); diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp index 0b88ff299ea..7497b987eba 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -164,7 +164,7 @@ ObjectContainerUniversalMachO::ParseHeader (lldb_private::DataExtractor &data, void ObjectContainerUniversalMachO::Dump (Stream *s) const { - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<const void*>(this)); s->Indent(); const size_t num_archs = GetNumArchitectures(); const size_t num_objects = GetNumObjects(); diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp index ec0f093e6ad..1ed77701770 100644 --- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp @@ -202,16 +202,16 @@ ObjectFileJIT::Dump (Stream *s) if (module_sp) { lldb_private::Mutex::Locker locker(module_sp->GetMutex()); - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<void*>(this)); s->Indent(); s->PutCString("ObjectFileJIT"); - + ArchSpec arch; if (GetArchitecture(arch)) *s << ", arch = " << arch.GetArchitectureName(); - + s->EOL(); - + SectionList *sections = GetSectionList(); if (sections) sections->Dump(s, NULL, true, UINT32_MAX); diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 72190742d0b..ed80c635c74 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1632,7 +1632,10 @@ struct TrieEntry void Dump () const { - printf ("0x%16.16llx 0x%16.16llx 0x%16.16llx \"%s\"", address, flags, other, name.GetCString()); + printf ("0x%16.16llx 0x%16.16llx 0x%16.16llx \"%s\"", + static_cast<unsigned long long>(address), + static_cast<unsigned long long>(flags), + static_cast<unsigned long long>(other), name.GetCString()); if (import_name) printf (" -> \"%s\"\n", import_name.GetCString()); else @@ -1649,17 +1652,18 @@ struct TrieEntryWithOffset { lldb::offset_t nodeOffset; TrieEntry entry; - + TrieEntryWithOffset (lldb::offset_t offset) : nodeOffset (offset), entry() { } - + void Dump (uint32_t idx) const { - printf ("[%3u] 0x%16.16llx: ", idx, nodeOffset); + printf ("[%3u] 0x%16.16llx: ", idx, + static_cast<unsigned long long>(nodeOffset)); entry.Dump(); } @@ -4081,7 +4085,7 @@ ObjectFileMachO::Dump (Stream *s) if (module_sp) { lldb_private::Mutex::Locker locker(module_sp->GetMutex()); - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<void*>(this)); s->Indent(); if (m_header.magic == MH_MAGIC_64 || m_header.magic == MH_CIGAM_64) s->PutCString("ObjectFileMachO64"); diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 91c3f50bc6a..ca70b96651a 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -790,19 +790,19 @@ ObjectFilePECOFF::Dump(Stream *s) if (module_sp) { lldb_private::Mutex::Locker locker(module_sp->GetMutex()); - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<void*>(this)); s->Indent(); s->PutCString("ObjectFilePECOFF"); - + ArchSpec header_arch; GetArchitecture (header_arch); - + *s << ", file = '" << m_file << "', arch = " << header_arch.GetArchitectureName() << "\n"; - + SectionList *sections = GetSectionList(); if (sections) sections->Dump(s, NULL, true, UINT32_MAX); - + if (m_symtab_ap.get()) m_symtab_ap->Dump(s, NULL, eSortOrderNone); diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp index 744d7ada9c8..35e82925f42 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -632,7 +632,8 @@ DynamicRegisterInfo::Dump () const { StreamFile s(stdout, false); const size_t num_regs = m_regs.size(); - s.Printf("%p: DynamicRegisterInfo contains %" PRIu64 " registers:\n", this, (uint64_t)num_regs); + s.Printf("%p: DynamicRegisterInfo contains %" PRIu64 " registers:\n", + static_cast<const void*>(this), static_cast<uint64_t>(num_regs)); for (size_t i=0; i<num_regs; ++i) { s.Printf("[%3" PRIu64 "] name = %-10s", (uint64_t)i, m_regs[i].name); @@ -671,9 +672,10 @@ DynamicRegisterInfo::Dump () const } s.EOL(); } - + const size_t num_sets = m_sets.size(); - s.Printf("%p: DynamicRegisterInfo contains %" PRIu64 " register sets:\n", this, (uint64_t)num_sets); + s.Printf("%p: DynamicRegisterInfo contains %" PRIu64 " register sets:\n", + static_cast<const void*>(this), static_cast<uint64_t>(num_sets)); for (size_t i=0; i<num_sets; ++i) { s.Printf("set[%" PRIu64 "] name = %s, regs = [", (uint64_t)i, m_sets[i].name); diff --git a/lldb/source/Plugins/Process/Utility/HistoryThread.cpp b/lldb/source/Plugins/Process/Utility/HistoryThread.cpp index 6b8c7dfd5d3..11ad8152176 100644 --- a/lldb/source/Plugins/Process/Utility/HistoryThread.cpp +++ b/lldb/source/Plugins/Process/Utility/HistoryThread.cpp @@ -42,7 +42,8 @@ HistoryThread::HistoryThread (lldb_private::Process &process, m_unwinder_ap.reset (new HistoryUnwind (*this, pcs, stop_id, stop_id_is_valid)); Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - log->Printf ("%p HistoryThread::HistoryThread", this); + log->Printf ("%p HistoryThread::HistoryThread", + static_cast<void*>(this)); } // Destructor @@ -51,7 +52,8 @@ HistoryThread::~HistoryThread () { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - log->Printf ("%p HistoryThread::~HistoryThread (tid=0x%" PRIx64 ")", this, GetID()); + log->Printf ("%p HistoryThread::~HistoryThread (tid=0x%" PRIx64 ")", + static_cast<void*>(this), GetID()); DestroyThread(); } diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 393def34975..a3cd6e9351e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1458,8 +1458,7 @@ ProcessGDBRemote::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new if (log && log->GetMask().Test(GDBR_LOG_VERBOSE)) log->Printf( "ProcessGDBRemote::%s Making new thread: %p for thread ID: 0x%" PRIx64 ".\n", - __FUNCTION__, - thread_sp.get(), + __FUNCTION__, static_cast<void*>(thread_sp.get()), thread_sp->GetID()); } else @@ -1467,8 +1466,7 @@ ProcessGDBRemote::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new if (log && log->GetMask().Test(GDBR_LOG_VERBOSE)) log->Printf( "ProcessGDBRemote::%s Found old thread: %p for thread ID: 0x%" PRIx64 ".\n", - __FUNCTION__, - thread_sp.get(), + __FUNCTION__, static_cast<void*>(thread_sp.get()), thread_sp->GetID()); } new_thread_list.AddThread(thread_sp); @@ -1563,9 +1561,9 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) if (log && log->GetMask().Test(GDBR_LOG_VERBOSE)) log->Printf ("ProcessGDBRemote::%s Adding new thread: %p for thread ID: 0x%" PRIx64 ".\n", __FUNCTION__, - thread_sp.get(), + static_cast<void*>(thread_sp.get()), thread_sp->GetID()); - + m_thread_list_real.AddThread(thread_sp); } gdb_thread = static_cast<ThreadGDBRemote *> (thread_sp.get()); @@ -1588,7 +1586,6 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) if (tid != LLDB_INVALID_THREAD_ID) m_thread_ids.push_back (tid); value.erase(0, comma_pos + 1); - } tid = Args::StringToUInt64 (value.c_str(), LLDB_INVALID_THREAD_ID, 16); if (tid != LLDB_INVALID_THREAD_ID) @@ -1715,7 +1712,6 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) thread_sp->SetStopInfo (invalid_stop_info_sp); } } - } else if (reason.compare("trap") == 0) { @@ -1740,7 +1736,7 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) handled = true; } } - + if (!handled && signo && did_exec == false) { if (signo == SIGTRAP) @@ -1750,7 +1746,7 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) handled = true; addr_t pc = thread_sp->GetRegisterContext()->GetPC() + m_breakpoint_pc_offset; lldb::BreakpointSiteSP bp_site_sp = thread_sp->GetProcess()->GetBreakpointSiteList().FindByAddress(pc); - + if (bp_site_sp) { // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread, @@ -1782,7 +1778,7 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) if (!handled) thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithSignal (*thread_sp, signo)); } - + if (!description.empty()) { lldb::StopInfoSP stop_info_sp (thread_sp->GetStopInfo ()); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index be60321fb4e..60e5c6ed62f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -135,7 +135,7 @@ void DWARFDebugAranges::Sort (bool minimize) { Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", - __PRETTY_FUNCTION__, this); + __PRETTY_FUNCTION__, static_cast<void*>(this)); Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES)); size_t orig_arange_size = 0; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp index 06ac825e0d4..488e9820b6f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp @@ -66,11 +66,12 @@ DWARFDebugPubnames::GeneratePubnames(SymbolFileDWARF* dwarf2Data) { Timer scoped_timer (__PRETTY_FUNCTION__, "DWARFDebugPubnames::GeneratePubnames (data = %p)", - dwarf2Data); + static_cast<void*>(dwarf2Data)); Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_PUBNAMES)); if (log) - log->Printf("DWARFDebugPubnames::GeneratePubnames (data = %p)", dwarf2Data); + log->Printf("DWARFDebugPubnames::GeneratePubnames (data = %p)", + static_cast<void*>(dwarf2Data)); m_sets.clear(); DWARFDebugInfo* debug_info = dwarf2Data->DebugInfo(); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 28cbe82ebc8..03159ff6493 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -829,7 +829,8 @@ SymbolFileDWARF::DebugInfo() { if (m_info.get() == NULL) { - Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", __PRETTY_FUNCTION__, this); + Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", + __PRETTY_FUNCTION__, static_cast<void*>(this)); if (get_debug_info_data().GetByteSize() > 0) { m_info.reset(new DWARFDebugInfo()); @@ -879,7 +880,8 @@ SymbolFileDWARF::DebugRanges() { if (m_ranges.get() == NULL) { - Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", __PRETTY_FUNCTION__, this); + Timer scoped_timer(__PRETTY_FUNCTION__, "%s this = %p", + __PRETTY_FUNCTION__, static_cast<void*>(this)); if (get_debug_ranges_data().GetByteSize() > 0) { m_ranges.reset(new DWARFDebugRanges()); @@ -2380,7 +2382,6 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) // The type will get resolved when all of the calls to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition // are done. m_forward_decl_clang_type_to_die.erase (clang_type_no_qualifiers.GetOpaqueQualType()); - // Disable external storage for this type so we don't get anymore // clang::ExternalASTSource queries for this type. @@ -2395,14 +2396,11 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) Log *log (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO|DWARF_LOG_TYPE_COMPLETION)); if (log) - { GetObjectFile()->GetModule()->LogMessageVerboseBacktrace (log, "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type->GetName().AsCString()); - - } assert (clang_type); DWARFDebugInfoEntry::Attributes attributes; @@ -2413,11 +2411,10 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) case DW_TAG_class_type: { LayoutInfo layout_info; - + { if (die->HasChildren()) { - LanguageType class_language = eLanguageTypeUnknown; if (clang_type.IsObjCObjectOrInterfaceType()) { @@ -2426,7 +2423,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) // the class is created. clang_type.StartTagDeclarationDefinition (); } - + int tag_decl_kind = -1; AccessType default_accessibility = eAccessNone; if (tag == DW_TAG_structure_type) @@ -2444,14 +2441,14 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) tag_decl_kind = clang::TTK_Class; default_accessibility = eAccessPrivate; } - + SymbolContext sc(GetCompUnitForDWARFCompUnit(dwarf_cu)); std::vector<clang::CXXBaseSpecifier *> base_classes; std::vector<int> member_accessibilities; bool is_a_class = false; // Parse members and base classes first DWARFDIECollection member_function_dies; - + DelayedPropertyList delayed_properties; ParseChildMembers (sc, dwarf_cu, @@ -2465,7 +2462,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) default_accessibility, is_a_class, layout_info); - + // Now parse any methods if there were any... size_t num_functions = member_function_dies.Size(); if (num_functions > 0) @@ -2475,13 +2472,12 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) ResolveType(dwarf_cu, member_function_dies.GetDIEPtrAtIndex(i)); } } - + if (class_language == eLanguageTypeObjC) { ConstString class_name (clang_type.GetTypeName()); if (class_name) { - DIEArray method_die_offsets; if (m_using_apple_tables) { @@ -2492,21 +2488,21 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) { if (!m_indexed) Index (); - + m_objc_class_selectors_index.Find (class_name, method_die_offsets); } - + if (!method_die_offsets.empty()) { DWARFDebugInfo* debug_info = DebugInfo(); - + DWARFCompileUnit* method_cu = NULL; const size_t num_matches = method_die_offsets.size(); for (size_t i=0; i<num_matches; ++i) { const dw_offset_t die_offset = method_die_offsets[i]; DWARFDebugInfoEntry *method_die = debug_info->GetDIEPtrWithCompileUnitHint (die_offset, &method_cu); - + if (method_die) ResolveType (method_cu, method_die); else @@ -2519,14 +2515,14 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) } } } - + for (DelayedPropertyList::iterator pi = delayed_properties.begin(), pe = delayed_properties.end(); pi != pe; ++pi) pi->Finalize(); } } - + // If we have a DW_TAG_structure_type instead of a DW_TAG_class_type we // need to tell the clang type it is actually a class. if (class_language != eLanguageTypeObjC) @@ -2534,7 +2530,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) if (is_a_class && tag_decl_kind != clang::TTK_Class) clang_type.SetTagTypeKind (clang::TTK_Class); } - + // Since DW_TAG_structure_type gets used for both classes // and structures, we may need to set any DW_TAG_member // fields to have a "private" access if none was specified. @@ -2553,7 +2549,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) &member_accessibilities.front(), member_accessibilities.size()); } - + if (!base_classes.empty()) { // Make sure all base classes refer to complete types and not @@ -2589,7 +2585,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) } clang_type.SetBaseClassesForClassType (&base_classes.front(), base_classes.size()); - + // Clang will copy each CXXBaseSpecifier in "base_classes" // so we have to free them all. ClangASTType::DeleteBaseClassSpecifiers (&base_classes.front(), @@ -2597,10 +2593,10 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) } } } - + clang_type.BuildIndirectFields (); clang_type.CompleteTagDeclarationDefinition (); - + if (!layout_info.field_offsets.empty() || !layout_info.base_offsets.empty() || !layout_info.vbase_offsets.empty() ) @@ -2609,7 +2605,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) layout_info.bit_size = type->GetByteSize() * 8; if (layout_info.bit_size == 0) layout_info.bit_size = die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_byte_size, 0) * 8; - + clang::CXXRecordDecl *record_decl = clang_type.GetAsCXXRecordDecl(); if (record_decl) { @@ -2617,14 +2613,14 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) caching layout info for record_decl = %p, bit_size = %" PRIu64 ", alignment = %" PRIu64 ", field_offsets[%u], base_offsets[%u], vbase_offsets[%u])", - clang_type.GetOpaqueQualType(), - record_decl, + static_cast<void*>(clang_type.GetOpaqueQualType()), + static_cast<void*>(record_decl), layout_info.bit_size, layout_info.alignment, - (uint32_t)layout_info.field_offsets.size(), - (uint32_t)layout_info.base_offsets.size(), - (uint32_t)layout_info.vbase_offsets.size()); - + static_cast<uint32_t>(layout_info.field_offsets.size()), + static_cast<uint32_t>(layout_info.base_offsets.size()), + static_cast<uint32_t>(layout_info.vbase_offsets.size())); + uint32_t idx; { llvm::DenseMap <const clang::FieldDecl *, uint64_t>::const_iterator pos, end = layout_info.field_offsets.end(); @@ -2632,13 +2628,13 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) field[%u] = { bit_offset=%u, name='%s' }", - clang_type.GetOpaqueQualType(), + static_cast<void*>(clang_type.GetOpaqueQualType()), idx, - (uint32_t)pos->second, + static_cast<uint32_t>(pos->second), pos->first->getNameAsString().c_str()); } } - + { llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits>::const_iterator base_pos, base_end = layout_info.base_offsets.end(); for (idx = 0, base_pos = layout_info.base_offsets.begin(); base_pos != base_end; ++base_pos, ++idx) @@ -2657,9 +2653,9 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) vbase[%u] = { byte_offset=%u, name='%s' }", - clang_type.GetOpaqueQualType(), + static_cast<void*>(clang_type.GetOpaqueQualType()), idx, - (uint32_t)vbase_pos->second.getQuantity(), + static_cast<uint32_t>(vbase_pos->second.getQuantity()), vbase_pos->first->getNameAsString().c_str()); } } @@ -2755,9 +2751,8 @@ SymbolFileDWARF::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_ { Timer scoped_timer(__PRETTY_FUNCTION__, "SymbolFileDWARF::ResolveSymbolContext (so_addr = { section = %p, offset = 0x%" PRIx64 " }, resolve_scope = 0x%8.8x)", - so_addr.GetSection().get(), - so_addr.GetOffset(), - resolve_scope); + static_cast<void*>(so_addr.GetSection().get()), + so_addr.GetOffset(), resolve_scope); uint32_t resolved = 0; if (resolve_scope & ( eSymbolContextCompUnit | eSymbolContextFunction | @@ -3134,18 +3129,15 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_privat Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); if (log) - { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", namespace_decl=%p, append=%u, max_matches=%u, variables)", name.GetCString(), - namespace_decl, - append, - max_matches); - } - + static_cast<const void*>(namespace_decl), + append, max_matches); + if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) return 0; - + DWARFDebugInfo* info = DebugInfo(); if (info == NULL) return 0; @@ -3159,7 +3151,7 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_privat const uint32_t original_size = variables.GetSize(); DIEArray die_offsets; - + if (m_using_apple_tables) { if (m_apple_names_ap.get()) @@ -3167,10 +3159,10 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_privat const char *name_cstr = name.GetCString(); const char *base_name_start; const char *base_name_end = NULL; - + if (!CPPLanguageRuntime::StripNamespacesFromVariableName(name_cstr, base_name_start, base_name_end)) base_name_start = name_cstr; - + m_apple_names_ap->FindByName (base_name_start, die_offsets); } } @@ -3182,14 +3174,14 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_privat m_global_index.Find (name, die_offsets); } - + const size_t num_die_matches = die_offsets.size(); if (num_die_matches) { SymbolContext sc; sc.module_sp = m_obj_file->GetModule(); assert (sc.module_sp); - + DWARFDebugInfo* debug_info = DebugInfo(); DWARFCompileUnit* dwarf_cu = NULL; const DWARFDebugInfoEntry* die = NULL; @@ -3209,11 +3201,11 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_privat case DW_TAG_try_block: case DW_TAG_catch_block: break; - + case DW_TAG_variable: { sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, UINT32_MAX); - + if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die)) continue; @@ -3242,10 +3234,9 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_privat { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", namespace_decl=%p, append=%u, max_matches=%u, variables) => %u", - name.GetCString(), - namespace_decl, - append, - max_matches, + name.GetCString(), + static_cast<const void*>(namespace_decl), + append, max_matches, num_matches); } return num_matches; @@ -3255,13 +3246,12 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables) { Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); - + if (log) { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindGlobalVariables (regex=\"%s\", append=%u, max_matches=%u, variables)", - regex.GetText(), - append, + regex.GetText(), append, max_matches); } @@ -3959,38 +3949,32 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc, return 0; Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); - + if (log) { if (namespace_decl) - { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(%p) \"%s\", append=%u, max_matches=%u, type_list)", name.GetCString(), - namespace_decl->GetNamespaceDecl(), + static_cast<void*>(namespace_decl->GetNamespaceDecl()), namespace_decl->GetQualifiedName().c_str(), - append, - max_matches); - } + append, max_matches); else - { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(NULL), append=%u, max_matches=%u, type_list)", - name.GetCString(), - append, + name.GetCString(), append, max_matches); - } } // If we aren't appending the results to this list, then clear the list if (!append) types.Clear(); - + if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) return 0; DIEArray die_offsets; - + if (m_using_apple_tables) { if (m_apple_types_ap.get()) @@ -4003,10 +3987,10 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc, { if (!m_indexed) Index (); - + m_type_index.Find (name, die_offsets); } - + const size_t num_die_matches = die_offsets.size(); if (num_die_matches) @@ -4024,7 +4008,7 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc, { if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die)) continue; - + Type *matching_type = ResolveType (dwarf_cu, die); if (matching_type) { @@ -4052,10 +4036,9 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc, GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(%p) \"%s\", append=%u, max_matches=%u, type_list) => %u", name.GetCString(), - namespace_decl->GetNamespaceDecl(), + static_cast<void*>(namespace_decl->GetNamespaceDecl()), namespace_decl->GetQualifiedName().c_str(), - append, - max_matches, + append, max_matches, num_matches); } else @@ -4063,8 +4046,7 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc, GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(NULL), append=%u, max_matches=%u, type_list) => %u", name.GetCString(), - append, - max_matches, + append, max_matches, num_matches); } } @@ -4156,7 +4138,7 @@ SymbolFileDWARF::FindNamespace (const SymbolContext& sc, GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::FindNamespace (sc, name=\"%s\") => clang::NamespaceDecl(%p) \"%s\"", name.GetCString(), - namespace_decl.GetNamespaceDecl(), + static_cast<const void*>(namespace_decl.GetNamespaceDecl()), namespace_decl.GetQualifiedName().c_str()); } @@ -4618,20 +4600,20 @@ SymbolFileDWARF::ResolveNamespaceDIE (DWARFCompileUnit *dwarf_cu, const DWARFDeb { GetObjectFile()->GetModule()->LogMessage (log, "ASTContext => %p: 0x%8.8" PRIx64 ": DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl *%p (original = %p)", - GetClangASTContext().getASTContext(), + static_cast<void*>(GetClangASTContext().getASTContext()), MakeUserID(die->GetOffset()), namespace_name, - namespace_decl, - namespace_decl->getOriginalNamespace()); + static_cast<void*>(namespace_decl), + static_cast<void*>(namespace_decl->getOriginalNamespace())); } else { GetObjectFile()->GetModule()->LogMessage (log, "ASTContext => %p: 0x%8.8" PRIx64 ": DW_TAG_namespace (anonymous) => clang::NamespaceDecl *%p (original = %p)", - GetClangASTContext().getASTContext(), + static_cast<void*>(GetClangASTContext().getASTContext()), MakeUserID(die->GetOffset()), - namespace_decl, - namespace_decl->getOriginalNamespace()); + static_cast<void*>(namespace_decl), + static_cast<void*>(namespace_decl->getOriginalNamespace())); } } @@ -5456,7 +5438,7 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, // Is everything kosher so we can go through the members at top speed? bool fast_path = true; - + if (src_size != dst_size) { if (src_size != 0 && dst_size != 0) @@ -5468,12 +5450,12 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, src_size, dst_size); } - + fast_path = false; } uint32_t idx; - + if (fast_path) { for (idx = 0; idx < src_size; ++idx) @@ -5493,10 +5475,10 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, DW_TAG_value_to_name(src_die->Tag())); fast_path = false; } - + const char *src_name = src_die->GetMangledName (src_symfile, src_cu); const char *dst_name = dst_die->GetMangledName (this, dst_cu); - + // Make sure the names match if (src_name == dst_name || (strcmp (src_name, dst_name) == 0)) continue; @@ -5509,7 +5491,7 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, src_name, dst_die->GetOffset(), dst_name); - + fast_path = false; } } @@ -5523,25 +5505,31 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, { src_die = src_name_to_die.GetValueAtIndexUnchecked (idx); dst_die = dst_name_to_die.GetValueAtIndexUnchecked (idx); - + clang::DeclContext *src_decl_ctx = src_symfile->m_die_to_decl_ctx[src_die]; if (src_decl_ctx) { if (log) - log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", src_decl_ctx, src_die->GetOffset(), dst_die->GetOffset()); + log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", + static_cast<void*>(src_decl_ctx), + src_die->GetOffset(), dst_die->GetOffset()); LinkDeclContextToDIE (src_decl_ctx, dst_die); } else { if (log) - log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found", src_die->GetOffset(), dst_die->GetOffset()); + log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found", + src_die->GetOffset(), dst_die->GetOffset()); } - + Type *src_child_type = m_die_to_type[src_die]; if (src_child_type) { if (log) - log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset()); + log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", + static_cast<void*>(src_child_type), + src_child_type->GetID(), + src_die->GetOffset(), dst_die->GetOffset()); m_die_to_type[dst_die] = src_child_type; } else @@ -5556,24 +5544,27 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, // We must do this slowly. For each member of the destination, look // up a member in the source with the same name, check its tag, and // unique them if everything matches up. Report failures. - + if (!src_name_to_die.IsEmpty() && !dst_name_to_die.IsEmpty()) { src_name_to_die.Sort(); - + for (idx = 0; idx < dst_size; ++idx) { const char *dst_name = dst_name_to_die.GetCStringAtIndex(idx); dst_die = dst_name_to_die.GetValueAtIndexUnchecked(idx); src_die = src_name_to_die.Find(dst_name, NULL); - + if (src_die && (src_die->Tag() == dst_die->Tag())) { clang::DeclContext *src_decl_ctx = src_symfile->m_die_to_decl_ctx[src_die]; if (src_decl_ctx) { if (log) - log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", src_decl_ctx, src_die->GetOffset(), dst_die->GetOffset()); + log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", + static_cast<void*>(src_decl_ctx), + src_die->GetOffset(), + dst_die->GetOffset()); LinkDeclContextToDIE (src_decl_ctx, dst_die); } else @@ -5581,12 +5572,16 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, if (log) log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found", src_die->GetOffset(), dst_die->GetOffset()); } - + Type *src_child_type = m_die_to_type[src_die]; if (src_child_type) { if (log) - log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset()); + log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", + static_cast<void*>(src_child_type), + src_child_type->GetID(), + src_die->GetOffset(), + dst_die->GetOffset()); m_die_to_type[dst_die] = src_child_type; } else @@ -5614,13 +5609,13 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, if (src_size_artificial && dst_size_artificial) { dst_name_to_die_artificial.Sort(); - + for (idx = 0; idx < src_size_artificial; ++idx) { const char *src_name_artificial = src_name_to_die_artificial.GetCStringAtIndex(idx); src_die = src_name_to_die_artificial.GetValueAtIndexUnchecked (idx); dst_die = dst_name_to_die_artificial.Find(src_name_artificial, NULL); - + if (dst_die) { // Both classes have the artificial types, link them @@ -5628,7 +5623,9 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, if (src_decl_ctx) { if (log) - log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", src_decl_ctx, src_die->GetOffset(), dst_die->GetOffset()); + log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x", + static_cast<void*>(src_decl_ctx), + src_die->GetOffset(), dst_die->GetOffset()); LinkDeclContextToDIE (src_decl_ctx, dst_die); } else @@ -5636,12 +5633,15 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (SymbolFileDWARF *src_symfile, if (log) log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found", src_die->GetOffset(), dst_die->GetOffset()); } - + Type *src_child_type = m_die_to_type[src_die]; if (src_child_type) { if (log) - log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset()); + log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", + static_cast<void*>(src_child_type), + src_child_type->GetID(), + src_die->GetOffset(), dst_die->GetOffset()); m_die_to_type[dst_die] = src_child_type; } else @@ -5690,14 +5690,14 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, { const DWARFDebugInfoEntry *context_die; clang::DeclContext *context = GetClangDeclContextContainingDIE (dwarf_cu, die, &context_die); - + GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ParseType (die = 0x%8.8x, decl_ctx = %p (die 0x%8.8x)) %s name = '%s')", - die->GetOffset(), - context, - context_die->GetOffset(), - DW_TAG_value_to_name(die->Tag()), - die->GetName(this, dwarf_cu)); - + die->GetOffset(), + static_cast<void*>(context), + context_die->GetOffset(), + DW_TAG_value_to_name(die->Tag()), + die->GetName(this, dwarf_cu)); + #if defined(LLDB_CONFIGURATION_DEBUG) or defined(LLDB_CONFIGURATION_RELEASE) scoped_die_logger.Push (dwarf_cu, die); g_die_stack.LogDIEs(log, this); @@ -5712,7 +5712,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDwarf::%s %s", __FUNCTION__, s.GetData()); // // } - + Type *type_ptr = m_die_to_type.lookup (die); TypeList* type_list = GetTypeList(); if (type_ptr == NULL) @@ -5770,7 +5770,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, case DW_AT_decl_line: decl.SetLine(form_value.Unsigned()); break; case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break; case DW_AT_name: - + type_name_cstr = form_value.AsCString(&get_debug_str_data()); // Work around a bug in llvm-gcc where they give a name to a reference type which doesn't // include the "&"... @@ -5829,7 +5829,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (!clang_type && (encoding_data_type == Type::eEncodingIsPointerUID || encoding_data_type == Type::eEncodingIsTypedefUID) && sc.comp_unit != NULL) { bool translation_unit_is_objc = (sc.comp_unit->GetLanguage() == eLanguageTypeObjC || sc.comp_unit->GetLanguage() == eLanguageTypeObjC_plus_plus); - + if (translation_unit_is_objc) { if (type_name_cstr != NULL) @@ -5837,7 +5837,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, static ConstString g_objc_type_name_id("id"); static ConstString g_objc_type_name_Class("Class"); static ConstString g_objc_type_name_selector("SEL"); - + if (type_name_const_str == g_objc_type_name_id) { if (log) @@ -5879,11 +5879,11 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, else if (encoding_data_type == Type::eEncodingIsPointerUID && encoding_uid != LLDB_INVALID_UID) { // Clang sometimes erroneously emits id as objc_object*. In that case we fix up the type to "id". - + DWARFDebugInfoEntry* encoding_die = dwarf_cu->GetDIEPtr(encoding_uid); - + if (encoding_die && encoding_die->Tag() == DW_TAG_structure_type) - { + { if (const char *struct_name = encoding_die->GetAttributeValueAsString(this, dwarf_cu, DW_AT_name, NULL)) { if (!strcmp(struct_name, "objc_object")) @@ -5903,7 +5903,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } } - + type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, @@ -5914,7 +5914,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, &decl, clang_type, resolve_state)); - + m_die_to_type[die] = type_sp.get(); // Type* encoding_type = GetUniquedTypeForDIEOffset(encoding_uid, type_sp, NULL, 0, 0, false); @@ -5996,7 +5996,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, case DW_AT_APPLE_objc_complete_type: is_complete_objc_class = form_value.Signed(); break; - + case DW_AT_allocated: case DW_AT_associated: case DW_AT_data_location: @@ -6035,7 +6035,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, return type_sp; } } - + DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); int tag_decl_kind = -1; @@ -6055,7 +6055,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, tag_decl_kind = clang::TTK_Class; default_accessibility = eAccessPrivate; } - + if (byte_size_valid && byte_size == 0 && type_name_cstr && die->HasChildren() == false && sc.comp_unit->GetLanguage() == eLanguageTypeObjC) @@ -6093,20 +6093,20 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // else... type_sp = m_debug_map_symfile->FindCompleteObjCDefinitionTypeForDIE (die, type_name_const_str, true); } - + if (type_sp) { if (log) { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is an incomplete objc type, complete type is 0x%8.8" PRIx64, - this, + static_cast<void*>(this), die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr, type_sp->GetID()); } - + // We found a real definition for this type elsewhere // so lets use it and cache the fact that we found // a complete type for this die @@ -6115,7 +6115,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } } - + if (is_forward_declaration) { @@ -6128,12 +6128,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is a forward declaration, trying to find complete type", - this, + static_cast<void*>(this), die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr); } - + DWARFDeclContext die_decl_ctx; die->GetDWARFDeclContext(this, dwarf_cu, die_decl_ctx); @@ -6154,7 +6154,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is a forward declaration, complete type is 0x%8.8" PRIx64, - this, + static_cast<void*>(this), die->GetOffset(), DW_TAG_value_to_name(tag), type_name_cstr, @@ -6174,7 +6174,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (!clang_type) { const DWARFDebugInfoEntry *decl_ctx_die; - + clang::DeclContext *decl_ctx = GetClangDeclContextContainingDIE (dwarf_cu, die, &decl_ctx_die); if (accessibility == eAccessNone && decl_ctx) { @@ -6199,14 +6199,14 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, type_name_cstr, tag_decl_kind, template_param_infos); - + clang::ClassTemplateSpecializationDecl *class_specialization_decl = ast.CreateClassTemplateSpecializationDecl (decl_ctx, class_template_decl, tag_decl_kind, template_param_infos); clang_type = ast.CreateClassTemplateSpecializationType (class_specialization_decl); clang_type_was_created = true; - + GetClangASTContext().SetMetadata (class_template_decl, metadata); GetClangASTContext().SetMetadata (class_specialization_decl, metadata); } @@ -6238,7 +6238,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, &decl, clang_type, Type::eResolveStateForward)); - + type_sp->SetIsCompleteObjCClass(is_complete_objc_class); @@ -6253,7 +6253,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, unique_ast_entry.m_byte_size = byte_size; GetUniqueDWARFASTTypeMap().Insert (type_name_const_str, unique_ast_entry); - + if (is_forward_declaration && die->HasChildren()) { // Check to see if the DIE actually has a definition, some version of GCC will @@ -6294,18 +6294,18 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // No children for this struct/union/class, lets finish it clang_type.StartTagDeclarationDefinition (); clang_type.CompleteTagDeclarationDefinition (); - + if (tag == DW_TAG_structure_type) // this only applies in C { clang::RecordDecl *record_decl = clang_type.GetAsRecordDecl(); - + if (record_decl) { LayoutInfo layout_info; - + layout_info.alignment = 0; layout_info.bit_size = 0; - + m_record_decl_to_layout_map.insert(std::make_pair(record_decl, layout_info)); } } @@ -6319,7 +6319,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // we want to start the definition in case the class is needed as the // declaration context for a contained class or type without the need // to complete that type.. - + if (class_language != eLanguageTypeObjC && class_language != eLanguageTypeObjC_plus_plus) clang_type.StartTagDeclarationDefinition (); @@ -6334,7 +6334,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, clang_type.SetHasExternalStorage (true); } } - + } break; @@ -6397,12 +6397,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (enumerator_type) enumerator_clang_type = enumerator_type->GetClangFullType(); } - + if (!enumerator_clang_type) enumerator_clang_type = ast.GetBuiltinTypeForDWARFEncodingAndBitSize (NULL, DW_ATE_signed, byte_size * 8); - + clang_type = ast.CreateEnumerationType (type_name_cstr, GetClangDeclContextContainingDIE (dwarf_cu, die, NULL), decl, @@ -6414,7 +6414,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } LinkDeclContextToDIE(clang_type.GetDeclContextForType(), die); - + type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, @@ -6491,7 +6491,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, case DW_AT_virtuality: is_virtual = form_value.Boolean(); break; case DW_AT_explicit: is_explicit = form_value.Boolean(); break; case DW_AT_artificial: is_artificial = form_value.Boolean(); break; - + case DW_AT_external: if (form_value.Unsigned()) @@ -6554,12 +6554,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, object_pointer_name.assign(s.GetData()); } } - + DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); ClangASTType return_clang_type; Type *func_type = NULL; - + if (type_die_offset != DW_INVALID_OFFSET) func_type = ResolveTypeUID(type_die_offset); @@ -6573,7 +6573,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, std::vector<clang::ParmVarDecl*> function_param_decls; // Parse the function children for the parameters - + const DWARFDebugInfoEntry *decl_ctx_die = NULL; clang::DeclContext *containing_decl_ctx = GetClangDeclContextContainingDIE (dwarf_cu, die, &decl_ctx_die); const clang::Decl::Kind containing_decl_kind = containing_decl_ctx->getDeclKind(); @@ -6608,9 +6608,9 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, function_param_types.size(), is_variadic, type_quals); - + bool ignore_containing_context = false; - + if (type_name_cstr) { bool type_handled = false; @@ -6677,7 +6677,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, SymbolFileDWARF *class_symfile = NULL; DWARFCompileUnitSP class_type_cu_sp; const DWARFDebugInfoEntry *class_type_die = NULL; - + SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile(); if (debug_map_symfile) { @@ -6692,7 +6692,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (class_type_die) { llvm::SmallVector<const DWARFDebugInfoEntry *, 0> failures; - + CopyUniqueClassMethodTypes (class_symfile, class_type, class_type_cu_sp.get(), @@ -6700,12 +6700,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, dwarf_cu, decl_ctx_die, failures); - + // FIXME do something with these failures that's smarter than // just dropping them on the ground. Unfortunately classes don't // like having stuff added to them after their definitions are // complete... - + type_ptr = m_die_to_type[die]; if (type_ptr && type_ptr != DIE_IS_BEING_PARSED) { @@ -6714,7 +6714,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } } - + if (specification_die_offset != DW_INVALID_OFFSET) { // We have a specification which we are going to base our function @@ -6773,7 +6773,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // in the DWARF for C++ methods... Default to public for now... if (accessibility == eAccessNone) accessibility = eAccessPublic; - + if (!is_static && !die->HasChildren()) { // We have a C++ member function with no children (this pointer!) @@ -6792,7 +6792,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, m_obj_file->GetFileSpec().GetPath().c_str()); const bool is_attr_used = false; - + cxx_method_decl = class_opaque_type.AddMethodToCXXRecordType (type_name_cstr, clang_type, accessibility, @@ -6802,7 +6802,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, is_explicit, is_attr_used, is_artificial); - + type_handled = cxx_method_decl != NULL; if (type_handled) @@ -6811,17 +6811,17 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, Host::SetCrashDescription (NULL); - + ClangASTMetadata metadata; metadata.SetUserID(MakeUserID(die->GetOffset())); - + if (!object_pointer_name.empty()) { metadata.SetObjectPtrName(object_pointer_name.c_str()); if (log) log->Printf ("Setting object pointer name: %s on method object %p.\n", object_pointer_name.c_str(), - cxx_method_decl); + static_cast<void*>(cxx_method_decl)); } GetClangASTContext().SetMetadata (cxx_method_decl, metadata); } @@ -6841,7 +6841,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // we need to modify the m_die_to_type so it doesn't think we are // trying to parse this DIE anymore... m_die_to_type[die] = NULL; - + // Now we get the full type to force our class type to complete itself // using the clang::ExternalASTSource protocol which will parse all // base classes and all methods (including the method for this DIE). @@ -6854,7 +6854,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, type_sp = type_ptr->shared_from_this(); break; } - + // FIXME This is fixing some even uglier behavior but we really need to // uniq the methods of each class as well as the class itself. // <rdar://problem/11240464> @@ -6865,7 +6865,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } } - + if (!type_handled) { // We just have a function that isn't part of a class @@ -6893,17 +6893,17 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, ast.SetFunctionParameters (function_decl, &function_param_decls.front(), function_param_decls.size()); - + ClangASTMetadata metadata; metadata.SetUserID(MakeUserID(die->GetOffset())); - + if (!object_pointer_name.empty()) { metadata.SetObjectPtrName(object_pointer_name.c_str()); if (log) log->Printf ("Setting object pointer name: %s on function object %p.", object_pointer_name.c_str(), - function_decl); + static_cast<void*>(function_decl)); } GetClangASTContext().SetMetadata (function_decl, metadata); } @@ -7022,7 +7022,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, dw_offset_t containing_type_die_offset = DW_INVALID_OFFSET; const size_t num_attributes = die->GetAttributes(this, dwarf_cu, NULL, attributes); - + if (num_attributes > 0) { uint32_t i; for (i=0; i<num_attributes; ++i) @@ -7040,10 +7040,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } } - + Type *pointee_type = ResolveTypeUID(type_die_offset); Type *class_type = ResolveTypeUID(containing_type_die_offset); - + ClangASTType pointee_clang_type = pointee_type->GetClangForwardType(); ClangASTType class_clang_type = class_type->GetClangLayoutType(); @@ -7062,7 +7062,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, clang_type, Type::eResolveStateForward)); } - + break; } default: @@ -8011,12 +8011,11 @@ SymbolFileDWARF::LayoutRecordType (const clang::RecordDecl *record_decl, if (log) GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::LayoutRecordType (record_decl = %p, bit_size = %" PRIu64 ", alignment = %" PRIu64 ", field_offsets[%u],base_offsets[%u], vbase_offsets[%u]) success = %i", - record_decl, - bit_size, - alignment, - (uint32_t)field_offsets.size(), - (uint32_t)base_offsets.size(), - (uint32_t)vbase_offsets.size(), + static_cast<const void*>(record_decl), + bit_size, alignment, + static_cast<uint32_t>(field_offsets.size()), + static_cast<uint32_t>(base_offsets.size()), + static_cast<uint32_t>(vbase_offsets.size()), success); return success; } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 0cb2143711a..90ecc1f55fb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -55,20 +55,19 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa Module *oso_module = exe_symfile->GetModuleByCompUnitInfo (this); if (!oso_module) return file_range_map; - + ObjectFile *oso_objfile = oso_module->GetObjectFile(); if (!oso_objfile) return file_range_map; - + Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_MAP)); if (log) { ConstString object_name (oso_module->GetObjectName()); log->Printf("%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s')", - this, + static_cast<void*>(this), oso_module->GetSpecificationDescription().c_str()); } - std::vector<SymbolFileDWARFDebugMap::CompileUnitInfo *> cu_infos; if (exe_symfile->GetCompUnitInfosForModule(oso_module, cu_infos)) @@ -78,12 +77,12 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa Symtab *exe_symtab = exe_symfile->GetObjectFile()->GetSymtab(); ModuleSP oso_module_sp (oso_objfile->GetModule()); Symtab *oso_symtab = oso_objfile->GetSymtab(); - + ///const uint32_t fun_resolve_flags = SymbolContext::Module | eSymbolContextCompUnit | eSymbolContextFunction; //SectionList *oso_sections = oso_objfile->Sections(); // Now we need to make sections that map from zero based object // file addresses to where things eneded up in the main executable. - + assert (comp_unit_info->first_symbol_index != UINT32_MAX); // End index is one past the last valid symbol index const uint32_t oso_end_idx = comp_unit_info->last_symbol_index + 1; @@ -96,12 +95,12 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa { if (exe_symbol->IsDebug() == false) continue; - + switch (exe_symbol->GetType()) { default: break; - + case eSymbolTypeCode: { // For each N_FUN, or function that we run into in the debug map @@ -112,7 +111,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa // before we parse any dwarf info so that when it goes get parsed // all section/offset addresses that get registered will resolve // correctly to the new addresses in the main executable. - + // First we find the original symbol in the .o file's symbol table Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType (exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), eSymbolTypeCode, @@ -125,11 +124,11 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa exe_symbol->GetAddress().GetFileAddress(), oso_fun_symbol->GetAddress().GetFileAddress(), std::min<addr_t>(exe_symbol->GetByteSize(), oso_fun_symbol->GetByteSize())); - + } } break; - + case eSymbolTypeData: { // For each N_GSYM we remap the address for the global by making @@ -144,13 +143,12 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa // fix up these addresses further after all globals have been // parsed to span the gaps, or we can find the global variable // sizes from the DWARF info as we are parsing. - + // Next we find the non-stab entry that corresponds to the N_GSYM in the .o file Symbol *oso_gsym_symbol = oso_symtab->FindFirstSymbolWithNameAndType (exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), eSymbolTypeData, Symtab::eDebugNo, Symtab::eVisibilityAny); - if (exe_symbol && oso_gsym_symbol && exe_symbol->ValueIsAddress() && oso_gsym_symbol->ValueIsAddress()) @@ -166,7 +164,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(SymbolFileDWARFDebugMa } } } - + exe_symfile->FinalizeOSOFileRanges (this); // We don't need the symbols anymore for the .o files oso_objfile->ClearSymtab(); |