From nobody Wed Dec 22 10:05:35 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 671811904F99; Wed, 22 Dec 2021 10:05:38 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JJpqN17CDz4YHW; Wed, 22 Dec 2021 10:05:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D2971B1D3; Wed, 22 Dec 2021 10:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BMA5Zq7091550; Wed, 22 Dec 2021 10:05:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BMA5ZBn091549; Wed, 22 Dec 2021 10:05:35 GMT (envelope-from git) Date: Wed, 22 Dec 2021 10:05:35 GMT Message-Id: <202112221005.1BMA5ZBn091549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a5822f2391aa - stable/12 - Reapply r327151 (partially): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a5822f2391aa141c8c4d27f633053c87b9e6d749 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640167537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XkhUKQGl1ptPnIfIu7QSx4nq2lsmNjmzPHvDjiwquOY=; b=PwCicBxHrSB9U4SgR+xq9PkFkphTQZWWnIRnumLdbNRtM1WJPZSQV8GjcM8hhKhFHOTnBI Y016Z2JgzDnhNiUtgWW2BYEy1y6tY+gpLSR0xvWIe/4Z6tkatkJ09gpB4yGPLbADw5k1fU 8tKntiDF6DjwxB8AgJytFcxStUXTkd7hWCTVHBRpXRDqA+3v//17Zt2jcaJFSMisanyQ5r bKygcfOHhqG80JvWBfeyc4vbRrOBoMDEZZQsW4mHVcocYct7tQhNEKyGRf+dg0aTQpgxw8 RKkfzf8TTkdlwgAxTM0c+EOSCTpKbyOBiMQ9qQ01McoQQ4ePOSv0mXAPQOw3SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640167537; a=rsa-sha256; cv=none; b=V8TxW+enz8lExK0pdM/UPOrmtvGh+fjGZGuJOYYgbeV7Oz8DH+RadPenxvvct+EWf6vuwH TXiiviPbussXc2vD7kG7moBcK4fjL3j8hcI/fiBFJ/231VZR4GeYPj7ZjHA7cDMO1MhqfO dioWxBuyAF+F+Tukx9MtZoKym6ub2IjxLPhv5r9K64sCSis+7qHRBXevPO7SoO/1MpaSJH 93HHfHp/QgpPzK7orfBjo2yIVkqist4wD/D0OkzFPnA0gwdzh8wKvMDjhuK8CCu2XfbgMA Ln9r7PeUsCCoZLAokUWFxQde2JmOYxk7UvfqpJKqHqM4JGlWxcKJUuzcLkzRWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a5822f2391aa141c8c4d27f633053c87b9e6d749 commit a5822f2391aa141c8c4d27f633053c87b9e6d749 Author: Dimitry Andric AuthorDate: 2020-08-06 15:46:39 +0000 Commit: Dimitry Andric CommitDate: 2021-12-22 09:58:16 +0000 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.) (cherry picked from commit 580012d60438215d86a9e6b2a8038de964867163) --- .../lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp | 6 ++++++ contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp | 6 ++++++ contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp | 12 ++++++++++++ .../lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp | 7 ++++++- .../lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp | 8 ++++++++ .../source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 4 ++++ .../lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 4 ++++ .../lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h | 4 ++++ 8 files changed, 50 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp b/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp index 5cf9fb4ad37f..8dee6b48453a 100644 --- a/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp @@ -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 diff --git a/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp b/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp index 882c14d386e3..01138b449215 100644 --- a/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/ABI/ARM/ABIARM.cpp @@ -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 } diff --git a/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp b/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp index bf5ab669417e..643365f72a79 100644 --- a/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86.cpp @@ -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) { diff --git a/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp index cbeef600ba9b..74d65b3caaf0 100644 --- a/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -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_entries) { 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_entries) { symbolfile_size, vmaddrheuristic, lower, upper); } - } else { + } else +#endif // LLDB_ENABLE_ALL + { bool changed = false; module_sp->SetLoadAddress(target, 0, true, changed); } diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp index 6b5acfa4bc1b..9083ee060f07 100644 --- a/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp @@ -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(StackFrame *frame) { 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(StackFrame *frame) { 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( diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 1fed8e064267..b03184b41abb 100644 --- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -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; diff --git a/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index bc06ea8164d4..7491d0609e52 100644 --- a/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -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; diff --git a/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h index 9475e4d9f442..659d48812353 100644 --- a/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h +++ b/contrib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h @@ -465,7 +465,9 @@ 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 @@ private: 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;