From owner-svn-src-projects@freebsd.org Thu Aug 6 15:46:41 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F2A03A5983 for ; Thu, 6 Aug 2020 15:46:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMtC53jBmz4H0W; Thu, 6 Aug 2020 15:46:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 490D28E7F; Thu, 6 Aug 2020 15:46:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076FkfeB028817; Thu, 6 Aug 2020 15:46:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076Fkdlt028809; Thu, 6 Aug 2020 15:46:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008061546.076Fkdlt028809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 6 Aug 2020 15:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r363961 - in projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins: ABI/AArch64 ABI/ARM ABI/X86 JITLoader/GDB Process/elf-core Process/gdb-remote TypeSystem/Clang X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins: ABI/AArch64 ABI/ARM ABI/X86 JITLoader/GDB Process/elf-core Process/gdb-remote TypeSystem/Clang X-SVN-Commit-Revision: 363961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2020 15:46:41 -0000 Author: dim Date: Thu Aug 6 15:46:39 2020 New Revision: 363961 URL: https://svnweb.freebsd.org/changeset/base/363961 Log: Reapply r327151 (partially): For our lldb customizations, instead of commenting out lines, use #ifdef LLDB_ENABLE_ALL / #endif preprocess directives instead, so our diffs against upstream only consist of added lines. (Note that upstream has largely reshuffled the way optional lldb plugins are handled, so we need a lot less of these #ifdefs. However, not all of them can be dropped, unless we re-import several sources that we have always skipped.) Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp Thu Aug 6 15:46:39 2020 (r363961) @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "ABIAArch64.h" +#ifdef LLDB_ENABLE_ALL #include "ABIMacOSX_arm64.h" +#endif // LLDB_ENABLE_ALL #include "ABISysV_arm64.h" #include "Utility/ARM64_DWARF_Registers.h" #include "lldb/Core/PluginManager.h" @@ -16,12 +18,16 @@ LLDB_PLUGIN_DEFINE(ABIAArch64) void ABIAArch64::Initialize() { ABISysV_arm64::Initialize(); +#ifdef LLDB_ENABLE_ALL ABIMacOSX_arm64::Initialize(); +#endif // LLDB_ENABLE_ALL } void ABIAArch64::Terminate() { ABISysV_arm64::Terminate(); +#ifdef LLDB_ENABLE_ALL ABIMacOSX_arm64::Terminate(); +#endif // LLDB_ENABLE_ALL } std::pair Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp Thu Aug 6 15:46:39 2020 (r363961) @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "ABIARM.h" +#ifdef LLDB_ENABLE_ALL #include "ABIMacOSX_arm.h" +#endif // LLDB_ENABLE_ALL #include "ABISysV_arm.h" #include "lldb/Core/PluginManager.h" @@ -15,10 +17,14 @@ LLDB_PLUGIN_DEFINE(ABIARM) void ABIARM::Initialize() { ABISysV_arm::Initialize(); +#ifdef LLDB_ENABLE_ALL ABIMacOSX_arm::Initialize(); +#endif // LLDB_ENABLE_ALL } void ABIARM::Terminate() { ABISysV_arm::Terminate(); +#ifdef LLDB_ENABLE_ALL ABIMacOSX_arm::Terminate(); +#endif // LLDB_ENABLE_ALL } Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp Thu Aug 6 15:46:39 2020 (r363961) @@ -7,26 +7,38 @@ //===----------------------------------------------------------------------===// #include "ABIX86.h" +#ifdef LLDB_ENABLE_ALL #include "ABIMacOSX_i386.h" +#endif // LLDB_ENABLE_ALL #include "ABISysV_i386.h" #include "ABISysV_x86_64.h" +#ifdef LLDB_ENABLE_ALL #include "ABIWindows_x86_64.h" +#endif // LLDB_ENABLE_ALL #include "lldb/Core/PluginManager.h" LLDB_PLUGIN_DEFINE(ABIX86) void ABIX86::Initialize() { +#ifdef LLDB_ENABLE_ALL ABIMacOSX_i386::Initialize(); +#endif // LLDB_ENABLE_ALL ABISysV_i386::Initialize(); ABISysV_x86_64::Initialize(); +#ifdef LLDB_ENABLE_ALL ABIWindows_x86_64::Initialize(); +#endif // LLDB_ENABLE_ALL } void ABIX86::Terminate() { +#ifdef LLDB_ENABLE_ALL ABIMacOSX_i386::Terminate(); +#endif // LLDB_ENABLE_ALL ABISysV_i386::Terminate(); ABISysV_x86_64::Terminate(); +#ifdef LLDB_ENABLE_ALL ABIWindows_x86_64::Terminate(); +#endif // LLDB_ENABLE_ALL } uint32_t ABIX86::GetGenericNum(llvm::StringRef name) { Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp Thu Aug 6 15:46:39 2020 (r363961) @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "JITLoaderGDB.h" +#ifdef LLDB_ENABLE_ALL #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" +#endif // LLDB_ENABLE_ALL #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" @@ -338,6 +340,7 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entr module_sp->GetObjectFile()->GetSymtab(); m_jit_objects.insert(std::make_pair(symbolfile_addr, module_sp)); +#ifdef LLDB_ENABLE_ALL if (auto image_object_file = llvm::dyn_cast(module_sp->GetObjectFile())) { const SectionList *section_list = image_object_file->GetSectionList(); @@ -349,7 +352,9 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entr symbolfile_size, vmaddrheuristic, lower, upper); } - } else { + } else +#endif // LLDB_ENABLE_ALL + { bool changed = false; module_sp->SetLoadAddress(target, 0, true, changed); } Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp Thu Aug 6 15:46:39 2020 (r363961) @@ -20,7 +20,9 @@ #include "Plugins/Process/Utility/RegisterContextLinux_i386.h" #include "Plugins/Process/Utility/RegisterContextLinux_mips.h" #include "Plugins/Process/Utility/RegisterContextLinux_mips64.h" +#ifdef LLDB_ENABLE_ALL #include "Plugins/Process/Utility/RegisterContextLinux_s390x.h" +#endif // LLDB_ENABLE_ALL #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h" #include "Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h" #include "Plugins/Process/Utility/RegisterContextOpenBSD_i386.h" @@ -34,7 +36,9 @@ #include "RegisterContextPOSIXCore_mips64.h" #include "RegisterContextPOSIXCore_powerpc.h" #include "RegisterContextPOSIXCore_ppc64le.h" +#ifdef LLDB_ENABLE_ALL #include "RegisterContextPOSIXCore_s390x.h" +#endif // LLDB_ENABLE_ALL #include "RegisterContextPOSIXCore_x86_64.h" #include "ThreadElfCore.h" @@ -138,9 +142,11 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFram case llvm::Triple::ppc64le: reg_interface = new RegisterInfoPOSIX_ppc64le(arch); break; +#ifdef LLDB_ENABLE_ALL case llvm::Triple::systemz: reg_interface = new RegisterContextLinux_s390x(arch); break; +#endif // LLDB_ENABLE_ALL case llvm::Triple::x86: reg_interface = new RegisterContextLinux_i386(arch); break; @@ -211,10 +217,12 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFram m_thread_reg_ctx_sp = std::make_shared( *this, reg_interface, m_gpregset_data, m_notes); break; +#ifdef LLDB_ENABLE_ALL case llvm::Triple::systemz: m_thread_reg_ctx_sp = std::make_shared( *this, reg_interface, m_gpregset_data, m_notes); break; +#endif // LLDB_ENABLE_ALL case llvm::Triple::x86: case llvm::Triple::x86_64: m_thread_reg_ctx_sp = std::make_shared( Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Aug 6 15:46:39 2020 (r363961) @@ -73,7 +73,9 @@ #include "lldb/Utility/Timer.h" #include "GDBRemoteRegisterContext.h" +#ifdef LLDB_ENABLE_ALL #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h" +#endif // LLDB_ENABLE_ALL #include "Plugins/Process/Utility/GDBRemoteSignals.h" #include "Plugins/Process/Utility/InferiorCallPOSIX.h" #include "Plugins/Process/Utility/StopInfoMachException.h" @@ -2424,6 +2426,7 @@ Status ProcessGDBRemote::DoDestroy() { Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); LLDB_LOGF(log, "ProcessGDBRemote::DoDestroy()"); +#ifdef LLDB_ENABLE_ALL // XXX Currently no iOS target support on FreeBSD // There is a bug in older iOS debugservers where they don't shut down the // process they are debugging properly. If the process is sitting at a // breakpoint or an exception, this can cause problems with restarting. So @@ -2527,6 +2530,7 @@ Status ProcessGDBRemote::DoDestroy() { } } } +#endif // LLDB_ENABLE_ALL // Interrupt if our inferior is running... int exit_status = SIGABRT; Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp Thu Aug 6 15:46:39 2020 (r363961) @@ -9092,11 +9092,13 @@ DWARFASTParser *TypeSystemClang::GetDWARFParser() { return m_dwarf_ast_parser_up.get(); } +#ifdef LLDB_ENABLE_ALL PDBASTParser *TypeSystemClang::GetPDBParser() { if (!m_pdb_ast_parser_up) m_pdb_ast_parser_up = std::make_unique(*this); return m_pdb_ast_parser_up.get(); } +#endif // LLDB_ENABLE_ALL bool TypeSystemClang::LayoutRecordType( const clang::RecordDecl *record_decl, uint64_t &bit_size, @@ -9109,8 +9111,10 @@ bool TypeSystemClang::LayoutRecordType( lldb_private::ClangASTImporter *importer = nullptr; if (m_dwarf_ast_parser_up) importer = &m_dwarf_ast_parser_up->GetClangASTImporter(); +#ifdef LLDB_ENABLE_ALL if (!importer && m_pdb_ast_parser_up) importer = &m_pdb_ast_parser_up->GetClangASTImporter(); +#endif // LLDB_ENABLE_ALL if (!importer) return false; Modified: projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h ============================================================================== --- projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h Thu Aug 6 15:43:15 2020 (r363960) +++ projects/clang1100-import/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h Thu Aug 6 15:46:39 2020 (r363961) @@ -465,7 +465,9 @@ class TypeSystemClang : public TypeSystem { (public) // TypeSystem methods DWARFASTParser *GetDWARFParser() override; +#ifdef LLDB_ENABLE_ALL PDBASTParser *GetPDBParser() override; +#endif // LLDB_ENABLE_ALL // TypeSystemClang callbacks for external source lookups. void CompleteTagDecl(clang::TagDecl *); @@ -1084,7 +1086,9 @@ class TypeSystemClang : public TypeSystem { (public) std::unique_ptr m_header_search_up; std::unique_ptr m_module_map_up; std::unique_ptr m_dwarf_ast_parser_up; +#ifdef LLDB_ENABLE_ALL std::unique_ptr m_pdb_ast_parser_up; +#endif // LLDB_ENABLE_ALL std::unique_ptr m_mangle_ctx_up; uint32_t m_pointer_byte_size = 0; bool m_ast_owned = false;